Some more UI updates and fixes.

* Added UICreatureButton class for handling/replacing "battle buttons" (can now be used in other modules).
* Added the ability to use items on creatures via the battle window.
* Some minor cosmetics.
This commit is contained in:
BeniS
2012-08-26 04:05:33 +12:00
parent f93d79649f
commit 0763b266d5
9 changed files with 252 additions and 194 deletions

View File

@@ -182,6 +182,11 @@ function onUseWith(clickedWidget, mousePosition)
end
elseif clickedWidget:getClassName() == 'UIItem' and not clickedWidget:isVirtual() then
g_game.useWith(selectedThing, clickedWidget:getItem())
elseif clickedWidget:getClassName() == 'UICreatureButton' then
local creature = clickedWidget:getCreature()
if creature then
g_game.useWith(selectedThing, creature)
end
end
end