mirror of
https://github.com/zhenyan121/SporeBG-Conid.git
synced 2026-04-10 06:14:08 +08:00
feat: add round display
This commit is contained in:
@@ -9,5 +9,6 @@ struct DebugData {
|
||||
std::pair<int, int> mousePosition = {0, 0};
|
||||
std::pair<int, int> mouseLogicalPostion = {0, 0};
|
||||
int currentFPS = 0;
|
||||
int round = 0;
|
||||
|
||||
};
|
||||
@@ -34,6 +34,14 @@ void DebugOverlay::initialize() {
|
||||
80
|
||||
);
|
||||
m_labels.emplace(mouseLogicalPos->getNameHash(), std::move(mouseLogicalPos));
|
||||
|
||||
auto roundLabel = UIWidgetFactory::createStandardLabel(
|
||||
"RoundLabel",
|
||||
"Round: 0",
|
||||
0,
|
||||
120
|
||||
);
|
||||
m_labels.emplace(roundLabel->getNameHash(), std::move(roundLabel));
|
||||
}
|
||||
|
||||
|
||||
@@ -125,4 +133,12 @@ void DebugOverlay::updateDebugInfo() {
|
||||
} else {
|
||||
std::cerr << "Mouse LogicalPosition Label not found!\n";
|
||||
}
|
||||
|
||||
const auto roundLabelKey = makeHash("RoundLabel");
|
||||
auto roundLabel = m_labels.find(roundLabelKey);
|
||||
if (roundLabel != m_labels.end()) {
|
||||
roundLabel->second->setText("Round: " + std::to_string(m_debugData.round));
|
||||
} else {
|
||||
std::cerr << "Round Label not found!\n";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user