MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / notifyGuiAction

Method notifyGuiAction

source/modes/EditorMode.cpp:830–876  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

828}
829
830void EditorMode::notifyGuiAction(GuiAction guiAction)
831{
832 switch(guiAction)
833 {
834 case GuiAction::ButtonPressedCreatureWorker:
835 {
836 if(ODClient::getSingleton().isConnected())
837 {
838 ClientNotification *clientNotification = new ClientNotification(
839 ClientNotificationType::editorCreateWorker);
840 clientNotification->mPacket << getModeManager().getInputManager().mSeatIdSelected;
841 ODClient::getSingleton().queueClientNotification(clientNotification);
842 }
843 break;
844 }
845 case GuiAction::ButtonPressedCreatureFighter:
846 {
847 if(ODClient::getSingleton().isConnected())
848 {
849 const CreatureDefinition* def = mGameMap->getClassDescription(mCurrentCreatureIndex);
850 if(def == nullptr)
851 {
852 OD_LOG_ERR("unexpected null CreatureDefinition mCurrentCreatureIndex=" + Helper::toString(mCurrentCreatureIndex));
853 break;
854 }
855 ClientNotification *clientNotification = new ClientNotification(
856 ClientNotificationType::editorCreateFighter);
857 clientNotification->mPacket << getModeManager().getInputManager().mSeatIdSelected;
858 clientNotification->mPacket << def->getClassName();
859 ODClient::getSingleton().queueClientNotification(clientNotification);
860 }
861 break;
862 }
863 case GuiAction::ButtonPressedMapLight:
864 {
865 if(ODClient::getSingleton().isConnected())
866 {
867 ClientNotification *clientNotification = new ClientNotification(
868 ClientNotificationType::editorAskCreateMapLight);
869 ODClient::getSingleton().queueClientNotification(clientNotification);
870 }
871 break;
872 }
873 default:
874 break;
875 }
876}
877
878bool EditorMode::toggleOptionsWindow(const CEGUI::EventArgs& /*arg*/)
879{

Callers

nothing calls this directly

Calls 4

getClassDescriptionMethod · 0.80
toStringFunction · 0.50
isConnectedMethod · 0.45

Tested by

no test coverage detected