add target cursor
This commit is contained in:
parent
34af633b47
commit
8db565f456
|
@ -19,3 +19,4 @@ Module
|
||||||
require 'effects'
|
require 'effects'
|
||||||
require 'settings'
|
require 'settings'
|
||||||
require 'hotkeys'
|
require 'hotkeys'
|
||||||
|
require 'cursor'
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
function setTargetCursor()
|
||||||
|
g_window.setMouseCursor('/core_styles/icons/targetcursor.png')
|
||||||
|
end
|
||||||
|
|
||||||
|
function restoreCursor()
|
||||||
|
g_window.restoreMouseCursor()
|
||||||
|
end
|
Binary file not shown.
After Width: | Height: | Size: 256 B |
|
@ -31,7 +31,7 @@ function Game.processMouseAction(menuPosition, mouseButton, autoWalk, lookThing,
|
||||||
print "open"
|
print "open"
|
||||||
elseif useThing:isMultiUse() then
|
elseif useThing:isMultiUse() then
|
||||||
Game.setSelectedThing(useThing)
|
Game.setSelectedThing(useThing)
|
||||||
-- todo change cursor
|
setTargetCursor()
|
||||||
else
|
else
|
||||||
Game.use(useThing)
|
Game.use(useThing)
|
||||||
end
|
end
|
||||||
|
@ -44,7 +44,7 @@ function Game.processMouseAction(menuPosition, mouseButton, autoWalk, lookThing,
|
||||||
if mouseButton == MouseLeftButton and selectedThing then
|
if mouseButton == MouseLeftButton and selectedThing then
|
||||||
Game.useWith(Game.getSelectedThing(), multiUseThing)
|
Game.useWith(Game.getSelectedThing(), multiUseThing)
|
||||||
Game.setSelectedThing(nil)
|
Game.setSelectedThing(nil)
|
||||||
-- restore cursor
|
restoreCursor()
|
||||||
return true
|
return true
|
||||||
elseif multiUseThing and keyboardModifiers == KeyboardNoModifier and mouseButton == MouseRightButton then
|
elseif multiUseThing and keyboardModifiers == KeyboardNoModifier and mouseButton == MouseRightButton then
|
||||||
if multiUseThing:asCreature() then
|
if multiUseThing:asCreature() then
|
||||||
|
@ -53,7 +53,7 @@ function Game.processMouseAction(menuPosition, mouseButton, autoWalk, lookThing,
|
||||||
print "open"
|
print "open"
|
||||||
elseif multiUseThing:isMultiUse() then
|
elseif multiUseThing:isMultiUse() then
|
||||||
Game.setSelectedThing(multiUseThing)
|
Game.setSelectedThing(multiUseThing)
|
||||||
-- todo change cursor
|
setTargetCursor()
|
||||||
else
|
else
|
||||||
Game.use(useThing)
|
Game.use(useThing)
|
||||||
end
|
end
|
||||||
|
@ -88,7 +88,7 @@ function Game.createThingMenu(menuPosition, lookThing, useThing, creatureThing)
|
||||||
menu:addOption('Open', function() print('open') end)
|
menu:addOption('Open', function() print('open') end)
|
||||||
else
|
else
|
||||||
if useThing:isMultiUse() then
|
if useThing:isMultiUse() then
|
||||||
-- todo change cursor
|
setTargetCursor()
|
||||||
menu:addOption('Use with ...', function() Game.setSelectedThing(useThing) end)
|
menu:addOption('Use with ...', function() Game.setSelectedThing(useThing) end)
|
||||||
else
|
else
|
||||||
menu:addOption('Use', function() Game.use(useThing) end)
|
menu:addOption('Use', function() Game.use(useThing) end)
|
||||||
|
|
Loading…
Reference in New Issue