From 2dcc1973ae026de8ec5f4b7d214ea1ae21b05e19 Mon Sep 17 00:00:00 2001 From: devZoGok Date: Sat, 18 May 2024 11:47:56 +0300 Subject: [PATCH] using 3D positions for GUI elements --- Assets/Scripts/Gui/activeGameState.lua | 50 ++++++++----------- Assets/Scripts/Gui/audioTab.lua | 10 ++-- Assets/Scripts/Gui/console.lua | 6 +-- Assets/Scripts/Gui/controlsTab.lua | 8 +-- Assets/Scripts/Gui/defeat.lua | 8 ++- Assets/Scripts/Gui/engineerCommands.lua | 12 ++--- Assets/Scripts/Gui/fortCommands.lua | 2 +- Assets/Scripts/Gui/gamePaused.lua | 10 ++-- Assets/Scripts/Gui/inGameOptions.lua | 12 ++--- Assets/Scripts/Gui/landFactoryCommands.lua | 6 +-- Assets/Scripts/Gui/loadMap.lua | 6 +-- Assets/Scripts/Gui/mainMenu.lua | 8 +-- Assets/Scripts/Gui/mainMenuOptions.lua | 12 ++--- Assets/Scripts/Gui/mapEditor.lua | 12 ++--- Assets/Scripts/Gui/mapEditorMenu.lua | 6 +-- Assets/Scripts/Gui/mouseTab.lua | 12 ++--- Assets/Scripts/Gui/multiplayerTab.lua | 12 ++--- Assets/Scripts/Gui/navalFactoryCommands.lua | 2 +- Assets/Scripts/Gui/newMap.lua | 10 ++-- Assets/Scripts/Gui/options.lua | 12 ++--- Assets/Scripts/Gui/playerSelection.lua | 2 +- Assets/Scripts/Gui/researchStructCommands.lua | 2 +- Assets/Scripts/Gui/singlePlayerMenu.lua | 12 ++--- Assets/Scripts/Gui/statistics.lua | 20 ++++---- Assets/Scripts/Gui/techTree.lua | 20 ++++---- Assets/Scripts/Gui/tradingCenterCommands.lua | 8 +-- Assets/Scripts/Gui/tradingHub.lua | 7 ++- Assets/Scripts/Gui/tradingPlayerGuiTray.lua | 8 ++- Assets/Scripts/Gui/tradingScreen.lua | 28 +++++------ Assets/Scripts/Gui/videoTab.lua | 18 +++---- activeStateButton.cpp | 2 +- activeStateButton.h | 2 +- backButton.cpp | 2 +- backButton.h | 2 +- buildButton.cpp | 2 +- buildButton.h | 2 +- concreteGuiManager.cpp | 21 ++++---- defaultsButton.cpp | 2 +- defaultsButton.h | 2 +- exitButton.cpp | 2 +- exitButton.h | 2 +- exportButton.cpp | 2 +- exportButton.h | 2 +- gameObjectListbox.cpp | 2 +- gameObjectListbox.h | 2 +- inGameAppState.cpp | 6 +-- inGameAppState.h | 6 +-- landTextureListbox.cpp | 2 +- landTextureListbox.h | 2 +- loadMapButton.cpp | 4 +- loadMapButton.h | 4 +- mainMenuButton.cpp | 2 +- mainMenuButton.h | 2 +- mapEditorButton.h | 2 +- newMapButton.cpp | 4 +- newMapButton.h | 4 +- offerButton.cpp | 2 +- offerButton.h | 2 +- okButton.cpp | 2 +- okButton.h | 2 +- optionsButton.cpp | 2 +- optionsButton.h | 2 +- playButton.cpp | 2 +- playButton.h | 2 +- playerTradeButton.cpp | 2 +- playerTradeButton.h | 2 +- researchButton.cpp | 2 +- researchButton.h | 2 +- resourceAmmountButton.cpp | 2 +- resourceAmmountButton.h | 2 +- singlePlayerButton.cpp | 2 +- singlePlayerButton.h | 2 +- skyboxTextureListbox.cpp | 2 +- skyboxTextureListbox.h | 2 +- statsButton.cpp | 2 +- statsButton.h | 2 +- tabButton.cpp | 2 +- tabButton.h | 2 +- tradeButton.cpp | 2 +- tradeButton.h | 2 +- tradingScreenButton.cpp | 2 +- tradingScreenButton.h | 2 +- trainButton.cpp | 2 +- trainButton.h | 2 +- unitButton.cpp | 2 +- unitButton.h | 2 +- 86 files changed, 238 insertions(+), 250 deletions(-) diff --git a/Assets/Scripts/Gui/activeGameState.lua b/Assets/Scripts/Gui/activeGameState.lua index a283e27..f1801d5 100644 --- a/Assets/Scripts/Gui/activeGameState.lua +++ b/Assets/Scripts/Gui/activeGameState.lua @@ -12,9 +12,8 @@ gui = { guiType = GuiType.TEXT, name = 'refineds', text = '', - pos = {x = 100, y = 100}, - zIndex = 0, - scale = 1, + pos = {x = 100, y = 100, z = 0}, + scale = {x = 1, y = 1}, font = 'batang.ttf', fontFirstChar = 0, fontLastChar = 256, @@ -24,21 +23,19 @@ gui = { guiType = GuiType.TEXT, name = 'wealth', text = '', - pos = {x = 100, y = 200}, - zIndex = 0, - scale = 1, + pos = {x = 100, y = 200, z = 0}, + scale = {x = 1, y = 1}, font = 'batang.ttf', fontFirstChar = 0, fontLastChar = 256, - color = {x = 1, y = 1, z = 1, w = 1} + color = {x = 1, y = 0, z = 1, w = 1} }, { guiType = GuiType.TEXT, name = 'research', text = '', - pos = {x = 100, y = 300}, - zIndex = 0, - scale = 1, + pos = {x = 100, y = 300, z = 0}, + scale = {x = 1, y = 1}, font = 'batang.ttf', fontFirstChar = 0, fontLastChar = 256, @@ -46,22 +43,19 @@ gui = { }, { guiType = GuiType.GUI_RECTANGLE, - pos = {x = 0, y = 0}, - zIndex = .9, + pos = {x = 0, y = 0, z = 0}, size = {x = s, y = s}, - imagePath = resIconBasePath .. 'refineds.jpg', + imagePath = resIconBasePath .. 'refineds.png', }, { guiType = GuiType.GUI_RECTANGLE, - pos = {x = 0, y = 100}, - zIndex = .9, + pos = {x = 0, y = 100, z = 0}, size = {x = s, y = s}, imagePath = resIconBasePath .. 'wealth.jpg', }, { guiType = GuiType.GUI_RECTANGLE, - pos = {x = 0, y = 200}, - zIndex = .9, + pos = {x = 0, y = 200, z = 0}, size = {x = s, y = s}, imagePath = resIconBasePath .. 'research.jpg', }, @@ -69,9 +63,8 @@ gui = { guiType = GuiType.TEXT, name = 'depth', text = '', - pos = {x = 0, y = 400}, - zIndex = 0, - scale = 1, + pos = {x = 0, y = 400, z = 0}, + scale = {x = 1, y = 1}, font = 'batang.ttf', fontFirstChar = 0, fontLastChar = 256, @@ -82,29 +75,26 @@ gui = { buttonType = ButtonType.PLAYER_TRADE, name = 'Trade', guiScreen = 'tradingHub.lua', - pos = {x = res.x - Size.x, y = 200}, + pos = {x = res.x - Size.x, y = 200, z = 0}, size = Size, trigger = 10 }, { guiType = GuiType.GUI_RECTANGLE, - pos = {x = res.x - sz, y = res.y - sz}, - zIndex = .9, + pos = {x = res.x - sz, y = res.y - sz, z = 0}, size = {x = sz, y = sz}, - color = {x = .6, y = .6, z = .6, w = .6} + color = {x = .6, y = .6, z = .6, w = .4} }, { guiType = GuiType.GUI_RECTANGLE, - pos = {x = 0, y = res.y - sz}, - zIndex = .9, + pos = {x = 0, y = res.y - sz, z = 0}, size = {x = sz, y = sz}, - color = {x = .6, y = .6, z = .6, w = .6} + color = {x = .6, y = .6, z = .6, w = .4} }, { guiType = GuiType.GUI_RECTANGLE, - pos = {x = sz, y = res.y - .75 * sz}, - zIndex = .9, + pos = {x = sz, y = res.y - .75 * sz, z = 0}, size = {x = res.x - 2 * sz, y = sz * .75}, - color = {x = .6, y = .6, z = .6, w = .6} + color = {x = .6, y = .6, z = .6, w = .4} }, } diff --git a/Assets/Scripts/Gui/audioTab.lua b/Assets/Scripts/Gui/audioTab.lua index a8b5676..0419e1b 100644 --- a/Assets/Scripts/Gui/audioTab.lua +++ b/Assets/Scripts/Gui/audioTab.lua @@ -1,12 +1,12 @@ numGui = 5 gui = { { - pos = {x = 110, y = 90}, + pos = {x = 110, y = 90, z = 0}, size = {x = 100, y = 10}, guiType = GuiType.TEXTBOX, }, { - pos = {x = 110, y = 40}, + pos = {x = 110, y = 40, z = 0}, size = {x = 100, y = 10}, guiType = GuiType.SLIDER, minValue = 0, @@ -17,21 +17,21 @@ gui = { } }, { - pos = {x = 100, y = 400}, + pos = {x = 100, y = 400, z = 0}, size = {x = 150, y = 20}, guiType = GuiType.BUTTON, name = 'Ok', buttonType = ButtonType.OK }, { - pos = {x = 260, y = 400}, + pos = {x = 260, y = 400, z = 0}, size = {x = 150, y = 20}, guiType = GuiType.BUTTON, name = 'Restore defaults', buttonType = ButtonType.DEFAULTS }, { - pos = {x = 420, y = 400}, + pos = {x = 420, y = 400, z = 0}, size = {x = 150, y = 20}, guiType = GuiType.BUTTON, name = 'Back', diff --git a/Assets/Scripts/Gui/console.lua b/Assets/Scripts/Gui/console.lua index 0bf39e5..61e3e64 100644 --- a/Assets/Scripts/Gui/console.lua +++ b/Assets/Scripts/Gui/console.lua @@ -1,7 +1,7 @@ numGui = 3 gui = { { - pos = {x = 100, y = 100}, + pos = {x = 100, y = 100, z = 0}, size = {x = 300, y = 20}, guiType = GuiType.LISTBOX, listboxType = ListboxType.CONSOLE, @@ -9,12 +9,12 @@ gui = { closable = false }, { - pos = {x = 100, y = 510}, + pos = {x = 100, y = 510, z = 0}, size = {x = 270, y = 20}, guiType = GuiType.TEXTBOX }, { - pos = {x = 380, y = 510}, + pos = {x = 380, y = 510, z = 0}, size = {x = 20, y = 20}, guiType = GuiType.BUTTON, buttonType = ButtonType.CONSOLE_COMMAND_OK, diff --git a/Assets/Scripts/Gui/controlsTab.lua b/Assets/Scripts/Gui/controlsTab.lua index 9b11a14..8518863 100644 --- a/Assets/Scripts/Gui/controlsTab.lua +++ b/Assets/Scripts/Gui/controlsTab.lua @@ -1,28 +1,28 @@ numGui = 4 gui = { { - pos = {x = 110, y = 190}, + pos = {x = 110, y = 190, z = 0}, size = {x = 360, y = 20}, guiType = GuiType.LISTBOX, listboxType = ListboxType.CONTROLS, numMaxDisplay = 5 }, { - pos = {x = 100, y = 400}, + pos = {x = 100, y = 400, z = 0}, size = {x = 150, y = 20}, guiType = GuiType.BUTTON, name = 'Ok', buttonType = ButtonType.OK }, { - pos = {x = 260, y = 400}, + pos = {x = 260, y = 400, z = 0}, size = {x = 150, y = 20}, guiType = GuiType.BUTTON, name = 'Restore defaults', buttonType = ButtonType.DEFAULTS }, { - pos = {x = 420, y = 400}, + pos = {x = 420, y = 400, z = 0}, size = {x = 150, y = 20}, guiType = GuiType.BUTTON, name = 'Back', diff --git a/Assets/Scripts/Gui/defeat.lua b/Assets/Scripts/Gui/defeat.lua index 78e89b4..97b18b9 100644 --- a/Assets/Scripts/Gui/defeat.lua +++ b/Assets/Scripts/Gui/defeat.lua @@ -5,8 +5,7 @@ gui = { guiType = GuiType.TEXT, text = 'Defeat', name = 'D', - pos = {x = 100, y = 100}, - zIndex = 0, + pos = {x = 100, y = 100, z = 0}, scale = 1, font = 'batang.ttf', fontFirstChar = 0, @@ -15,13 +14,12 @@ gui = { }, { guiType = GuiType.GUI_RECTANGLE, - pos = {x = 100, y = 200}, - zIndex = 1, + pos = {x = 100, y = 200, z = .1}, size = {x = 600, y = 600}, color = {x = 0, y = 0, z = 0, w = 0.1} }, { - pos = {x = 110, y = 350}, + pos = {x = 110, y = 350, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Leave', diff --git a/Assets/Scripts/Gui/engineerCommands.lua b/Assets/Scripts/Gui/engineerCommands.lua index c40ed26..c8093f2 100644 --- a/Assets/Scripts/Gui/engineerCommands.lua +++ b/Assets/Scripts/Gui/engineerCommands.lua @@ -5,42 +5,42 @@ sz = {x = Size.x - margin, y = Size.y - margin} gui = { { - pos = {x = res.x - 3 * Size.x, y = res.y - 3 * Size.y}, + pos = {x = res.x - 3 * Size.x, y = res.y - 3 * Size.y, z = 0}, size = sz, guiType = GuiType.BUTTON, buttonType = ButtonType.BUILD, trigger = 76, }, { - pos = {x = res.x - 2 * Size.x, y = res.y - 3 * Size.y}, + pos = {x = res.x - 2 * Size.x, y = res.y - 3 * Size.y, z = 0}, size = sz, guiType = GuiType.BUTTON, buttonType = ButtonType.BUILD, trigger = 78, }, { - pos = {x = res.x - 1 * Size.x, y = res.y - 3 * Size.y}, + pos = {x = res.x - 1 * Size.x, y = res.y - 3 * Size.y, z = 0}, size = sz, guiType = GuiType.BUTTON, buttonType = ButtonType.BUILD, trigger = 77, }, { - pos = {x = res.x - 3 * Size.x, y = res.y - 2 * Size.y}, + pos = {x = res.x - 3 * Size.x, y = res.y - 2 * Size.y, z = 0}, size = sz, guiType = GuiType.BUTTON, buttonType = ButtonType.BUILD, trigger = 84, }, { - pos = {x = res.x - 2 * Size.x, y = res.y - 2 * Size.y}, + pos = {x = res.x - 2 * Size.x, y = res.y - 2 * Size.y, z = 0}, size = sz, guiType = GuiType.BUTTON, buttonType = ButtonType.BUILD, trigger = 68, }, { - pos = {x = res.x - 1 * Size.x, y = res.y - 2 * Size.y}, + pos = {x = res.x - 1 * Size.x, y = res.y - 2 * Size.y, z = 0}, size = sz, guiType = GuiType.BUTTON, buttonType = ButtonType.BUILD, diff --git a/Assets/Scripts/Gui/fortCommands.lua b/Assets/Scripts/Gui/fortCommands.lua index c126665..e2d1732 100644 --- a/Assets/Scripts/Gui/fortCommands.lua +++ b/Assets/Scripts/Gui/fortCommands.lua @@ -5,7 +5,7 @@ sz = {x = Size.x - margin, y = Size.y - margin} gui = { { - pos = {x = res.x - Size.x + .5 * margin, y = res.y - Size.y + .5 * margin}, + pos = {x = res.x - Size.x + .5 * margin, y = res.y - Size.y + .5 * margin, z = 0}, size = sz, guiType = GuiType.BUTTON, buttonType = ButtonType.FORT_TRAIN, diff --git a/Assets/Scripts/Gui/gamePaused.lua b/Assets/Scripts/Gui/gamePaused.lua index 2fdfbe8..f9a4be1 100644 --- a/Assets/Scripts/Gui/gamePaused.lua +++ b/Assets/Scripts/Gui/gamePaused.lua @@ -2,35 +2,35 @@ Size = {x = 150, y = 50} numGui = 5 gui = { { - pos = {x = 100, y = 100}, + pos = {x = 100, y = 100, z = 0}, size = Size, guiType = GuiType.BUTTON, buttonType = ButtonType.RESUME, name = 'Resume' }, { - pos = {x = 100, y = 100 + 1 * (Size.y + 10)}, + pos = {x = 100, y = 100 + 1 * (Size.y + 10), z = 0}, size = Size, guiType = GuiType.BUTTON, buttonType = ButtonType.CONSOLE, name = 'Console' }, { - pos = {x = 100, y = 100 + 2 * (Size.y + 10)}, + pos = {x = 100, y = 100 + 2 * (Size.y + 10), z = 0}, size = Size, guiType = GuiType.BUTTON, buttonType = ButtonType.OPTIONS, name = 'Options' }, { - pos = {x = 100, y = 100 + 3 * (Size.y + 10)}, + pos = {x = 100, y = 100 + 3 * (Size.y + 10), z = 0}, size = Size, guiType = GuiType.BUTTON, buttonType = ButtonType.MAIN_MENU, name = 'Main menu' }, { - pos = {x = 100, y = 100 + 4 * (Size.y + 10)}, + pos = {x = 100, y = 100 + 4 * (Size.y + 10), z = 0}, size = Size, guiType = GuiType.BUTTON, buttonType = ButtonType.EXIT, diff --git a/Assets/Scripts/Gui/inGameOptions.lua b/Assets/Scripts/Gui/inGameOptions.lua index 650d260..4f4e27d 100644 --- a/Assets/Scripts/Gui/inGameOptions.lua +++ b/Assets/Scripts/Gui/inGameOptions.lua @@ -3,42 +3,42 @@ Size = {x = 150, y = 40} numGui = 6 gui = { { - pos = {x = 110, y = 40}, + pos = {x = 110, y = 40}, z = 0, size = Size, guiType = GuiType.BUTTON, name = 'Controls', buttonType = ButtonType.CONTROLS_TAB }, { - pos = {x = 270, y = 40}, + pos = {x = 270, y = 40}, z = 0, size = Size, guiType = GuiType.BUTTON, name = 'Mouse', buttonType = ButtonType.MOUSE_TAB }, { - pos = {x = 430, y = 40}, + pos = {x = 430, y = 40, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Video', buttonType = ButtonType.VIDEO_TAB }, { - pos = {x = 590, y = 40}, + pos = {x = 590, y = 40, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Audio', buttonType = ButtonType.AUDIO_TAB }, { - pos = {x = 750, y = 40}, + pos = {x = 750, y = 40, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Multiplayer', buttonType = ButtonType.MULTIPLAYER_TAB }, { - pos = {x = 910, y = 100}, + pos = {x = 910, y = 100, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Back', diff --git a/Assets/Scripts/Gui/landFactoryCommands.lua b/Assets/Scripts/Gui/landFactoryCommands.lua index efb28c2..15c4e3e 100644 --- a/Assets/Scripts/Gui/landFactoryCommands.lua +++ b/Assets/Scripts/Gui/landFactoryCommands.lua @@ -5,21 +5,21 @@ sz = {x = Size.x - margin, y = Size.y - margin} gui = { { - pos = {x = res.x + .5 * margin - Size.x, y = res.y - 3 * Size.y}, + pos = {x = res.x + .5 * margin - Size.x, y = res.y - 3 * Size.y, z = 0}, size = sz, guiType = GuiType.BUTTON, buttonType = ButtonType.LAND_FACTORY_TRAIN, trigger = 87 }, { - pos = {x = res.x + .5 * margin - 2 * Size.x, y = res.y - 3 * Size.y}, + pos = {x = res.x + .5 * margin - 2 * Size.x, y = res.y - 3 * Size.y, z = 0}, size = sz, guiType = GuiType.BUTTON, buttonType = ButtonType.LAND_FACTORY_TRAIN, trigger = 84 }, { - pos = {x = res.x + .5 * margin - 3 * Size.x, y = res.y - 3 * Size.y}, + pos = {x = res.x + .5 * margin - 3 * Size.x, y = res.y - 3 * Size.y, z = 0}, size = sz, guiType = GuiType.BUTTON, buttonType = ButtonType.LAND_FACTORY_TRAIN, diff --git a/Assets/Scripts/Gui/loadMap.lua b/Assets/Scripts/Gui/loadMap.lua index 45d120f..f77ec44 100644 --- a/Assets/Scripts/Gui/loadMap.lua +++ b/Assets/Scripts/Gui/loadMap.lua @@ -1,14 +1,14 @@ numGui = 3 gui = { { - pos = {x = 110, y = 190}, + pos = {x = 110, y = 190, z = 0}, size = {x = 360, y = 20}, guiType = GuiType.LISTBOX, listboxType = ListboxType.MAPS, numMaxDisplay = 5 }, { - pos = {x = 110, y = 250}, + pos = {x = 110, y = 250, z = 0}, size = {x = 140, y = 40}, guiType = GuiType.BUTTON, name = 'Ok', @@ -19,7 +19,7 @@ gui = { } }, { - pos = {x = 420, y = 400}, + pos = {x = 420, y = 400, z = 0}, size = {x = 150, y = 50}, guiType = GuiType.BUTTON, name = 'Back', diff --git a/Assets/Scripts/Gui/mainMenu.lua b/Assets/Scripts/Gui/mainMenu.lua index 6195049..85edd47 100644 --- a/Assets/Scripts/Gui/mainMenu.lua +++ b/Assets/Scripts/Gui/mainMenu.lua @@ -3,28 +3,28 @@ Size = {x = 150, y = 40} numGui = 4 gui = { { - pos = {x = 110, y = 40}, + pos = {x = 110, y = 40, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Single player', buttonType = ButtonType.SINGLE_PLAYER }, { - pos = {x = 110, y = 90}, + pos = {x = 110, y = 90, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Map editor', buttonType = ButtonType.MAP_EDITOR }, { - pos = {x = 110, y = 140}, + pos = {x = 110, y = 140, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Options', buttonType = ButtonType.OPTIONS }, { - pos = {x = 110, y = 190}, + pos = {x = 110, y = 190, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Exit', diff --git a/Assets/Scripts/Gui/mainMenuOptions.lua b/Assets/Scripts/Gui/mainMenuOptions.lua index df7159c..d5be514 100644 --- a/Assets/Scripts/Gui/mainMenuOptions.lua +++ b/Assets/Scripts/Gui/mainMenuOptions.lua @@ -3,42 +3,42 @@ Size = {x = 150, y = 40} numGui = 6 gui = { { - pos = {x = 110, y = 40}, + pos = {x = 110, y = 40, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Controls', buttonType = ButtonType.CONTROLS_TAB }, { - pos = {x = 270, y = 40}, + pos = {x = 270, y = 40, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Mouse', buttonType = ButtonType.MOUSE_TAB }, { - pos = {x = 430, y = 40}, + pos = {x = 430, y = 40, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Video', buttonType = ButtonType.VIDEO_TAB }, { - pos = {x = 590, y = 40}, + pos = {x = 590, y = 40, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Audio', buttonType = ButtonType.AUDIO_TAB }, { - pos = {x = 750, y = 40}, + pos = {x = 750, y = 40, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Multiplayer', buttonType = ButtonType.MULTIPLAYER_TAB }, { - pos = {x = 910, y = 100}, + pos = {x = 910, y = 100, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Back', diff --git a/Assets/Scripts/Gui/mapEditor.lua b/Assets/Scripts/Gui/mapEditor.lua index a462588..b17dda4 100644 --- a/Assets/Scripts/Gui/mapEditor.lua +++ b/Assets/Scripts/Gui/mapEditor.lua @@ -4,42 +4,42 @@ Size = {x = 140, y = 20} startX = 100 gui = { { - pos = {x = startX, y = 400}, + pos = {x = startX, y = 400, z = 0}, size = Size, guiType = GuiType.BUTTON, buttonType = ButtonType.EXPORT, name = 'Export' }, { - pos = {x = startX + Size.x + 10, y = 400}, + pos = {x = startX + Size.x + 10, y = 400, z = 0}, size = Size, guiType = GuiType.LISTBOX, listboxType = ListboxType.VEHICLES, numMaxDisplay = 5 }, { - pos = {x = startX + 2 * (Size.x + 10), y = 400}, + pos = {x = startX + 2 * (Size.x + 10), y = 400, z = 0}, size = Size, guiType = GuiType.LISTBOX, listboxType = ListboxType.STRUCTURES, numMaxDisplay = 5 }, { - pos = {x = startX + 3 * (Size.x + 10), y = 400}, + pos = {x = startX + 3 * (Size.x + 10), y = 400, z = 0}, size = Size, guiType = GuiType.LISTBOX, listboxType = ListboxType.RESOURCE_DEPOSITS, numMaxDisplay = 5 }, { - pos = {x = startX + 4 * (Size.x + 10), y = 400}, + pos = {x = startX + 4 * (Size.x + 10), y = 400, z = 0}, size = Size, guiType = GuiType.LISTBOX, listboxType = ListboxType.SKYBOX_TEXTURES, numMaxDisplay = 5 }, { - pos = {x = startX + 5 * (Size.x + 10), y = 400}, + pos = {x = startX + 5 * (Size.x + 10), y = 400, z = 0}, size = Size, guiType = GuiType.LISTBOX, listboxType = ListboxType.LAND_TEXTURES, diff --git a/Assets/Scripts/Gui/mapEditorMenu.lua b/Assets/Scripts/Gui/mapEditorMenu.lua index c053a39..5bae37a 100644 --- a/Assets/Scripts/Gui/mapEditorMenu.lua +++ b/Assets/Scripts/Gui/mapEditorMenu.lua @@ -3,21 +3,21 @@ Size = {x = 150, y = 40} numGui = 3 gui = { { - pos = {x = 110, y = 40}, + pos = {x = 110, y = 40, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'New map', buttonType = ButtonType.NEW_MAP }, { - pos = {x = 110, y = 90}, + pos = {x = 110, y = 90, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Load map', buttonType = ButtonType.LOAD_MAP }, { - pos = {x = 110, y = 140}, + pos = {x = 110, y = 140, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Back', diff --git a/Assets/Scripts/Gui/mouseTab.lua b/Assets/Scripts/Gui/mouseTab.lua index 1d39c27..e9c34f4 100644 --- a/Assets/Scripts/Gui/mouseTab.lua +++ b/Assets/Scripts/Gui/mouseTab.lua @@ -1,12 +1,12 @@ numGui = 6 gui = { { - pos = {x = 110, y = 80}, + pos = {x = 110, y = 80, z = 0}, size = {x = 300, y = 10}, guiType = GuiType.TEXTBOX }, { - pos = {x = 110, y = 40}, + pos = {x = 110, y = 40, z = 0}, size = {x = 300, y = 10}, minValue = 0, maxValue = 2, @@ -17,25 +17,25 @@ gui = { } }, { - pos = {x = 110, y = 110}, + pos = {x = 110, y = 110, z = 0}, guiType = GuiType.CHECKBOX }, { - pos = {x = 100, y = 400}, + pos = {x = 100, y = 400, z = 0}, size = {x = 150, y = 20}, guiType = GuiType.BUTTON, name = 'Ok', buttonType = ButtonType.OK }, { - pos = {x = 260, y = 400}, + pos = {x = 260, y = 400, z = 0}, size = {x = 150, y = 20}, guiType = GuiType.BUTTON, name = 'Restore defaults', buttonType = ButtonType.DEFAULTS }, { - pos = {x = 420, y = 400}, + pos = {x = 420, y = 400, z = 0}, size = {x = 150, y = 20}, guiType = GuiType.BUTTON, name = 'Back', diff --git a/Assets/Scripts/Gui/multiplayerTab.lua b/Assets/Scripts/Gui/multiplayerTab.lua index bec5ea2..1fb7bff 100644 --- a/Assets/Scripts/Gui/multiplayerTab.lua +++ b/Assets/Scripts/Gui/multiplayerTab.lua @@ -1,36 +1,36 @@ numGui = 6 gui = { { - pos = {x = 110, y = 40}, + pos = {x = 110, y = 40, z = 0}, size = {x = 100, y = 20}, guiType = GuiType.TEXTBOX }, { - pos = {x = 110, y = 70}, + pos = {x = 110, y = 70, z = 0}, size = {x = 100, y = 20}, guiType = GuiType.TEXTBOX }, { - pos = {x = 110, y = 100}, + pos = {x = 110, y = 100, z = 0}, size = {x = 100, y = 20}, guiType = GuiType.TEXTBOX }, { - pos = {x = 100, y = 400}, + pos = {x = 100, y = 400, z = 0}, size = {x = 150, y = 20}, guiType = GuiType.BUTTON, name = 'Ok', buttonType = ButtonType.OK }, { - pos = {x = 260, y = 400}, + pos = {x = 260, y = 400, z = 0}, size = {x = 150, y = 20}, guiType = GuiType.BUTTON, name = 'Restore defaults', buttonType = ButtonType.DEFAULTS }, { - pos = {x = 420, y = 400}, + pos = {x = 420, y = 400, z = 0}, size = {x = 150, y = 20}, guiType = GuiType.BUTTON, name = 'Back', diff --git a/Assets/Scripts/Gui/navalFactoryCommands.lua b/Assets/Scripts/Gui/navalFactoryCommands.lua index b429ca0..719313b 100644 --- a/Assets/Scripts/Gui/navalFactoryCommands.lua +++ b/Assets/Scripts/Gui/navalFactoryCommands.lua @@ -3,7 +3,7 @@ Size = {x = 70, y = 70} gui = { { - pos = {x = res.x - Size.x, y = res.y - Size.y}, + pos = {x = res.x - Size.x, y = res.y - Size.y, z = 0}, size = Size, guiType = GuiType.BUTTON, buttonType = ButtonType.NAVAL_FACTORY_TRAIN, diff --git a/Assets/Scripts/Gui/newMap.lua b/Assets/Scripts/Gui/newMap.lua index 1b1a4d4..2f0fc99 100644 --- a/Assets/Scripts/Gui/newMap.lua +++ b/Assets/Scripts/Gui/newMap.lua @@ -3,22 +3,22 @@ Size = {x = 140, y = 40} numGui = 5 gui = { { - pos = {x = 110, y = 150}, + pos = {x = 110, y = 150, z = 0}, size = Size, guiType = GuiType.TEXTBOX }, { - pos = {x = 110, y = 190}, + pos = {x = 110, y = 190, z = 0}, size = Size, guiType = GuiType.TEXTBOX }, { - pos = {x = 110, y = 220}, + pos = {x = 110, y = 220, z = 0}, size = Size, guiType = GuiType.TEXTBOX }, { - pos = {x = 420, y = 400}, + pos = {x = 420, y = 400, z = 0}, size = {x = 150, y = 50}, guiType = GuiType.BUTTON, name = 'Ok', @@ -31,7 +31,7 @@ gui = { } }, { - pos = {x = 250, y = 400}, + pos = {x = 250, y = 400, z = 0}, size = {x = 150, y = 50}, guiType = GuiType.BUTTON, name = 'Back', diff --git a/Assets/Scripts/Gui/options.lua b/Assets/Scripts/Gui/options.lua index df7159c..d5be514 100644 --- a/Assets/Scripts/Gui/options.lua +++ b/Assets/Scripts/Gui/options.lua @@ -3,42 +3,42 @@ Size = {x = 150, y = 40} numGui = 6 gui = { { - pos = {x = 110, y = 40}, + pos = {x = 110, y = 40, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Controls', buttonType = ButtonType.CONTROLS_TAB }, { - pos = {x = 270, y = 40}, + pos = {x = 270, y = 40, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Mouse', buttonType = ButtonType.MOUSE_TAB }, { - pos = {x = 430, y = 40}, + pos = {x = 430, y = 40, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Video', buttonType = ButtonType.VIDEO_TAB }, { - pos = {x = 590, y = 40}, + pos = {x = 590, y = 40, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Audio', buttonType = ButtonType.AUDIO_TAB }, { - pos = {x = 750, y = 40}, + pos = {x = 750, y = 40, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Multiplayer', buttonType = ButtonType.MULTIPLAYER_TAB }, { - pos = {x = 910, y = 100}, + pos = {x = 910, y = 100, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Back', diff --git a/Assets/Scripts/Gui/playerSelection.lua b/Assets/Scripts/Gui/playerSelection.lua index 3857ed9..f6f09d2 100644 --- a/Assets/Scripts/Gui/playerSelection.lua +++ b/Assets/Scripts/Gui/playerSelection.lua @@ -1,4 +1,4 @@ -Pos = {x = 110, y = 150} +Pos = {x = 110, y = 150, z = 0} Size = {x = 100, y = 20} space = 60 diff --git a/Assets/Scripts/Gui/researchStructCommands.lua b/Assets/Scripts/Gui/researchStructCommands.lua index e377833..8c17b96 100644 --- a/Assets/Scripts/Gui/researchStructCommands.lua +++ b/Assets/Scripts/Gui/researchStructCommands.lua @@ -20,7 +20,7 @@ gui = { buttonType = ButtonType.ACTIVE_GAME_STATE, name = 'Tech', guiScreen = 'techTree.lua', - pos = {x = res.x - 2 * Size.x, y = res.y - Size.y}, + pos = {x = res.x - 2 * Size.x, y = res.y - Size.y, z = 0}, size = sz, trigger = 85 }, diff --git a/Assets/Scripts/Gui/singlePlayerMenu.lua b/Assets/Scripts/Gui/singlePlayerMenu.lua index d9b633d..d43e620 100644 --- a/Assets/Scripts/Gui/singlePlayerMenu.lua +++ b/Assets/Scripts/Gui/singlePlayerMenu.lua @@ -3,35 +3,35 @@ Size = {x = 100, y = 20} numGui = 6 gui = { { - pos = {x = 100, y = 100}, + pos = {x = 100, y = 100, z = 0}, size = Size, guiType = GuiType.LISTBOX, numMaxDisplay = 3, listboxType = ListboxType.CPU_DIFFICULTIES }, { - pos = {x = 210, y = 100}, + pos = {x = 210, y = 100, z = 0}, size = Size, guiType = GuiType.LISTBOX, numMaxDisplay = 3, listboxType = ListboxType.FACTIONS }, { - pos = {x = 100, y = 230}, + pos = {x = 100, y = 230, z = 0}, size = Size, guiType = GuiType.LISTBOX, numMaxDisplay = 3, listboxType = ListboxType.FACTIONS }, { - pos = {x = 110, y = 310}, + pos = {x = 110, y = 310, z = 0}, size = Size, guiType = GuiType.LISTBOX, listboxType = ListboxType.MAPS, numMaxDisplay = 5 }, { - pos = {x = 110, y = 460}, + pos = {x = 110, y = 460, z = 0}, size = Size, guiType = GuiType.BUTTON, buttonType = ButtonType.PLAY, @@ -45,7 +45,7 @@ gui = { } }, { - pos = {x = 110 + Size.x + 10, y = 460}, + pos = {x = 110 + Size.x + 10, y = 460, z = 0}, size = Size, guiType = GuiType.BUTTON, buttonType = ButtonType.BACK, diff --git a/Assets/Scripts/Gui/statistics.lua b/Assets/Scripts/Gui/statistics.lua index cc22a67..6beac18 100644 --- a/Assets/Scripts/Gui/statistics.lua +++ b/Assets/Scripts/Gui/statistics.lua @@ -3,7 +3,7 @@ gui = { guiType = GuiType.TEXT, text = 'Statistics', name = 'stat', - pos = {x = 850, y = 100}, + pos = {x = 850, y = 100, z = 0}, zIndex = 0, scale = 0.5, font = 'batang.ttf', @@ -15,7 +15,7 @@ gui = { guiType = GuiType.TEXT, text = 'Player', name = 'pl', - pos = {x = 50, y = 200}, + pos = {x = 50, y = 200, z = 0}, zIndex = 0, scale = 0.3, font = 'batang.ttf', @@ -27,7 +27,7 @@ gui = { guiType = GuiType.TEXT, text = 'Vehicles built', name = 'vb', - pos = {x = 150, y = 200}, + pos = {x = 150, y = 200, z = 0}, zIndex = 0, scale = 0.3, font = 'batang.ttf', @@ -39,7 +39,7 @@ gui = { guiType = GuiType.TEXT, text = 'Vehicles destroyed', name = 'vd', - pos = {x = 450, y = 200}, + pos = {x = 450, y = 200, z = 0}, zIndex = 0, scale = 0.3, font = 'batang.ttf', @@ -51,7 +51,7 @@ gui = { guiType = GuiType.TEXT, text = 'Vehicles lost', name = 'vl', - pos = {x = 850, y = 200}, + pos = {x = 850, y = 200, z = 0}, zIndex = 0, scale = 0.3, font = 'batang.ttf', @@ -63,7 +63,7 @@ gui = { guiType = GuiType.TEXT, text = 'Structures built', name = 'sb', - pos = {x = 1050, y = 200}, + pos = {x = 1050, y = 200, z = 0}, zIndex = 0, scale = 0.3, font = 'batang.ttf', @@ -75,7 +75,7 @@ gui = { guiType = GuiType.TEXT, text = 'Structures destroyed', name = 'sd', - pos = {x = 1350, y = 200}, + pos = {x = 1350, y = 200, z = 0}, zIndex = 0, scale = 0.3, font = 'batang.ttf', @@ -87,7 +87,7 @@ gui = { guiType = GuiType.TEXT, text = 'Structures lost', name = 'sl', - pos = {x = 1720, y = 200}, + pos = {x = 1720, y = 200, z = 0}, zIndex = 0, scale = 0.3, font = 'batang.ttf', @@ -97,13 +97,13 @@ gui = { }, { guiType = GuiType.GUI_RECTANGLE, - pos = {x = 100, y = 200}, + pos = {x = 100, y = 200, z = 0}, zIndex = 1, size = {x = 600, y = 600}, color = {x = 0, y = 0, z = 1, w = 1} }, { - pos = {x = 1700, y = 1000}, + pos = {x = 1700, y = 1000, z = 0}, size = Size, guiType = GuiType.BUTTON, name = 'Back', diff --git a/Assets/Scripts/Gui/techTree.lua b/Assets/Scripts/Gui/techTree.lua index 2118987..8c75fdd 100644 --- a/Assets/Scripts/Gui/techTree.lua +++ b/Assets/Scripts/Gui/techTree.lua @@ -1,7 +1,7 @@ res = graphics.resolution Size = {x = res.x * .5, y = res.y * .5} techButtonSize = {x = 50, y = 50} -Pos = {x = res.x * .3, y = res.y * .1} +Pos = {x = res.x * .3, y = res.y * .1, z = 0} margin = {top = 10, left = 10, right = 10, bottom = 10} baseTechPath = 'Icons/Technologies/' heightOffset = techButtonSize.y + 10 @@ -15,7 +15,7 @@ gui = { color = {x = 0, y = 0, z = 0, w = .6} }, { - pos = {x = Pos.x + .5 * (Size.x - techButtonSize.x), y = Pos.y + margin.top}, + pos = {x = Pos.x + .5 * (Size.x - techButtonSize.x), y = Pos.y + margin.top, z = 0}, size = techButtonSize, name = "Research", imagePath = baseTechPath .. 'apt.jpg', @@ -25,7 +25,7 @@ gui = { trigger = 82, }, { - pos = {x = Pos.x + margin.left, y = Pos.y + margin.top + heightOffset}, + pos = {x = Pos.x + margin.left, y = Pos.y + margin.top + heightOffset, z = 0}, size = techButtonSize, name = "Research", imagePath = baseTechPath .. 'fpt.jpg', @@ -35,7 +35,7 @@ gui = { trigger = 82, }, { - pos = {x = Pos.x + margin.left, y = Pos.y + margin.top + 2 * heightOffset}, + pos = {x = Pos.x + margin.left, y = Pos.y + margin.top + 2 * heightOffset, z = 0}, size = techButtonSize, name = "Research", imagePath = baseTechPath .. 'cruisers.jpg', @@ -45,7 +45,7 @@ gui = { trigger = 82, }, { - pos = {x = Pos.x + .5 * (Size.x - techButtonSize.x), y = Pos.y + margin.top + heightOffset}, + pos = {x = Pos.x + .5 * (Size.x - techButtonSize.x), y = Pos.y + margin.top + heightOffset, z = 0}, size = techButtonSize, name = "Research", imagePath = baseTechPath .. 'ept.jpg', @@ -55,7 +55,7 @@ gui = { trigger = 82, }, { - pos = {x = Pos.x + .5 * (Size.x - 3 * techButtonSize.x), y = Pos.y + margin.top + 2 * heightOffset}, + pos = {x = Pos.x + .5 * (Size.x - 3 * techButtonSize.x), y = Pos.y + margin.top + 2 * heightOffset, z = 0}, size = techButtonSize, name = "Research", imagePath = baseTechPath .. 'stealth.jpg', @@ -65,7 +65,7 @@ gui = { trigger = 82, }, { - pos = {x = Pos.x + .5 * (Size.x + 3 * techButtonSize.x), y = Pos.y + margin.top + 2 * heightOffset}, + pos = {x = Pos.x + .5 * (Size.x + 3 * techButtonSize.x), y = Pos.y + margin.top + 2 * heightOffset, z = 0}, size = techButtonSize, name = "Research", imagePath = baseTechPath .. 'robo.jpg', @@ -75,7 +75,7 @@ gui = { trigger = 82, }, { - pos = {x = Pos.x + Size.x - (margin.right + techButtonSize.x), y = Pos.y + margin.top + heightOffset}, + pos = {x = Pos.x + Size.x - (margin.right + techButtonSize.x), y = Pos.y + margin.top + heightOffset, z = 0}, size = techButtonSize, name = "Research", imagePath = baseTechPath .. 'pct.jpg', @@ -85,7 +85,7 @@ gui = { trigger = 82, }, { - pos = {x = Pos.x + Size.x - (margin.right + 3 * techButtonSize.x), y = Pos.y + margin.top + 2 * heightOffset}, + pos = {x = Pos.x + Size.x - (margin.right + 3 * techButtonSize.x), y = Pos.y + margin.top + 2 * heightOffset, z = 0}, size = techButtonSize, name = "Research", imagePath = baseTechPath .. 'carriers.jpg', @@ -95,7 +95,7 @@ gui = { trigger = 82, }, { - pos = {x = Pos.x + Size.x - (margin.right + techButtonSize.x), y = Pos.y + margin.top + 2 * heightOffset}, + pos = {x = Pos.x + Size.x - (margin.right + techButtonSize.x), y = Pos.y + margin.top + 2 * heightOffset, z = 0}, size = techButtonSize, name = "Research", imagePath = baseTechPath .. 'tanks.jpg', diff --git a/Assets/Scripts/Gui/tradingCenterCommands.lua b/Assets/Scripts/Gui/tradingCenterCommands.lua index fb1f423..4a4dbda 100644 --- a/Assets/Scripts/Gui/tradingCenterCommands.lua +++ b/Assets/Scripts/Gui/tradingCenterCommands.lua @@ -5,7 +5,7 @@ sz = {x = Size.x - margin, y = Size.y - margin} gui = { { - pos = {x = res.x - Size.x, y = res.y - Size.y}, + pos = {x = res.x - Size.x, y = res.y - Size.y, z = 0}, size = sz, name = 'Buy ref', guiType = GuiType.BUTTON, @@ -13,7 +13,7 @@ gui = { trigger = 73, }, { - pos = {x = res.x - 2 * Size.x, y = res.y - Size.y}, + pos = {x = res.x - 2 * Size.x, y = res.y - Size.y, z = 0}, size = sz, name = 'Sell ref', guiType = GuiType.BUTTON, @@ -21,7 +21,7 @@ gui = { trigger = 79, }, { - pos = {x = res.x - Size.x, y = res.y - 2 * Size.y}, + pos = {x = res.x - Size.x, y = res.y - 2 * Size.y, z = 0}, size = sz, name = 'Buy rsch', guiType = GuiType.BUTTON, @@ -29,7 +29,7 @@ gui = { trigger = 75, }, { - pos = {x = res.x - 2 * Size.x, y = res.y - 2 * Size.y}, + pos = {x = res.x - 2 * Size.x, y = res.y - 2 * Size.y, z = 0}, size = sz, name = 'Sell rsch', guiType = GuiType.BUTTON, diff --git a/Assets/Scripts/Gui/tradingHub.lua b/Assets/Scripts/Gui/tradingHub.lua index 58f81a8..2fc1b3b 100644 --- a/Assets/Scripts/Gui/tradingHub.lua +++ b/Assets/Scripts/Gui/tradingHub.lua @@ -1,6 +1,6 @@ res = graphics.resolution -Pos = {x = 10, y = 10} -Size = {x = res.x * .8, y = res.y * .8} +Pos = {x = 10, y = 10, z = .1} +Size = {x = res.x * .8, y = res.y * .8 + 40} buttonSize = {x = 100, y = 20} textboxSize = {x = 200, y = 25} margin = {top = 10, left = 10, right = 10, bottom = 10} @@ -9,7 +9,6 @@ gui = { { guiType = GuiType.GUI_RECTANGLE, pos = Pos, - zIndex = .9, size = Size, color = {x = 0, y = 0, z = 0, w = .6} }, @@ -18,7 +17,7 @@ gui = { buttonType = ButtonType.ACTIVE_GAME_STATE, name = 'Back', guiScreen = 'activeGameState.lua', - pos = {x = Pos.x + Size.x - buttonSize.x - margin.right, y = Pos.y + Size.y - buttonSize.y - margin.bottom}, + pos = {x = Pos.x + Size.x - buttonSize.x - margin.right, y = Pos.y + Size.y - buttonSize.y - margin.bottom, z = .11}, size = buttonSize, trigger = 10 }, diff --git a/Assets/Scripts/Gui/tradingPlayerGuiTray.lua b/Assets/Scripts/Gui/tradingPlayerGuiTray.lua index 63b3ad8..1ffa6fc 100644 --- a/Assets/Scripts/Gui/tradingPlayerGuiTray.lua +++ b/Assets/Scripts/Gui/tradingPlayerGuiTray.lua @@ -14,9 +14,8 @@ gui = { guiType = GuiType.TEXT, name = 'playerName', text = '', - pos = {x = Pos.x + margin.left, y = height}, - zIndex = 0, - scale = 1, + pos = {x = Pos.x + margin.left, y = height, z = .11}, + scale = {x = .2, y = .2}, font = 'batang.ttf', fontFirstChar = 0, fontLastChar = 256, @@ -26,7 +25,6 @@ gui = { { guiType = GuiType.GUI_RECTANGLE, pos = {x = Pos.x + margin.left + 20, y = height}, - zIndex = .9, size = Size, color = {x = 0, y = 0, z = 0, w = .6} }, @@ -44,7 +42,7 @@ gui = { buttonType = ButtonType.TRADING_SCREEN, name = 'Trade', guiScreen = 'tradingScreen.lua', - pos = {x = Pos.x + Size.x - buttonSize.x - margin.right, y = height}, + pos = {x = Pos.x + Size.x - buttonSize.x - margin.right, y = height, z = .11}, size = buttonSize, trigger = 10 } diff --git a/Assets/Scripts/Gui/tradingScreen.lua b/Assets/Scripts/Gui/tradingScreen.lua index 78e3456..1517aa4 100644 --- a/Assets/Scripts/Gui/tradingScreen.lua +++ b/Assets/Scripts/Gui/tradingScreen.lua @@ -11,21 +11,21 @@ buttonSize = {x = 100, y = 20} ResourceTrayGuiId = {ICON = 0, TEXTBOX = 1, INCREMENT = 2, DECREMENT = 3} IconPath = {WEALTH = 'Icons/Resources/wealth.jpg', RESEARCH = 'Icons/Resources/research.jpg', REFINEDS = 'Icons/Resources/refineds.jpg', TIME = 'Icons/Resources/time.jpg'} + function createResourceTrayGui(cpuPlayer, lineId, guiId, imgPath) height = margin.top + lineId * iconSize.y if guiId == ResourceTrayGuiId.ICON then - guiElPos = {x = Pos.x + (cpuPlayer and margin.left or Size.x -(margin.right + 3 * iconSize.x + textboxSize.x)), y = height} + guiElPos = {x = Pos.x + (cpuPlayer and margin.left or Size.x -(margin.right + 3 * iconSize.x + textboxSize.x)), y = height, z = .2} return { guiType = GuiType.GUI_RECTANGLE, pos = guiElPos, - zIndex = .8, size = iconSize, imagePath = imgPath } elseif guiId == ResourceTrayGuiId.TEXTBOX then - guiElPos = {x = Pos.x + (cpuPlayer and margin.left + iconSize.x or Size.x -(margin.right + 2 * iconSize.x + textboxSize.x)), y = height} + guiElPos = {x = Pos.x + (cpuPlayer and margin.left + iconSize.x or Size.x -(margin.right + 2 * iconSize.x + textboxSize.x)), y = height, z = .2} return { pos = guiElPos, @@ -33,7 +33,7 @@ function createResourceTrayGui(cpuPlayer, lineId, guiId, imgPath) guiType = GuiType.TEXTBOX, } elseif guiId == ResourceTrayGuiId.INCREMENT then - guiElPos = {x = Pos.x + (cpuPlayer and margin.left + iconSize.x + textboxSize.x or Size.x -(margin.right + 2 * iconSize.x)), y = height} + guiElPos = {x = Pos.x + (cpuPlayer and margin.left + iconSize.x + textboxSize.x or Size.x -(margin.right + 2 * iconSize.x)), y = height, z = .2} return { guiType = GuiType.BUTTON, @@ -45,7 +45,7 @@ function createResourceTrayGui(cpuPlayer, lineId, guiId, imgPath) trigger = 10 } elseif guiId == ResourceTrayGuiId.DECREMENT then - guiElPos = {x = Pos.x + (cpuPlayer and margin.left + 2 * iconSize.x + textboxSize.x or Size.x -(margin.right + iconSize.x)), y = height} + guiElPos = {x = Pos.x + (cpuPlayer and margin.left + 2 * iconSize.x + textboxSize.x or Size.x -(margin.right + iconSize.x)), y = height, z = .2} return { guiType = GuiType.BUTTON, @@ -64,9 +64,8 @@ gui = { guiType = GuiType.TEXT, name = 'P0', text = 'P0', - pos = {x = Pos.x + margin.left, y = Pos.y + margin.top}, - zIndex = 0, - scale = 1, + pos = {x = Pos.x + margin.left, y = Pos.y + margin.top - 20, z = .2}, + scale = {x = .5, y = .5}, font = 'batang.ttf', fontFirstChar = 0, fontLastChar = 256, @@ -76,14 +75,14 @@ gui = { guiType = GuiType.TEXT, name = 'You', text = 'You', - pos = {x = Pos.x + margin.left, y = Pos.y + margin.top}, - zIndex = 0, - scale = 1, + pos = {x = Pos.x + Size.x -(margin.right + textboxSize.x + iconSize.x + 50), y = Pos.y + margin.top - 20, z = .2}, + scale = {x = .5, y = .5}, font = 'batang.ttf', fontFirstChar = 0, fontLastChar = 256, color = {x = 1, y = 1, z = 1, w = 1} }, + createResourceTrayGui(true, 0, ResourceTrayGuiId.ICON, IconPath.REFINEDS), createResourceTrayGui(true, 0, ResourceTrayGuiId.TEXTBOX), createResourceTrayGui(true, 0, ResourceTrayGuiId.INCREMENT), @@ -116,12 +115,13 @@ gui = { createResourceTrayGui(false, 3, ResourceTrayGuiId.TEXTBOX), createResourceTrayGui(false, 3, ResourceTrayGuiId.INCREMENT), createResourceTrayGui(false, 3, ResourceTrayGuiId.DECREMENT), + { guiType = GuiType.BUTTON, buttonType = ButtonType.PLAYER_TRADE, name = 'Back', guiScreen = 'tradingHub.lua', - pos = {x = Pos.x + Size.x - 2 * buttonSize.x - margin.right, y = Pos.y + Size.y - buttonSize.y - margin.bottom}, + pos = {x = Pos.x + Size.x - 2 * buttonSize.x - margin.right, y = Pos.y + Size.y - buttonSize.y - margin.bottom, z = .2}, size = buttonSize, trigger = 10 }, @@ -129,12 +129,12 @@ gui = { guiType = GuiType.BUTTON, buttonType = ButtonType.TRADE_OFFER, name = 'Offer', - pos = {x = Pos.x + Size.x - buttonSize.x - margin.right, y = Pos.y + Size.y - buttonSize.y - margin.bottom}, + pos = {x = Pos.x + Size.x - buttonSize.x - margin.right, y = Pos.y + Size.y - buttonSize.y - margin.bottom, z = .2}, size = buttonSize, trigger = 10 }, { - pos = {x = Pos.x + margin.left, y = Pos.y + Size.y - textboxSize.y - margin.bottom}, + pos = {x = Pos.x + margin.left, y = Pos.y + Size.y - textboxSize.y - margin.bottom, z = .2}, size = textboxSize, guiType = GuiType.TEXTBOX, } diff --git a/Assets/Scripts/Gui/videoTab.lua b/Assets/Scripts/Gui/videoTab.lua index 4277f15..3ee280e 100644 --- a/Assets/Scripts/Gui/videoTab.lua +++ b/Assets/Scripts/Gui/videoTab.lua @@ -1,7 +1,7 @@ numGui = 9 gui = { { - pos = {x = 210, y = 190}, + pos = {x = 210, y = 190, z = 0}, size = {x = 360, y = 20}, guiType = GuiType.LISTBOX, listboxType = ListboxType.RESOLUTION, @@ -14,41 +14,41 @@ gui = { } }, { - pos = {x = 110, y = 40}, + pos = {x = 110, y = 40, z = 0}, guiType = GuiType.CHECKBOX }, { - pos = {x = 110, y = 70}, + pos = {x = 110, y = 70, z = 0}, guiType = GuiType.CHECKBOX }, { - pos = {x = 110, y = 100}, + pos = {x = 110, y = 100, z = 0}, guiType = GuiType.CHECKBOX }, { - pos = {x = 110, y = 130}, + pos = {x = 110, y = 130, z = 0}, guiType = GuiType.CHECKBOX }, { - pos = {x = 110, y = 160}, + pos = {x = 110, y = 160, z = 0}, guiType = GuiType.CHECKBOX }, { - pos = {x = 100, y = 400}, + pos = {x = 100, y = 400, z = 0}, size = {x = 150, y = 20}, guiType = GuiType.BUTTON, name = 'Ok', buttonType = ButtonType.OK }, { - pos = {x = 260, y = 400}, + pos = {x = 260, y = 400, z = 0}, size = {x = 150, y = 20}, guiType = GuiType.BUTTON, name = 'Restore defaults', buttonType = ButtonType.DEFAULTS }, { - pos = {x = 420, y = 400}, + pos = {x = 420, y = 400, z = 0}, size = {x = 150, y = 20}, guiType = GuiType.BUTTON, name = 'Back', diff --git a/activeStateButton.cpp b/activeStateButton.cpp index e81eeac..6e92853 100644 --- a/activeStateButton.cpp +++ b/activeStateButton.cpp @@ -18,7 +18,7 @@ namespace battleship{ using namespace vb01Gui; using namespace gameBase; - ActiveStateButton::ActiveStateButton(Vector2 pos, Vector2 size, string gs, string name, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath), guiScreen(gs){ + ActiveStateButton::ActiveStateButton(Vector3 pos, Vector2 size, string gs, string name, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath), guiScreen(gs){ StateManager *stateManager = GameManager::getSingleton()->getStateManager(); ActiveGameState *activeState = (ActiveGameState*)stateManager->getAppStateByType((int)AppStateType::ACTIVE_STATE); diff --git a/activeStateButton.h b/activeStateButton.h index 42badeb..2def462 100644 --- a/activeStateButton.h +++ b/activeStateButton.h @@ -6,7 +6,7 @@ namespace battleship{ class ActiveStateButton : public vb01Gui::Button{ public: - ActiveStateButton(vb01::Vector2, vb01::Vector2, std::string, std::string, int = -1, std::string = ""); + ActiveStateButton(vb01::Vector3, vb01::Vector2, std::string, std::string, int = -1, std::string = ""); void onClick(); private: std::string guiScreen = ""; diff --git a/backButton.cpp b/backButton.cpp index a0d7d55..eb40f90 100644 --- a/backButton.cpp +++ b/backButton.cpp @@ -7,7 +7,7 @@ namespace battleship{ using namespace vb01; using namespace vb01Gui; - BackButton::BackButton(Vector2 pos, Vector2 size, string name, string screen) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) { + BackButton::BackButton(Vector3 pos, Vector2 size, string name, string screen) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) { this->screen = screen; } diff --git a/backButton.h b/backButton.h index b0f7fc3..504eef7 100644 --- a/backButton.h +++ b/backButton.h @@ -6,7 +6,7 @@ namespace battleship{ class BackButton : public vb01Gui::Button{ public: - BackButton(vb01::Vector2, vb01::Vector2, std::string, std::string); + BackButton(vb01::Vector3, vb01::Vector2, std::string, std::string); void onClick(); private: std::string screen; diff --git a/buildButton.cpp b/buildButton.cpp index 29f57e0..32790ec 100644 --- a/buildButton.cpp +++ b/buildButton.cpp @@ -16,7 +16,7 @@ namespace battleship{ using namespace vb01Gui; using namespace gameBase; - BuildButton::BuildButton(Vector2 pos, Vector2 size, string name, int trigger, string imagePath, int uid, int slId) : + BuildButton::BuildButton(Vector3 pos, Vector2 size, string name, int trigger, string imagePath, int uid, int slId) : UnitButton(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, imagePath, uid), slotId(slId){} void BuildButton::onClick(){ diff --git a/buildButton.h b/buildButton.h index b4cd97b..a87af94 100644 --- a/buildButton.h +++ b/buildButton.h @@ -6,7 +6,7 @@ namespace battleship{ class BuildButton : public UnitButton{ public: - BuildButton(vb01::Vector2, vb01::Vector2, std::string, int, std::string, int, int); + BuildButton(vb01::Vector3, vb01::Vector2, std::string, int, std::string, int, int); void onClick(); private: int slotId; diff --git a/concreteGuiManager.cpp b/concreteGuiManager.cpp index d3ab17d..262c459 100644 --- a/concreteGuiManager.cpp +++ b/concreteGuiManager.cpp @@ -54,12 +54,13 @@ namespace battleship{ } //TODO refactor player difficulty and faction listbox selection + //TODO remove hardcoded font path values Button* ConcreteGuiManager::parseButton(int guiId){ sol::state_view SOL_LUA_STATE = generateView(); sol::table guiTable = SOL_LUA_STATE["gui"][guiId + 1]; sol::table posTable = guiTable["pos"]; - Vector2 pos = Vector2(posTable["x"], posTable["y"]); + Vector3 pos = Vector3(posTable["x"], posTable["y"], posTable["z"]); sol::table sizeTable = guiTable["size"]; Vector2 size = Vector2(sizeTable["x"], sizeTable["y"]); @@ -261,7 +262,7 @@ namespace battleship{ sol::table guiTable = SOL_LUA_STATE["gui"][guiId + 1]; string posTable = "pos"; - Vector2 pos = Vector2(guiTable[posTable]["x"], guiTable[posTable]["y"]); + Vector3 pos = Vector3(guiTable[posTable]["x"], guiTable[posTable]["y"], guiTable[posTable]["z"]); string sizeTable = "size"; Vector2 size = Vector2(guiTable[sizeTable]["x"], guiTable[sizeTable]["y"]); @@ -392,7 +393,7 @@ namespace battleship{ sol::table guiTable = SOL_LUA_STATE["gui"][guiId + 1]; string posTable = "pos"; - Vector2 pos = Vector2(guiTable[posTable]["x"], guiTable[posTable]["y"]); + Vector3 pos = Vector3(guiTable[posTable]["x"], guiTable[posTable]["y"], guiTable[posTable]["z"]); Checkbox *checkbox = new Checkbox(pos, fontBasePath + "batang.ttf"); int typeArr[2]{(int)GuiElementType::CHECKBOX, -1}; @@ -406,7 +407,7 @@ namespace battleship{ sol::table guiTable = SOL_LUA_STATE["gui"][guiId + 1]; string posTable = "pos", sizeTable = "size"; - Vector2 pos = Vector2(guiTable[posTable]["x"], guiTable[posTable]["y"]); + Vector3 pos = Vector3(guiTable[posTable]["x"], guiTable[posTable]["y"], guiTable[posTable]["z"]); Vector2 size = Vector2(guiTable[sizeTable]["x"], guiTable[sizeTable]["y"]); Slider *slider = new Slider(pos, size, guiTable["minValue"], guiTable["maxValue"]); @@ -422,7 +423,7 @@ namespace battleship{ sol::table guiTable = SOL_LUA_STATE["gui"][guiId + 1]; string posTable = "pos", sizeTable = "size"; - Vector2 pos = Vector2(guiTable[posTable]["x"], guiTable[posTable]["y"]); + Vector3 pos = Vector3(guiTable[posTable]["x"], guiTable[posTable]["y"], guiTable[posTable]["z"]); Vector2 size = Vector2(guiTable[sizeTable]["x"], guiTable[sizeTable]["y"]); Textbox *textbox = new Textbox(pos, size, fontBasePath + "batang.ttf"); @@ -438,6 +439,7 @@ namespace battleship{ Root *root = Root::getSingleton(); Material *mat = new Material(root->getLibPath() + "gui"); + mat->setTransparent(true); string ipk = "imagePath"; sol::optional pathOpt = guiTable[ipk]; @@ -461,7 +463,7 @@ namespace battleship{ quad->setMaterial(mat); sol::table posTable = guiTable["pos"]; - Node *guiRectangle = new Node(Vector3(posTable["x"], posTable["y"], guiTable["zIndex"])); + Node *guiRectangle = new Node(Vector3(posTable["x"], posTable["y"], posTable["z"])); guiRectangle->attachMesh(quad); root->getGuiNode()->attachChild(guiRectangle); @@ -475,6 +477,7 @@ namespace battleship{ sol::state_view SOL_LUA_STATE = generateView(); sol::table guiTable = SOL_LUA_STATE["gui"][guiId + 1]; sol::table posTable = guiTable["pos"]; + sol::table scaleTable = guiTable["scale"]; Root *root = Root::getSingleton(); @@ -484,11 +487,11 @@ namespace battleship{ mat->addVec4Uniform("diffuseColor", Vector4(colorTable["x"], colorTable["y"], colorTable["z"], colorTable["w"])); Text *text = new Text(fontBasePath + (string)guiTable["font"], (wstring)guiTable["text"], guiTable["fontFirstChar"], guiTable["fontLastChar"]); - text->setScale((float)guiTable["scale"]); text->setMaterial(mat); - Vector3 pos = Vector3(posTable["x"], posTable["y"], guiTable["zIndex"]); - Node *node = new Node(pos, Quaternion::QUAT_W, Vector3::VEC_IJK, guiTable["name"]); + Vector3 pos = Vector3(posTable["x"], posTable["y"], posTable["z"]); + Vector3 scale = Vector3(scaleTable["x"], scaleTable["y"], 1); + Node *node = new Node(pos, Quaternion::QUAT_W, scale, guiTable["name"]); node->addText(text); root->getGuiNode()->attachChild(node); diff --git a/defaultsButton.cpp b/defaultsButton.cpp index 78d4cdc..8658e2c 100644 --- a/defaultsButton.cpp +++ b/defaultsButton.cpp @@ -6,7 +6,7 @@ namespace battleship{ using namespace vb01; using namespace vb01Gui; - DefaultsButton::DefaultsButton(Vector2 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {} + DefaultsButton::DefaultsButton(Vector3 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {} void DefaultsButton::onClick() {} } diff --git a/defaultsButton.h b/defaultsButton.h index ede19dd..f7ac6dd 100644 --- a/defaultsButton.h +++ b/defaultsButton.h @@ -6,7 +6,7 @@ namespace battleship{ class DefaultsButton : public vb01Gui::Button{ public: - DefaultsButton(vb01::Vector2, vb01::Vector2, std::string); + DefaultsButton(vb01::Vector3, vb01::Vector2, std::string); void onClick(); private: }; diff --git a/exitButton.cpp b/exitButton.cpp index f180df2..884f3fa 100755 --- a/exitButton.cpp +++ b/exitButton.cpp @@ -7,7 +7,7 @@ using namespace std; using namespace vb01; namespace battleship{ - ExitButton::ExitButton(Vector2 pos, Vector2 size) : Button(pos, size, "Exit", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {} + ExitButton::ExitButton(Vector3 pos, Vector2 size) : Button(pos, size, "Exit", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {} void ExitButton::onClick() { //Root::getSingleton()->set diff --git a/exitButton.h b/exitButton.h index cdfaf0b..d43e9e3 100755 --- a/exitButton.h +++ b/exitButton.h @@ -8,7 +8,7 @@ namespace battleship { class ExitButton : public vb01Gui::Button { public: - ExitButton(vb01::Vector2, vb01::Vector2); + ExitButton(vb01::Vector3, vb01::Vector2); void onClick(); }; } diff --git a/exportButton.cpp b/exportButton.cpp index e8c4640..f38eea6 100644 --- a/exportButton.cpp +++ b/exportButton.cpp @@ -10,7 +10,7 @@ namespace battleship{ using namespace vb01Gui; using namespace gameBase; - ExportButton::ExportButton(Vector2 pos, Vector2 size) : Button(pos, size, "Export", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){} + ExportButton::ExportButton(Vector3 pos, Vector2 size) : Button(pos, size, "Export", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){} void ExportButton::onClick(){ StateManager *sm = GameManager::getSingleton()->getStateManager(); diff --git a/exportButton.h b/exportButton.h index 698f9d0..6066051 100644 --- a/exportButton.h +++ b/exportButton.h @@ -6,7 +6,7 @@ namespace battleship{ class ExportButton : public vb01Gui::Button{ public: - ExportButton(vb01::Vector2 pos, vb01::Vector2 size); + ExportButton(vb01::Vector3 pos, vb01::Vector2 size); void onClick(); }; } diff --git a/gameObjectListbox.cpp b/gameObjectListbox.cpp index 7c9fca8..bb65af0 100644 --- a/gameObjectListbox.cpp +++ b/gameObjectListbox.cpp @@ -10,7 +10,7 @@ namespace battleship{ using namespace vb01Gui; using namespace gameBase; - GameObjectListbox::GameObjectListbox(bool ul, Vector2 pos, Vector2 size, vector lines, int maxDisplay, string fontPath) : Listbox(pos, size, lines, maxDisplay, fontPath), unitListbox(ul) {} + GameObjectListbox::GameObjectListbox(bool ul, Vector3 pos, Vector2 size, vector lines, int maxDisplay, string fontPath) : Listbox(pos, size, lines, maxDisplay, fontPath), unitListbox(ul) {} void GameObjectListbox::onClose(){ GameObjectFrameController *ufCtr = GameObjectFrameController::getSingleton(); diff --git a/gameObjectListbox.h b/gameObjectListbox.h index 0d7967f..de919f9 100644 --- a/gameObjectListbox.h +++ b/gameObjectListbox.h @@ -6,7 +6,7 @@ namespace battleship{ class GameObjectListbox : public vb01Gui::Listbox{ public: - GameObjectListbox(bool, vb01::Vector2, vb01::Vector2, std::vector, int, std::string); + GameObjectListbox(bool, vb01::Vector3, vb01::Vector2, std::vector, int, std::string); void onClose(); private: bool unitListbox; diff --git a/inGameAppState.cpp b/inGameAppState.cpp index 82b51c8..dbd16da 100755 --- a/inGameAppState.cpp +++ b/inGameAppState.cpp @@ -24,19 +24,19 @@ using namespace std; namespace battleship{ using namespace configData; - InGameAppState::ResumeButton::ResumeButton(Vector2 pos, Vector2 size) : Button(pos, size, "Resume", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {} + InGameAppState::ResumeButton::ResumeButton(Vector3 pos, Vector2 size) : Button(pos, size, "Resume", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {} void InGameAppState::ResumeButton::onClick() { Game::getSingleton()->togglePause(); } - InGameAppState::ConsoleButton::ConsoleButton(Vector2 pos, Vector2 size) : Button(pos, size, "Console", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) { } + InGameAppState::ConsoleButton::ConsoleButton(Vector3 pos, Vector2 size) : Button(pos, size, "Console", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) { } void InGameAppState::ConsoleButton::onClick() { ConcreteGuiManager::getSingleton()->readLuaScreenScript("console.lua"); } - InGameAppState::ConsoleButton::ConsoleButton::ConsoleCommandEntryButton::ConsoleCommandEntryButton(Textbox *t, Listbox *l, Vector2 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", 257, true) { + InGameAppState::ConsoleButton::ConsoleButton::ConsoleCommandEntryButton::ConsoleCommandEntryButton(Textbox *t, Listbox *l, Vector3 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", 257, true) { textbox = t; listbox = l; } diff --git a/inGameAppState.h b/inGameAppState.h index 46d11aa..0bb77e4 100755 --- a/inGameAppState.h +++ b/inGameAppState.h @@ -18,7 +18,7 @@ namespace battleship{ public: class ResumeButton : public vb01Gui::Button { public: - ResumeButton(vb01::Vector2, vb01::Vector2); + ResumeButton(vb01::Vector3, vb01::Vector2); void onClick(); private: }; @@ -27,14 +27,14 @@ namespace battleship{ public: class ConsoleCommandEntryButton : public Button { public: - ConsoleCommandEntryButton(vb01Gui::Textbox*, vb01Gui::Listbox*, vb01::Vector2, vb01::Vector2, std::string); + ConsoleCommandEntryButton(vb01Gui::Textbox*, vb01Gui::Listbox*, vb01::Vector3, vb01::Vector2, std::string); void onClick(); private: vb01Gui::Textbox *textbox; vb01Gui::Listbox *listbox; }; - ConsoleButton(vb01::Vector2, vb01::Vector2); + ConsoleButton(vb01::Vector3, vb01::Vector2); void onClick(); private: }; diff --git a/landTextureListbox.cpp b/landTextureListbox.cpp index 64a1dba..13891eb 100644 --- a/landTextureListbox.cpp +++ b/landTextureListbox.cpp @@ -15,7 +15,7 @@ namespace battleship{ using namespace vb01Gui; using namespace gameBase; - LandTextureListbox::LandTextureListbox(Vector2 pos, Vector2 size, vector lines, int maxDisplay, std::string fontPath) : Listbox(pos, size, lines, maxDisplay, fontPath){} + LandTextureListbox::LandTextureListbox(Vector3 pos, Vector2 size, vector lines, int maxDisplay, std::string fontPath) : Listbox(pos, size, lines, maxDisplay, fontPath){} void LandTextureListbox::onClose(){ StateManager *sm = GameManager::getSingleton()->getStateManager(); diff --git a/landTextureListbox.h b/landTextureListbox.h index ac5ce5b..867824b 100644 --- a/landTextureListbox.h +++ b/landTextureListbox.h @@ -6,7 +6,7 @@ namespace battleship{ class LandTextureListbox : public vb01Gui::Listbox{ public: - LandTextureListbox(vb01::Vector2, vb01::Vector2, std::vector, int, std::string); + LandTextureListbox(vb01::Vector3, vb01::Vector2, std::vector, int, std::string); void onClose(); private: }; diff --git a/loadMapButton.cpp b/loadMapButton.cpp index 3456f44..0a0ef9c 100644 --- a/loadMapButton.cpp +++ b/loadMapButton.cpp @@ -11,7 +11,7 @@ namespace battleship{ using namespace vb01Gui; using namespace gameBase; - LoadMapButton::OkButton::OkButton(vb01::Vector2 pos, vb01::Vector2 size, vb01Gui::Listbox *listbox) : Button(pos, size, "Ok", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){ this->listbox = listbox; } + LoadMapButton::OkButton::OkButton(vb01::Vector3 pos, vb01::Vector2 size, vb01Gui::Listbox *listbox) : Button(pos, size, "Ok", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){ this->listbox = listbox; } void LoadMapButton::OkButton::onClick(){ StateManager *sm = GameManager::getSingleton()->getStateManager(); @@ -20,7 +20,7 @@ namespace battleship{ ConcreteGuiManager::getSingleton()->readLuaScreenScript("mapEditor.lua"); } - LoadMapButton::LoadMapButton(Vector2 pos, Vector2 size) : Button(pos, size, "Load map", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){} + LoadMapButton::LoadMapButton(Vector3 pos, Vector2 size) : Button(pos, size, "Load map", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){} void LoadMapButton::onClick(){ ConcreteGuiManager::getSingleton()->readLuaScreenScript("loadMap.lua"); diff --git a/loadMapButton.h b/loadMapButton.h index afe733f..997fea3 100644 --- a/loadMapButton.h +++ b/loadMapButton.h @@ -12,13 +12,13 @@ namespace battleship{ public: class OkButton : public vb01Gui::Button{ public: - OkButton(vb01::Vector2, vb01::Vector2, vb01Gui::Listbox*); + OkButton(vb01::Vector3, vb01::Vector2, vb01Gui::Listbox*); void onClick(); private: vb01Gui::Listbox *listbox; }; - LoadMapButton(vb01::Vector2, vb01::Vector2); + LoadMapButton(vb01::Vector3, vb01::Vector2); void onClick(); private: }; diff --git a/mainMenuButton.cpp b/mainMenuButton.cpp index 1888907..f7516c9 100644 --- a/mainMenuButton.cpp +++ b/mainMenuButton.cpp @@ -7,7 +7,7 @@ namespace battleship{ using namespace vb01; using namespace vb01Gui; - MainMenuButton::MainMenuButton(Vector2 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true){} + MainMenuButton::MainMenuButton(Vector3 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true){} void MainMenuButton::onClick(){ } diff --git a/mainMenuButton.h b/mainMenuButton.h index 17f8d66..dff8db3 100644 --- a/mainMenuButton.h +++ b/mainMenuButton.h @@ -6,7 +6,7 @@ namespace battleship{ class MainMenuButton : public vb01Gui::Button{ public: - MainMenuButton(vb01::Vector2, vb01::Vector2, std::string); + MainMenuButton(vb01::Vector3, vb01::Vector2, std::string); void onClick(); private: }; diff --git a/mapEditorButton.h b/mapEditorButton.h index 5f34227..5c3be9d 100644 --- a/mapEditorButton.h +++ b/mapEditorButton.h @@ -8,7 +8,7 @@ namespace battleship{ class MapEditorButton : public vb01Gui::Button{ public: - MapEditorButton(vb01::Vector2 pos, vb01::Vector2 size) : vb01Gui::Button(pos, size, "Map editor", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){} + MapEditorButton(vb01::Vector3 pos, vb01::Vector2 size) : vb01Gui::Button(pos, size, "Map editor", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){} void onClick(); private: }; diff --git a/newMapButton.cpp b/newMapButton.cpp index 602a21e..ecc621a 100644 --- a/newMapButton.cpp +++ b/newMapButton.cpp @@ -14,7 +14,7 @@ namespace battleship{ using namespace vb01Gui; using namespace gameBase; - NewMapButton::OkButton::OkButton(vb01::Vector2 pos, vb01::Vector2 size, vb01Gui::Textbox *name, vb01Gui::Textbox *sx, vb01Gui::Textbox *sy) : Button(pos, size, "Ok", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true){ + NewMapButton::OkButton::OkButton(vb01::Vector3 pos, vb01::Vector2 size, vb01Gui::Textbox *name, vb01Gui::Textbox *sx, vb01Gui::Textbox *sy) : Button(pos, size, "Ok", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true){ this->name = name; this->sizeX = sx; this->sizeY = sy; @@ -31,7 +31,7 @@ namespace battleship{ ConcreteGuiManager::getSingleton()->readLuaScreenScript("mapEditor.lua"); } - NewMapButton::NewMapButton(Vector2 pos, Vector2 size) : Button(pos, size, "New map", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){} + NewMapButton::NewMapButton(Vector3 pos, Vector2 size) : Button(pos, size, "New map", GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"){} void NewMapButton::onClick(){ ConcreteGuiManager::getSingleton()->readLuaScreenScript("newMap.lua"); diff --git a/newMapButton.h b/newMapButton.h index 371e394..fd48fb0 100644 --- a/newMapButton.h +++ b/newMapButton.h @@ -12,13 +12,13 @@ namespace battleship{ public: class OkButton : public vb01Gui::Button{ public: - OkButton(vb01::Vector2, vb01::Vector2, vb01Gui::Textbox*, vb01Gui::Textbox*, vb01Gui::Textbox*); + OkButton(vb01::Vector3, vb01::Vector2, vb01Gui::Textbox*, vb01Gui::Textbox*, vb01Gui::Textbox*); void onClick(); private: vb01Gui::Textbox *name, *sizeX, *sizeY; }; - NewMapButton(vb01::Vector2, vb01::Vector2); + NewMapButton(vb01::Vector3, vb01::Vector2); void onClick(); private: }; diff --git a/offerButton.cpp b/offerButton.cpp index 8bfb5ae..c12a9b3 100644 --- a/offerButton.cpp +++ b/offerButton.cpp @@ -14,7 +14,7 @@ namespace battleship{ using namespace vb01Gui; using namespace gameBase; - OfferButton::OfferButton(Vector2 pos, Vector2 size, int plId, string name, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath), playerId(plId){} + OfferButton::OfferButton(Vector3 pos, Vector2 size, int plId, string name, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath), playerId(plId){} void OfferButton::onClick(){ ConcreteGuiManager *guiManager = ConcreteGuiManager::getSingleton(); diff --git a/offerButton.h b/offerButton.h index 451af2a..6de5592 100644 --- a/offerButton.h +++ b/offerButton.h @@ -6,7 +6,7 @@ namespace battleship{ class OfferButton : public vb01Gui::Button{ public: - OfferButton(vb01::Vector2, vb01::Vector2, int, std::string, int, std::string); + OfferButton(vb01::Vector3, vb01::Vector2, int, std::string, int, std::string); void onClick(); inline void setPlayerId(int plId){playerId = plId;} private: diff --git a/okButton.cpp b/okButton.cpp index 16b382b..91aa580 100644 --- a/okButton.cpp +++ b/okButton.cpp @@ -6,7 +6,7 @@ namespace battleship{ using namespace vb01; using namespace vb01Gui; - OkButton::OkButton(Vector2 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {} + OkButton::OkButton(Vector3 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) {} void OkButton::onClick() {} } diff --git a/okButton.h b/okButton.h index 07a0007..9aedbd7 100644 --- a/okButton.h +++ b/okButton.h @@ -6,7 +6,7 @@ namespace battleship{ class OkButton : public vb01Gui::Button{ public: - OkButton(vb01::Vector2, vb01::Vector2, std::string); + OkButton(vb01::Vector3, vb01::Vector2, std::string); void onClick(); private: }; diff --git a/optionsButton.cpp b/optionsButton.cpp index 50a2264..d7297c7 100755 --- a/optionsButton.cpp +++ b/optionsButton.cpp @@ -7,7 +7,7 @@ using namespace vb01; using namespace std; namespace battleship{ - OptionsButton::OptionsButton(Vector2 pos, Vector2 size, string name, bool separate) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, separate) {} + OptionsButton::OptionsButton(Vector3 pos, Vector2 size, string name, bool separate) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, separate) {} void OptionsButton::onClick() { ConcreteGuiManager::getSingleton()->readLuaScreenScript("options.lua"); diff --git a/optionsButton.h b/optionsButton.h index 7a68c5f..98a5681 100755 --- a/optionsButton.h +++ b/optionsButton.h @@ -7,7 +7,7 @@ namespace battleship { class OptionsButton : public vb01Gui::Button { public: - OptionsButton(vb01::Vector2, vb01::Vector2, std::string, bool); + OptionsButton(vb01::Vector3, vb01::Vector2, std::string, bool); virtual void onClick(); }; } diff --git a/playButton.cpp b/playButton.cpp index 1d4b369..4bdeeed 100644 --- a/playButton.cpp +++ b/playButton.cpp @@ -14,7 +14,7 @@ namespace battleship{ using namespace vb01Gui; using namespace gameBase; - PlayButton::PlayButton(vector difficulties, vector factions, Listbox *mapListbox, Vector2 pos, Vector2 size, string name, bool separate) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", GLFW_KEY_P, separate) { + PlayButton::PlayButton(vector difficulties, vector factions, Listbox *mapListbox, Vector3 pos, Vector2 size, string name, bool separate) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", GLFW_KEY_P, separate) { difficultiesListboxes = difficulties; factionsListboxes = factions; this->mapListbox = mapListbox; diff --git a/playButton.h b/playButton.h index f2da5ae..2c2565a 100644 --- a/playButton.h +++ b/playButton.h @@ -10,7 +10,7 @@ namespace vb01Gui{ namespace battleship{ class PlayButton : public vb01Gui::Button { public: - PlayButton(std::vector, std::vector, vb01Gui::Listbox*, vb01::Vector2, vb01::Vector2, std::string, bool); + PlayButton(std::vector, std::vector, vb01Gui::Listbox*, vb01::Vector3, vb01::Vector2, std::string, bool); void onClick(); private: std::vector difficultiesListboxes, factionsListboxes; diff --git a/playerTradeButton.cpp b/playerTradeButton.cpp index a4ca830..1caf49d 100644 --- a/playerTradeButton.cpp +++ b/playerTradeButton.cpp @@ -12,7 +12,7 @@ namespace battleship{ using namespace vb01Gui; using namespace gameBase; - PlayerTradeButton::PlayerTradeButton(Vector2 pos, Vector2 size, string gs, string name, int trigger, string imagePath) : ActiveStateButton(pos, size, gs, name, trigger, imagePath){} + PlayerTradeButton::PlayerTradeButton(Vector3 pos, Vector2 size, string gs, string name, int trigger, string imagePath) : ActiveStateButton(pos, size, gs, name, trigger, imagePath){} void PlayerTradeButton::onClick(){ ActiveStateButton::onClick(); diff --git a/playerTradeButton.h b/playerTradeButton.h index 35e5b5c..3528056 100644 --- a/playerTradeButton.h +++ b/playerTradeButton.h @@ -6,7 +6,7 @@ namespace battleship{ class PlayerTradeButton : public ActiveStateButton{ public: - PlayerTradeButton(vb01::Vector2, vb01::Vector2, std::string, std::string, int, std::string); + PlayerTradeButton(vb01::Vector3, vb01::Vector2, std::string, std::string, int, std::string); void onClick(); private: }; diff --git a/researchButton.cpp b/researchButton.cpp index 44b749d..4dffae2 100644 --- a/researchButton.cpp +++ b/researchButton.cpp @@ -19,7 +19,7 @@ namespace battleship{ using namespace vb01; using namespace std; - ResearchButton::ResearchButton(Vector2 pos, Vector2 size, string name, int trigger, string imagePath, int uid, int tid) : + ResearchButton::ResearchButton(Vector3 pos, Vector2 size, string name, int trigger, string imagePath, int uid, int tid) : UnitButton(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, imagePath, uid), techId(tid){ Root *root = Root::getSingleton(); Material *mat = new Material(root->getLibPath() + "gui"); diff --git a/researchButton.h b/researchButton.h index 20b1bc2..639f8e9 100644 --- a/researchButton.h +++ b/researchButton.h @@ -6,7 +6,7 @@ namespace battleship{ class ResearchButton : public UnitButton{ public: - ResearchButton(vb01::Vector2, vb01::Vector2, std::string, int, std::string, int, int); + ResearchButton(vb01::Vector3, vb01::Vector2, std::string, int, std::string, int, int); ~ResearchButton(); void onClick(); void update(); diff --git a/resourceAmmountButton.cpp b/resourceAmmountButton.cpp index e9721ee..2d1448f 100644 --- a/resourceAmmountButton.cpp +++ b/resourceAmmountButton.cpp @@ -9,7 +9,7 @@ namespace battleship{ using namespace vb01; using namespace vb01Gui; - ResourceAmmountButton::ResourceAmmountButton(Vector2 pos, Vector2 size, string name, int amm, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath), ammount(amm) { + ResourceAmmountButton::ResourceAmmountButton(Vector3 pos, Vector2 size, string name, int amm, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath), ammount(amm) { ConcreteGuiManager *guiManager = ConcreteGuiManager::getSingleton(); int numTextboxes = guiManager->getTextboxes().size(); textbox = guiManager->getTextboxes()[numTextboxes - 1]; diff --git a/resourceAmmountButton.h b/resourceAmmountButton.h index 8296170..390dedd 100644 --- a/resourceAmmountButton.h +++ b/resourceAmmountButton.h @@ -10,7 +10,7 @@ namespace vb01Gui{ namespace battleship{ class ResourceAmmountButton : public vb01Gui::Button{ public: - ResourceAmmountButton(vb01::Vector2, vb01::Vector2, std::string, int, int, std::string); + ResourceAmmountButton(vb01::Vector3, vb01::Vector2, std::string, int, int, std::string); void onClick(); private: vb01Gui::Textbox *textbox = nullptr; diff --git a/singlePlayerButton.cpp b/singlePlayerButton.cpp index 1d36885..f0ff156 100644 --- a/singlePlayerButton.cpp +++ b/singlePlayerButton.cpp @@ -9,7 +9,7 @@ namespace battleship{ using namespace vb01; using namespace vb01Gui; - SinglePlayerButton::SinglePlayerButton(Vector2 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", GLFW_KEY_S, true) {} + SinglePlayerButton::SinglePlayerButton(Vector3 pos, Vector2 size, string name) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", GLFW_KEY_S, true) {} void SinglePlayerButton::onMouseOver(){ setColor(Vector4(.8, .8, .8, 1)); diff --git a/singlePlayerButton.h b/singlePlayerButton.h index 8ac0398..09e0224 100644 --- a/singlePlayerButton.h +++ b/singlePlayerButton.h @@ -8,7 +8,7 @@ namespace battleship{ class SinglePlayerButton : public vb01Gui::Button { public: - SinglePlayerButton(vb01::Vector2, vb01::Vector2, std::string); + SinglePlayerButton(vb01::Vector3, vb01::Vector2, std::string); void onClick(); void onMouseOver(); void onMouseOff(); diff --git a/skyboxTextureListbox.cpp b/skyboxTextureListbox.cpp index ccc5d0a..4d729dd 100644 --- a/skyboxTextureListbox.cpp +++ b/skyboxTextureListbox.cpp @@ -15,7 +15,7 @@ namespace battleship{ using namespace vb01Gui; using namespace gameBase; - SkyboxTextureListbox::SkyboxTextureListbox(Vector2 pos, Vector2 size, vector lines, int maxDisplay, string fontPath) : Listbox(pos, size, lines, maxDisplay, fontPath){} + SkyboxTextureListbox::SkyboxTextureListbox(Vector3 pos, Vector2 size, vector lines, int maxDisplay, string fontPath) : Listbox(pos, size, lines, maxDisplay, fontPath){} void SkyboxTextureListbox::onClose(){ Root *root = Root::getSingleton(); diff --git a/skyboxTextureListbox.h b/skyboxTextureListbox.h index 4e594a1..8465753 100644 --- a/skyboxTextureListbox.h +++ b/skyboxTextureListbox.h @@ -6,7 +6,7 @@ namespace battleship{ class SkyboxTextureListbox : public vb01Gui::Listbox{ public: - SkyboxTextureListbox(vb01::Vector2, vb01::Vector2, std::vector, int, std::string); + SkyboxTextureListbox(vb01::Vector3, vb01::Vector2, std::vector, int, std::string); void onClose(); private: }; diff --git a/statsButton.cpp b/statsButton.cpp index 912ec45..7e034d2 100644 --- a/statsButton.cpp +++ b/statsButton.cpp @@ -12,7 +12,7 @@ namespace battleship{ using namespace vb01; using namespace gameBase; - StatsButton::StatsButton(Vector2 pos, Vector2 size, string name, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath){} + StatsButton::StatsButton(Vector3 pos, Vector2 size, string name, int trigger, string imagePath) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, true, imagePath){} void StatsButton::addPlayerDataGuiElements(int playerId){ const int numPairs = 7; diff --git a/statsButton.h b/statsButton.h index f6cf165..57e73cf 100644 --- a/statsButton.h +++ b/statsButton.h @@ -6,7 +6,7 @@ namespace battleship { class StatsButton : public vb01Gui::Button{ public: - StatsButton(vb01::Vector2, vb01::Vector2, std::string, int, std::string); + StatsButton(vb01::Vector3, vb01::Vector2, std::string, int, std::string); void onClick(); private: void addPlayerDataGuiElements(int); diff --git a/tabButton.cpp b/tabButton.cpp index 23bf546..64cf1cd 100644 --- a/tabButton.cpp +++ b/tabButton.cpp @@ -7,7 +7,7 @@ namespace battleship{ using namespace vb01; using namespace vb01Gui; - TabButton::TabButton(Vector2 pos, Vector2 size, string name, string screenScript) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) { + TabButton::TabButton(Vector3 pos, Vector2 size, string name, string screenScript) : Button(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", -1, true) { this->screenScript = screenScript; } diff --git a/tabButton.h b/tabButton.h index 5c084af..5d91331 100644 --- a/tabButton.h +++ b/tabButton.h @@ -6,7 +6,7 @@ namespace battleship{ class TabButton : public vb01Gui::Button{ public: - TabButton(vb01::Vector2, vb01::Vector2, std::string, std::string); + TabButton(vb01::Vector3, vb01::Vector2, std::string, std::string); void onClick(); private: std::string screenScript; diff --git a/tradeButton.cpp b/tradeButton.cpp index 9a25a9b..4ea639f 100644 --- a/tradeButton.cpp +++ b/tradeButton.cpp @@ -9,7 +9,7 @@ namespace battleship{ using namespace vb01; using namespace gameBase; - TradeButton::TradeButton(Vector2 pos, Vector2 size, string name, int trigger, string imagePath, int uid, Type t) : UnitButton(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, imagePath, uid), type(t){} + TradeButton::TradeButton(Vector3 pos, Vector2 size, string name, int trigger, string imagePath, int uid, Type t) : UnitButton(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, imagePath, uid), type(t){} void TradeButton::onClick(){ ActiveGameState *activeState = (ActiveGameState*)(GameManager::getSingleton()->getStateManager()->getAppStateByType((int)AppStateType::ACTIVE_STATE)); diff --git a/tradeButton.h b/tradeButton.h index f59e59b..a1fbe4e 100644 --- a/tradeButton.h +++ b/tradeButton.h @@ -8,7 +8,7 @@ namespace battleship{ public: enum class Type{BUY_REFINEDS, SELL_REFINEDS, BUY_RESEARCH, SELL_RESEARCH}; - TradeButton(vb01::Vector2, vb01::Vector2, std::string, int, std::string, int, Type); + TradeButton(vb01::Vector3, vb01::Vector2, std::string, int, std::string, int, Type); void onClick(); private: Type type; diff --git a/tradingScreenButton.cpp b/tradingScreenButton.cpp index 78c7c41..b8b9028 100644 --- a/tradingScreenButton.cpp +++ b/tradingScreenButton.cpp @@ -8,7 +8,7 @@ namespace battleship{ using namespace vb01; using namespace vb01Gui; - TradingScreenButton::TradingScreenButton(Vector2 pos, Vector2 size, int plId, string gs, string name, int trigger, string imagePath) : ActiveStateButton(pos, size, gs, name, trigger, imagePath), playerId(plId){} + TradingScreenButton::TradingScreenButton(Vector3 pos, Vector2 size, int plId, string gs, string name, int trigger, string imagePath) : ActiveStateButton(pos, size, gs, name, trigger, imagePath), playerId(plId){} //TODO add method to get buttons by name void TradingScreenButton::onClick(){ diff --git a/tradingScreenButton.h b/tradingScreenButton.h index f8d1549..07763e0 100644 --- a/tradingScreenButton.h +++ b/tradingScreenButton.h @@ -6,7 +6,7 @@ namespace battleship{ class TradingScreenButton : public ActiveStateButton{ public: - TradingScreenButton(vb01::Vector2, vb01::Vector2, int, std::string, std::string, int, std::string); + TradingScreenButton(vb01::Vector3, vb01::Vector2, int, std::string, std::string, int, std::string); void onClick(); private: int playerId; diff --git a/trainButton.cpp b/trainButton.cpp index b2fb4e6..a7ede04 100644 --- a/trainButton.cpp +++ b/trainButton.cpp @@ -11,7 +11,7 @@ namespace battleship{ using namespace vb01; using namespace gameBase; - TrainButton::TrainButton(Vector2 pos, Vector2 size, string name, int trigger, string imagePath, int uid, int slId) : + TrainButton::TrainButton(Vector3 pos, Vector2 size, string name, int trigger, string imagePath, int uid, int slId) : UnitButton(pos, size, name, GameManager::getSingleton()->getPath() + "Fonts/batang.ttf", trigger, imagePath, uid), slotId(slId) {} diff --git a/trainButton.h b/trainButton.h index 149c906..3d71268 100644 --- a/trainButton.h +++ b/trainButton.h @@ -6,7 +6,7 @@ namespace battleship{ class TrainButton : public UnitButton{ public: - TrainButton(vb01::Vector2, vb01::Vector2, std::string, int, std::string, int, int); + TrainButton(vb01::Vector3, vb01::Vector2, std::string, int, std::string, int, int); void onClick(); private: int slotId; diff --git a/unitButton.cpp b/unitButton.cpp index fddecb7..620398c 100644 --- a/unitButton.cpp +++ b/unitButton.cpp @@ -10,7 +10,7 @@ namespace battleship{ using namespace vb01Gui; using namespace gameBase; - UnitButton::UnitButton(Vector2 pos, Vector2 size, string name, string fontPath, int trigger, string imagePath, int uid) : Button(pos, size, name, fontPath, trigger, true, imagePath), unitId(uid){ + UnitButton::UnitButton(Vector3 pos, Vector2 size, string name, string fontPath, int trigger, string imagePath, int uid) : Button(pos, size, name, fontPath, trigger, true, imagePath), unitId(uid){ StateManager *stateManager = GameManager::getSingleton()->getStateManager(); ActiveGameState *activeState = (ActiveGameState*)stateManager->getAppStateByType((int)AppStateType::ACTIVE_STATE); diff --git a/unitButton.h b/unitButton.h index 94fa57f..89a1b69 100644 --- a/unitButton.h +++ b/unitButton.h @@ -8,7 +8,7 @@ namespace battleship{ class UnitButton : public vb01Gui::Button{ public: - UnitButton(vb01::Vector2, vb01::Vector2, std::string, std::string, int, std::string, int); + UnitButton(vb01::Vector3, vb01::Vector2, std::string, std::string, int, std::string, int); protected: int unitId;