improvement(cbs): translate battle system menu

This commit is contained in:
Kazhnuz 2019-08-14 17:07:42 +02:00
parent 02c81c29f6
commit eec6214305
5 changed files with 100 additions and 19 deletions

View file

@ -0,0 +1,12 @@
return {
['attack'] = "Attack",
['skills'] = "Skills",
['objects'] = "Objects",
['defend'] = "Defends",
['flee'] = "Flee",
['back'] = "Back",
['heal'] = "Healing",
['rings'] = "Rings",
['wisps'] = "Wisps",
['other'] = "Other",
}

View file

@ -0,0 +1,11 @@
return {
['spinattack'] = "Spin Attack",
['spinjump'] = "Spin Jump",
['spindash'] = "Spin Dash",
['hommingattack'] = "Homming Attack",
['sonicflare'] = "Sonic Flare",
['bluetornado'] = "Blue Tornado",
['soniccracker'] = "Sonic Cracker",
['boost'] = "Boost",
['lightspeedattack'] = "L. Speed Atk",
}

View file

@ -0,0 +1,12 @@
return {
['attack'] = "Attaquer",
['skills'] = "Techniques",
['objects'] = "Objets",
['defend'] = "Défendre",
['flee'] = "Fuite",
['back'] = "Retour",
['heal'] = "Médecines",
['rings'] = "Anneaux",
['wisps'] = "Wisps",
['other'] = "Autres",
}

View file

@ -0,0 +1,11 @@
return {
['spinattack'] = "Atk Tourbillon",
['spinjump'] = "Saut Tourbillon",
['spindash'] = "Charge Tourbillon",
['hommingattack'] = "Atk Téléguidée",
['sonicflare'] = "Sonic Flare",
['bluetornado'] = "Tornade Bleu",
['soniccracker'] = "Sonic Cracker",
['boost'] = "Boost",
['lightspeedattack'] = "L. Speed Atk",
}

View file

