diff --git a/Assets/Scripts/Gui/activeGameState.lua b/Assets/Scripts/Gui/activeGameState.lua index c6c5aa0..0cf49c2 100644 --- a/Assets/Scripts/Gui/activeGameState.lua +++ b/Assets/Scripts/Gui/activeGameState.lua @@ -2,6 +2,7 @@ res = graphics.resolution Size = {x = 70, y = 70} sz = 210 s = 90 +resIconBasePath = 'Icons/Resources/' gui = { { @@ -45,21 +46,21 @@ gui = { pos = {x = 0, y = 0}, zIndex = .9, size = {x = s, y = s}, - imagePath = 'Icons/refineds.png', + imagePath = resIconBasePath .. 'refineds.png', }, { guiType = GuiType.GUI_RECTANGLE, pos = {x = 0, y = 100}, zIndex = .9, size = {x = s, y = s}, - imagePath = 'Icons/wealth.png', + imagePath = resIconBasePath .. 'wealth.png', }, { guiType = GuiType.GUI_RECTANGLE, pos = {x = 0, y = 200}, zIndex = .9, size = {x = s, y = s}, - imagePath = 'Icons/research.png', + imagePath = resIconBasePath .. 'research.png', }, { guiType = GuiType.TEXT, @@ -77,7 +78,6 @@ gui = { guiType = GuiType.BUTTON, buttonType = ButtonType.PLAYER_TRADE, name = 'Trade', - imagePath = '', guiScreen = 'tradingHub.lua', pos = {x = res.x - Size.x, y = 200}, size = Size, diff --git a/Assets/Scripts/Gui/engineerCommands.lua b/Assets/Scripts/Gui/engineerCommands.lua index 243e3fb..c40ed26 100644 --- a/Assets/Scripts/Gui/engineerCommands.lua +++ b/Assets/Scripts/Gui/engineerCommands.lua @@ -7,7 +7,6 @@ gui = { { pos = {x = res.x - 3 * Size.x, y = res.y - 3 * Size.y}, size = sz, - imagePath = '', guiType = GuiType.BUTTON, buttonType = ButtonType.BUILD, trigger = 76, @@ -15,7 +14,6 @@ gui = { { pos = {x = res.x - 2 * Size.x, y = res.y - 3 * Size.y}, size = sz, - imagePath = '', guiType = GuiType.BUTTON, buttonType = ButtonType.BUILD, trigger = 78, @@ -23,7 +21,6 @@ gui = { { pos = {x = res.x - 1 * Size.x, y = res.y - 3 * Size.y}, size = sz, - imagePath = '', guiType = GuiType.BUTTON, buttonType = ButtonType.BUILD, trigger = 77, @@ -31,7 +28,6 @@ gui = { { pos = {x = res.x - 3 * Size.x, y = res.y - 2 * Size.y}, size = sz, - imagePath = '', guiType = GuiType.BUTTON, buttonType = ButtonType.BUILD, trigger = 84, @@ -39,7 +35,6 @@ gui = { { pos = {x = res.x - 2 * Size.x, y = res.y - 2 * Size.y}, size = sz, - imagePath = '', guiType = GuiType.BUTTON, buttonType = ButtonType.BUILD, trigger = 68, @@ -47,7 +42,6 @@ gui = { { pos = {x = res.x - 1 * Size.x, y = res.y - 2 * Size.y}, size = sz, - imagePath = '', guiType = GuiType.BUTTON, buttonType = ButtonType.BUILD, trigger = 70, diff --git a/Assets/Scripts/Gui/fortCommands.lua b/Assets/Scripts/Gui/fortCommands.lua index 7511344..c126665 100644 --- a/Assets/Scripts/Gui/fortCommands.lua +++ b/Assets/Scripts/Gui/fortCommands.lua @@ -7,7 +7,6 @@ gui = { { pos = {x = res.x - Size.x + .5 * margin, y = res.y - Size.y + .5 * margin}, size = sz, - imagePath = '', guiType = GuiType.BUTTON, buttonType = ButtonType.FORT_TRAIN, trigger = 82 diff --git a/Assets/Scripts/Gui/landFactoryCommands.lua b/Assets/Scripts/Gui/landFactoryCommands.lua index 3b9a662..efb28c2 100644 --- a/Assets/Scripts/Gui/landFactoryCommands.lua +++ b/Assets/Scripts/Gui/landFactoryCommands.lua @@ -7,7 +7,6 @@ gui = { { pos = {x = res.x + .5 * margin - Size.x, y = res.y - 3 * Size.y}, size = sz, - imagePath = '', guiType = GuiType.BUTTON, buttonType = ButtonType.LAND_FACTORY_TRAIN, trigger = 87 @@ -15,7 +14,6 @@ gui = { { pos = {x = res.x + .5 * margin - 2 * Size.x, y = res.y - 3 * Size.y}, size = sz, - imagePath = '', guiType = GuiType.BUTTON, buttonType = ButtonType.LAND_FACTORY_TRAIN, trigger = 84 @@ -23,7 +21,6 @@ gui = { { pos = {x = res.x + .5 * margin - 3 * Size.x, y = res.y - 3 * Size.y}, size = sz, - imagePath = '', guiType = GuiType.BUTTON, buttonType = ButtonType.LAND_FACTORY_TRAIN, trigger = 65 diff --git a/Assets/Scripts/Gui/navalFactoryCommands.lua b/Assets/Scripts/Gui/navalFactoryCommands.lua index 8ad22b0..b429ca0 100644 --- a/Assets/Scripts/Gui/navalFactoryCommands.lua +++ b/Assets/Scripts/Gui/navalFactoryCommands.lua @@ -5,7 +5,6 @@ gui = { { pos = {x = res.x - Size.x, y = res.y - Size.y}, size = Size, - imagePath = '', guiType = GuiType.BUTTON, buttonType = ButtonType.NAVAL_FACTORY_TRAIN, trigger = 66 diff --git a/Assets/Scripts/Gui/researchStructCommands.lua b/Assets/Scripts/Gui/researchStructCommands.lua index 5c6bb90..e377833 100644 --- a/Assets/Scripts/Gui/researchStructCommands.lua +++ b/Assets/Scripts/Gui/researchStructCommands.lua @@ -4,21 +4,22 @@ margin = 10 sz = {x = Size.x - margin, y = Size.y - margin} gui = { + --[[ { pos = {x = res.x - Size.x, y = res.y - Size.y}, size = sz, name = "Research", - imagePath = '', guiType = GuiType.BUTTON, buttonType = ButtonType.RESEARCH, techId = TechId.APT, trigger = 82, }, + ]]-- { guiType = GuiType.BUTTON, buttonType = ButtonType.ACTIVE_GAME_STATE, name = 'Tech', - imagePath = '', + guiScreen = 'techTree.lua', pos = {x = res.x - 2 * Size.x, y = res.y - Size.y}, size = sz, trigger = 85 diff --git a/Assets/Scripts/Gui/tradingHub.lua b/Assets/Scripts/Gui/tradingHub.lua index 63117e6..e891f97 100644 --- a/Assets/Scripts/Gui/tradingHub.lua +++ b/Assets/Scripts/Gui/tradingHub.lua @@ -17,7 +17,15 @@ gui = { guiType = GuiType.BUTTON, buttonType = ButtonType.ACTIVE_GAME_STATE, name = 'Back', - imagePath = '', + guiScreen = 'activeGameState.lua', + pos = {x = Pos.x + Size.x - buttonSize.x - margin.right, y = Pos.y + Size.y - buttonSize.y - margin.bottom}, + size = buttonSize, + trigger = 10 + }, + { + guiType = GuiType.BUTTON, + 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}, size = buttonSize, diff --git a/Assets/Scripts/Gui/tradingPlayerGuiTray.lua b/Assets/Scripts/Gui/tradingPlayerGuiTray.lua index d6d98c1..09553c8 100644 --- a/Assets/Scripts/Gui/tradingPlayerGuiTray.lua +++ b/Assets/Scripts/Gui/tradingPlayerGuiTray.lua @@ -6,8 +6,8 @@ textboxSize = {x = 200, y = 25} margin = {top = 10, left = 10, right = 10, bottom = 10} height = Pos.y + margin.top + lineId * 30 -warIcon = 'Icons/war.png' -allianceIcon = 'Icons/alliance.png' +warIcon = 'Icons/PlayerStates/war.png' +allianceIcon = 'Icons/PlayerStates/alliance.png' gui = { { @@ -43,7 +43,6 @@ gui = { guiType = GuiType.BUTTON, buttonType = ButtonType.ACTIVE_GAME_STATE, name = 'Trade', - imagePath = '', guiScreen = 'tradingScreen.lua', pos = {x = Pos.x + Size.x - buttonSize.x - margin.right, y = height}, size = buttonSize, diff --git a/Assets/Scripts/Gui/tradingScreen.lua b/Assets/Scripts/Gui/tradingScreen.lua index 040acbc..9a07193 100644 --- a/Assets/Scripts/Gui/tradingScreen.lua +++ b/Assets/Scripts/Gui/tradingScreen.lua @@ -10,7 +10,7 @@ textboxSize = {x = 200, y = 25} buttonSize = {x = 100, y = 20} ResourceTrayGuiId = {ICON = 0, TEXTBOX = 1, INCREMENT = 2, DECREMENT = 3} -IconPath = {WEALTH = 'Icons/wealth.png', RESEARCH = 'Icons/research.png', REFINEDS = 'Icons/refineds.png', TIME = 'Icons/time.png'} +IconPath = {WEALTH = 'Icons/Resources/wealth.png', RESEARCH = 'Icons/Resources/research.png', REFINEDS = 'Icons/Resources/refineds.png', TIME = 'Icons/Resources/time.png'} function createResourceTrayGui(cpuPlayer, lineId, guiId, imgPath) height = margin.top + lineId * iconSize.y @@ -39,7 +39,6 @@ function createResourceTrayGui(cpuPlayer, lineId, guiId, imgPath) guiType = GuiType.BUTTON, buttonType = ButtonType.ACTIVE_GAME_STATE, name = '+', - imagePath = '', guiScreen = 'tradingScreen.lua', pos = guiElPos, size = iconSize, @@ -52,7 +51,6 @@ function createResourceTrayGui(cpuPlayer, lineId, guiId, imgPath) guiType = GuiType.BUTTON, buttonType = ButtonType.ACTIVE_GAME_STATE, name = '-', - imagePath = '', guiScreen = 'tradingScreen.lua', pos = guiElPos, size = iconSize, @@ -122,7 +120,6 @@ gui = { guiType = GuiType.BUTTON, buttonType = ButtonType.PLAYER_TRADE, name = 'Back', - imagePath = '', guiScreen = 'tradingHub.lua', pos = {x = Pos.x + Size.x - 2 * buttonSize.x - margin.right, y = Pos.y + Size.y - buttonSize.y - margin.bottom}, size = buttonSize, @@ -132,7 +129,6 @@ gui = { guiType = GuiType.BUTTON, buttonType = ButtonType.ACTIVE_GAME_STATE, name = 'Offer', - imagePath = '', guiScreen = 'tradingHub.lua', pos = {x = Pos.x + Size.x - buttonSize.x - margin.right, y = Pos.y + Size.y - buttonSize.y - margin.bottom}, size = buttonSize, diff --git a/Assets/Textures/Icons/aam.png b/Assets/Textures/Icons/GameObjects/aam.png similarity index 100% rename from Assets/Textures/Icons/aam.png rename to Assets/Textures/Icons/GameObjects/aam.png diff --git a/Assets/Textures/Icons/aircraftCarrier00.png b/Assets/Textures/Icons/GameObjects/aircraftCarrier00.png similarity index 100% rename from Assets/Textures/Icons/aircraftCarrier00.png rename to Assets/Textures/Icons/GameObjects/aircraftCarrier00.png diff --git a/Assets/Textures/Icons/aircraftCarrier01.png b/Assets/Textures/Icons/GameObjects/aircraftCarrier01.png similarity index 100% rename from Assets/Textures/Icons/aircraftCarrier01.png rename to Assets/Textures/Icons/GameObjects/aircraftCarrier01.png diff --git a/Assets/Textures/Icons/awm.png b/Assets/Textures/Icons/GameObjects/awm.png similarity index 100% rename from Assets/Textures/Icons/awm.png rename to Assets/Textures/Icons/GameObjects/awm.png diff --git a/Assets/Textures/Icons/battleship00.png b/Assets/Textures/Icons/GameObjects/battleship00.png similarity index 100% rename from Assets/Textures/Icons/battleship00.png rename to Assets/Textures/Icons/GameObjects/battleship00.png diff --git a/Assets/Textures/Icons/battleship01.png b/Assets/Textures/Icons/GameObjects/battleship01.png similarity index 100% rename from Assets/Textures/Icons/battleship01.png rename to Assets/Textures/Icons/GameObjects/battleship01.png diff --git a/Assets/Textures/Icons/cruiser00.png b/Assets/Textures/Icons/GameObjects/cruiser00.png similarity index 100% rename from Assets/Textures/Icons/cruiser00.png rename to Assets/Textures/Icons/GameObjects/cruiser00.png diff --git a/Assets/Textures/Icons/cruiser01.png b/Assets/Textures/Icons/GameObjects/cruiser01.png similarity index 100% rename from Assets/Textures/Icons/cruiser01.png rename to Assets/Textures/Icons/GameObjects/cruiser01.png diff --git a/Assets/Textures/Icons/destroyer00.png b/Assets/Textures/Icons/GameObjects/destroyer00.png similarity index 100% rename from Assets/Textures/Icons/destroyer00.png rename to Assets/Textures/Icons/GameObjects/destroyer00.png diff --git a/Assets/Textures/Icons/destroyer01.png b/Assets/Textures/Icons/GameObjects/destroyer01.png similarity index 100% rename from Assets/Textures/Icons/destroyer01.png rename to Assets/Textures/Icons/GameObjects/destroyer01.png diff --git a/Assets/Textures/Icons/guidedMissile00.png b/Assets/Textures/Icons/GameObjects/guidedMissile00.png similarity index 100% rename from Assets/Textures/Icons/guidedMissile00.png rename to Assets/Textures/Icons/GameObjects/guidedMissile00.png diff --git a/Assets/Textures/Icons/guidedMissile01.png b/Assets/Textures/Icons/GameObjects/guidedMissile01.png similarity index 100% rename from Assets/Textures/Icons/guidedMissile01.png rename to Assets/Textures/Icons/GameObjects/guidedMissile01.png diff --git a/Assets/Textures/Icons/jet00.png b/Assets/Textures/Icons/GameObjects/jet00.png similarity index 100% rename from Assets/Textures/Icons/jet00.png rename to Assets/Textures/Icons/GameObjects/jet00.png diff --git a/Assets/Textures/Icons/jet01.png b/Assets/Textures/Icons/GameObjects/jet01.png similarity index 100% rename from Assets/Textures/Icons/jet01.png rename to Assets/Textures/Icons/GameObjects/jet01.png diff --git a/Assets/Textures/Icons/submarine00.png b/Assets/Textures/Icons/GameObjects/submarine00.png similarity index 100% rename from Assets/Textures/Icons/submarine00.png rename to Assets/Textures/Icons/GameObjects/submarine00.png diff --git a/Assets/Textures/Icons/submarine01.png b/Assets/Textures/Icons/GameObjects/submarine01.png similarity index 100% rename from Assets/Textures/Icons/submarine01.png rename to Assets/Textures/Icons/GameObjects/submarine01.png diff --git a/Assets/Textures/Icons/PlayerStates/alliance.png b/Assets/Textures/Icons/PlayerStates/alliance.png new file mode 100755 index 0000000..a1451cc Binary files /dev/null and b/Assets/Textures/Icons/PlayerStates/alliance.png differ diff --git a/Assets/Textures/Icons/PlayerStates/war.png b/Assets/Textures/Icons/PlayerStates/war.png new file mode 100755 index 0000000..a1451cc Binary files /dev/null and b/Assets/Textures/Icons/PlayerStates/war.png differ diff --git a/Assets/Textures/Icons/Resources/refineds.png b/Assets/Textures/Icons/Resources/refineds.png new file mode 100755 index 0000000..a1451cc Binary files /dev/null and b/Assets/Textures/Icons/Resources/refineds.png differ diff --git a/Assets/Textures/Icons/Resources/research.png b/Assets/Textures/Icons/Resources/research.png new file mode 100755 index 0000000..a1451cc Binary files /dev/null and b/Assets/Textures/Icons/Resources/research.png differ diff --git a/Assets/Textures/Icons/Resources/time.png b/Assets/Textures/Icons/Resources/time.png new file mode 100755 index 0000000..a1451cc Binary files /dev/null and b/Assets/Textures/Icons/Resources/time.png differ diff --git a/Assets/Textures/Icons/Resources/wealth.png b/Assets/Textures/Icons/Resources/wealth.png new file mode 100755 index 0000000..a1451cc Binary files /dev/null and b/Assets/Textures/Icons/Resources/wealth.png differ diff --git a/Assets/Textures/Icons/Technologies/advancedTower.png b/Assets/Textures/Icons/Technologies/advancedTower.png new file mode 100755 index 0000000..a1451cc Binary files /dev/null and b/Assets/Textures/Icons/Technologies/advancedTower.png differ diff --git a/Assets/Textures/Icons/Technologies/apt.jpg b/Assets/Textures/Icons/Technologies/apt.jpg new file mode 100755 index 0000000..a1451cc Binary files /dev/null and b/Assets/Textures/Icons/Technologies/apt.jpg differ diff --git a/Assets/Textures/Icons/Technologies/carrierFoundation.png b/Assets/Textures/Icons/Technologies/carrierFoundation.png new file mode 100755 index 0000000..a1451cc Binary files /dev/null and b/Assets/Textures/Icons/Technologies/carrierFoundation.png differ diff --git a/Assets/Textures/Icons/Technologies/ept.jpg b/Assets/Textures/Icons/Technologies/ept.jpg new file mode 100755 index 0000000..a1451cc Binary files /dev/null and b/Assets/Textures/Icons/Technologies/ept.jpg differ diff --git a/Assets/Textures/Icons/Technologies/fpt.jpg b/Assets/Textures/Icons/Technologies/fpt.jpg new file mode 100755 index 0000000..a1451cc Binary files /dev/null and b/Assets/Textures/Icons/Technologies/fpt.jpg differ diff --git a/Assets/Textures/Icons/Technologies/pct.jpg b/Assets/Textures/Icons/Technologies/pct.jpg new file mode 100755 index 0000000..a1451cc Binary files /dev/null and b/Assets/Textures/Icons/Technologies/pct.jpg differ diff --git a/Assets/Textures/Icons/Technologies/siegeFactory.jpg b/Assets/Textures/Icons/Technologies/siegeFactory.jpg new file mode 100755 index 0000000..a1451cc Binary files /dev/null and b/Assets/Textures/Icons/Technologies/siegeFactory.jpg differ diff --git a/Assets/Textures/Icons/Technologies/tacticalCruiser.png b/Assets/Textures/Icons/Technologies/tacticalCruiser.png new file mode 100755 index 0000000..a1451cc Binary files /dev/null and b/Assets/Textures/Icons/Technologies/tacticalCruiser.png differ diff --git a/concreteGuiManager.cpp b/concreteGuiManager.cpp index e130446..1b50b7c 100644 --- a/concreteGuiManager.cpp +++ b/concreteGuiManager.cpp @@ -61,11 +61,17 @@ namespace battleship{ sol::table sizeTable = guiTable["size"]; Vector2 size = Vector2(sizeTable["x"], sizeTable["y"]); + //TODO factor out repetetive optional lua key checks string nk = "name"; sol::optional nameOpt = guiTable[nk]; string name = (nameOpt != sol::nullopt ? (string)guiTable[nk] : ""); ButtonType type = (ButtonType)guiTable["buttonType"]; + string ipk = "imagePath"; + sol::optional pathOpt = guiTable[ipk]; + string imagePath = (pathOpt != sol::nullopt ? texBasePath + (string)guiTable[ipk] : ""); + bool texturingEnabled = (imagePath != ""); + Button *button = nullptr; switch(type){ @@ -176,7 +182,7 @@ namespace battleship{ int unitId = SOL_LUA_STATE["UnitId"]["ENGINEER"]; int strId = SOL_LUA_STATE["units"][unitId + 1]["buildableUnits"][guiId + 1]["id"]; string buttonName = SOL_LUA_STATE["units"][strId + 1]["name"]; - button = new BuildButton(pos, size, buttonName, (int)guiTable["trigger"], (string)guiTable["imagePath"], unitId, guiId); + button = new BuildButton(pos, size, buttonName, (int)guiTable["trigger"], imagePath, unitId, guiId); break; } case LAND_FACTORY_TRAIN: @@ -184,7 +190,7 @@ namespace battleship{ int facId = SOL_LUA_STATE["UnitId"]["LAND_FACTORY"]; int unitId = SOL_LUA_STATE["units"][facId + 1]["buildableUnits"][guiId + 1]["id"]; string buttonName = SOL_LUA_STATE["units"][unitId + 1]["name"]; - button = new TrainButton(pos, size, buttonName, (int)guiTable["trigger"], (string)guiTable["imagePath"], facId, guiId); + button = new TrainButton(pos, size, buttonName, (int)guiTable["trigger"], imagePath, facId, guiId); break; } case NAVAL_FACTORY_TRAIN: @@ -192,7 +198,7 @@ namespace battleship{ int facId = SOL_LUA_STATE["UnitId"]["NAVAL_FACTORY"]; int unitId = SOL_LUA_STATE["units"][facId + 1]["buildableUnits"][guiId + 1]["id"]; string buttonName = SOL_LUA_STATE["units"][unitId + 1]["name"]; - button = new TrainButton(pos, size, buttonName, (int)guiTable["trigger"], (string)guiTable["imagePath"], facId, guiId); + button = new TrainButton(pos, size, buttonName, (int)guiTable["trigger"], imagePath, facId, guiId); break; } case FORT_TRAIN: @@ -200,32 +206,32 @@ namespace battleship{ int facId = SOL_LUA_STATE["UnitId"]["FORT"]; int unitId = SOL_LUA_STATE["units"][facId + 1]["buildableUnits"][guiId + 1]["id"]; string buttonName = SOL_LUA_STATE["units"][unitId + 1]["name"]; - button = new TrainButton(pos, size, buttonName, (int)guiTable["trigger"], (string)guiTable["imagePath"], facId, guiId); + button = new TrainButton(pos, size, buttonName, (int)guiTable["trigger"], imagePath, facId, guiId); break; } case STATISTICS: - button = new StatsButton(pos, size, name, (int)guiTable["trigger"], (string)guiTable["imagePath"]); + button = new StatsButton(pos, size, name, (int)guiTable["trigger"], imagePath); break; case RESEARCH: - button = new ResearchButton(pos, size, name, (int)guiTable["trigger"], (string)guiTable["imagePath"], (int)SOL_LUA_STATE["UnitId"]["LAB"], (int)guiTable["techId"]); + button = new ResearchButton(pos, size, name, (int)guiTable["trigger"], imagePath, (int)SOL_LUA_STATE["UnitId"]["LAB"], (int)guiTable["techId"]); break; case BUY_REFINEDS: - button = new TradeButton(pos, size, name, (int)guiTable["trigger"], (string)guiTable["imagePath"], (int)SOL_LUA_STATE["UnitId"]["TRADE_CENTER"], TradeButton::Type::BUY_REFINEDS); + button = new TradeButton(pos, size, name, (int)guiTable["trigger"], imagePath, (int)SOL_LUA_STATE["UnitId"]["TRADE_CENTER"], TradeButton::Type::BUY_REFINEDS); break; case SELL_REFINEDS: - button = new TradeButton(pos, size, name, (int)guiTable["trigger"], (string)guiTable["imagePath"], (int)SOL_LUA_STATE["UnitId"]["TRADE_CENTER"], TradeButton::Type::SELL_REFINEDS); + button = new TradeButton(pos, size, name, (int)guiTable["trigger"], imagePath, (int)SOL_LUA_STATE["UnitId"]["TRADE_CENTER"], TradeButton::Type::SELL_REFINEDS); break; case BUY_RESEARCH: - button = new TradeButton(pos, size, name, (int)guiTable["trigger"], (string)guiTable["imagePath"], (int)SOL_LUA_STATE["UnitId"]["TRADE_CENTER"], TradeButton::Type::BUY_RESEARCH); + button = new TradeButton(pos, size, name, (int)guiTable["trigger"], imagePath, (int)SOL_LUA_STATE["UnitId"]["TRADE_CENTER"], TradeButton::Type::BUY_RESEARCH); break; case SELL_RESEARCH: - button = new TradeButton(pos, size, name, (int)guiTable["trigger"], (string)guiTable["imagePath"], (int)SOL_LUA_STATE["UnitId"]["TRADE_CENTER"], TradeButton::Type::SELL_RESEARCH); + button = new TradeButton(pos, size, name, (int)guiTable["trigger"], imagePath, (int)SOL_LUA_STATE["UnitId"]["TRADE_CENTER"], TradeButton::Type::SELL_RESEARCH); break; case ACTIVE_GAME_STATE: - button = new ActiveStateButton(pos, size, (string)guiTable["guiScreen"], name, (int)guiTable["trigger"], (string)guiTable["imagePath"]); + button = new ActiveStateButton(pos, size, (string)guiTable["guiScreen"], name, (int)guiTable["trigger"], imagePath); break; case PLAYER_TRADE: - button = new PlayerTradeButton(pos, size, (string)guiTable["guiScreen"], name, (int)guiTable["trigger"], (string)guiTable["imagePath"]); + button = new PlayerTradeButton(pos, size, (string)guiTable["guiScreen"], name, (int)guiTable["trigger"], imagePath); break; }