examples/inventory: translate inventory
This commit is contained in:
parent
374ca29d3a
commit
a224021726
1 changed files with 9 additions and 7 deletions
|
@ -38,10 +38,10 @@ function Inventory:new()
|
||||||
|
|
||||||
|
|
||||||
HListBox(self.menusystem, "main", 42, 32, 424-84, 32, 5)
|
HListBox(self.menusystem, "main", 42, 32, 424-84, 32, 5)
|
||||||
self:addSubMenu("weapon", "Weapons")
|
self:addSubMenu("weapon", "weapons")
|
||||||
self:addSubMenu("shield", "Shields")
|
self:addSubMenu("shield", "shields")
|
||||||
self:addSubMenu("stuff", "Stuff")
|
self:addSubMenu("stuff", "stuff")
|
||||||
ExitWidget(self, "main", "Exit")
|
ExitWidget(self, "main", "exit")
|
||||||
|
|
||||||
self:addItem("weapon", 3)
|
self:addItem("weapon", 3)
|
||||||
self:addItem("weapon", 2)
|
self:addItem("weapon", 2)
|
||||||
|
@ -89,7 +89,8 @@ function InventoryWidget:new(scene, menu, newmenu, fullname)
|
||||||
local widgetmenu = self.scene.menusystem.menus[menu]
|
local widgetmenu = self.scene.menusystem.menus[menu]
|
||||||
local font = self.scene.assets.fonts["medium"]
|
local font = self.scene.assets.fonts["medium"]
|
||||||
self.newmenu = newmenu
|
self.newmenu = newmenu
|
||||||
InventoryWidget.super.new(self, widgetmenu, font, fullname)
|
local label = core.lang:translate("inventory", fullname)
|
||||||
|
InventoryWidget.super.new(self, widgetmenu, font, label)
|
||||||
end
|
end
|
||||||
|
|
||||||
function InventoryWidget:action(source)
|
function InventoryWidget:action(source)
|
||||||
|
@ -114,11 +115,12 @@ end
|
||||||
|
|
||||||
-- Exit widget
|
-- Exit widget
|
||||||
|
|
||||||
function ExitWidget:new(scene, menu, fullname)
|
function ExitWidget:new(scene, menu)
|
||||||
self.scene = scene
|
self.scene = scene
|
||||||
local widgetmenu = self.scene.menusystem.menus[menu]
|
local widgetmenu = self.scene.menusystem.menus[menu]
|
||||||
local font = self.scene.assets.fonts["medium"]
|
local font = self.scene.assets.fonts["medium"]
|
||||||
ExitWidget.super.new(self, widgetmenu, font, fullname)
|
local label = core.lang:translate("commons", "exit")
|
||||||
|
ExitWidget.super.new(self, widgetmenu, font, label)
|
||||||
end
|
end
|
||||||
|
|
||||||
function ExitWidget:action(source)
|
function ExitWidget:action(source)
|
||||||
|
|
Loading…
Reference in a new issue