implemented instant trading

This commit is contained in:
devZoGok
2024-03-10 15:41:56 +02:00
parent 8a885391f9
commit e2d6a1ae69
27 changed files with 297 additions and 50 deletions
+13
View File
@@ -25,6 +25,7 @@
#include "trainButton.h"
#include "statsButton.h"
#include "researchButton.h"
#include "tradeButton.h"
namespace battleship{
using namespace std;
@@ -200,6 +201,18 @@ namespace battleship{
case RESEARCH:
button = new ResearchButton(pos, size, name, (int)guiTable["trigger"], (string)guiTable["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);
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);
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);
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);
break;
}
int typeArr[2]{(int)GuiElementType::BUTTON, (int)type};