mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-25 16:30:15 +00:00
feat: add /clear chat command and movement speed display in stats
- /clear slash command empties the chat history (was listed in autocomplete but never handled) - Stats panel shows run/flight/swim speed as percentage of base only when non-default (e.g. mounted or speed-buffed), under a new Movement section
This commit is contained in:
parent
01ec830555
commit
f5a834b543
3 changed files with 39 additions and 0 deletions
|
|
@ -283,6 +283,7 @@ public:
|
|||
* @return Vector of chat messages
|
||||
*/
|
||||
const std::deque<MessageChatData>& getChatHistory() const { return chatHistory; }
|
||||
void clearChatHistory() { chatHistory.clear(); }
|
||||
|
||||
/**
|
||||
* Add a locally-generated chat message (e.g., emote feedback)
|
||||
|
|
|
|||
|
|
@ -4669,6 +4669,12 @@ void GameScreen::sendChatMessage(game::GameHandler& gameHandler) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (cmdLower == "clear") {
|
||||
gameHandler.clearChatHistory();
|
||||
chatInputBuffer[0] = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
// /invite command
|
||||
if (cmdLower == "invite" && spacePos != std::string::npos) {
|
||||
std::string targetName = command.substr(spacePos + 1);
|
||||
|
|
|
|||
|
|
@ -1931,6 +1931,38 @@ void InventoryScreen::renderStatsPanel(game::Inventory& inventory, uint32_t play
|
|||
ImGui::TextColored(cyan, "Resilience: %d", resilR);
|
||||
}
|
||||
}
|
||||
|
||||
// Movement speeds (always show when non-default)
|
||||
{
|
||||
constexpr float kBaseRun = 7.0f;
|
||||
constexpr float kBaseFlight = 7.0f;
|
||||
float runSpeed = gh->getServerRunSpeed();
|
||||
float flightSpeed = gh->getServerFlightSpeed();
|
||||
float swimSpeed = gh->getServerSwimSpeed();
|
||||
|
||||
bool showRun = runSpeed > 0.0f && std::fabs(runSpeed - kBaseRun) > 0.05f;
|
||||
bool showFlight = flightSpeed > 0.0f && std::fabs(flightSpeed - kBaseFlight) > 0.05f;
|
||||
bool showSwim = swimSpeed > 0.0f && std::fabs(swimSpeed - 4.722f) > 0.05f;
|
||||
|
||||
if (showRun || showFlight || showSwim) {
|
||||
ImGui::Spacing();
|
||||
ImGui::Separator();
|
||||
ImGui::TextColored(ImVec4(1.0f, 0.84f, 0.0f, 1.0f), "Movement");
|
||||
ImVec4 speedColor(0.6f, 1.0f, 0.8f, 1.0f);
|
||||
if (showRun) {
|
||||
float pct = (runSpeed / kBaseRun) * 100.0f;
|
||||
ImGui::TextColored(speedColor, "Run Speed: %.1f%%", pct);
|
||||
}
|
||||
if (showFlight) {
|
||||
float pct = (flightSpeed / kBaseFlight) * 100.0f;
|
||||
ImGui::TextColored(speedColor, "Flight Speed: %.1f%%", pct);
|
||||
}
|
||||
if (showSwim) {
|
||||
float pct = (swimSpeed / 4.722f) * 100.0f;
|
||||
ImGui::TextColored(speedColor, "Swim Speed: %.1f%%", pct);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue