mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-02 15:53:51 +00:00
feat: add /stopfollow and /zone slash commands, update /help
This commit is contained in:
parent
aaa3649975
commit
ec93981a9d
3 changed files with 34 additions and 3 deletions
|
|
@ -402,6 +402,7 @@ public:
|
||||||
|
|
||||||
// Follow/Assist
|
// Follow/Assist
|
||||||
void followTarget();
|
void followTarget();
|
||||||
|
void cancelFollow(); // Stop following current target
|
||||||
void assistTarget();
|
void assistTarget();
|
||||||
|
|
||||||
// PvP
|
// PvP
|
||||||
|
|
|
||||||
|
|
@ -10256,6 +10256,15 @@ void GameHandler::followTarget() {
|
||||||
LOG_INFO("Following target: ", targetName, " (GUID: 0x", std::hex, targetGuid, std::dec, ")");
|
LOG_INFO("Following target: ", targetName, " (GUID: 0x", std::hex, targetGuid, std::dec, ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GameHandler::cancelFollow() {
|
||||||
|
if (followTargetGuid_ == 0) {
|
||||||
|
addSystemChatMessage("You are not following anyone.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
followTargetGuid_ = 0;
|
||||||
|
addSystemChatMessage("You stop following.");
|
||||||
|
}
|
||||||
|
|
||||||
void GameHandler::assistTarget() {
|
void GameHandler::assistTarget() {
|
||||||
if (state != WorldState::IN_WORLD) {
|
if (state != WorldState::IN_WORLD) {
|
||||||
LOG_WARNING("Cannot assist: not in world");
|
LOG_WARNING("Cannot assist: not in world");
|
||||||
|
|
|
||||||
|
|
@ -3809,6 +3809,20 @@ void GameScreen::sendChatMessage(game::GameHandler& gameHandler) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// /zone command — print current zone name
|
||||||
|
if (cmdLower == "zone") {
|
||||||
|
std::string zoneName;
|
||||||
|
if (auto* rend = core::Application::getInstance().getRenderer())
|
||||||
|
zoneName = rend->getCurrentZoneName();
|
||||||
|
game::MessageChatData sysMsg;
|
||||||
|
sysMsg.type = game::ChatType::SYSTEM;
|
||||||
|
sysMsg.language = game::ChatLanguage::UNIVERSAL;
|
||||||
|
sysMsg.message = zoneName.empty() ? "You are not in a known zone." : "You are in: " + zoneName;
|
||||||
|
gameHandler.addLocalChatMessage(sysMsg);
|
||||||
|
chatInputBuffer[0] = '\0';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// /played command
|
// /played command
|
||||||
if (cmdLower == "played") {
|
if (cmdLower == "played") {
|
||||||
gameHandler.requestPlayedTime();
|
gameHandler.requestPlayedTime();
|
||||||
|
|
@ -3834,11 +3848,11 @@ void GameScreen::sendChatMessage(game::GameHandler& gameHandler) {
|
||||||
" /maintank /mainassist /roll [min-max]",
|
" /maintank /mainassist /roll [min-max]",
|
||||||
"Guild: /ginvite /gkick /gquit /gpromote /gdemote /gmotd",
|
"Guild: /ginvite /gkick /gquit /gpromote /gdemote /gmotd",
|
||||||
" /gleader /groster /ginfo /gcreate /gdisband",
|
" /gleader /groster /ginfo /gcreate /gdisband",
|
||||||
"Combat: /startattack /stopattack /stopcasting /duel /pvp",
|
"Combat: /startattack /stopattack /stopcasting /cast <spell> /duel /pvp",
|
||||||
" /forfeit /follow /assist",
|
" /forfeit /follow /stopfollow /assist",
|
||||||
"Target: /target <name> /cleartarget /focus /clearfocus",
|
"Target: /target <name> /cleartarget /focus /clearfocus",
|
||||||
"Movement: /sit /stand /kneel /dismount",
|
"Movement: /sit /stand /kneel /dismount",
|
||||||
"Misc: /played /time /afk [msg] /dnd [msg] /inspect",
|
"Misc: /played /time /zone /afk [msg] /dnd [msg] /inspect",
|
||||||
" /helm /cloak /trade /join <channel> /leave <channel>",
|
" /helm /cloak /trade /join <channel> /leave <channel>",
|
||||||
" /unstuck /logout /ticket /help",
|
" /unstuck /logout /ticket /help",
|
||||||
};
|
};
|
||||||
|
|
@ -4083,6 +4097,13 @@ void GameScreen::sendChatMessage(game::GameHandler& gameHandler) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// /stopfollow command
|
||||||
|
if (cmdLower == "stopfollow") {
|
||||||
|
gameHandler.cancelFollow();
|
||||||
|
chatInputBuffer[0] = '\0';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// /assist command
|
// /assist command
|
||||||
if (cmdLower == "assist") {
|
if (cmdLower == "assist") {
|
||||||
gameHandler.assistTarget();
|
gameHandler.assistTarget();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue