add target cursor
This commit is contained in:
parent
34af633b47
commit
8db565f456
|
@ -19,3 +19,4 @@ Module
|
|||
require 'effects'
|
||||
require 'settings'
|
||||
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"
|
||||
elseif useThing:isMultiUse() then
|
||||
Game.setSelectedThing(useThing)
|
||||
-- todo change cursor
|
||||
setTargetCursor()
|
||||
else
|
||||
Game.use(useThing)
|
||||
end
|
||||
|
@ -44,7 +44,7 @@ function Game.processMouseAction(menuPosition, mouseButton, autoWalk, lookThing,
|
|||
if mouseButton == MouseLeftButton and selectedThing then
|
||||
Game.useWith(Game.getSelectedThing(), multiUseThing)
|
||||
Game.setSelectedThing(nil)
|
||||
-- restore cursor
|
||||
restoreCursor()
|
||||
return true
|
||||
elseif multiUseThing and keyboardModifiers == KeyboardNoModifier and mouseButton == MouseRightButton then
|
||||
if multiUseThing:asCreature() then
|
||||
|
@ -53,7 +53,7 @@ function Game.processMouseAction(menuPosition, mouseButton, autoWalk, lookThing,
|
|||
print "open"
|
||||
elseif multiUseThing:isMultiUse() then
|
||||
Game.setSelectedThing(multiUseThing)
|
||||
-- todo change cursor
|
||||
setTargetCursor()
|
||||
else
|
||||
Game.use(useThing)
|
||||
end
|
||||
|
@ -88,7 +88,7 @@ function Game.createThingMenu(menuPosition, lookThing, useThing, creatureThing)
|
|||
menu:addOption('Open', function() print('open') end)
|
||||
else
|
||||
if useThing:isMultiUse() then
|
||||
-- todo change cursor
|
||||
setTargetCursor()
|
||||
menu:addOption('Use with ...', function() Game.setSelectedThing(useThing) end)
|
||||
else
|
||||
menu:addOption('Use', function() Game.use(useThing) end)
|
||||
|
|
Loading…
Reference in New Issue