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

Method onAddCommand

plugins/dm.conversation/ConversationEditor.cpp:496–522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

494}
495
496void ConversationEditor::onAddCommand(wxCommandEvent& ev)
497{
498 conversation::Conversation& conv = _conversation; // shortcut
499
500 // Create a new command
501 conversation::ConversationCommandPtr command(new conversation::ConversationCommand);
502
503 // Construct a command editor (blocks on construction)
504 CommandEditor* editor = new CommandEditor(this, *command, conv);
505
506 if (editor->ShowModal() == wxID_OK)
507 {
508 // The user hit ok, insert the command, find the first free index
509 int index = 1;
510 while (conv.commands.find(index) != conv.commands.end())
511 {
512 index++;
513 }
514
515 // Insert the command at the new location
516 conv.commands[index] = command;
517
518 updateWidgets();
519 }
520
521 editor->Destroy();
522}
523
524void ConversationEditor::onEditCommand(wxCommandEvent& ev)
525{

Callers

nothing calls this directly

Calls 4

ShowModalMethod · 0.45
findMethod · 0.45
endMethod · 0.45
DestroyMethod · 0.45

Tested by

no test coverage detected