battlesystem: initial signal sending use in widgets
This commit is contained in:
parent
67ef04bcc8
commit
5aa8b2da36
1 changed files with 7 additions and 0 deletions
|
@ -222,6 +222,8 @@ end
|
||||||
|
|
||||||
function CharMenuWidget:new(scene, menu_name, label1, label2, character)
|
function CharMenuWidget:new(scene, menu_name, label1, label2, character)
|
||||||
self.character = character
|
self.character = character
|
||||||
|
self.menuname = menu_name
|
||||||
|
self.scene = scene
|
||||||
local menu = scene.menusystem.menus[menu_name] or error("menu " ..menu_name .. " doesn't exist")
|
local menu = scene.menusystem.menus[menu_name] or error("menu " ..menu_name .. " doesn't exist")
|
||||||
local font = scene.assets.fonts["small"]
|
local font = scene.assets.fonts["small"]
|
||||||
CharMenuWidget.super.new(self, menu, font, label1)
|
CharMenuWidget.super.new(self, menu, font, label1)
|
||||||
|
@ -241,4 +243,9 @@ function CharMenuWidget:drawCanvas()
|
||||||
self.font:print(self.label2, self.width - 9, h, "right")
|
self.font:print(self.label2, self.width - 9, h, "right")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function CharMenuWidget:action()
|
||||||
|
self.character:getSignal(self.menuname, self.label)
|
||||||
|
self.scene.menusystem:reset()
|
||||||
|
end
|
||||||
|
|
||||||
return MenuConstructor
|
return MenuConstructor
|
||||||
|
|
Loading…
Reference in a new issue