Merge with develop

--HG--
branch : compatibility-develop
hg/compatibility-develop
Nimetu 7 years ago
commit 6bb44135c0

@ -97,7 +97,6 @@
<action id="pa_free" name="uimGcmFree" handler="beast_order" params="order=free|beast_index=@UI:GCM_BEAST_SELECTED"/> <action id="pa_free" name="uimGcmFree" handler="beast_order" params="order=free|beast_index=@UI:GCM_BEAST_SELECTED"/>
<action id="pa_enter_stable" name="uimGcmEnterStable" handler="beast_order" params="order=enter_stable|beast_index=@UI:GCM_BEAST_SELECTED"/> <action id="pa_enter_stable" name="uimGcmEnterStable" handler="beast_order" params="order=enter_stable|beast_index=@UI:GCM_BEAST_SELECTED"/>
<action id="extract_rm" name="uimGcmExtractRM" handler="context_extract_rm" params="" /> <action id="extract_rm" name="uimGcmExtractRM" handler="context_extract_rm" params="" />
<action id="quit_team" name="uimGcmQuitTeam" handler="context_quit_team" params="" />
<action id="info" name="uimGcmInfo" handler="open_title_help" params="from=target" /> <action id="info" name="uimGcmInfo" handler="open_title_help" params="from=target" />
<action id="build_totem" name="uimGcmChooseBuilding" handler="build_totem" params="" /> <action id="build_totem" name="uimGcmChooseBuilding" handler="build_totem" params="" />
@ -107,6 +106,9 @@
<action id="move" name="uimGcmMove" handler="context_move" params="" /> <action id="move" name="uimGcmMove" handler="context_move" params="" />
<action id="stop" name="uimGcmStopMove" handler="context_stop" params="" /> <action id="stop" name="uimGcmStopMove" handler="context_stop" params="" />
<action id="unseat" name="uimUnmount" handler="beast_order" params="order=unmount|beast_index=0" /> <action id="unseat" name="uimUnmount" handler="beast_order" params="order=unmount|beast_index=0" />
<separator/>
<action id="quit_team" name="uimGcmQuitTeam" handler="context_quit_team" params="" />
</group> </group>
<!-- TEMPORARY FOR TESTS --> <!-- TEMPORARY FOR TESTS -->

@ -234,6 +234,8 @@
<group type="menu" id="options_macro" exit_click_b="true" extends="base_menu" > <group type="menu" id="options_macro" exit_click_b="true" extends="base_menu" >
<action name="uimMacroExec" handler="macros_exec" /> <action name="uimMacroExec" handler="macros_exec" />
<action name="uimMacroEdit" handler="macros_edit" /> <action name="uimMacroEdit" handler="macros_edit" />
<action name="uimMacroCopy" handler="macros_copy" />
<separator/>
<action name="uimMacroDel" handler="macros_del" /> <action name="uimMacroDel" handler="macros_del" />
</group> </group>
@ -324,6 +326,8 @@
<action name="uimMCMoveUp" handler="new_macro_cmd_move_up" /> <action name="uimMCMoveUp" handler="new_macro_cmd_move_up" />
<action name="uimMCMoveDown" handler="new_macro_cmd_move_down" /> <action name="uimMCMoveDown" handler="new_macro_cmd_move_down" />
<action name="uimMCEdit" handler="new_macro_cmd_edit" /> <action name="uimMCEdit" handler="new_macro_cmd_edit" />
<action name="uimMCCopy" handler="new_macro_cmd_copy" />
<separator/>
<action name="uimMCDel" handler="new_macro_cmd_delete" /> <action name="uimMCDel" handler="new_macro_cmd_delete" />
</group> </group>

@ -777,6 +777,25 @@ public:
}; };
REGISTER_ACTION_HANDLER( CHandlerNewMacroCmdEdit, "new_macro_cmd_edit"); REGISTER_ACTION_HANDLER( CHandlerNewMacroCmdEdit, "new_macro_cmd_edit");
// ***************************************************************************
// Called from context menu when we right click on a command of the new_macro container
class CHandlerNewMacroCmdCopy: public IActionHandler
{
public:
virtual void execute(CCtrlBase *pCaller, const string &/* Params */)
{
CMacroCmdManager *pMCM = CMacroCmdManager::getInstance();
sint nCmdNb = getCmdNbFromId(pCaller->getId());
pMCM->CurrentEditMacro.addCommand(pMCM->CurrentEditMacro.Commands[nCmdNb].Name,
pMCM->CurrentEditMacro.Commands[nCmdNb].Params,
nCmdNb);
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CMacroCmdManager::getInstance()->EditCmd->deactivate();
CAHManager::getInstance()->runActionHandler("new_macro_open",NULL);
}
};
REGISTER_ACTION_HANDLER( CHandlerNewMacroCmdCopy, "new_macro_cmd_copy");
// *************************************************************************** // ***************************************************************************
// Called from context menu when we right click on a command of the new_macro container // Called from context menu when we right click on a command of the new_macro container
class CHandlerNewMacroCmdDelete: public IActionHandler class CHandlerNewMacroCmdDelete: public IActionHandler
@ -1087,6 +1106,29 @@ public:
}; };
REGISTER_ACTION_HANDLER( CHandlerMacrosEdit, "macros_edit"); REGISTER_ACTION_HANDLER( CHandlerMacrosEdit, "macros_edit");
// ***************************************************************************
// Called from context menu on a macro
class CHandlerMacrosCopy : public IActionHandler
{
public:
virtual void execute(CCtrlBase *pCaller, const string &/* Params */)
{
sint nMacNb = getMacroFromId(pCaller->getId());
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CMacroCmdManager *pMCM = CMacroCmdManager::getInstance();
// duplicate selected macro
CMacroCmd m = pMCM->getMacros()[nMacNb];
m.ID = -1;
m.Combo.Key = KeyCount;
m.Combo.KeyButtons = noKeyButton;
pMCM->addMacro(m, nMacNb+1);
CAHManager::getInstance()->runActionHandler("macros_open",NULL);
}
};
REGISTER_ACTION_HANDLER( CHandlerMacrosCopy, "macros_copy");
// *************************************************************************** // ***************************************************************************
// Called from context menu on a macro // Called from context menu on a macro
class CHandlerMacrosDel : public IActionHandler class CHandlerMacrosDel : public IActionHandler

Loading…
Cancel
Save