diff --git a/code/ryzom/client/src/actions.cpp b/code/ryzom/client/src/actions.cpp index f6b24f5c5..599f7a637 100644 --- a/code/ryzom/client/src/actions.cpp +++ b/code/ryzom/client/src/actions.cpp @@ -59,7 +59,7 @@ void CAction::runAction () CInterfaceManager *IM = CInterfaceManager::getInstance (); if (IM) { - IM->runActionHandler (Name.Name, NULL, Name.Argu); + CAHManager::getInstance()->runActionHandler (Name.Name, NULL, Name.Argu); } } diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index 3f97ff83d..6b6c2b01b 100644 --- a/code/ryzom/client/src/commands.cpp +++ b/code/ryzom/client/src/commands.cpp @@ -1340,11 +1340,11 @@ NLMISC_COMMAND(ah, "Launch an action handler", " ") CInterfaceManager *pIM = CInterfaceManager::getInstance(); if (args.size() == 1) { - pIM->runActionHandler(args[0], NULL); + CAHManager::getInstance()->runActionHandler(args[0], NULL); } else { - pIM->runActionHandler(args[0], NULL, args[1]); + CAHManager::getInstance()->runActionHandler(args[0], NULL, args[1]); } return true; @@ -4016,14 +4016,14 @@ NLMISC_COMMAND(browse, "Browse a HTML document with the internal help web browse { if (args.size() != 1) return false; CInterfaceManager *im = CInterfaceManager::getInstance(); - im->runActionHandler("browse", NULL, "name=ui:interface:help_browser:content:html|url="+args[0]); + CAHManager::getInstance()->runActionHandler("browse", NULL, "name=ui:interface:help_browser:content:html|url="+args[0]); return true; } NLMISC_COMMAND(openRingWindow, "Browse the main page in the ring web browser.", "") { CInterfaceManager *im = CInterfaceManager::getInstance(); - im->runActionHandler("browse", NULL, "name=ui:interface:r2ed_web_admin:content:admin_web_page|url="+RingMainURL); + CAHManager::getInstance()->runActionHandler("browse", NULL, "name=ui:interface:r2ed_web_admin:content:admin_web_page|url="+RingMainURL); return true; } @@ -4031,7 +4031,7 @@ NLMISC_COMMAND(browseRingAdmin, "Browse a HTML document with the ring web browse { if (args.size() != 1) return false; CInterfaceManager *im = CInterfaceManager::getInstance(); - im->runActionHandler("browse", NULL, "name=ui:interface:r2ed_web_admin:content:admin_web_page|url="+args[0]); + CAHManager::getInstance()->runActionHandler("browse", NULL, "name=ui:interface:r2ed_web_admin:content:admin_web_page|url="+args[0]); return true; } @@ -4129,13 +4129,13 @@ NLMISC_COMMAND(GUKick, "kick a member", "") NLMISC_COMMAND(GUAccept, "accept an invitation", "") { - CInterfaceManager::getInstance()->runActionHandler("accept_guild_invitation",NULL); + CAHManager::getInstance()->runActionHandler("accept_guild_invitation",NULL); return true; } NLMISC_COMMAND(GURefuse, "refuse an invitation", "") { - CInterfaceManager::getInstance()->runActionHandler("refuse_guild_invitation",NULL); + CAHManager::getInstance()->runActionHandler("refuse_guild_invitation",NULL); return true; } @@ -5296,7 +5296,7 @@ bool CUserCommand::execute(const std::string &/* rawCommandString */, const std: } // Run the action handler - pIM->runActionHandler (mode->Action, pIM->getOldCaptureKeyboard(), finalArgs); + CAHManager::getInstance()->runActionHandler (mode->Action, pIM->getOldCaptureKeyboard(), finalArgs); } else { @@ -5763,7 +5763,7 @@ NLMISC_COMMAND(em, "emote command", "") emotePhrase += " "; emotePhrase += args[i]; } - pIM->runActionHandler("emote", NULL, "nb=0|behav=255|custom_phrase="+emotePhrase); + CAHManager::getInstance()->runActionHandler("emote", NULL, "nb=0|behav=255|custom_phrase="+emotePhrase); return true; } return false; diff --git a/code/ryzom/client/src/connection.cpp b/code/ryzom/client/src/connection.cpp index e6017ea6b..86f26961f 100644 --- a/code/ryzom/client/src/connection.cpp +++ b/code/ryzom/client/src/connection.cpp @@ -1161,7 +1161,7 @@ TInterfaceState globalMenu() } // Auto-selection for fast launching (dev only) - pIM->runActionHandler("launch_game", NULL, toString("slot=%d|edit_mode=0", ClientCfg.SelectCharacter)); + CAHManager::getInstance()->runActionHandler("launch_game", NULL, toString("slot=%d|edit_mode=0", ClientCfg.SelectCharacter)); } } @@ -2179,7 +2179,7 @@ public: if (pCB != NULL) { pCB->setPushed(true); - pIM->runActionHandler (pCB->getActionOnLeftClick(), pCB, pCB->getParamsOnLeftClick()); + CAHManager::getInstance()->runActionHandler (pCB->getActionOnLeftClick(), pCB, pCB->getParamsOnLeftClick()); } } pList->invalidateCoords(); @@ -2419,7 +2419,7 @@ public: if (pCB != NULL) { pCB->setPushed(true); - pIM->runActionHandler (pCB->getActionOnLeftClick(), pCB, pCB->getParamsOnLeftClick()); + CAHManager::getInstance()->runActionHandler (pCB->getActionOnLeftClick(), pCB, pCB->getParamsOnLeftClick()); } } } @@ -3229,7 +3229,7 @@ class CAHLoadScenario : public IActionHandler CViewText* pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); if (pVT != NULL) pVT->setText(CI18N::get("uiRingWarningFreeTrial")); - pIM->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); + CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); return; } @@ -3310,7 +3310,7 @@ class CAHLoadScenario : public IActionHandler CViewText* pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); if (pVT != NULL) pVT->setText(CI18N::get("uiRingWarningFreeTrial")); - pIM->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); + CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); } @@ -3339,7 +3339,7 @@ class CAHLoadScenario : public IActionHandler CViewText* pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); if (pVT != NULL) pVT->setText(CI18N::get("uiRingWarningInviteFreeTrial")); - pIM->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); + CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); } } } diff --git a/code/ryzom/client/src/cursor_functions.cpp b/code/ryzom/client/src/cursor_functions.cpp index 7e64c644e..ef9c5fcb3 100644 --- a/code/ryzom/client/src/cursor_functions.cpp +++ b/code/ryzom/client/src/cursor_functions.cpp @@ -890,7 +890,7 @@ void contextWebIG(bool rightClick, bool dblClick) { if (pGC != NULL) pGC->setActive(false); - IM->runActionHandler("browse", NULL, "name=ui:interface:webig:content:html|url="+selectedInstanceURL); + CAHManager::getInstance()->runActionHandler("browse", NULL, "name=ui:interface:webig:content:html|url="+selectedInstanceURL); } }// contextWebIG // diff --git a/code/ryzom/client/src/far_tp.cpp b/code/ryzom/client/src/far_tp.cpp index cb3387873..5b4b28c99 100644 --- a/code/ryzom/client/src/far_tp.cpp +++ b/code/ryzom/client/src/far_tp.cpp @@ -519,7 +519,7 @@ void CLoginStateMachine::run() // Far TP part 1.1: From the ingame main loop, the admin html box gives us an event ev_connect for the destination shard. // Note: the admin html box is run by CInputHandlerManager::getInstance()->pumpEvents() in the main loop. // Tip: to see where a co-task is resumed from, just add a breakpoint on the end of CCoTask::resume(). - CInterfaceManager::getInstance()->runActionHandler("quit_ryzom", NULL, ""); + CAHManager::getInstance()->runActionHandler("quit_ryzom", NULL, ""); if (!FarTP.isIngame()) // assumes there is no Far TP starting between char selection and main loop, see below { @@ -859,8 +859,8 @@ retryJoinEdit: if ( letReturnToCharSelect ) { // // Hide all buttons except Quit. If !requestRetToMainland, we will show them back at the end of connectToNewShard(). -// pIM->runActionHandler( "proc", NULL, "charsel_disable_buttons" ); -// pIM->runActionHandler( "set", NULL, "target_property=ui:outgame:charsel:quit_but:active|value=1" ); +// CAHManager::getInstance()->runActionHandler( "proc", NULL, "charsel_disable_buttons" ); +// CAHManager::getInstance()->runActionHandler( "set", NULL, "target_property=ui:outgame:charsel:quit_but:active|value=1" ); CInterfaceElement *btnOk = CWidgetManager::getInstance()->getElementFromId("ui:outgame:charsel:message_box:ok"); if (btnOk) @@ -926,12 +926,12 @@ retryJoinEdit: else if ( letReturnToCharSelect ) { // Show all buttons except 'New character' so that the character can retry entering game or choose another character. - pIM->runActionHandler( "proc", NULL, "charsel_enable_buttons" ); - pIM->runActionHandler( "set", NULL, "target_property=ui:outgame:charsel:create_new_but:active|value=0" ); + CAHManager::getInstance()->runActionHandler( "proc", NULL, "charsel_enable_buttons" ); + CAHManager::getInstance()->runActionHandler( "set", NULL, "target_property=ui:outgame:charsel:create_new_but:active|value=0" ); CInterfaceGroup* charselGroup = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:outgame:charsel")); if(charselGroup) - pIM->runActionHandler( "proc", charselGroup, "charsel_init_buttons" ); + CAHManager::getInstance()->runActionHandler( "proc", charselGroup, "charsel_init_buttons" ); } return false; diff --git a/code/ryzom/client/src/interface_v3/action_handler.cpp b/code/ryzom/client/src/interface_v3/action_handler.cpp index b1aa1fa79..6ec889ca4 100644 --- a/code/ryzom/client/src/interface_v3/action_handler.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler.cpp @@ -201,6 +201,78 @@ void CAHManager::parseAH(xmlNodePtr cur, const char *ahId, const char *paramId, } } +// ------------------------------------------------------------------------------------------------ +void CAHManager::runActionHandler (const string &ahCmdLine, CCtrlBase *pCaller, const string &ahUserParams) +{ + if (ahCmdLine.empty()) return; + + // Special AH form ("ah:params") ? + string::size_type i = ahCmdLine.find(':'); + string ahName; + string ahParams; + if(i!=string::npos) + { + ahName= ahCmdLine.substr(0, i); + ahParams= ahCmdLine.substr(i+1); + } + else + { + ahName= ahCmdLine; + } + + // Replace params if defined + if(!ahUserParams.empty()) + ahParams= ahUserParams; + + // Execute the action handler + map::iterator it = FactoryMap.find (ahName); + if (it == FactoryMap.end()) + { + nlwarning ("not found action handler : %s",ahName.c_str()); + return; + } + IActionHandler *pAH = it->second; + pAH->execute (pCaller, ahParams); + + // Quick Help + const string submitQuickHelp = "submit_quick_help"; + it = FactoryMap.find(submitQuickHelp); + if(it == FactoryMap.end()) + { + nlwarning ("not found action handler : %s", submitQuickHelp.c_str()); + return; + } + pAH = it->second; + const std::string event = ahName + ":" + ahParams; + pAH->execute(NULL, event); +} + +// ------------------------------------------------------------------------------------------------ +void CAHManager::runActionHandler (IActionHandler *pAH, CCtrlBase *pCaller, const std::string &Params) +{ + if (pAH == NULL) + { + nlwarning ("no action handler"); + return; + } + pAH->execute (pCaller, Params); + string AHName = CAHManager::getInstance()->getAHName(pAH); + + // Quick Help + const string submitQuickHelp = "submit_quick_help"; + map::iterator it = FactoryMap.find (AHName); + it = FactoryMap.find(submitQuickHelp); + if(it == FactoryMap.end()) + { + nlwarning ("not found action handler : %s", submitQuickHelp.c_str()); + return; + } + pAH = it->second; + const std::string event = AHName + ":" + Params; + pAH->execute(NULL, event); +} + + // ------------------------------------------------------------------------------------------------ class CAHSet : public IActionHandler { diff --git a/code/ryzom/client/src/interface_v3/action_handler.h b/code/ryzom/client/src/interface_v3/action_handler.h index e86471a58..b4234335c 100644 --- a/code/ryzom/client/src/interface_v3/action_handler.h +++ b/code/ryzom/client/src/interface_v3/action_handler.h @@ -100,7 +100,10 @@ public: void parseAH(xmlNodePtr cur, const char *ahId, const char *paramId, IActionHandler *&ahRet, class CStringShared ¶ms); /// Get the AH name from ptr - const std::string &getAHName(IActionHandler *pAH) { return getActionHandlerName(pAH); } + const std::string &getAHName(IActionHandler *pAH){ return getActionHandlerName(pAH); } + + void runActionHandler(const std::string &AHName, CCtrlBase *pCaller, const std::string &Params=std::string("") ); + void runActionHandler(IActionHandler *ah, CCtrlBase *pCaller, const std::string &Params=std::string("") ); private: CAHManager(){} diff --git a/code/ryzom/client/src/interface_v3/action_handler_edit.cpp b/code/ryzom/client/src/interface_v3/action_handler_edit.cpp index dc1c64f4f..042f2788b 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_edit.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_edit.cpp @@ -511,7 +511,7 @@ protected: if (!_GroupEdit->getAHOnChange().empty()) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler(_GroupEdit->getAHOnChange(), _GroupEdit, _GroupEdit->getParamsOnChange()); + CAHManager::getInstance()->runActionHandler(_GroupEdit->getAHOnChange(), _GroupEdit, _GroupEdit->getParamsOnChange()); } } // else cut forwards @@ -524,7 +524,7 @@ protected: if (!_GroupEdit->getAHOnChange().empty()) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler(_GroupEdit->getAHOnChange(), _GroupEdit, _GroupEdit->getParamsOnChange()); + CAHManager::getInstance()->runActionHandler(_GroupEdit->getAHOnChange(), _GroupEdit, _GroupEdit->getParamsOnChange()); } } // must stop selection in all case diff --git a/code/ryzom/client/src/interface_v3/action_handler_game.cpp b/code/ryzom/client/src/interface_v3/action_handler_game.cpp index 6d5ea3f5d..39fff2c6d 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_game.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_game.cpp @@ -185,7 +185,7 @@ public: { ucstring name = CEntityCL::removeTitleAndShardFromName(selection->getEntityName()); if (name.empty()) return; - im->runActionHandler("enter_tell", pCaller, "player=" + name.toString()); + CAHManager::getInstance()->runActionHandler("enter_tell", pCaller, "player=" + name.toString()); } } protected: @@ -942,7 +942,7 @@ public: { // directly launch the quit_team AH. CInterfaceManager *pIM= CInterfaceManager::getInstance(); - pIM->runActionHandler("quit_team",pCaller, sParams); + CAHManager::getInstance()->runActionHandler("quit_team",pCaller, sParams); } protected: }; @@ -1026,7 +1026,7 @@ public: (typeProp != NULL) && (typeProp->getValue32() == ANIMAL_TYPE::Mount)) { beastOrder("mount", toString(i+1)); // why +1 ? : dixit sendAnimalCommand in EGS : index 0 = all animals, 1 = animal 0 etc - pIM->runActionHandler("animal_target", NULL, toString(i+1)); + CAHManager::getInstance()->runActionHandler("animal_target", NULL, toString(i+1)); UserEntity->moveTo(UserEntity->selection(),2.0,CUserEntity::None); } } @@ -1181,7 +1181,7 @@ public: if(!FreeTrial) { CInterfaceManager *pIM= CInterfaceManager::getInstance(); - pIM->runActionHandler("quit_ryzom", NULL); + CAHManager::getInstance()->runActionHandler("quit_ryzom", NULL); } } }; @@ -1232,7 +1232,7 @@ public: { // send a message to server, thru cancel cast CInterfaceManager *pIM= CInterfaceManager::getInstance(); - pIM->runActionHandler("phrase_cancel_cast", NULL); + CAHManager::getInstance()->runActionHandler("phrase_cancel_cast", NULL); } paying_account_request = false; paying_account_already_request = false; @@ -1260,10 +1260,10 @@ public: else { paying_account_already_request = true; - pIM->runActionHandler("quit_ryzom", NULL); + CAHManager::getInstance()->runActionHandler("quit_ryzom", NULL); } - pIM->runActionHandler("leave_modal", NULL); + CAHManager::getInstance()->runActionHandler("leave_modal", NULL); } }; REGISTER_ACTION_HANDLER( CAHCloseFreeTrialQuitting, "close_free_trial_game_quitting"); @@ -1509,7 +1509,7 @@ public: string beastIndex; if( CInterfaceExpr::evalAsString(getParam(Params,"beast_index"), beastIndex) ) { - pIM->runActionHandler("animal_target", NULL, beastIndex); + CAHManager::getInstance()->runActionHandler("animal_target", NULL, beastIndex); } // move to the beast UserEntity->moveTo(UserEntity->selection(),3.0,CUserEntity::Mount); @@ -1889,7 +1889,7 @@ public: pIG->setActive(true); // browse the url - pIM->runActionHandler("browse", NULL, "name="+helpContainer+":content:html|url="+url); + CAHManager::getInstance()->runActionHandler("browse", NULL, "name="+helpContainer+":content:html|url="+url); } }; REGISTER_ACTION_HANDLER( CAHLaunchHelp, "launch_help"); @@ -2943,7 +2943,7 @@ public: else pBut->setPushed(true); } - pIM->runActionHandler("game_config_change_vid_fullscreen",NULL); + CAHManager::getInstance()->runActionHandler("game_config_change_vid_fullscreen",NULL); // **** Init Texture Size Modes // init the combo box, according to Texture Installed or not @@ -3825,13 +3825,13 @@ void runMissionProc(sint32 nSelected) { string sButtonPath = UI_MISSION_LIST ":b_title"+toString(nSelected); CCtrlButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sButtonPath)); - pIM->runActionHandler("proc", pCB, "mission_proc_title|"+toString(nSelected)); + CAHManager::getInstance()->runActionHandler("proc", pCB, "mission_proc_title|"+toString(nSelected)); } else if (nSelected < (nNbMission+nNbGroupMission)) { string sButtonPath = UI_MISSION_LIST ":b_group_title"+toString(nSelected-nNbMission); CCtrlButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sButtonPath)); - pIM->runActionHandler("proc", pCB, "group_mission_proc_title|"+toString(nSelected-nNbMission)); + CAHManager::getInstance()->runActionHandler("proc", pCB, "group_mission_proc_title|"+toString(nSelected-nNbMission)); } return; } diff --git a/code/ryzom/client/src/interface_v3/action_handler_help.cpp b/code/ryzom/client/src/interface_v3/action_handler_help.cpp index 7004f31c9..6a93a9da3 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_help.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_help.cpp @@ -656,7 +656,7 @@ class CHandlerOpenTitleHelp : public IActionHandler ucstring name = peopleList->getName(index); if ( ! name.empty()) { - CInterfaceManager::getInstance()->runActionHandler("show_hide", pCaller, "profile|pname="+name.toUtf8()+"|ptype="+toString((int)CEntityCL::Player)); + CAHManager::getInstance()->runActionHandler("show_hide", pCaller, "profile|pname="+name.toUtf8()+"|ptype="+toString((int)CEntityCL::Player)); } return; } @@ -697,7 +697,7 @@ class CHandlerOpenTitleHelp : public IActionHandler } } if(!name.empty()) - CInterfaceManager::getInstance()->runActionHandler("show_hide", pCaller, "profile|pname="+name.toUtf8()+"|ptype="+toString((int)selection->Type)); + CAHManager::getInstance()->runActionHandler("show_hide", pCaller, "profile|pname="+name.toUtf8()+"|ptype="+toString((int)selection->Type)); return; } } @@ -994,7 +994,7 @@ class CHandlerBrowse : public IActionHandler CInterfaceManager::parseTokens(ucparams); params = ucparams.toUtf8(); // go. NB: the action handler himself may translate params from utf8 - CInterfaceManager::getInstance()->runActionHandler(action, elementGroup, params); + CAHManager::getInstance()->runActionHandler(action, elementGroup, params); // Next name start = end+2; @@ -3913,7 +3913,7 @@ void updateStatReport () if ((ingameTime0 () <= time4StatReport) && (ingameTime1 () > time4StatReport)) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler ("proc", NULL, "proc_stat_report"); + CAHManager::getInstance()->runActionHandler ("proc", NULL, "proc_stat_report"); } } diff --git a/code/ryzom/client/src/interface_v3/action_handler_item.cpp b/code/ryzom/client/src/interface_v3/action_handler_item.cpp index 16b7cdc68..511b59c2e 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_item.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_item.cpp @@ -1498,7 +1498,7 @@ class CHandlerMoveItem : public IActionHandler if (pLS->getSheet(i)->getSheetId() == 0) { // Send swap_item - pIM->runActionHandler("swap_item", pLS->getSheet(i), "src="+toString(pCaller->getId())); + CAHManager::getInstance()->runActionHandler("swap_item", pLS->getSheet(i), "src="+toString(pCaller->getId())); return; } } @@ -1563,7 +1563,7 @@ class CHandlerMoveItem : public IActionHandler (pCS->getSheetId() == 0) && pCS->canDropItem(item) && (!pCS->getGrayed())) { // Send swap_item - pIM->runActionHandler("swap_item", pCS, "src="+toString(pCaller->getId())); + CAHManager::getInstance()->runActionHandler("swap_item", pCS, "src="+toString(pCaller->getId())); return; } } @@ -1597,7 +1597,7 @@ class CHandlerMoveItem : public IActionHandler if ((pCS->canDropItem(item)) && (!pCS->getGrayed())) { // Send swap_item - pIM->runActionHandler("swap_item", pCS, "src="+toString(pCaller->getId())); + CAHManager::getInstance()->runActionHandler("swap_item", pCS, "src="+toString(pCaller->getId())); return; } } @@ -1629,7 +1629,7 @@ class CHandlerDragNDrop : public IActionHandler CDBCtrlSheet *pCSsrc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sSrc)); CDBCtrlSheet *pCSdst = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sDst)); if ((pCSdst == NULL) || (pCSsrc == NULL) || sAH.empty()) return; - pIM->runActionHandler(sAH, pCSdst, "src="+pCSsrc->getId()); + CAHManager::getInstance()->runActionHandler(sAH, pCSdst, "src="+pCSsrc->getId()); } }; REGISTER_ACTION_HANDLER( CHandlerDragNDrop, "drag_n_drop" ); @@ -1657,7 +1657,7 @@ class CHandlerItemCristalEnchant : public IActionHandler void execute (CCtrlBase *pCaller, const std::string &sParams) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler("item_cristal_reload", pCaller, sParams); + CAHManager::getInstance()->runActionHandler("item_cristal_reload", pCaller, sParams); } }; REGISTER_ACTION_HANDLER( CHandlerItemCristalEnchant, "item_cristal_enchant" ); diff --git a/code/ryzom/client/src/interface_v3/action_handler_outpost.cpp b/code/ryzom/client/src/interface_v3/action_handler_outpost.cpp index c544594d5..f38ecdfe7 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_outpost.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_outpost.cpp @@ -180,7 +180,7 @@ public: sendMsgToServer("OUTPOST:INSERT_SQUAD", getOutpostSheet(), nSquadSlot); // Then set the selected squad at this place - pIM->runActionHandler("outpost_set_squad", pCaller, sParams); + CAHManager::getInstance()->runActionHandler("outpost_set_squad", pCaller, sParams); } }; REGISTER_ACTION_HANDLER(COutpostInsertSquad, "outpost_insert_squad"); @@ -410,7 +410,7 @@ public: node->setValue32(localToGmt(attPeriod)); // Nead to resend a Declare War Start (because wanted Att Hour changed) - pIM->runActionHandler("outpost_declare_war_start", pCaller); + CAHManager::getInstance()->runActionHandler("outpost_declare_war_start", pCaller); } }; REGISTER_ACTION_HANDLER(CAHOutpostSelectAttPeriod, "outpost_select_att_period"); diff --git a/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp b/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp index 551c17f5c..2eda5c560 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp @@ -250,7 +250,7 @@ public: { // Act as if the player click on this button CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler(button->getActionOnLeftClick(), button, button->getParamsOnLeftClick() ); + CAHManager::getInstance()->runActionHandler(button->getActionOnLeftClick(), button, button->getParamsOnLeftClick() ); } } }; @@ -721,7 +721,7 @@ public: string mode = getParam(Params, "mode"); //default mode is copy if (mode == "cut") //need delete src { - CInterfaceManager::getInstance()->runActionHandler("forget_phrase_or_macro", ctrl); + CAHManager::getInstance()->runActionHandler("forget_phrase_or_macro", ctrl); } } } @@ -895,7 +895,7 @@ void CHandlerMemorizePhraseOrMacro::execute (CCtrlBase *pCaller, const string &P memorizePhraseOrMacro(dstMemoryIndex, srcIsMacro, srcPhraseId, srcMacroId); // forget src (after shorctut change!) - pIM->runActionHandler("forget_phrase_or_macro", pCSSrc); + CAHManager::getInstance()->runActionHandler("forget_phrase_or_macro", pCSSrc); } } } @@ -1273,9 +1273,9 @@ public: { // run the standard cast case. if(ctrl->isMacro()) - pIM->runActionHandler("cast_macro", ctrl); + CAHManager::getInstance()->runActionHandler("cast_macro", ctrl); else - pIM->runActionHandler("cast_phrase", ctrl); + CAHManager::getInstance()->runActionHandler("cast_phrase", ctrl); } } } @@ -1303,7 +1303,7 @@ public: // if a phrase is on this slot, just cast the phrase if(phraseId) { - pIM->runActionHandler("cast_phrase", pCaller, Params); + CAHManager::getInstance()->runActionHandler("cast_phrase", pCaller, Params); } // else open the RightMenuEmpty, to have "NewAction" else @@ -1339,7 +1339,7 @@ public: CDBCtrlSheet *ctrl= dynamic_cast(parent->getCtrl("ctrl_phrase")); if(ctrl) { - pIM->runActionHandler(ctrl->getActionOnRightClick(), ctrl, ctrl->getParamsOnRightClick()); + CAHManager::getInstance()->runActionHandler(ctrl->getActionOnRightClick(), ctrl, ctrl->getParamsOnRightClick()); } } diff --git a/code/ryzom/client/src/interface_v3/action_handler_ui.cpp b/code/ryzom/client/src/interface_v3/action_handler_ui.cpp index 745b89d57..d4e83c4fb 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_ui.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_ui.cpp @@ -233,9 +233,9 @@ class CAHUIPopupPopin : public IActionHandler } if (!isContainerAuthorized(pGC)) return; if (pGC->isPopuped()) - pIM->runActionHandler("popin", NULL, Params); + CAHManager::getInstance()->runActionHandler("popin", NULL, Params); else - pIM->runActionHandler("popup", NULL, Params); + CAHManager::getInstance()->runActionHandler("popup", NULL, Params); } }; REGISTER_ACTION_HANDLER( CAHUIPopupPopin, "popup_popin" ); @@ -561,7 +561,7 @@ class CAHTalkUntalk : public IActionHandler double distanceSquare = pow(vect1.x-vect2.x,2) + pow(vect1.y-vect2.y,2); if(distanceSquare <= MaxTalkingDistSquare) { - pIM->runActionHandler("context_talk",NULL); + CAHManager::getInstance()->runActionHandler("context_talk",NULL); } } } @@ -593,7 +593,7 @@ class CAHMountUnmount : public IActionHandler else if(UserEntity->isRiding()) { // We are currently mounted so unmount - pIM->runActionHandler("context_unseat",NULL); + CAHManager::getInstance()->runActionHandler("context_unseat",NULL); } // Not in combat mode. else @@ -607,7 +607,7 @@ class CAHMountUnmount : public IActionHandler if(distanceSquare <= MaxTalkingDistSquare) { // Ok lets mount - pIM->runActionHandler("context_mount",NULL); + CAHManager::getInstance()->runActionHandler("context_mount",NULL); } } } @@ -638,7 +638,7 @@ class CAHExchange : public IActionHandler { if (selection && selection->properties().canExchangeItem()) if (!UserEntity->isBusy()) - pIM->runActionHandler("context_exchange",NULL); + CAHManager::getInstance()->runActionHandler("context_exchange",NULL); } } }; diff --git a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp index b6b797246..89ffb9f65 100644 --- a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp +++ b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp @@ -1219,7 +1219,7 @@ public: if( button && !button->getFrozen() ) { // Act as if the player click on this button - pIM->runActionHandler("phrase_faber_validate", button ); + CAHManager::getInstance()->runActionHandler("phrase_faber_validate", button ); } } }; diff --git a/code/ryzom/client/src/interface_v3/ctrl_base_button.cpp b/code/ryzom/client/src/interface_v3/ctrl_base_button.cpp index 4584ac003..dbcc1c9aa 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_base_button.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_base_button.cpp @@ -229,7 +229,7 @@ bool CCtrlBaseButton::handleEvent (const NLGUI::CEventDescriptor& event) { if ((CCtrlBaseButton *) _LastLeftClickButton == this && (T1 - _LastLeftClickDate) < pIM->getUserDblClickDelay()) { - pIM->runActionHandler (_AHOnLeftDblClick, this, _AHLeftDblClickParams); + CAHManager::getInstance()->runActionHandler (_AHOnLeftDblClick, this, _AHLeftDblClickParams); _LeftDblClickHandled = true; _LastLeftClickButton = NULL; return true; @@ -279,7 +279,7 @@ bool CCtrlBaseButton::handleEvent (const NLGUI::CEventDescriptor& event) { //nlinfo("clicked on %s", _Id.c_str()); pIM->submitEvent ("button_click:"+getId());//TEMP - pIM->runActionHandler (_AHOnLeftClick, this, _AHLeftClickParams); + CAHManager::getInstance()->runActionHandler (_AHOnLeftClick, this, _AHLeftClickParams); //pIM->submitEvent ("button_click:"+getId()); } */ @@ -316,7 +316,7 @@ bool CCtrlBaseButton::handleEvent (const NLGUI::CEventDescriptor& event) if(_AHOnRightClick != NULL) { handled= true; - pIM->runActionHandler (_AHOnRightClick, this, _AHRightClickParams); + CAHManager::getInstance()->runActionHandler (_AHOnRightClick, this, _AHRightClickParams); } if (pIM->getCapturePointerRight() == NULL) return true; // if this become NULL, this ctrl has been deleted // Run Menu @@ -339,7 +339,7 @@ bool CCtrlBaseButton::handleEvent (const NLGUI::CEventDescriptor& event) if (_AHOnClockTick != NULL) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler(_AHOnClockTick, this, _AHClockTickParams); + CAHManager::getInstance()->runActionHandler(_AHOnClockTick, this, _AHClockTickParams); } CInterfaceManager *pIM = CInterfaceManager::getInstance(); @@ -355,7 +355,7 @@ bool CCtrlBaseButton::handleEvent (const NLGUI::CEventDescriptor& event) if ((T1 - _LeftLongClickDate) > repeatDelay) { _LeftLongClickHandled = true; - pIM->runActionHandler(_AHOnLeftLongClick, this, _AHLeftLongClickParams); + CAHManager::getInstance()->runActionHandler(_AHOnLeftLongClick, this, _AHLeftLongClickParams); } } } @@ -504,7 +504,7 @@ void CCtrlBaseButton::runLeftClickAction() //nlinfo("clicked on %s", _Id.c_str()); pIM->submitEvent ("button_click:"+getId());//TEMP - pIM->runActionHandler (_AHOnLeftClick, this, _AHLeftClickParams); + CAHManager::getInstance()->runActionHandler (_AHOnLeftClick, this, _AHLeftClickParams); //pIM->submitEvent ("button_click:"+getId()); } } diff --git a/code/ryzom/client/src/interface_v3/ctrl_button.cpp b/code/ryzom/client/src/interface_v3/ctrl_button.cpp index 112759519..cbccfc131 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_button.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_button.cpp @@ -224,7 +224,7 @@ void CCtrlButton::draw () { if ((lastOver == false) && (_AHOnOver != NULL)) - pIM->runActionHandler (_AHOnOver, this, _AHOverParams); + CAHManager::getInstance()->runActionHandler (_AHOnOver, this, _AHOverParams); // the pointer is over the button color= getCurrentColorOver(globalColor); diff --git a/code/ryzom/client/src/interface_v3/ctrl_col_pick.cpp b/code/ryzom/client/src/interface_v3/ctrl_col_pick.cpp index 70a1856e8..6e38caf46 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_col_pick.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_col_pick.cpp @@ -187,7 +187,7 @@ void CCtrlColPick::selectColor (sint32 x, sint32 y) _ColSelA.setSInt32(_ColorSelect.A); if (!_AHOnChange.empty()) - pIM->runActionHandler(_AHOnChange, this, _AHOnChangeParams); + CAHManager::getInstance()->runActionHandler(_AHOnChange, this, _AHOnChangeParams); } // ------------------------------------------------------------------------------------------------ diff --git a/code/ryzom/client/src/interface_v3/ctrl_scroll.cpp b/code/ryzom/client/src/interface_v3/ctrl_scroll.cpp index f77bb4397..59c5ca636 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_scroll.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_scroll.cpp @@ -70,7 +70,7 @@ void CCtrlScroll::runAH(const std::string &name, const std::string ¶ms) if (_CallingAH) return; // avoid infinite loop CInterfaceManager *pIM = CInterfaceManager::getInstance(); _CallingAH = true; - pIM->runActionHandler(name, this, params); + CAHManager::getInstance()->runActionHandler(name, this, params); _CallingAH = false; } diff --git a/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp b/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp index 9014ebdc8..ad791b5c1 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp @@ -365,7 +365,7 @@ void CCtrlTextButton::draw () if (_Over && (_OverWhenPushed || !(_Pushed || pIM->getCapturePointerLeft() == this))) { if ((lastOver == false) && (_AHOnOver != NULL)) - pIM->runActionHandler (_AHOnOver, this, _AHOverParams); + CAHManager::getInstance()->runActionHandler (_AHOnOver, this, _AHOverParams); // the pointer is over the button. color= getCurrentColorOver(globalColor); diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp index c42e1699b..d00d0ba77 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp @@ -1881,7 +1881,7 @@ void CDBCtrlSheet::draw() params = sTmp + "|" + params; } } - pIM->runActionHandler (_AHOnCanDrop, this, params); + CAHManager::getInstance()->runActionHandler (_AHOnCanDrop, this, params); } } } @@ -2633,7 +2633,7 @@ bool CDBCtrlSheet::handleEvent (const NLGUI::CEventDescriptor &event) if (validClic && _AHOnCanDrag != NULL) { _TempCanDrag= true; - pIM->runActionHandler (_AHOnCanDrag, this, _AHCanDragParams); + CAHManager::getInstance()->runActionHandler (_AHOnCanDrag, this, _AHCanDragParams); validClic= _TempCanDrag; } @@ -2650,7 +2650,7 @@ bool CDBCtrlSheet::handleEvent (const NLGUI::CEventDescriptor &event) if (_AHOnDrag != NULL) { - pIM->runActionHandler (_AHOnDrag, this, _AHDragParams); + CAHManager::getInstance()->runActionHandler (_AHOnDrag, this, _AHDragParams); } } } @@ -2698,7 +2698,7 @@ bool CDBCtrlSheet::handleEvent (const NLGUI::CEventDescriptor &event) params = sTmp + "|" + params; } } - pIM->runActionHandler (pCSdest->_AHOnCanDrop, pCSdest, params); + CAHManager::getInstance()->runActionHandler (pCSdest->_AHOnCanDrop, pCSdest, params); // Drop only if canDrop. if(pCSdest->_CanDrop) @@ -2719,7 +2719,7 @@ bool CDBCtrlSheet::handleEvent (const NLGUI::CEventDescriptor &event) } } // call action - pIM->runActionHandler (pCSdest->_AHOnDrop, pCSdest, params); + CAHManager::getInstance()->runActionHandler (pCSdest->_AHOnDrop, pCSdest, params); handled = true; } } @@ -2763,7 +2763,7 @@ bool CDBCtrlSheet::handleEvent (const NLGUI::CEventDescriptor &event) params = sTmp + "|" + params; } } - pIM->runActionHandler (pList->getCtrlSheetInfo()._AHOnCanDrop, pList, params); + CAHManager::getInstance()->runActionHandler (pList->getCtrlSheetInfo()._AHOnCanDrop, pList, params); // Drop only if canDrop. if(pList->getCanDrop()) @@ -2784,7 +2784,7 @@ bool CDBCtrlSheet::handleEvent (const NLGUI::CEventDescriptor &event) } } // call action - pIM->runActionHandler (pList->getCtrlSheetInfo()._AHOnDrop, pList, params); + CAHManager::getInstance()->runActionHandler (pList->getCtrlSheetInfo()._AHOnDrop, pList, params); handled = true; } } @@ -2799,7 +2799,7 @@ bool CDBCtrlSheet::handleEvent (const NLGUI::CEventDescriptor &event) string sTmp = pTextList->getCtrlSheetInfo()._AHCanDropParams; params = sTmp + "|" + params; } - pIM->runActionHandler (pTextList->getCtrlSheetInfo()._AHOnCanDrop, pTextList, params); + CAHManager::getInstance()->runActionHandler (pTextList->getCtrlSheetInfo()._AHOnCanDrop, pTextList, params); // Drop only if canDrop. if(pTextList->getCanDrop()) @@ -2812,7 +2812,7 @@ bool CDBCtrlSheet::handleEvent (const NLGUI::CEventDescriptor &event) params = sTmp + "|" + params; // must copy 'drop' params at start because it could be the name of a procedure } // call action - pIM->runActionHandler (pTextList->getCtrlSheetInfo()._AHOnDrop, pTextList, params); + CAHManager::getInstance()->runActionHandler (pTextList->getCtrlSheetInfo()._AHOnDrop, pTextList, params); handled = true; } } @@ -2822,7 +2822,7 @@ bool CDBCtrlSheet::handleEvent (const NLGUI::CEventDescriptor &event) if (!handled && _AHOnCannotDrop != NULL ) { - pIM->runActionHandler (_AHOnCannotDrop, this, _AHCannotDropParams); + CAHManager::getInstance()->runActionHandler (_AHOnCannotDrop, this, _AHCannotDropParams); handled = true; } @@ -2854,7 +2854,7 @@ bool CDBCtrlSheet::handleEvent (const NLGUI::CEventDescriptor &event) // RunAction if(_AHOnLeftClick != NULL) - pIM->runActionHandler (_AHOnLeftClick, this, _AHLeftClickParams); + CAHManager::getInstance()->runActionHandler (_AHOnLeftClick, this, _AHLeftClickParams); // Run Menu (if item is not being dragged) if (!_ListMenuLeft.empty() && _LastDraggedSheet == NULL) { @@ -2884,7 +2884,7 @@ bool CDBCtrlSheet::handleEvent (const NLGUI::CEventDescriptor &event) if(_AHOnRightClick != NULL) { handled= true; - pIM->runActionHandler (_AHOnRightClick, this, _AHRightClickParams); + CAHManager::getInstance()->runActionHandler (_AHOnRightClick, this, _AHRightClickParams); } // Run Menu (if item is not being dragged) if (!_ListMenuRight.empty() || !_ListMenuRightEmptySlot.empty()) diff --git a/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp b/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp index 30d25ba22..f376c306a 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp @@ -295,7 +295,7 @@ void CDBGroupComboBox::setSelection(sint32 val) if (!_CallingOnChangeActionHandler) { _CallingOnChangeActionHandler = true; - CInterfaceManager::getInstance()->runActionHandler (_AHOnChange, this, _AHOnChangeParams); + CAHManager::getInstance()->runActionHandler (_AHOnChange, this, _AHOnChangeParams); _CallingOnChangeActionHandler = false; } } @@ -578,7 +578,7 @@ public: // After menu init, Call user activation method if( !pCB->_AHOnSelectStart.empty() ) { - pIM->runActionHandler(pCB->_AHOnSelectStart, pCB); + CAHManager::getInstance()->runActionHandler(pCB->_AHOnSelectStart, pCB); } // launch the menu diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp index f5b920383..dc6a9dd91 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp @@ -730,7 +730,7 @@ void CDBGroupListSheet::draw () string sTmp = _CtrlInfo._AHCanDropParams; params = sTmp + "|" + params; } - pIM->runActionHandler (_CtrlInfo._AHOnCanDrop, this, params); + CAHManager::getInstance()->runActionHandler (_CtrlInfo._AHOnCanDrop, this, params); } } } diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp index 0dfd0c909..2dcea9d7a 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp @@ -640,7 +640,7 @@ void CDBGroupListSheetText::draw () string sTmp = _CtrlInfo._AHCanDropParams; params = sTmp + "|" + params; } - pIM->runActionHandler (_CtrlInfo._AHOnCanDrop, this, params); + CAHManager::getInstance()->runActionHandler (_CtrlInfo._AHOnCanDrop, this, params); } } } @@ -1138,7 +1138,7 @@ class CHandlerListSheetTextSelect : public IActionHandler CCtrlButton *ctrlButton= listSheetTrade->_SheetChildren[selected]->Button; // run it, but take the wanted action handler - pIM->runActionHandler( + CAHManager::getInstance()->runActionHandler( listSheetTrade->_CtrlInfo._AHOnLeftClick, ctrlSheet, listSheetTrade->_CtrlInfo._AHLeftClickParams); @@ -1175,7 +1175,7 @@ class CHandlerListSheetTextRightClick : public IActionHandler CDBCtrlSheet::setCurrSelSheet(ctrlSheet); // run it, but take the wanted action handler - pIM->runActionHandler( + CAHManager::getInstance()->runActionHandler( listSheetTrade->_CtrlInfo._AHOnRightClick, ctrlSheet, listSheetTrade->_CtrlInfo._AHRightClickParams); diff --git a/code/ryzom/client/src/interface_v3/group_container.cpp b/code/ryzom/client/src/interface_v3/group_container.cpp index 629dba6fe..bc442c0f4 100644 --- a/code/ryzom/client/src/interface_v3/group_container.cpp +++ b/code/ryzom/client/src/interface_v3/group_container.cpp @@ -330,7 +330,7 @@ bool CCtrlResizer::handleEvent (const NLGUI::CEventDescriptor &event) if (gc && gc->getAHOnResizePtr() != NULL) { CInterfaceManager *im = CInterfaceManager::getInstance(); - im->runActionHandler(gc->getAHOnResize(), gc, gc->getAHOnResizeParams()); + CAHManager::getInstance()->runActionHandler(gc->getAHOnResize(), gc, gc->getAHOnResizeParams()); } } return true; @@ -716,7 +716,7 @@ bool CCtrlMover::handleEvent (const NLGUI::CEventDescriptor &event) if (gc->getAHOnBeginMovePtr()) { CInterfaceManager *im = CInterfaceManager::getInstance(); - im->runActionHandler(gc->getAHOnBeginMove(), gc, gc->getAHOnBeginMoveParams()); + CAHManager::getInstance()->runActionHandler(gc->getAHOnBeginMove(), gc, gc->getAHOnBeginMoveParams()); } return true; } @@ -825,7 +825,7 @@ bool CCtrlMover::handleEvent (const NLGUI::CEventDescriptor &event) // udpate XReal/YReal coords only of the container gc->CInterfaceElement::updateCoords(); // execute the AH - pIM->runActionHandler(gc->getAHOnMovePtr(), this, gc->getAHOnMoveParams()); + CAHManager::getInstance()->runActionHandler(gc->getAHOnMovePtr(), this, gc->getAHOnMoveParams()); } } else @@ -1033,13 +1033,13 @@ bool CCtrlMover::runTitleActionHandler() CInterfaceGroup *gr = gc->isOpen() ? gc->getHeaderOpened() : gc->getHeaderClosed(); if (gr && !gr->getLeftClickHandler().empty()) { - im->runActionHandler(gr->getLeftClickHandler(), this, gr->getLeftClickHandlerParams()); + CAHManager::getInstance()->runActionHandler(gr->getLeftClickHandler(), this, gr->getLeftClickHandlerParams()); return true; } // try with the main group if (!gc->getLeftClickHandler().empty()) { - im->runActionHandler(gc->getLeftClickHandler(), this, gc->getLeftClickHandlerParams()); + CAHManager::getInstance()->runActionHandler(gc->getLeftClickHandler(), this, gc->getLeftClickHandlerParams()); return true; } return false; @@ -2330,7 +2330,7 @@ void CGroupContainer::open() if (_AHOnOpen != NULL) { CInterfaceManager *im = CInterfaceManager::getInstance(); - im->runActionHandler(_AHOnOpen, this, _AHOnOpenParams); + CAHManager::getInstance()->runActionHandler(_AHOnOpen, this, _AHOnOpenParams); } } @@ -2358,7 +2358,7 @@ void CGroupContainer::close() if (_AHOnClose != NULL) { CInterfaceManager *im = CInterfaceManager::getInstance(); - im->runActionHandler(_AHOnClose, this, _AHOnCloseParams); + CAHManager::getInstance()->runActionHandler(_AHOnClose, this, _AHOnCloseParams); } } @@ -3502,7 +3502,7 @@ public: CGroupContainer::_ValidateCanDeactivate = true; if (!pIC->getAHOnDeactiveCheck().empty()) { - im->runActionHandler(pIC->getAHOnDeactiveCheck(), pCaller, pIC->getAHOnDeactiveCheckParams()); + CAHManager::getInstance()->runActionHandler(pIC->getAHOnDeactiveCheck(), pCaller, pIC->getAHOnDeactiveCheckParams()); } if (CGroupContainer::_ValidateCanDeactivate) @@ -3510,7 +3510,7 @@ public: // send close button msg if (!pIC->getAHOnCloseButton().empty()) { - im->runActionHandler(pIC->getAHOnCloseButton(), pCaller, pIC->getAHOnCloseButtonParams()); + CAHManager::getInstance()->runActionHandler(pIC->getAHOnCloseButton(), pCaller, pIC->getAHOnCloseButtonParams()); } CWidgetManager::getInstance()->setBackWindow(pIC); pIC->setActive(false); @@ -3596,7 +3596,7 @@ class CICHelp : public IActionHandler { CInterfaceManager *pIM= CInterfaceManager::getInstance(); // open the web browser, and point to the page - pIM->runActionHandler("launch_help", NULL, "url=" + helpPage); + CAHManager::getInstance()->runActionHandler("launch_help", NULL, "url=" + helpPage); } } }; @@ -4035,7 +4035,7 @@ void CGroupContainer::triggerAlphaSettingsChangedAH() if (_AHOnAlphaSettingsChanged != NULL) { CInterfaceManager *im = CInterfaceManager::getInstance(); - im->runActionHandler(_AHOnAlphaSettingsChanged, this, _AHOnAlphaSettingsChangedParams); + CAHManager::getInstance()->runActionHandler(_AHOnAlphaSettingsChanged, this, _AHOnAlphaSettingsChangedParams); } } diff --git a/code/ryzom/client/src/interface_v3/group_editbox.cpp b/code/ryzom/client/src/interface_v3/group_editbox.cpp index c42878ef8..ea5811b9b 100644 --- a/code/ryzom/client/src/interface_v3/group_editbox.cpp +++ b/code/ryzom/client/src/interface_v3/group_editbox.cpp @@ -594,7 +594,7 @@ void CGroupEditBox::handleEventChar(const NLGUI::CEventDescriptorKey &rEDK) // stop selection _CurrSelection = NULL; _CursorAtPreviousLineEnd = false; - pIM->runActionHandler(_AHOnEnter, this, _AHOnEnterParams); + CAHManager::getInstance()->runActionHandler(_AHOnEnter, this, _AHOnEnterParams); } else { @@ -701,7 +701,7 @@ void CGroupEditBox::handleEventChar(const NLGUI::CEventDescriptorKey &rEDK) } if (rEDK.getChar() == KeyRETURN) { - pIM->runActionHandler(_AHOnEnter, this, _AHOnEnterParams); + CAHManager::getInstance()->runActionHandler(_AHOnEnter, this, _AHOnEnterParams); } } _CursorAtPreviousLineEnd = false; @@ -753,7 +753,7 @@ void CGroupEditBox::triggerOnChangeAH() if (!_AHOnChange.empty()) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler(_AHOnChange, this, _ParamsOnChange); + CAHManager::getInstance()->runActionHandler(_AHOnChange, this, _ParamsOnChange); } } @@ -1291,7 +1291,7 @@ void CGroupEditBox::setCommand(const ucstring &command, bool execute) // stop selection _CurrSelection = NULL; _CursorAtPreviousLineEnd = false; - CInterfaceManager::getInstance()->runActionHandler(_AHOnEnter, this, _AHOnEnterParams); + CAHManager::getInstance()->runActionHandler(_AHOnEnter, this, _AHOnEnterParams); } else { @@ -1409,7 +1409,7 @@ void CGroupEditBox::onKeyboardCaptureLost() if (!_AHOnFocusLost.empty()) { CInterfaceManager *im = CInterfaceManager::getInstance(); - im->runActionHandler(_AHOnFocusLost, this, _AHOnFocusLostParams); + CAHManager::getInstance()->runActionHandler(_AHOnFocusLost, this, _AHOnFocusLostParams); } } diff --git a/code/ryzom/client/src/interface_v3/group_header.cpp b/code/ryzom/client/src/interface_v3/group_header.cpp index 964f6ca82..01d87d4f8 100644 --- a/code/ryzom/client/src/interface_v3/group_header.cpp +++ b/code/ryzom/client/src/interface_v3/group_header.cpp @@ -338,7 +338,7 @@ public: { ghe->setW(_TargetGroup->getW()); ghe->invalidateCoords(); - im->runActionHandler(ghe->getAHOnResize(), ghe, ghe->getAHOnResizeParams()); + CAHManager::getInstance()->runActionHandler(ghe->getAHOnResize(), ghe, ghe->getAHOnResizeParams()); } return true; } diff --git a/code/ryzom/client/src/interface_v3/group_html_qcm.cpp b/code/ryzom/client/src/interface_v3/group_html_qcm.cpp index 426c6dbd5..4bf0a1fac 100644 --- a/code/ryzom/client/src/interface_v3/group_html_qcm.cpp +++ b/code/ryzom/client/src/interface_v3/group_html_qcm.cpp @@ -55,7 +55,7 @@ void CGroupHTMLQCM::addText (const char * buf, int len) if (sTmp.find("zzz_QUIT_RYZOM_zzz") != string::npos) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler("quit_ryzom", NULL); + CAHManager::getInstance()->runActionHandler("quit_ryzom", NULL); CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId("ui:interface:web_on_quit"); pIE->setActive(false); } diff --git a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp index be8d1a950..cd7ee194b 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp +++ b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp @@ -790,7 +790,7 @@ void CGroupInSceneBubbleManager::addContextHelpHTML (const string &url, const st if (context) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler("browse", NULL, "name="+context->Group->getId()+":header_opened:window:html|url="+url); + CAHManager::getInstance()->runActionHandler("browse", NULL, "name="+context->Group->getId()+":header_opened:window:html|url="+url); // Add the URL context->Url = url; @@ -1277,7 +1277,7 @@ void CGroupInSceneBubbleManager::CDynBubble::skip() if (nNbOptions == 1) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler("dynchat_click_option", Bubble, "0"); + CAHManager::getInstance()->runActionHandler("dynchat_click_option", Bubble, "0"); } } diff --git a/code/ryzom/client/src/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index f2bf62aff..20429edb0 100644 --- a/code/ryzom/client/src/interface_v3/group_map.cpp +++ b/code/ryzom/client/src/interface_v3/group_map.cpp @@ -3410,11 +3410,11 @@ class CAHWorldMapRightClick : public IActionHandler if (!gm) return; if (!gm->isIsland()) { - im->runActionHandler("active_menu", pCaller, "menu=ui:interface:map_menu"); + CAHManager::getInstance()->runActionHandler("active_menu", pCaller, "menu=ui:interface:map_menu"); } else { - im->runActionHandler("active_menu", pCaller, "menu=ui:interface:map_menu_island"); + CAHManager::getInstance()->runActionHandler("active_menu", pCaller, "menu=ui:interface:map_menu_island"); } } }; diff --git a/code/ryzom/client/src/interface_v3/group_menu.cpp b/code/ryzom/client/src/interface_v3/group_menu.cpp index 9f8bbf3aa..7635a5344 100644 --- a/code/ryzom/client/src/interface_v3/group_menu.cpp +++ b/code/ryzom/client/src/interface_v3/group_menu.cpp @@ -983,7 +983,7 @@ bool CGroupSubMenu::handleEvent (const NLGUI::CEventDescriptor &event) if ((_Selected != -1) && (!_Lines[i].ViewText->getGrayed())) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler ( _Lines[_Selected].AHName, + CAHManager::getInstance()->runActionHandler ( _Lines[_Selected].AHName, CWidgetManager::getInstance()->getCtrlLaunchingModal(), _Lines[_Selected].AHParams ); diff --git a/code/ryzom/client/src/interface_v3/group_quick_help.cpp b/code/ryzom/client/src/interface_v3/group_quick_help.cpp index 26245433a..5de2f530d 100644 --- a/code/ryzom/client/src/interface_v3/group_quick_help.cpp +++ b/code/ryzom/client/src/interface_v3/group_quick_help.cpp @@ -326,7 +326,7 @@ void CGroupQuickHelp::activateCurrentStep () // A link to follow ? if (!step.URL.empty()) - pIM->runActionHandler("browse", NULL, "url="+step.URL); + CAHManager::getInstance()->runActionHandler("browse", NULL, "url="+step.URL); // Test a skip condition if (!step.Condition.empty() && evalExpression (step.Condition)) @@ -411,7 +411,7 @@ class CHandlerRunQuickHelp : public IActionHandler button->setPushed(true); // Run the left click action handler - pIM->runActionHandler(button->getActionOnLeftClick(), button, button->getParamsOnLeftClick()); + CAHManager::getInstance()->runActionHandler(button->getActionOnLeftClick(), button, button->getParamsOnLeftClick()); } } } diff --git a/code/ryzom/client/src/interface_v3/group_skills.cpp b/code/ryzom/client/src/interface_v3/group_skills.cpp index 8fc17fac5..a4ede0d59 100644 --- a/code/ryzom/client/src/interface_v3/group_skills.cpp +++ b/code/ryzom/client/src/interface_v3/group_skills.cpp @@ -192,7 +192,7 @@ void CGroupSkills::CSkillsObs::update (ICDBNode *node) uint skillId; if (skillParent->getNodeIndex (skill, skillId)) { - pIM->runActionHandler("skill_popup", NULL, "skillId="+toString(skillId)+"|delta="+toString(leaf->getValue32()-leaf->getOldValue32())); + CAHManager::getInstance()->runActionHandler("skill_popup", NULL, "skillId="+toString(skillId)+"|delta="+toString(leaf->getValue32()-leaf->getOldValue32())); // Context help contextHelp ("skill"); diff --git a/code/ryzom/client/src/interface_v3/group_tab.cpp b/code/ryzom/client/src/interface_v3/group_tab.cpp index 8c189ae11..69d66694c 100644 --- a/code/ryzom/client/src/interface_v3/group_tab.cpp +++ b/code/ryzom/client/src/interface_v3/group_tab.cpp @@ -133,7 +133,7 @@ void CGroupTab::addTab(CCtrlTabButton * tabB) if(_HideOutTabs && !_AHOnChange.empty()) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler(_AHOnChange, this, _ParamsOnChange); + CAHManager::getInstance()->runActionHandler(_AHOnChange, this, _ParamsOnChange); } } @@ -227,7 +227,7 @@ void CGroupTab::addTab(CCtrlTabButton * tabB, sint index) if(_HideOutTabs && !_AHOnChange.empty()) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler(_AHOnChange, this, _ParamsOnChange); + CAHManager::getInstance()->runActionHandler(_AHOnChange, this, _ParamsOnChange); } } @@ -247,7 +247,7 @@ int CGroupTab::luaAddTab(CLuaState &ls) if(_HideOutTabs && !_AHOnChange.empty()) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler(_AHOnChange, this, _ParamsOnChange); + CAHManager::getInstance()->runActionHandler(_AHOnChange, this, _ParamsOnChange); } } return 0; @@ -334,7 +334,7 @@ void CGroupTab::removeTab(sint index) if(!_AHOnChange.empty()) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler(_AHOnChange, this, _ParamsOnChange); + CAHManager::getInstance()->runActionHandler(_AHOnChange, this, _ParamsOnChange); } } } @@ -505,7 +505,7 @@ void CGroupTab::updateFirstTabButton() if(!_AHOnChange.empty() && ((oldFirstTabIndex!=_FirstTabIndex) || (oldLastTabIndex!=_LastTabIndex))) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler(_AHOnChange, this, _ParamsOnChange); + CAHManager::getInstance()->runActionHandler(_AHOnChange, this, _ParamsOnChange); } } diff --git a/code/ryzom/client/src/interface_v3/group_tree.cpp b/code/ryzom/client/src/interface_v3/group_tree.cpp index 9797f0844..01f7b5e63 100644 --- a/code/ryzom/client/src/interface_v3/group_tree.cpp +++ b/code/ryzom/client/src/interface_v3/group_tree.cpp @@ -727,7 +727,7 @@ void CGroupTree::selectLine(uint line, bool runAH /*= true*/) { _CancelNextSelectLine = false; /* - pIM->runActionHandler ( _Lines[line].Node->AHName, + CAHManager::getInstance()->runActionHandler ( _Lines[line].Node->AHName, this, _Lines[line].Node->AHParams ); */ @@ -736,7 +736,7 @@ void CGroupTree::selectLine(uint line, bool runAH /*= true*/) _SelectedLine = line; _SelectedNode = _Lines[line].Node; } - pIM->runActionHandler ( _Lines[line].Node->AHName, + CAHManager::getInstance()->runActionHandler ( _Lines[line].Node->AHName, this, _Lines[line].Node->AHParams ); _CancelNextSelectLine = false; @@ -755,7 +755,7 @@ bool CGroupTree::rightButton(uint line) if (line != (uint) _SelectedLine) selectLine(line, false); CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler ( _Lines[line].Node->AHNameRight, + CAHManager::getInstance()->runActionHandler ( _Lines[line].Node->AHNameRight, this, _Lines[line].Node->AHParamsRight ); return true; @@ -863,7 +863,7 @@ bool CGroupTree::handleEvent (const NLGUI::CEventDescriptor& event) } CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler(changedNode->AHNameClose, this, changedNode->AHParamsClose); + CAHManager::getInstance()->runActionHandler(changedNode->AHNameClose, this, changedNode->AHParamsClose); } forceRebuild(); } @@ -1303,7 +1303,7 @@ bool CGroupTree::selectNodeById(const std::string &nodeId, bool triggerAH) _AvoidSelectNodeByIdIR= true; // launch the action handler - pIM->runActionHandler ( selNode->AHName, + CAHManager::getInstance()->runActionHandler ( selNode->AHName, this, selNode->AHParams ); } diff --git a/code/ryzom/client/src/interface_v3/group_wheel.cpp b/code/ryzom/client/src/interface_v3/group_wheel.cpp index 78bd079b5..b8b25c70b 100644 --- a/code/ryzom/client/src/interface_v3/group_wheel.cpp +++ b/code/ryzom/client/src/interface_v3/group_wheel.cpp @@ -54,12 +54,12 @@ bool CInterfaceGroupWheel::handleEvent(const NLGUI::CEventDescriptor &event) CInterfaceManager *im = CInterfaceManager::getInstance(); if (eventDesc.getWheel() > 0 && _AHWheelUp) { - im->runActionHandler (_AHWheelUp, this, _AHWheelUpParams); + CAHManager::getInstance()->runActionHandler (_AHWheelUp, this, _AHWheelUpParams); return true; } else if (_AHWheelDown) { - im->runActionHandler (_AHWheelDown, this, _AHWheelDownParams); + CAHManager::getInstance()->runActionHandler (_AHWheelDown, this, _AHWheelDownParams); return true; } } diff --git a/code/ryzom/client/src/interface_v3/guild_manager.cpp b/code/ryzom/client/src/interface_v3/guild_manager.cpp index 7092cd903..9271753f9 100644 --- a/code/ryzom/client/src/interface_v3/guild_manager.cpp +++ b/code/ryzom/client/src/interface_v3/guild_manager.cpp @@ -437,7 +437,7 @@ void CGuildManager::update() } // Rebuild interface. Rebuild members only if needed - pIM->runActionHandler("guild_sheet_open", NULL, toString("update_members=%d", (uint)_NeedUpdateMembers) ); + CAHManager::getInstance()->runActionHandler("guild_sheet_open", NULL, toString("update_members=%d", (uint)_NeedUpdateMembers) ); } } @@ -1035,7 +1035,7 @@ public: } NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:GUILD_LIST:SORT_ORDER")->setValue32((sint32)order); - pIM->runActionHandler("guild_sheet_open", NULL, toString("update_members=1")); + CAHManager::getInstance()->runActionHandler("guild_sheet_open", NULL, toString("update_members=1")); } }; REGISTER_ACTION_HANDLER(CAHGuildSheetSortGuildList, "sort_guild_list"); diff --git a/code/ryzom/client/src/interface_v3/interface_anim.cpp b/code/ryzom/client/src/interface_v3/interface_anim.cpp index 436b84133..a27c248d6 100644 --- a/code/ryzom/client/src/interface_v3/interface_anim.cpp +++ b/code/ryzom/client/src/interface_v3/interface_anim.cpp @@ -642,7 +642,7 @@ void CInterfaceAnim::stop() CInterfaceManager *pIM = CInterfaceManager::getInstance(); if (!_AHOnFinish.empty()) - pIM->runActionHandler(_AHOnFinish, _Parent, _AHOnFinishParams); + CAHManager::getInstance()->runActionHandler(_AHOnFinish, _Parent, _AHOnFinishParams); } // ************************** diff --git a/code/ryzom/client/src/interface_v3/interface_group.cpp b/code/ryzom/client/src/interface_v3/interface_group.cpp index 1a4a380b6..4d917a80d 100644 --- a/code/ryzom/client/src/interface_v3/interface_group.cpp +++ b/code/ryzom/client/src/interface_v3/interface_group.cpp @@ -116,11 +116,11 @@ void CInterfaceGroup::setActive(bool state) CInterfaceManager *pIM = CInterfaceManager::getInstance(); if (_AHOnActive != NULL && state) { - pIM->runActionHandler (_AHOnActive, this, _AHOnActiveParams); + CAHManager::getInstance()->runActionHandler (_AHOnActive, this, _AHOnActiveParams); } if (_AHOnDeactive != NULL && !state) { - pIM->runActionHandler (_AHOnDeactive, this, _AHOnDeactiveParams); + CAHManager::getInstance()->runActionHandler (_AHOnDeactive, this, _AHOnDeactiveParams); } notifyActiveCalled(NLGUI::CEventDescriptorActiveCalledOnParent(state)); @@ -739,7 +739,7 @@ bool CInterfaceGroup::handleEvent (const NLGUI::CEventDescriptor &event) { if (_AHOnLeftClick != NULL) { - im->runActionHandler(_AHOnLeftClick, this, _AHOnLeftClickParams); + CAHManager::getInstance()->runActionHandler(_AHOnLeftClick, this, _AHOnLeftClickParams); return true; } } @@ -748,7 +748,7 @@ bool CInterfaceGroup::handleEvent (const NLGUI::CEventDescriptor &event) { if (_AHOnRightClick != NULL) { - im->runActionHandler(_AHOnRightClick, this, _AHOnRightClickParams); + CAHManager::getInstance()->runActionHandler(_AHOnRightClick, this, _AHOnRightClickParams); return true; } } @@ -868,7 +868,7 @@ void CInterfaceGroup::executeLuaScriptOnDraw() if(!_LUAOnDraw.empty()) { CInterfaceManager *pIM= CInterfaceManager::getInstance(); - pIM->runActionHandler("lua", this, _LUAOnDraw); + CAHManager::getInstance()->runActionHandler("lua", this, _LUAOnDraw); } } diff --git a/code/ryzom/client/src/interface_v3/interface_link.cpp b/code/ryzom/client/src/interface_v3/interface_link.cpp index 4a7315ef0..c61891634 100644 --- a/code/ryzom/client/src/interface_v3/interface_link.cpp +++ b/code/ryzom/client/src/interface_v3/interface_link.cpp @@ -365,7 +365,7 @@ void CInterfaceLink::update() if(launch) { CInterfaceManager *im = CInterfaceManager::getInstance(); - im->runActionHandler(_ActionHandler, _AHParent, _AHParams); + CAHManager::getInstance()->runActionHandler(_ActionHandler, _AHParent, _AHParams); // do not add any code after this line because this can be deleted !!!! } } diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index 9872b5962..e07e4b64f 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -1386,79 +1386,6 @@ CInterfaceOptions *CInterfaceManager::getOptions(const string &name) return it->second; } -// ------------------------------------------------------------------------------------------------ -void CInterfaceManager::runActionHandler (const string &ahCmdLine, CCtrlBase *pCaller, const string &ahUserParams) -{ - if (ahCmdLine.empty()) return; - - // Special AH form ("ah:params") ? - string::size_type i = ahCmdLine.find(':'); - string ahName; - string ahParams; - if(i!=string::npos) - { - ahName= ahCmdLine.substr(0, i); - ahParams= ahCmdLine.substr(i+1); - } - else - { - ahName= ahCmdLine; - } - - // Replace params if defined - if(!ahUserParams.empty()) - ahParams= ahUserParams; - - // Execute the action handler - CAHManager *pAHFM = CAHManager::getInstance(); - map::iterator it = pAHFM->FactoryMap.find (ahName); - if (it == pAHFM->FactoryMap.end()) - { - nlwarning ("not found action handler : %s",ahName.c_str()); - return; - } - IActionHandler *pAH = it->second; - pAH->execute (pCaller, ahParams); - - // Quick Help - const string submitQuickHelp = "submit_quick_help"; - it = pAHFM->FactoryMap.find(submitQuickHelp); - if(it == pAHFM->FactoryMap.end()) - { - nlwarning ("not found action handler : %s", submitQuickHelp.c_str()); - return; - } - pAH = it->second; - const std::string event = ahName + ":" + ahParams; - pAH->execute(NULL, event); -} - -// ------------------------------------------------------------------------------------------------ -void CInterfaceManager::runActionHandler (IActionHandler *pAH, CCtrlBase *pCaller, const std::string &Params) -{ - if (pAH == NULL) - { - nlwarning ("no action handler"); - return; - } - pAH->execute (pCaller, Params); - string AHName = CAHManager::getInstance()->getAHName(pAH); - - // Quick Help - const string submitQuickHelp = "submit_quick_help"; - CAHManager *pAHFM = CAHManager::getInstance(); - map::iterator it = pAHFM->FactoryMap.find (AHName); - it = pAHFM->FactoryMap.find(submitQuickHelp); - if(it == pAHFM->FactoryMap.end()) - { - nlwarning ("not found action handler : %s", submitQuickHelp.c_str()); - return; - } - pAH = it->second; - const std::string event = AHName + ":" + Params; - pAH->execute(NULL, event); -} - // ------------------------------------------------------------------------------------------------ void CInterfaceManager::setupOptions() { @@ -2403,7 +2330,7 @@ void CInterfaceManager::drawContextHelp () // UserDefined context help if( !newCtrl->getContextHelpActionHandler().empty() ) { - runActionHandler(newCtrl->getContextHelpActionHandler(), newCtrl, newCtrl->getContextHelpAHParams() ); + CAHManager::getInstance()->runActionHandler(newCtrl->getContextHelpActionHandler(), newCtrl, newCtrl->getContextHelpAHParams() ); } // If the text is finally empty (Special AH case), abort @@ -2726,7 +2653,7 @@ bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) if( dynamic_cast(win) ) { if(!win->getAHOnEscape().empty()) - runActionHandler(win->getAHOnEscape(), win, win->getAHOnEscapeParams()); + CAHManager::getInstance()->runActionHandler(win->getAHOnEscape(), win, win->getAHOnEscapeParams()); CWidgetManager::getInstance()->popModalWindow(); handled= true; } @@ -2735,7 +2662,7 @@ bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) else if(!_CaptureKeyboard ) { if(!win->getAHOnEscape().empty()) - runActionHandler(win->getAHOnEscape(), win, win->getAHOnEscapeParams()); + CAHManager::getInstance()->runActionHandler(win->getAHOnEscape(), win, win->getAHOnEscapeParams()); win->setActive(false); handled= true; } @@ -2760,7 +2687,7 @@ bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) else { // The window or modal control the OnEnter. Execute, and don't go to the chat. - runActionHandler(tw->getAHOnEnter(), tw, tw->getAHOnEnterParams()); + CAHManager::getInstance()->runActionHandler(tw->getAHOnEnter(), tw, tw->getAHOnEnterParams()); handled= true; } } @@ -2880,7 +2807,7 @@ bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown || (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown)) if (!mwi.ModalHandlerClickOut.empty()) - runActionHandler(mwi.ModalHandlerClickOut,NULL,mwi.ModalClickOutParams); + CAHManager::getInstance()->runActionHandler(mwi.ModalHandlerClickOut,NULL,mwi.ModalClickOutParams); // If the current window is not the modal and if must quit on click out if(pNewCurrentWnd != mwi.ModalWindow && mwi.ModalExitClickOut) @@ -2945,7 +2872,7 @@ bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) notifyElementCaptured(_CapturePointerLeft); if (clickedOutModalWindow && !clickedOutModalWindow->OnPostClickOut.empty()) { - runActionHandler(clickedOutModalWindow->OnPostClickOut, _CapturePointerLeft, clickedOutModalWindow->OnPostClickOutParams); + CAHManager::getInstance()->runActionHandler(clickedOutModalWindow->OnPostClickOut, _CapturePointerLeft, clickedOutModalWindow->OnPostClickOutParams); } } //if found @@ -2994,7 +2921,7 @@ bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) notifyElementCaptured(_CapturePointerRight); if (clickedOutModalWindow && !clickedOutModalWindow->OnPostClickOut.empty()) { - runActionHandler(clickedOutModalWindow->OnPostClickOut, _CapturePointerRight, clickedOutModalWindow->OnPostClickOutParams); + CAHManager::getInstance()->runActionHandler(clickedOutModalWindow->OnPostClickOut, _CapturePointerRight, clickedOutModalWindow->OnPostClickOutParams); } } //if found @@ -3681,7 +3608,7 @@ void CInterfaceManager::setCaptureKeyboard(CCtrlBase *c) if (!newEb->getAHOnFocus().empty()) { - runActionHandler(newEb->getAHOnFocus(), newEb, newEb->getAHOnFocusParams()); + CAHManager::getInstance()->runActionHandler(newEb->getAHOnFocus(), newEb, newEb->getAHOnFocusParams()); } } @@ -3739,7 +3666,7 @@ void CInterfaceManager::runProcedure (const string &procName, CCtrlBase *pCaller action.buildParams(paramList, params); // run //nlwarning("step %d : %s, %s", (int) i, action.Action.c_str(), params.c_str()); - runActionHandler(action.Action, pCaller, params); + CAHManager::getInstance()->runActionHandler(action.Action, pCaller, params); } } } @@ -4715,7 +4642,7 @@ uint CInterfaceManager::getUserDblClickDelay() void CInterfaceManager::submitEvent (const std::string &event) { // Submit the event to the quick help system - runActionHandler("submit_quick_help", NULL, event); + CAHManager::getInstance()->runActionHandler("submit_quick_help", NULL, event); } // *************************************************************************** @@ -4888,7 +4815,7 @@ void CInterfaceManager::displayWebWindow(const string & name, const string & url pIG->center(); } - runActionHandler("browse", NULL, "name="+name+":content:html|url="+url); + CAHManager::getInstance()->runActionHandler("browse", NULL, "name="+name+":content:html|url="+url); } /* // *************************************************************************** @@ -4897,7 +4824,7 @@ class CHandlerDispWebOnQuit : public IActionHandler virtual void execute (CCtrlBase *pCaller, const string &Params) { if (ClientCfg.Local) - CInterfaceManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:quit_dialog"); + CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:quit_dialog"); else CInterfaceManager::getInstance()->displayWebWindow("ui:interface:web_on_quit", "http://213.208.119.190/igpoll/poll_form.php"); } @@ -4909,7 +4836,7 @@ class CHandlerExitWebOnQuit : public IActionHandler { virtual void execute (CCtrlBase *pCaller, const string &Params) { - CInterfaceManager::getInstance()->runActionHandler("quit_ryzom", pCaller); + CAHManager::getInstance()->runActionHandler("quit_ryzom", pCaller); } }; REGISTER_ACTION_HANDLER (CHandlerExitWebOnQuit, "exit_web_on_quit"); @@ -5188,7 +5115,6 @@ void CInterfaceManager::updateEmotes() // Just call the action handler with good params bool CInterfaceManager::CEmoteCmd::execute(const std::string &/* rawCommandString */, const vector &args, CLog &/* log */, bool /* quiet */, bool /* human */) { - CInterfaceManager *pIM = CInterfaceManager::getInstance(); string customPhrase; if( args.size() > 0 ) { @@ -5199,7 +5125,7 @@ bool CInterfaceManager::CEmoteCmd::execute(const std::string &/* rawCommandStrin customPhrase += " "; customPhrase += args[i]; } - pIM->runActionHandler("emote", NULL, "nb="+toString(EmoteNb)+"|behav="+toString(Behaviour)+"|custom_phrase="+customPhrase); + CAHManager::getInstance()->runActionHandler("emote", NULL, "nb="+toString(EmoteNb)+"|behav="+toString(Behaviour)+"|custom_phrase="+customPhrase); return true; } diff --git a/code/ryzom/client/src/interface_v3/interface_manager.h b/code/ryzom/client/src/interface_v3/interface_manager.h index ac8e9b408..9bf7849e4 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.h +++ b/code/ryzom/client/src/interface_v3/interface_manager.h @@ -276,10 +276,6 @@ public: /// Handle The Event. return true if the interfaceManager catch it and if must not send to the Game Action Manager bool handleEvent (const NLGUI::CEventDescriptor &eventDesc); bool handleMouseMoveEvent( const NLGUI::CEventDescriptor &eventDesc ); - void runActionHandler (const std::string &AHName, CCtrlBase *pCaller, - const std::string &Params=std::string("")); - void runActionHandler (IActionHandler *ah, CCtrlBase *pCaller, - const std::string &Params=std::string("")); // execute a procedure. give a list of parameters. NB: the first param is the name of the proc (skipped)... void runProcedure(const std::string &procName, CCtrlBase *pCaller, const std::vector ¶mList); // replace an action in a procedure (if possible) diff --git a/code/ryzom/client/src/interface_v3/interface_parser.cpp b/code/ryzom/client/src/interface_v3/interface_parser.cpp index db5f1dc7d..7e1b15f34 100644 --- a/code/ryzom/client/src/interface_v3/interface_parser.cpp +++ b/code/ryzom/client/src/interface_v3/interface_parser.cpp @@ -2313,7 +2313,7 @@ bool CInterfaceParser::initCoordsAndLuaScript() { // execute the script on this group CInterfaceManager *pIM= CInterfaceManager::getInstance(); - pIM->runActionHandler("lua", itLua->first, itLua->second); + CAHManager::getInstance()->runActionHandler("lua", itLua->first, itLua->second); } diff --git a/code/ryzom/client/src/interface_v3/inventory_manager.cpp b/code/ryzom/client/src/interface_v3/inventory_manager.cpp index bb959f0ba..cdb2a2e36 100644 --- a/code/ryzom/client/src/interface_v3/inventory_manager.cpp +++ b/code/ryzom/client/src/interface_v3/inventory_manager.cpp @@ -1746,12 +1746,12 @@ void CTempInvManager::update() { // If all slots are empty, close the interface pGC->setActive(false); - pIM->runActionHandler("phrase_update_all_memory_ctrl_regen_tick_range", NULL); + CAHManager::getInstance()->runActionHandler("phrase_update_all_memory_ctrl_regen_tick_range", NULL); } else { pGC->setActive(true); - pIM->runActionHandler("phrase_update_all_memory_ctrl_regen_tick_range", NULL); + CAHManager::getInstance()->runActionHandler("phrase_update_all_memory_ctrl_regen_tick_range", NULL); // Something arrived, change text switch(_Mode) { @@ -1884,7 +1884,7 @@ void CTempInvManager::open(TEMP_INV_MODE::TInventoryMode m) }; pGC->setActive(true); - pIM->runActionHandler("phrase_update_all_memory_ctrl_regen_tick_range", NULL); + CAHManager::getInstance()->runActionHandler("phrase_update_all_memory_ctrl_regen_tick_range", NULL); } } @@ -1906,7 +1906,7 @@ void CTempInvManager::close() if (pIG != NULL) { pIG->setActive(false); - pIM->runActionHandler("phrase_update_all_memory_ctrl_regen_tick_range", NULL); + CAHManager::getInstance()->runActionHandler("phrase_update_all_memory_ctrl_regen_tick_range", NULL); } } @@ -2706,7 +2706,7 @@ class CHandlerInvDropTo : public IActionHandler if (((pListDstText != NULL) && (pListDstText->getInvType() == CInventoryManager::InvBag)) || ((pListDstIcon != NULL) && (pListDstIcon->getInvType() == CInventoryManager::InvBag))) { - pIM->runActionHandler("proc", pCSSrc, "move_to_bag"); + CAHManager::getInstance()->runActionHandler("proc", pCSSrc, "move_to_bag"); } else if (((pListDstText != NULL) && ((pListDstText->getInvType() == CInventoryManager::InvPA0) || (pListDstText->getInvType() == CInventoryManager::InvPA1) || @@ -2722,18 +2722,18 @@ class CHandlerInvDropTo : public IActionHandler string sTmp; if (pListDstText != NULL) sTmp = toString("%d",pListDstText->getInvType()-CInventoryManager::InvPA0); if (pListDstIcon != NULL) sTmp = toString("%d",pListDstIcon->getInvType()-CInventoryManager::InvPA0); - pIM->runActionHandler("proc", pCSSrc, "move_to_pa|"+sTmp); + CAHManager::getInstance()->runActionHandler("proc", pCSSrc, "move_to_pa|"+sTmp); } else if (((pListDstText != NULL) && (pListDstText->getInvType() == CInventoryManager::InvGuild)) || ((pListDstIcon != NULL) && (pListDstIcon->getInvType() == CInventoryManager::InvGuild))) { if (strnicmp(pCSSrc->getSheet().c_str(), "LOCAL:INVENTORY:BAG", 19) == 0) - pIM->runActionHandler("proc", pCSSrc, "move_to_guild"); + CAHManager::getInstance()->runActionHandler("proc", pCSSrc, "move_to_guild"); } else if (((pListDstText != NULL) && (pListDstText->getInvType() == CInventoryManager::InvRoom)) || ((pListDstIcon != NULL) && (pListDstIcon->getInvType() == CInventoryManager::InvRoom))) { - pIM->runActionHandler("proc", pCSSrc, "move_to_room"); + CAHManager::getInstance()->runActionHandler("proc", pCSSrc, "move_to_room"); } } } @@ -2760,7 +2760,7 @@ class CHandlerInvDropTo : public IActionHandler if (i1 != 0) getInventory().equip(sBag + toString(i1-1), invPath2); } - pIM->runActionHandler("inv_cannot_drop", pCSSrc); + CAHManager::getInstance()->runActionHandler("inv_cannot_drop", pCSSrc); } }; REGISTER_ACTION_HANDLER( CHandlerInvDropTo, "inv_drop" ); diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index 6c9ebb167..3211c20e9 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -1179,7 +1179,7 @@ int CLuaIHMRyzom::runAH(CLuaState &ls) if(!ctrl) throw ELuaIHMException("runAH(): '%s' is not a ctrl", pIE->getId().c_str()); } - pIM->runActionHandler(ah, ctrl, params); + CAHManager::getInstance()->runActionHandler(ah, ctrl, params); return 0; } diff --git a/code/ryzom/client/src/interface_v3/macrocmd_key.cpp b/code/ryzom/client/src/interface_v3/macrocmd_key.cpp index 4103026e1..d7b2bdb4b 100644 --- a/code/ryzom/client/src/interface_v3/macrocmd_key.cpp +++ b/code/ryzom/client/src/interface_v3/macrocmd_key.cpp @@ -584,13 +584,13 @@ void CModalContainerEditCmd::activateFrom (const std::string &cmdName, const std onChangeCategory(); IngameDbMngr.flushObserverCalls(); NLGUI::CDBManager::getInstance()->flushObserverCalls(); - //pIM->runActionHandler("editcmd_change_category",NULL); + //CAHManager::getInstance()->runActionHandler("editcmd_change_category",NULL); pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+WIN_EDITCMD_COMBO_ACTION)); pCB->setSelection(actCBIndex); onChangeAction(); IngameDbMngr.flushObserverCalls(); NLGUI::CDBManager::getInstance()->flushObserverCalls(); - //pIM->runActionHandler("editcmd_change_action",NULL); + //CAHManager::getInstance()->runActionHandler("editcmd_change_action",NULL); // Count number of displayed param uint nbRealParam = 0; @@ -1310,7 +1310,7 @@ public: { pMCM->CurrentEditMacro.addCommand(pMCM->EditCmd->CurrentEditCmdLine.ActionName.Name.c_str(),pMCM->EditCmd->CurrentEditCmdLine.ActionName.Argu.c_str()); } - pIM->runActionHandler("new_macro_open", pCaller); + CAHManager::getInstance()->runActionHandler("new_macro_open", pCaller); pMCM->EditCmd->deactivate(); } } diff --git a/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp b/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp index 47b770a10..5548f9354 100644 --- a/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp +++ b/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp @@ -485,7 +485,7 @@ void CMacroCmdManager::updateMacroExecution () } // Here we have to execute the current command - pIM->runActionHandler(rC.Name, NULL, rC.Params); + CAHManager::getInstance()->runActionHandler(rC.Name, NULL, rC.Params); // Flush interface links (else bug with Macro "Select ShortCutBar/Run Shortcut" IngameDbMngr.flushObserverCalls(); @@ -526,9 +526,9 @@ void CMacroCmdManager::refreshAllKeyDisplays() { CInterfaceManager *pIM= CInterfaceManager::getInstance(); // Refresh Key Window - pIM->runActionHandler("keys_open", NULL); + CAHManager::getInstance()->runActionHandler("keys_open", NULL); // Refresh gestion_windows container - pIM->runActionHandler("gestion_windows_update_key_binding", NULL); + CAHManager::getInstance()->runActionHandler("gestion_windows_update_key_binding", NULL); } // ------------------------------------------------------------------------------------------------ @@ -670,9 +670,9 @@ public: CInterfaceManager *pIM = CInterfaceManager::getInstance(); CMacroCmdManager *pMCM = CMacroCmdManager::getInstance(); - pIM->runActionHandler("reset_pushed", NULL, string("dblink=")+GROUP_MACROICONCREATION_BACK); - pIM->runActionHandler("reset_pushed", NULL, string("dblink=")+GROUP_MACROICONCREATION_ICON); - pIM->runActionHandler("reset_pushed", NULL, string("dblink=")+GROUP_MACROICONCREATION_OVER); + CAHManager::getInstance()->runActionHandler("reset_pushed", NULL, string("dblink=")+GROUP_MACROICONCREATION_BACK); + CAHManager::getInstance()->runActionHandler("reset_pushed", NULL, string("dblink=")+GROUP_MACROICONCREATION_ICON); + CAHManager::getInstance()->runActionHandler("reset_pushed", NULL, string("dblink=")+GROUP_MACROICONCREATION_OVER); uint8 back = pMCM->CurrentEditMacro.BitmapBack; if (back != 0xff) @@ -707,9 +707,9 @@ public: pCS->setMacroText(pEB->getInputStringAsStdString()); } - pIM->runActionHandler("set_macro_back", NULL, string("target=")+CTRL_MACROICONCREATION_ICON+"|value="+toString(back)); - pIM->runActionHandler("set_macro_icon", NULL, string("target=")+CTRL_MACROICONCREATION_ICON+"|value="+toString(icon)); - pIM->runActionHandler("set_macro_over", NULL, string("target=")+CTRL_MACROICONCREATION_ICON+"|value="+toString(over)); + CAHManager::getInstance()->runActionHandler("set_macro_back", NULL, string("target=")+CTRL_MACROICONCREATION_ICON+"|value="+toString(back)); + CAHManager::getInstance()->runActionHandler("set_macro_icon", NULL, string("target=")+CTRL_MACROICONCREATION_ICON+"|value="+toString(icon)); + CAHManager::getInstance()->runActionHandler("set_macro_over", NULL, string("target=")+CTRL_MACROICONCREATION_ICON+"|value="+toString(over)); } }; REGISTER_ACTION_HANDLER( CHandlerMacroIconCreationOpen, "macro_icon_creation_open"); @@ -740,7 +740,7 @@ public: pMCM->CurrentEditMacro.moveUpCommand(nCmdNb); CInterfaceManager *pIM = CInterfaceManager::getInstance(); CMacroCmdManager::getInstance()->EditCmd->deactivate(); - pIM->runActionHandler("new_macro_open",NULL); + CAHManager::getInstance()->runActionHandler("new_macro_open",NULL); } }; REGISTER_ACTION_HANDLER( CHandlerNewMacroCmdMoveUp, "new_macro_cmd_move_up"); @@ -757,7 +757,7 @@ public: pMCM->CurrentEditMacro.moveDownCommand(nCmdNb); CInterfaceManager *pIM = CInterfaceManager::getInstance(); CMacroCmdManager::getInstance()->EditCmd->deactivate(); - pIM->runActionHandler("new_macro_open",NULL); + CAHManager::getInstance()->runActionHandler("new_macro_open",NULL); } }; REGISTER_ACTION_HANDLER( CHandlerNewMacroCmdMoveDown, "new_macro_cmd_move_down"); @@ -790,7 +790,7 @@ public: pMCM->CurrentEditMacro.delCommand(nCmdNb); CInterfaceManager *pIM = CInterfaceManager::getInstance(); CMacroCmdManager::getInstance()->EditCmd->deactivate(); - pIM->runActionHandler("new_macro_open",NULL); + CAHManager::getInstance()->runActionHandler("new_macro_open",NULL); } }; REGISTER_ACTION_HANDLER( CHandlerNewMacroCmdDelete, "new_macro_cmd_delete"); @@ -820,7 +820,7 @@ public: virtual void execute(CCtrlBase * /* pCaller */, const string &/* Params */) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler("new_macro_enter_name",NULL); + CAHManager::getInstance()->runActionHandler("new_macro_enter_name",NULL); CMacroCmdManager *pMCM = CMacroCmdManager::getInstance(); pMCM->EditCmd->activate(); } @@ -914,7 +914,7 @@ public: CSPhraseManager *pPM = CSPhraseManager::getInstance(); // Validate name - pIM->runActionHandler("new_macro_enter_name",NULL); + CAHManager::getInstance()->runActionHandler("new_macro_enter_name",NULL); // Check if macro has more than one command if (pMCM->CurrentEditMacro.Commands.size() == 0) return; @@ -939,7 +939,7 @@ public: CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_NEWMACRO)); if (pGC != NULL) pGC->setActive (false); - pIM->runActionHandler("macros_open",NULL); + CAHManager::getInstance()->runActionHandler("macros_open",NULL); // Refresh key containers pMCM->refreshAllKeyDisplays(); @@ -1060,7 +1060,7 @@ public: { sint nMacNb = getMacroFromId(pCaller->getId()); - CInterfaceManager::getInstance()->runActionHandler(AH_MACRO_EXEC,pCaller,toString(nMacNb)); + CAHManager::getInstance()->runActionHandler(AH_MACRO_EXEC,pCaller,toString(nMacNb)); } }; REGISTER_ACTION_HANDLER( CHandlerMacrosExec, "macros_exec"); @@ -1124,7 +1124,7 @@ public: pPM->deleteMacroShortcuts(pMCM->getMacros()[nMacNb].ID); // then delete pMCM->delMacro(nMacNb); - pIM->runActionHandler("macros_open",NULL); + CAHManager::getInstance()->runActionHandler("macros_open",NULL); // Refresh key containers pMCM->refreshAllKeyDisplays(); diff --git a/code/ryzom/client/src/interface_v3/people_interraction.cpp b/code/ryzom/client/src/interface_v3/people_interraction.cpp index c357505cc..f2ca589b8 100644 --- a/code/ryzom/client/src/interface_v3/people_interraction.cpp +++ b/code/ryzom/client/src/interface_v3/people_interraction.cpp @@ -2236,7 +2236,7 @@ public: CGroupEditBox *geb = dynamic_cast(gc->getGroup("add_contact_eb:eb")); geb->setInputString(ucstring("")); } - pIM->runActionHandler("enter_modal", pCaller, sParams); + CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, sParams); } } } @@ -2300,7 +2300,7 @@ public: } } } - pIM->runActionHandler("leave_modal", pCaller, ""); + CAHManager::getInstance()->runActionHandler("leave_modal", pCaller, ""); } }; REGISTER_ACTION_HANDLER( CHandlerAddContact, "add_contact"); @@ -2745,12 +2745,12 @@ class CHandlerChatTargetSelected : public IActionHandler if (cw == PeopleInterraction.ChatGroup.Window) { PeopleInterraction.TheUserChat.Filter.setTargetGroup(cf.getTargetGroup(), cf.getTargetDynamicChannelDbIndex()); - CInterfaceManager::getInstance()->runActionHandler("chat_group_filter", NULL, "user"); + CAHManager::getInstance()->runActionHandler("chat_group_filter", NULL, "user"); } if (cw == PeopleInterraction.TheUserChat.Window) { PeopleInterraction.TheUserChat.Filter.setTargetGroup(cf.getTargetGroup(), cf.getTargetDynamicChannelDbIndex()); - CInterfaceManager::getInstance()->runActionHandler("user_chat_active", NULL, ""); + CAHManager::getInstance()->runActionHandler("user_chat_active", NULL, ""); } // The target should be a party chat diff --git a/code/ryzom/client/src/interface_v3/skill_manager.cpp b/code/ryzom/client/src/interface_v3/skill_manager.cpp index 0df3a071e..832b23f2b 100644 --- a/code/ryzom/client/src/interface_v3/skill_manager.cpp +++ b/code/ryzom/client/src/interface_v3/skill_manager.cpp @@ -587,7 +587,7 @@ void CSkillManager::checkTitleUnblocked(CHARACTER_TITLE::ECharacterTitle i, bool string titleStr = CHARACTER_TITLE::toString((CHARACTER_TITLE::ECharacterTitle)i); bool womenTitle = (UserEntity && UserEntity->getGender() == GSGENDER::female); const ucstring newtitle(CStringManagerClient::getTitleLocalizedName(titleStr, womenTitle)); - pIM->runActionHandler("message_popup", NULL, "text1="+newtitle.toUtf8()+"|text0="+CI18N::get("uiNewTitleBold").toUtf8()); + CAHManager::getInstance()->runActionHandler("message_popup", NULL, "text1="+newtitle.toUtf8()+"|text0="+CI18N::get("uiNewTitleBold").toUtf8()); } else { @@ -612,7 +612,7 @@ void CSkillManager::checkTitleUnblocked(CHARACTER_TITLE::ECharacterTitle i, bool } // Update title combo box - pIM->runActionHandler("title_init_combobox", NULL); + CAHManager::getInstance()->runActionHandler("title_init_combobox", NULL); } } } @@ -1032,7 +1032,7 @@ void CSkillManager::blockTitleFromServer(CHARACTER_TITLE::ECharacterTitle ct) void CSkillManager::setPlayerTitle(const std::string &name) { setCurrentTitle(CHARACTER_TITLE::toCharacterTitle(name)); - CInterfaceManager::getInstance()->runActionHandler("title_init_combobox", NULL); + CAHManager::getInstance()->runActionHandler("title_init_combobox", NULL); } @@ -1051,7 +1051,7 @@ public: virtual void execute(CCtrlBase * /* pCaller */, const string &/* Params */) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler("title_combobox_button", NULL); + CAHManager::getInstance()->runActionHandler("title_combobox_button", NULL); // Setup UI:TITLE from current title CSkillManager *pSM = CSkillManager::getInstance(); diff --git a/code/ryzom/client/src/light_cycle_manager.cpp b/code/ryzom/client/src/light_cycle_manager.cpp index 4b0488dd5..1299aa802 100644 --- a/code/ryzom/client/src/light_cycle_manager.cpp +++ b/code/ryzom/client/src/light_cycle_manager.cpp @@ -255,7 +255,7 @@ void CLightCycleManager::updateState() CInterfaceManager * pIM = CInterfaceManager::getInstance(); if( pIM ) { - pIM->runActionHandler("set",NULL,"dblink=UI:VARIABLES:NIGHT_WARNING_WANTED|value=1"); + CAHManager::getInstance()->runActionHandler("set",NULL,"dblink=UI:VARIABLES:NIGHT_WARNING_WANTED|value=1"); } } _State = Night; diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp index 1457aa396..4abecf8c1 100644 --- a/code/ryzom/client/src/login.cpp +++ b/code/ryzom/client/src/login.cpp @@ -221,7 +221,7 @@ void initEula() } else { - pIM->runActionHandler("accept_eula", NULL); + CAHManager::getInstance()->runActionHandler("accept_eula", NULL); } } @@ -265,7 +265,7 @@ void initCatDisplay() else { LoginSM.pushEvent(CLoginStateMachine::ev_run_patch); -// pIM->runActionHandler("login_patch", NULL); +// CAHManager::getInstance()->runActionHandler("login_patch", NULL); } } @@ -492,7 +492,7 @@ void loginMainLoop() else { LoginSM.pushEvent(CLoginStateMachine::ev_no_patch); - // pIM->runActionHandler("login_patch", NULL); + // CAHManager::getInstance()->runActionHandler("login_patch", NULL); } } else @@ -744,11 +744,11 @@ void initLoginScreen() { pGEB->setInputString(l); } - pIM->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_PASSWORD "|select_all=false"); + CAHManager::getInstance()->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_PASSWORD "|select_all=false"); } else { - pIM->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_LOGIN "|select_all=false"); + CAHManager::getInstance()->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_LOGIN "|select_all=false"); } @@ -766,7 +766,7 @@ void initAutoLogin() CGroupEditBox *pGEBPwd = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_EDITBOX_PASSWORD)); pGEBLog->setInputString(LoginLogin); pGEBPwd->setInputString(LoginPassword); - pIM->runActionHandler("on_login", NULL, ""); + CAHManager::getInstance()->runActionHandler("on_login", NULL, ""); if (ClientCfg.R2Mode) { @@ -793,7 +793,7 @@ void initAutoLogin() else { LoginSM.pushEvent(CLoginStateMachine::ev_login_ok); - // pIM->runActionHandler("login_connect_2", NULL); + // CAHManager::getInstance()->runActionHandler("login_connect_2", NULL); } } } @@ -869,11 +869,11 @@ bool login() // CGroupEditBox *pGEB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_EDITBOX_LOGIN)); // if (pGEB != NULL) // pGEB->setInputString(l); -// pIM->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_PASSWORD "|select_all=false"); +// CAHManager::getInstance()->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_PASSWORD "|select_all=false"); // } // else // { -// pIM->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_LOGIN "|select_all=false"); +// CAHManager::getInstance()->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_LOGIN "|select_all=false"); // } ShardSelected = -1; @@ -891,7 +891,7 @@ bool login() // CGroupEditBox *pGEBPwd = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_EDITBOX_PASSWORD)); // pGEBLog->setInputString(LoginLogin); // pGEBPwd->setInputString(LoginPassword); -// pIM->runActionHandler("on_login", NULL, ""); +// CAHManager::getInstance()->runActionHandler("on_login", NULL, ""); // // Select good shard // ShardSelected = -1; // for (uint32 i = 0; i < Shards.size(); ++i) @@ -906,7 +906,7 @@ bool login() // if (ShardSelected == -1) // pIM->messageBox(CI18N::get("uiErrServerLost"), "ui:login"); // else -// pIM->runActionHandler("login_connect_2", NULL); +// CAHManager::getInstance()->runActionHandler("login_connect_2", NULL); // } // start the login state machine @@ -1090,7 +1090,7 @@ void initShardDisplay() CCtrlButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_LIST_SHARD ":s0:but")); if (pCB != NULL) pCB->setPushed(true); - pIM->runActionHandler (pCB->getActionOnLeftClick(), pCB, pCB->getParamsOnLeftClick()); + CAHManager::getInstance()->runActionHandler (pCB->getActionOnLeftClick(), pCB, pCB->getParamsOnLeftClick()); } pList->invalidateCoords(); @@ -1217,7 +1217,7 @@ void onlogin(bool vanishScreen = true) // CCtrlButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_LIST_SHARD ":s0:but")); // if (pCB != NULL) // pCB->setPushed(true); -// pIM->runActionHandler (pCB->getActionOnLeftClick(), pCB, pCB->getParamsOnLeftClick()); +// CAHManager::getInstance()->runActionHandler (pCB->getActionOnLeftClick(), pCB, pCB->getParamsOnLeftClick()); // // } // pList->invalidateCoords(); @@ -1233,9 +1233,9 @@ void onlogin(bool vanishScreen = true) // NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:SCREEN")->setValue32(UI_VARIABLES_SCREEN_CHECKPASS); // // if (LoginLogin.empty()) -// pIM->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_LOGIN "|select_all=false"); +// CAHManager::getInstance()->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_LOGIN "|select_all=false"); // else -// pIM->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_PASSWORD "|select_all=false"); +// CAHManager::getInstance()->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_PASSWORD "|select_all=false"); } } @@ -1470,7 +1470,7 @@ class CAHLoginConnect : public IActionHandler // } // else // { -// pIM->runActionHandler("login_patch",NULL); +// CAHManager::getInstance()->runActionHandler("login_patch",NULL); // } } }; @@ -2173,9 +2173,9 @@ class CAHOnScanDataClose : public IActionHandler // loginEB= pGEB->getInputStringAsStdString(); // // if none entered // if (loginEB.empty()) -// pIM->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_LOGIN "|select_all=false"); +// CAHManager::getInstance()->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_LOGIN "|select_all=false"); // else -// pIM->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_PASSWORD "|select_all=false"); +// CAHManager::getInstance()->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_PASSWORD "|select_all=false"); } } }; @@ -2354,7 +2354,7 @@ bool initCreateAccount() rulesGr->setActive(false); // must be done after hide rules - pIM->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_CREATEACCOUNT_LOGIN "|select_all=false"); + CAHManager::getInstance()->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_CREATEACCOUNT_LOGIN "|select_all=false"); } diff --git a/code/ryzom/client/src/net_manager.cpp b/code/ryzom/client/src/net_manager.cpp index 21662969d..f4683d72e 100644 --- a/code/ryzom/client/src/net_manager.cpp +++ b/code/ryzom/client/src/net_manager.cpp @@ -1665,13 +1665,13 @@ void impulseTPCommon2(NLMISC::CBitMemStream &impulse, bool hasSeason) switch(tpContext) { case R2::TPContext_Mainland: - CInterfaceManager::getInstance()->runActionHandler("return_to_mainland", NULL); + CAHManager::getInstance()->runActionHandler("return_to_mainland", NULL); break; case R2::TPContext_Edit: - CInterfaceManager::getInstance()->runActionHandler("r2ed_stop_test", NULL); + CAHManager::getInstance()->runActionHandler("r2ed_stop_test", NULL); break; case R2::TPContext_IslandOwner: - CInterfaceManager::getInstance()->runActionHandler("r2_stop_live", NULL); + CAHManager::getInstance()->runActionHandler("r2_stop_live", NULL); break; default: break; diff --git a/code/ryzom/client/src/outpost_manager.cpp b/code/ryzom/client/src/outpost_manager.cpp index 1f6deb320..31d0fd647 100644 --- a/code/ryzom/client/src/outpost_manager.cpp +++ b/code/ryzom/client/src/outpost_manager.cpp @@ -105,7 +105,7 @@ void COutpostManager::update() CInterfaceManager *pIM= CInterfaceManager::getInstance(); // Force the neutral choose - pIM->runActionHandler("outpost_pvp_join", NULL, "neutral"); + CAHManager::getInstance()->runActionHandler("outpost_pvp_join", NULL, "neutral"); // close the window CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal")); diff --git a/code/ryzom/client/src/r2/editor.cpp b/code/ryzom/client/src/r2/editor.cpp index 24b0cd302..620ffd6c9 100644 --- a/code/ryzom/client/src/r2/editor.cpp +++ b/code/ryzom/client/src/r2/editor.cpp @@ -5281,7 +5281,7 @@ void CEditor::onTestModeConnected() CHECK_EDITOR // TODO nico : change the name of the function : should rather be 'onAnimationModeConnected' // start as a GM - getUI().runActionHandler("r2ed_anim_dm_mode", NULL, ""); + CAHManager::getInstance()->runActionHandler("r2ed_anim_dm_mode", NULL, ""); _DMC->CDynamicMapClient::onTestModeConnected(); } @@ -7394,7 +7394,7 @@ class CAHInviteCharacter : public IActionHandler CHECK_EDITOR CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler("leave_modal", pCaller, ""); + CAHManager::getInstance()->runActionHandler("leave_modal", pCaller, ""); if(pCaller) { @@ -7429,11 +7429,11 @@ class CAHInviteCharacter : public IActionHandler if (pVT != NULL) pVT->setText(CI18N::get("uiRingWarningInviteFreeTrial")); - pIM->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); + CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); } else if(sessionBrowser._LastInvokeResult == 12) { - pIM->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_newcomer"); + CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_newcomer"); } geb->setInputString(ucstring("")); diff --git a/code/ryzom/client/src/r2/tool_create_entity.cpp b/code/ryzom/client/src/r2/tool_create_entity.cpp index cbbcf6283..ccbc4ee7a 100644 --- a/code/ryzom/client/src/r2/tool_create_entity.cpp +++ b/code/ryzom/client/src/r2/tool_create_entity.cpp @@ -141,7 +141,7 @@ void CToolCreateEntity::commit(const NLMISC::CVector &createPosition, float crea // prevent newly created ghost to be removed twice ... removeGhostSlot(); // re set this tool to generate a new entity look - getUI().runActionHandler("r2ed_create_entity", NULL, "PaletteId=" + _PaletteId); + CAHManager::getInstance()->runActionHandler("r2ed_create_entity", NULL, "PaletteId=" + _PaletteId); } } @@ -616,7 +616,7 @@ void CToolCreateEntity::updateAfterRender() { commitArray(); CTool::TSmartPtr hold(this); - getUI().runActionHandler("r2ed_create_entity", NULL, "PaletteId="+_PaletteId); + CAHManager::getInstance()->runActionHandler("r2ed_create_entity", NULL, "PaletteId="+_PaletteId); return; } break; @@ -825,7 +825,7 @@ class CAHR2EDToggleDrawArray : public IActionHandler CToolCreateEntity *tce = dynamic_cast(getEditor().getCurrentTool()); if (tce) { - im->runActionHandler("r2ed_create_entity", NULL, "PaletteId=" + tce->getPaletteId()); + CAHManager::getInstance()->runActionHandler("r2ed_create_entity", NULL, "PaletteId=" + tce->getPaletteId()); } } } diff --git a/code/ryzom/client/src/session_browser_impl.cpp b/code/ryzom/client/src/session_browser_impl.cpp index b408686aa..856d1f204 100644 --- a/code/ryzom/client/src/session_browser_impl.cpp +++ b/code/ryzom/client/src/session_browser_impl.cpp @@ -222,7 +222,7 @@ int CSessionBrowserImpl::luaJoinRingSession(CLuaState &ls) CViewText* pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); if (pVT != NULL) pVT->setText(CI18N::get("uiRingWarningFreeTrial")); - pIM->runActionHandler("enter_modal", NULL, "group=ui:interface:warning_free_trial"); + CAHManager::getInstance()->runActionHandler("enter_modal", NULL, "group=ui:interface:warning_free_trial"); } return 0; @@ -326,7 +326,7 @@ void CSessionBrowserImpl::on_joinSessionResult(NLNET::TSockId /* from */, uint32 if (result == 0) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - pIM->runActionHandler("on_connect_to_shard", NULL, string("cookie=")+NetMngr.getLoginCookie().toString()+"|fsAddr="+shardAddr); + CAHManager::getInstance()->runActionHandler("on_connect_to_shard", NULL, string("cookie=")+NetMngr.getLoginCookie().toString()+"|fsAddr="+shardAddr); } } diff --git a/code/ryzom/client/src/user_entity.cpp b/code/ryzom/client/src/user_entity.cpp index 08d12fd0d..f91e22eb4 100644 --- a/code/ryzom/client/src/user_entity.cpp +++ b/code/ryzom/client/src/user_entity.cpp @@ -1571,12 +1571,12 @@ void CUserEntity::moveToAction(CEntityCL *ent) // Quartering case CUserEntity::Quarter: if((ent->properties()).harvestable()) - IM->runActionHandler("context_quartering", 0); + CAHManager::getInstance()->runActionHandler("context_quartering", 0); break; // Loot case CUserEntity::Loot: if((ent->properties()).lootable()) - IM->runActionHandler("context_loot", 0); + CAHManager::getInstance()->runActionHandler("context_loot", 0); break; // Pick Up case CUserEntity::PickUp: @@ -1587,57 +1587,57 @@ void CUserEntity::moveToAction(CEntityCL *ent) break; // Trade Item case CUserEntity::TradeItem: - IM->runActionHandler("context_trade_item", 0); + CAHManager::getInstance()->runActionHandler("context_trade_item", 0); break; // Trade Phrase case CUserEntity::TradePhrase: - IM->runActionHandler("context_trade_phrase", 0); + CAHManager::getInstance()->runActionHandler("context_trade_phrase", 0); break; // Trade Pact case CUserEntity::TradePact: - IM->runActionHandler("context_trade_pact", 0); + CAHManager::getInstance()->runActionHandler("context_trade_pact", 0); break; // Mission case CUserEntity::Mission: { string param = toString("id=%d", _MoveToMissionId); - IM->runActionHandler("mission_option", 0, param); + CAHManager::getInstance()->runActionHandler("mission_option", 0, param); } break; // Dynamic Mission case CUserEntity::DynamicMission: - IM->runActionHandler("context_dynamic_mission", 0); + CAHManager::getInstance()->runActionHandler("context_dynamic_mission", 0); break; // Static Mission case CUserEntity::StaticMission: - IM->runActionHandler("context_choose_mission", 0); + CAHManager::getInstance()->runActionHandler("context_choose_mission", 0); break; // Mission case CUserEntity::MissionRing: { string param = toString("id=%d", _MoveToMissionId); - IM->runActionHandler("mission_ring", 0, param); + CAHManager::getInstance()->runActionHandler("mission_ring", 0, param); } break; // Create Guild case CUserEntity::CreateGuild: - IM->runActionHandler("context_create_guild", 0); + CAHManager::getInstance()->runActionHandler("context_create_guild", 0); break; // News case CUserEntity::News: - IM->runActionHandler("context_talk", 0); + CAHManager::getInstance()->runActionHandler("context_talk", 0); break; // Trade Teleport case CUserEntity::TradeTeleport: - IM->runActionHandler("context_trade_teleport", 0); + CAHManager::getInstance()->runActionHandler("context_trade_teleport", 0); break; // Trade Faction items case CUserEntity::TradeFaction: - IM->runActionHandler("context_trade_faction", 0); + CAHManager::getInstance()->runActionHandler("context_trade_faction", 0); break; // Trade Cosmetic case CUserEntity::TradeCosmetic: - IM->runActionHandler("context_trade_cosmetic", 0); + CAHManager::getInstance()->runActionHandler("context_trade_cosmetic", 0); break; // Talk case CUserEntity::Talk: @@ -1658,7 +1658,7 @@ void CUserEntity::moveToAction(CEntityCL *ent) } // WebPage case CUserEntity::WebPage: - IM->runActionHandler("context_web_page", 0); + CAHManager::getInstance()->runActionHandler("context_web_page", 0); break; // Outpost case CUserEntity::Outpost: @@ -2248,7 +2248,7 @@ void CUserEntity::setDead() // virtual //CInterfaceManager * pIM = CInterfaceManager::getInstance(); if( pIM ) { - pIM->runActionHandler("set",NULL,"dblink=UI:VARIABLES:DEATH_WARNING_WANTED|value=1"); + CAHManager::getInstance()->runActionHandler("set",NULL,"dblink=UI:VARIABLES:DEATH_WARNING_WANTED|value=1"); } }// setDead // @@ -3746,7 +3746,7 @@ void CUserEntity::CSkillPointsObserver::update(ICDBNode* node ) spTitle= CI18N::get(toString("uiSkillPointsBold%d",SpType)); // run the popup - pIM->runActionHandler("message_popup", NULL, "text1="+deltaStr+"|text0="+spTitle.toUtf8()); + CAHManager::getInstance()->runActionHandler("message_popup", NULL, "text1="+deltaStr+"|text0="+spTitle.toUtf8()); // Context help contextHelp ("skill_point");