@ -7,6 +7,7 @@ local CharacterMenu = ListBox:extend()
local CharMenuWidget = Widget.Text:extend()
local SubMenuWidget = CharMenuWidget:extend()
local BackMenuWidget = CharMenuWidget:extend()
local SkillWidget = Widget.Text:extend()
local MENUPOS_X1, MENUPOS_X2, MENUPOS_Y = 32, 32, 110
local MENU_WIDTH, MENU_ITEM_HEIGHT = 112, 17
@ -31,12 +32,12 @@ end
function MenuConstructor:buildBaseMenu(character)
CharacterMenu(self.controller, "BaseMenu", MENUPOS_X1 - 16, MENUPOS_Y)
CharMenuWidget(self.controller, "BaseMenu", "Attaquer", "", character)
SubMenuWidget(self.controller, "BaseMenu", "Techniques", "SkillMenu", character)
SubMenuWidget(self.controller, "BaseMenu", "Objets", "ObjectMenu", character)
CharMenuWidget(self.controller, "BaseMenu", "Défendre", "", character)
CharMenuWidget(self.controller, "BaseMenu", "Fuite", "", character)
BackMenuWidget(self.controller, "BaseMenu", "Retour", character)
CharMenuWidget(self.controller, "BaseMenu", "attack", "", character)
SubMenuWidget(self.controller, "BaseMenu", "skills", "SkillMenu", character)
SubMenuWidget(self.controller, "BaseMenu", "objects", "ObjectMenu", character)
CharMenuWidget(self.controller, "BaseMenu", "defend", "", character)
CharMenuWidget(self.controller, "BaseMenu", "flee", "", character)
BackMenuWidget(self.controller, "BaseMenu", "back", character)
self.controller.menusystem.menus["BaseMenu"]:setCancelWidget()
end
@ -49,9 +50,9 @@ function MenuConstructor:buildSkillMenu(character)
CharacterMenu(self.controller, "SkillMenu", MENUPOS_X1 - 16, MENUPOS_Y)
local list = game.characters:getSkillList(character.charid)
for k,v in pairs(list) do
CharMenuWidget(self.controller, "SkillMenu", k, "", character)
SkillWidget(self.controller, "SkillMenu", k, "", character)
end
SubMenuWidget(self.controller, "SkillMenu", "Retour", "BaseMenu", character)
SubMenuWidget(self.controller, "SkillMenu", "back", "BaseMenu", character)
self.controller.menusystem.menus["SkillMenu"]:setCancelWidget()
end
@ -65,16 +66,16 @@ function MenuConstructor:buildObjectMenu(character)
CharacterMenu(self.controller, "OtherMenu", MENUPOS_X1 - 16, MENUPOS_Y)
SubMenuWidget(self.controller, "ObjectMenu", "Médecine", "MedMenu", character)
SubMenuWidget(self.controller, "ObjectMenu", "Rings", "RingMenu", character)
SubMenuWidget(self.controller, "ObjectMenu", "Wisps", "WispMenu", character)
SubMenuWidget(self.controller, "ObjectMenu", "Autres", "OtherMenu", character)
SubMenuWidget(self.controller, "ObjectMenu", "heal", "MedMenu", character)
SubMenuWidget(self.controller, "ObjectMenu", "rings", "RingMenu", character)
SubMenuWidget(self.controller, "ObjectMenu", "wisps", "WispMenu", character)
SubMenuWidget(self.controller, "ObjectMenu", "other", "OtherMenu", character)
SubMenuWidget(self.controller, "ObjectMenu", "Retour", "BaseMenu", character)
SubMenuWidget(self.controller, "MedMenu", "Retour", "ObjectMenu", character)
SubMenuWidget(self.controller, "RingMenu", "Retour", "ObjectMenu", character)
SubMenuWidget(self.controller, "WispMenu", "Retour", "ObjectMenu", character)
SubMenuWidget(self.controller, "OtherMenu", "Retour", "ObjectMenu", character)
SubMenuWidget(self.controller, "ObjectMenu", "back", "BaseMenu", character)
SubMenuWidget(self.controller, "MedMenu", "back", "ObjectMenu", character)
SubMenuWidget(self.controller, "RingMenu", "back", "ObjectMenu", character)
SubMenuWidget(self.controller, "WispMenu", "back", "ObjectMenu", character)
SubMenuWidget(self.controller, "OtherMenu", "back", "ObjectMenu", character)
self.controller.menusystem.menus["ObjectMenu"]:setCancelWidget()
@ -128,9 +129,11 @@ function CharMenuWidget:new(scene, menu_name, label1, label2, character)
self.character = character
self.menuname = menu_name
self.scene = scene
self.actionType = label1
local menu = scene.menusystem.menus[menu_name] or error("menu " ..menu_name .. " doesn't exist")
local font = scene.assets.fonts["small"]
CharMenuWidget.super.new(self, menu, font, label1)
CharMenuWidget.super.new(self, menu, font, core.lang:translate("battle", label1))
self.label2 = label2 or ""
end
@ -167,7 +170,7 @@ end
-- Back Widget
function BackMenuWidget:new(scene, menu_name, label, character)
BackMenuWidget.super.new(self, scene, menu_name, "Retour", "", character)
BackMenuWidget.super.new(self, scene, menu_name, "back", "", character)
end
function BackMenuWidget:action()
@ -176,5 +179,37 @@ function BackMenuWidget:action()
self.scene.menusystem:reset()
end
-- Skill Widget
function SkillWidget:new(scene, menu_name, label1, label2, character)
self.character = character
self.menuname = menu_name
self.scene = scene
self.actionType = label1
local menu = scene.menusystem.menus[menu_name] or error("menu " ..menu_name .. " doesn't exist")
local font = scene.assets.fonts["small"]
CharMenuWidget.super.new(self, menu, font, core.lang:translate("skills", label1))
self.label2 = label2 or ""
end
function SkillWidget:drawCanvas()
local h
local asset = love.graphics.newImage("assets/gui/attacklist.png")
love.graphics.draw(asset, 0, (self.height - 13) / 2)
h = math.floor(self.height / 2) - (self.font:getHeight() / 2)
love.graphics.setColor(0, 0, 0, .8)
self.font:print(self.label, 17, h, "left")
self.font:print(self.label2, self.width - 8, h, "right")
utils.graphics.resetColor()
self.font:print(self.label, 16, h, "left")
self.font:print(self.label2, self.width - 9, h, "right")
end
function SkillWidget:action()
self.character:getSignal(self.menuname, self.label)
self.scene:flushKeys()
self.scene.menusystem:reset()
end
return MenuConstructor