- Modified gameObserver and related classes to be able to work with a precise JGE instance given at construction and not the static global one. That allows to run gameObserver without JGE instance (for example in a worker thread).
- Added an "ACTION_LOGGING_TESTING" mode in the gameObserver. When this is defined, the game reloads itself in every update. I want to use that to track undo problems. Be aware that it kills performances and crashes with the testsuite if you want to activate it. - Various cleanup/refactor of the game observer. - Added a gameObserver == operator to compare two games - Added player mode to the player serialization - Added a multi-threaded mode to AI_CHANGE_TESTING. For the moment it's only useable with Qt. If you want to use it without, just defined a thread_count higher than 1. - Refactored random generator class to use list intead of queue - Defined a specific type for interrupt decision instead of int
This commit is contained in:
@@ -214,12 +214,12 @@ void GameStateShop::beginPurchase(int controlId)
|
||||
SAFE_DELETE(menu);
|
||||
if (mInventory[controlId] <= 0)
|
||||
{
|
||||
menu = NEW SimpleMenu(-145, this, Fonts::MENU_FONT, SCREEN_WIDTH - 300, SCREEN_HEIGHT / 2, _("Sold Out").c_str());
|
||||
menu = NEW SimpleMenu(JGE::GetInstance(), -145, this, Fonts::MENU_FONT, SCREEN_WIDTH - 300, SCREEN_HEIGHT / 2, _("Sold Out").c_str());
|
||||
menu->Add(-1, "Ok");
|
||||
}
|
||||
else if (playerdata->credits - mPrices[controlId] < 0)
|
||||
{
|
||||
menu = NEW SimpleMenu(-145, this, Fonts::MENU_FONT, SCREEN_WIDTH - 300, SCREEN_HEIGHT / 2, _("Not enough credits").c_str());
|
||||
menu = NEW SimpleMenu(JGE::GetInstance(), -145, this, Fonts::MENU_FONT, SCREEN_WIDTH - 300, SCREEN_HEIGHT / 2, _("Not enough credits").c_str());
|
||||
menu->Add(-1, "Ok");
|
||||
if (options[Options::CHEATMODE].number)
|
||||
{
|
||||
@@ -233,7 +233,7 @@ void GameStateShop::beginPurchase(int controlId)
|
||||
sprintf(buf, _("Purchase Booster: %i credits").c_str(), mPrices[controlId]);
|
||||
else
|
||||
sprintf(buf, _("Purchase Card: %i credits").c_str(), mPrices[controlId]);
|
||||
menu = NEW SimpleMenu(-145, this, Fonts::MENU_FONT, SCREEN_WIDTH - 300, SCREEN_HEIGHT / 2, buf);
|
||||
menu = NEW SimpleMenu(JGE::GetInstance(), -145, this, Fonts::MENU_FONT, SCREEN_WIDTH - 300, SCREEN_HEIGHT / 2, buf);
|
||||
|
||||
menu->Add(controlId, "Yes");
|
||||
menu->Add(-1, "No");
|
||||
@@ -495,7 +495,7 @@ void GameStateShop::Update(float dt)
|
||||
menu->Update(dt);
|
||||
else
|
||||
{
|
||||
menu = NEW SimpleMenu(11, this, Fonts::MENU_FONT, SCREEN_WIDTH / 2 - 100, 20);
|
||||
menu = NEW SimpleMenu(JGE::GetInstance(), 11, this, Fonts::MENU_FONT, SCREEN_WIDTH / 2 - 100, 20);
|
||||
menu->Add(22, "Ask about...");
|
||||
menu->Add(14, "Check task board");
|
||||
if (options[Options::CHEATMODE].number)
|
||||
@@ -525,7 +525,7 @@ void GameStateShop::Update(float dt)
|
||||
{
|
||||
if (!menu)
|
||||
{
|
||||
menu = NEW SimpleMenu(11, this, Fonts::MENU_FONT, SCREEN_WIDTH / 2 - 100, 20);
|
||||
menu = NEW SimpleMenu(JGE::GetInstance(), 11, this, Fonts::MENU_FONT, SCREEN_WIDTH / 2 - 100, 20);
|
||||
menu->Add(15, "Return to shop");
|
||||
menu->Add(12, "Save & Back to Main Menu");
|
||||
menu->Add(kCancelMenuID, "Cancel");
|
||||
|
||||
Reference in New Issue
Block a user