mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Added GameInstance class
- available as global GAME - integrates LOCPLINT (CPlayerInterface) - integrates CGI->mh (CMapHandler) - integrates CSH (CServerHandler)
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "CHeroBackpackWindow.h"
|
||||
|
||||
#include "../GameEngine.h"
|
||||
#include "../GameInstance.h"
|
||||
#include "../gui/Shortcut.h"
|
||||
|
||||
#include "../widgets/Buttons.h"
|
||||
@@ -51,15 +52,15 @@ CHeroBackpackWindow::CHeroBackpackWindow(const CGHeroInstance * hero, const std:
|
||||
|
||||
buttons.emplace_back(std::make_shared<CButton>(Point(), AnimationPath::builtin("heroBackpackSort"),
|
||||
CButton::tooltipLocalized("vcmi.heroWindow.sortBackpackByCost"),
|
||||
[hero]() { LOCPLINT->cb->sortBackpackArtifactsByCost(hero->id); }));
|
||||
[hero]() { GAME->interface()->cb->sortBackpackArtifactsByCost(hero->id); }));
|
||||
buttons.back()->setTextOverlay(sortByValue, EFonts::FONT_SMALL, Colors::YELLOW);
|
||||
buttons.emplace_back(std::make_shared<CButton>(Point(), AnimationPath::builtin("heroBackpackSort"),
|
||||
CButton::tooltipLocalized("vcmi.heroWindow.sortBackpackBySlot"),
|
||||
[hero]() { LOCPLINT->cb->sortBackpackArtifactsBySlot(hero->id); }));
|
||||
[hero]() { GAME->interface()->cb->sortBackpackArtifactsBySlot(hero->id); }));
|
||||
buttons.back()->setTextOverlay(sortBySlot, EFonts::FONT_SMALL, Colors::YELLOW);
|
||||
buttons.emplace_back(std::make_shared<CButton>(Point(), AnimationPath::builtin("heroBackpackSort"),
|
||||
CButton::tooltipLocalized("vcmi.heroWindow.sortBackpackByClass"),
|
||||
[hero]() { LOCPLINT->cb->sortBackpackArtifactsByClass(hero->id); }));
|
||||
[hero]() { GAME->interface()->cb->sortBackpackArtifactsByClass(hero->id); }));
|
||||
buttons.back()->setTextOverlay(sortByClass, EFonts::FONT_SMALL, Colors::YELLOW);
|
||||
|
||||
pos.w = stretchedBackground->pos.w = arts->pos.w + 2 * windowMargin;
|
||||
@@ -86,7 +87,7 @@ void CHeroBackpackWindow::notFocusedClick()
|
||||
void CHeroBackpackWindow::showAll(Canvas & to)
|
||||
{
|
||||
CIntObject::showAll(to);
|
||||
CMessage::drawBorder(PlayerColor(LOCPLINT->playerID), to, pos.w+28, pos.h+29, pos.x-14, pos.y-15);
|
||||
CMessage::drawBorder(PlayerColor(GAME->interface()->playerID), to, pos.w+28, pos.h+29, pos.x-14, pos.y-15);
|
||||
}
|
||||
|
||||
CHeroQuickBackpackWindow::CHeroQuickBackpackWindow(const CGHeroInstance * hero, ArtifactPosition targetSlot)
|
||||
@@ -137,6 +138,6 @@ void CHeroQuickBackpackWindow::showAll(Canvas & to)
|
||||
close();
|
||||
return;
|
||||
}
|
||||
CMessage::drawBorder(PlayerColor(LOCPLINT->playerID), to, pos.w + 28, pos.h + 29, pos.x - 14, pos.y - 15);
|
||||
CMessage::drawBorder(PlayerColor(GAME->interface()->playerID), to, pos.w + 28, pos.h + 29, pos.x - 14, pos.y - 15);
|
||||
CIntObject::showAll(to);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user