Skip to content

Commit

Permalink
Rename ActiveCommandSet to ActiveCommandChanged.
Browse files Browse the repository at this point in the history
  • Loading branch information
saurtron committed Dec 24, 2024
1 parent 97025e8 commit 3ceead3
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions rts/Game/UI/GuiHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1455,9 +1455,9 @@ void CGuiHandler::SetActiveCommandIndex(int newIndex)
if (inCommand != newIndex) {
inCommand = newIndex;
if (inCommand < commands.size())
eventHandler.ActiveCommandSet(&commands[inCommand]);
eventHandler.ActiveCommandChanged(&commands[inCommand]);
else
eventHandler.ActiveCommandSet(nullptr);
eventHandler.ActiveCommandChanged(nullptr);

}
}
Expand Down
4 changes: 2 additions & 2 deletions rts/Lua/LuaHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3338,12 +3338,12 @@ string CLuaHandle::GetTooltip(int x, int y)

/*** Called when a command is issued.
*
* @function ActiveCommandSet
* @function ActiveCommandChanged
* @int cmdID|nil
* @tparam table|nil cmdParams
* @tparam cmdOpts|nil options
*/
void CLuaHandle::ActiveCommandSet(const SCommandDescription* cmdDesc)
void CLuaHandle::ActiveCommandChanged(const SCommandDescription* cmdDesc)
{
RECOIL_DETAILED_TRACY_ZONE;
LUA_CALL_IN_CHECK(L, false);
Expand Down
2 changes: 1 addition & 1 deletion rts/Lua/LuaHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class CLuaHandle : public CEventClient

bool DefaultCommand(const CUnit* unit, const CFeature* feature, int& cmd) override;

void ActiveCommandSet(const SCommandDescription* cmdDesc) override;
void ActiveCommandChanged(const SCommandDescription* cmdDesc) override;

bool CommandNotify(const Command& cmd) override;

Expand Down
2 changes: 1 addition & 1 deletion rts/System/EventClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void CEventClient::DownloadProgress(int ID, long downloaded, long total) {}
bool CEventClient::IsAbove(int x, int y) { return false; }
std::string CEventClient::GetTooltip(int x, int y) { return ""; }

void CEventClient::ActiveCommandSet(const SCommandDescription* cmdDesc) {}
void CEventClient::ActiveCommandChanged(const SCommandDescription* cmdDesc) {}
bool CEventClient::CommandNotify(const Command& cmd) { return false; }

bool CEventClient::AddConsoleLine(const std::string& msg, const std::string& section, int level) { return false; }
Expand Down
2 changes: 1 addition & 1 deletion rts/System/EventClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class CEventClient

virtual bool DefaultCommand(const CUnit* unit, const CFeature* feature, int& cmd);

virtual void ActiveCommandSet(const SCommandDescription* cmdDesc);
virtual void ActiveCommandChanged(const SCommandDescription* cmdDesc);
virtual bool CommandNotify(const Command& cmd);

virtual bool AddConsoleLine(const std::string& msg, const std::string& section, int level);
Expand Down
4 changes: 2 additions & 2 deletions rts/System/EventHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -762,10 +762,10 @@ template<typename T, typename F, typename... A> std::string ControlReverseIterat
return {};
}

void CEventHandler::ActiveCommandSet(const SCommandDescription* cmdDesc)
void CEventHandler::ActiveCommandChanged(const SCommandDescription* cmdDesc)
{
ZoneScoped;
ITERATE_EVENTCLIENTLIST(ActiveCommandSet, cmdDesc);
ITERATE_EVENTCLIENTLIST(ActiveCommandChanged, cmdDesc);
}

bool CEventHandler::CommandNotify(const Command& cmd)
Expand Down
2 changes: 1 addition & 1 deletion rts/System/EventHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class CEventHandler

void DefaultCommand(const CUnit* unit, const CFeature* feature, int& cmd);

void ActiveCommandSet(const SCommandDescription *cmdDesc);
void ActiveCommandChanged(const SCommandDescription *cmdDesc);
bool CommandNotify(const Command& cmd);

bool AddConsoleLine(const std::string& msg, const std::string& section, int level);
Expand Down
2 changes: 1 addition & 1 deletion rts/System/Events.def
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@

SETUP_EVENT(LastMessagePosition, MANAGED_BIT | UNSYNCED_BIT)
SETUP_EVENT(DefaultCommand, MANAGED_BIT | UNSYNCED_BIT | CONTROL_BIT)
SETUP_EVENT(ActiveCommandSet, MANAGED_BIT | UNSYNCED_BIT)
SETUP_EVENT(ActiveCommandChanged, MANAGED_BIT | UNSYNCED_BIT)
SETUP_EVENT(CommandNotify, MANAGED_BIT | UNSYNCED_BIT | CONTROL_BIT)
SETUP_EVENT(AddConsoleLine, MANAGED_BIT | UNSYNCED_BIT)
SETUP_EVENT(GroupChanged, MANAGED_BIT | UNSYNCED_BIT)
Expand Down

0 comments on commit 3ceead3

Please sign in to comment.