MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / RunDialog

Method RunDialog

plugins/dm.gui/ReadableEditorDialog.cpp:113–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113void ReadableEditorDialog::RunDialog(const cmd::ArgumentList& args)
114{
115 // Check prerequisites
116 const SelectionInfo& info = GlobalSelectionSystem().getSelectionInfo();
117
118 if (info.entityCount == 1 && info.totalCount == info.entityCount)
119 {
120 // Check the entity type
121 Entity* entity = Node_getEntity(GlobalSelectionSystem().ultimateSelected());
122
123 if (entity != NULL && entity->getKeyValue("editor_readable") == "1")
124 {
125 // Show the dialog
126 ReadableEditorDialog* dialog = new ReadableEditorDialog(entity);
127
128 dialog->ShowModal();
129 dialog->Destroy();
130 return;
131 }
132 }
133
134 // Exactly one redable entity must be selected.
135 wxutil::Messagebox::ShowError(_(NO_ENTITY_ERROR));
136}
137
138// UI Creation
139

Callers

nothing calls this directly

Calls 6

Node_getEntityFunction · 0.85
_Function · 0.50
ultimateSelectedMethod · 0.45
getKeyValueMethod · 0.45
ShowModalMethod · 0.45
DestroyMethod · 0.45

Tested by

no test coverage detected