1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Fix issues discovered by self-review

This commit is contained in:
Ivan Savenko
2023-05-08 23:37:31 +03:00
parent 8504b891a8
commit edd5d11734
3 changed files with 21 additions and 14 deletions

View File

@@ -58,7 +58,8 @@ private:
/// if true, then scrolling was blocked via ctrl and should not restart until player move cursor outside scrolling area /// if true, then scrolling was blocked via ctrl and should not restart until player move cursor outside scrolling area
bool scrollingWasBlocked; bool scrollingWasBlocked;
const CSpell *spellBeingCasted; //nullptr if none /// spell for which player is selecting target, or nullptr if none
const CSpell *spellBeingCasted;
std::shared_ptr<MapAudioPlayer> mapAudio; std::shared_ptr<MapAudioPlayer> mapAudio;
std::shared_ptr<AdventureMapWidget> widget; std::shared_ptr<AdventureMapWidget> widget;
@@ -66,10 +67,14 @@ private:
private: private:
void setState(EAdventureState state); void setState(EAdventureState state);
void adjustActiveness(); //should be called every time at AI/human turn transition; blocks GUI during AI turn
const IShipyard * ourInaccessibleShipyard(const CGObjectInstance *obj) const; //checks if obj is our ashipyard and cursor is 0,0 -> returns shipyard or nullptr else /// updates active state of game window whenever game state changes
void adjustActiveness();
/// checks if obj is our ashipyard and cursor is 0,0 -> returns shipyard or nullptr else
const IShipyard * ourInaccessibleShipyard(const CGObjectInstance *obj) const;
/// check and if necessary reacts on scrolling by moving cursor to screen edge
void handleMapScrollingUpdate(); void handleMapScrollingUpdate();
void showMoveDetailsInStatusbar(const CGHeroInstance & hero, const CGPathNode & pathNode); void showMoveDetailsInStatusbar(const CGHeroInstance & hero, const CGPathNode & pathNode);
@@ -78,10 +83,12 @@ private:
/// exits currently opened world view mode and returns to normal map /// exits currently opened world view mode and returns to normal map
void exitCastingMode(); void exitCastingMode();
/// casts current spell at specified location
void performSpellcasting(const int3 & castTarget); void performSpellcasting(const int3 & castTarget);
protected: protected:
// CIntObject interface implementation /// CIntObject interface implementation
void activate() override; void activate() override;
void deactivate() override; void deactivate() override;

View File

@@ -51,7 +51,7 @@ CLobbyScreen::CLobbyScreen(ESelectionScreen screenType)
buttonOptions = std::make_shared<CButton>(Point(411, 510), "GSPBUTT.DEF", CGI->generaltexth->zelp[46], std::bind(&CLobbyScreen::toggleTab, this, tabOpt), EShortcut::LOBBY_ADDITIONAL_OPTIONS); buttonOptions = std::make_shared<CButton>(Point(411, 510), "GSPBUTT.DEF", CGI->generaltexth->zelp[46], std::bind(&CLobbyScreen::toggleTab, this, tabOpt), EShortcut::LOBBY_ADDITIONAL_OPTIONS);
}; };
buttonChat = std::make_shared<CButton>(Point(619, 83), "GSPBUT2.DEF", CGI->generaltexth->zelp[48], std::bind(&CLobbyScreen::toggleChat, this), EShortcut::LOBBY_HIDE_CHAT); buttonChat = std::make_shared<CButton>(Point(619, 80), "GSPBUT2.DEF", CGI->generaltexth->zelp[48], std::bind(&CLobbyScreen::toggleChat, this), EShortcut::LOBBY_HIDE_CHAT);
buttonChat->addTextOverlay(CGI->generaltexth->allTexts[532], FONT_SMALL); buttonChat->addTextOverlay(CGI->generaltexth->allTexts[532], FONT_SMALL);
switch(screenType) switch(screenType)

View File

@@ -452,7 +452,7 @@
// Resource & Data bar // Resource & Data bar
{ {
"type": "adventurePlayerTexture", "type": "adventurePlayerTexture",
"name" : "backgroundBottomCenter", "name" : "backgroundLeftOfResourceDateBar",
"image" : "DiBoxBck.pcx", "image" : "DiBoxBck.pcx",
"area" : { "left": 3, "bottom" : 4, "right" : 797, "height" : 21 } "area" : { "left": 3, "bottom" : 4, "right" : 797, "height" : 21 }
}, },
@@ -599,7 +599,7 @@
}, },
{ {
"type": "adventureMapIcon", "type": "adventureMapIcon",
"name": "worldViewIconOre", "name": "worldViewIconMineOre",
"image" : "VwSymbol.def", "image" : "VwSymbol.def",
"index" : 7, "index" : 7,
"perPlayer" : 19, "perPlayer" : 19,
@@ -641,7 +641,7 @@
// World view - resources icons // World view - resources icons
{ {
"type": "adventureMapIcon", "type": "adventureMapIcon",
"name": "worldViewIconMineWood", "name": "worldViewIconResourceWood",
"image" : "VwSymbol.def", "image" : "VwSymbol.def",
"index" : 12, "index" : 12,
"perPlayer" : 19, "perPlayer" : 19,
@@ -649,7 +649,7 @@
}, },
{ {
"type": "adventureMapIcon", "type": "adventureMapIcon",
"name": "worldViewIconMineMercury", "name": "worldViewIconResourceMercury",
"image" : "VwSymbol.def", "image" : "VwSymbol.def",
"index" : 13, "index" : 13,
"perPlayer" : 19, "perPlayer" : 19,
@@ -657,7 +657,7 @@
}, },
{ {
"type": "adventureMapIcon", "type": "adventureMapIcon",
"name": "worldViewIconOre", "name": "worldViewIconResourceOre",
"image" : "VwSymbol.def", "image" : "VwSymbol.def",
"index" : 14, "index" : 14,
"perPlayer" : 19, "perPlayer" : 19,
@@ -665,7 +665,7 @@
}, },
{ {
"type": "adventureMapIcon", "type": "adventureMapIcon",
"name": "worldViewIconMineSulfur", "name": "worldViewIconResourceSulfur",
"image" : "VwSymbol.def", "image" : "VwSymbol.def",
"index" : 15, "index" : 15,
"perPlayer" : 19, "perPlayer" : 19,
@@ -673,7 +673,7 @@
}, },
{ {
"type": "adventureMapIcon", "type": "adventureMapIcon",
"name": "worldViewIconMineCrystal", "name": "worldViewIconResourceCrystal",
"image" : "VwSymbol.def", "image" : "VwSymbol.def",
"index" : 16, "index" : 16,
"perPlayer" : 19, "perPlayer" : 19,
@@ -681,7 +681,7 @@
}, },
{ {
"type": "adventureMapIcon", "type": "adventureMapIcon",
"name": "worldViewIconMineGems", "name": "worldViewIconResourceGems",
"image" : "VwSymbol.def", "image" : "VwSymbol.def",
"index" : 17, "index" : 17,
"perPlayer" : 19, "perPlayer" : 19,
@@ -689,7 +689,7 @@
}, },
{ {
"type": "adventureMapIcon", "type": "adventureMapIcon",
"name": "worldViewIconMineGold", "name": "worldViewIconResourceGold",
"image" : "VwSymbol.def", "image" : "VwSymbol.def",
"index" : 18, "index" : 18,
"perPlayer" : 19, "perPlayer" : 19,