Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit d898331

Browse files
committed
Add settings flag to disable custom BuyMenu skin cursors
1 parent 50ddb65 commit d898331

File tree

4 files changed

+33
-16
lines changed

4 files changed

+33
-16
lines changed

Managers/SettingsMan.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ namespace RTE {
4848
m_SimplifiedCollisionDetection = false;
4949
m_SceneBackgroundAutoScaleMode = 1;
5050
m_DisableFactionBuyMenuThemes = false;
51+
m_DisableFactionBuyMenuThemeCursors = false;
5152
m_PathFinderGridNodeSize = c_PPM;
5253
m_AIUpdateInterval = 2;
5354

@@ -195,6 +196,8 @@ namespace RTE {
195196
SetSceneBackgroundAutoScaleMode(std::stoi(reader.ReadPropValue()));
196197
} else if (propName == "DisableFactionBuyMenuThemes") {
197198
reader >> m_DisableFactionBuyMenuThemes;
199+
} else if (propName == "DisableFactionBuyMenuThemeCursors") {
200+
reader >> m_DisableFactionBuyMenuThemeCursors;
198201
} else if (propName == "PathFinderGridNodeSize") {
199202
reader >> m_PathFinderGridNodeSize;
200203
} else if (propName == "AIUpdateInterval") {
@@ -388,6 +391,7 @@ namespace RTE {
388391
writer.NewPropertyWithValue("SimplifiedCollisionDetection", m_SimplifiedCollisionDetection);
389392
writer.NewPropertyWithValue("SceneBackgroundAutoScaleMode", m_SceneBackgroundAutoScaleMode);
390393
writer.NewPropertyWithValue("DisableFactionBuyMenuThemes", m_DisableFactionBuyMenuThemes);
394+
writer.NewPropertyWithValue("DisableFactionBuyMenuThemeCursors", m_DisableFactionBuyMenuThemeCursors);
391395
writer.NewPropertyWithValue("PathFinderGridNodeSize", m_PathFinderGridNodeSize);
392396
writer.NewPropertyWithValue("AIUpdateInterval", m_AIUpdateInterval);
393397
writer.NewPropertyWithValue("EnableParticleSettling", g_MovableMan.m_SettlingEnabled);

Managers/SettingsMan.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@ namespace RTE {
9393
/// <param name="disable">Whether faction BuyMenu theme support is disabled or not.</param>
9494
void SetFactionBuyMenuThemesDisabled(bool disable) { m_DisableFactionBuyMenuThemes = disable; }
9595

96+
/// <summary>
97+
/// Gets whether custom cursor support in faction BuyMenu themes is disabled.
98+
/// </summary>
99+
/// <returns>Whether faction BuyMenu theme support is disabled.</returns>
100+
bool FactionBuyMenuThemeCursorsDisabled() const { return m_DisableFactionBuyMenuThemeCursors; }
101+
102+
/// <summary>
103+
/// Sets whether custom cursor support in faction BuyMenu themes is disabled.
104+
/// </summary>
105+
/// <param name="disable">Whether custom cursor support in faction BuyMenu themes is disabled or not.</param>
106+
void SetFactionBuyMenuThemeCursorsDisabled(bool disable) { m_DisableFactionBuyMenuThemeCursors = disable; }
107+
96108
/// <summary>
97109
/// Gets the PathFinder grid node size.
98110
/// </summary>
@@ -521,6 +533,7 @@ namespace RTE {
521533
bool m_SimplifiedCollisionDetection; //!< Whether simplified collision detection (reduced MOID layer sampling) is enabled.
522534
int m_SceneBackgroundAutoScaleMode; //!< Scene background layer auto-scaling mode. 0 for off, 1 for fit screen dimensions and 2 for always upscaled to x2.
523535
bool m_DisableFactionBuyMenuThemes; //!< Whether faction BuyMenu theme support is disabled.
536+
bool m_DisableFactionBuyMenuThemeCursors; //!< Whether custom cursor support in faction BuyMenu themes is disabled.
524537
int m_PathFinderGridNodeSize; //!< The grid size used by the PathFinder, in pixels.
525538
int m_AIUpdateInterval; //!< How often actor's AI should be updated, i.e. every n simulation updates.
526539

Menus/BuyMenuGUI.cpp

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,21 +2049,18 @@ void BuyMenuGUI::Update()
20492049
}
20502050
}
20512051

2052+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
20522053

2053-
//////////////////////////////////////////////////////////////////////////////////////////
2054-
// Virtual Method: Draw
2055-
//////////////////////////////////////////////////////////////////////////////////////////
2056-
// Description: Draws the menu
2057-
2058-
void BuyMenuGUI::Draw(BITMAP *drawBitmap) const
2059-
{
2060-
AllegroScreen drawScreen(drawBitmap);
2061-
m_pGUIController->Draw(&drawScreen);
2062-
2063-
// Draw the cursor on top of everything
2064-
if (IsEnabled() && m_pController->IsMouseControlled())
2065-
m_pGUIController->DrawMouse();
2066-
//draw_sprite(drawBitmap, s_pCursor, m_CursorPos.GetFloorIntX(), m_CursorPos.GetFloorIntY());
2054+
void BuyMenuGUI::Draw(BITMAP *drawBitmap) const {
2055+
AllegroScreen drawScreen(drawBitmap);
2056+
m_pGUIController->Draw(&drawScreen);
2057+
if (IsEnabled() && m_pController->IsMouseControlled()) {
2058+
if (g_SettingsMan.FactionBuyMenuThemeCursorsDisabled()) {
2059+
draw_sprite(drawBitmap, s_pCursor, m_CursorPos.GetFloorIntX(), m_CursorPos.GetFloorIntY());
2060+
} else {
2061+
m_pGUIController->DrawMouse();
2062+
}
2063+
}
20672064
}
20682065

20692066
/*

Menus/ObjectPickerGUI.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,11 @@ namespace RTE {
599599
AllegroScreen drawScreen(drawBitmap);
600600
m_GUIControlManager->Draw(&drawScreen);
601601
if (IsEnabled() && m_Controller->IsMouseControlled()) {
602-
m_GUIControlManager->DrawMouse();
603-
//draw_sprite(drawBitmap, s_Cursor, m_CursorPos.GetFloorIntX(), m_CursorPos.GetFloorIntY());
602+
if (g_SettingsMan.FactionBuyMenuThemeCursorsDisabled()) {
603+
draw_sprite(drawBitmap, s_Cursor, m_CursorPos.GetFloorIntX(), m_CursorPos.GetFloorIntY());
604+
} else {
605+
m_GUIControlManager->DrawMouse();
606+
}
604607
}
605608
}
606609
}

0 commit comments

Comments
 (0)