Implement default best-yield resource and long-press resource selection for city slots

This commit is contained in:
bart
2026-11-08 21:43:11 +01:00
parent 4b237872eb
commit 43b8b1556d
9 changed files with 492 additions and 52 deletions
+25
View File
@@ -146,6 +146,31 @@ protected:
int m_cityProjectTab = 0; // 0 = Buildings, 1 = Units
QRect m_tabBuildingsRect;
QRect m_tabUnitsRect;
void drawCityResourceMenu(QPainter &painter, const QMatrix4x4 &vMatrix);
void onSlotLongPressTimeout();
// Slot Long Press & Resource Selection Menu State
bool m_slotPressPending = false;
bool m_slotLongPressTriggered = false;
int m_pressedSlotTx = -1;
int m_pressedSlotTy = -1;
QPoint m_slotPressPos;
QElapsedTimer m_slotPressElapsed;
QTimer *m_slotLongPressTimer = nullptr;
bool m_resourceMenuOpen = false;
int m_resourceMenuTx = -1;
int m_resourceMenuTy = -1;
QRect m_resourceMenuRect;
QRect m_resourceMenuCloseBtnRect;
struct CityResourceChoiceHit {
QRect rect;
QString res;
int amount;
};
std::vector<CityResourceChoiceHit> m_cityResourceChoiceHits;
};
#endif // QSCENERENDERER_H