MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / OnTrigEditName

Method OnTrigEditName

editor/TriggerDialog.cpp:768–793  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

766extern bool StripLeadingTrailingSpaces(char *s);
767
768void CTriggerDialog::OnTrigEditName() {
769 ASSERT(Current_trigger != -1);
770
771 trigger *tp = &Triggers[Current_trigger];
772
773 char name[TRIG_NAME_LEN + 1];
774
775 strcpy(name, tp->name);
776
777try_again:;
778 if (!InputString(name, sizeof(name), "Trigger Name", "Enter a new name:"))
779 return;
780
781 if (StripLeadingTrailingSpaces(name))
782 EditorMessageBox("Note: Leading and/or trailing spaces have been removed from this name (\"%s\")", name);
783
784 int n = osipf_FindTriggerName(name);
785 if ((n != -1) && (n != Current_trigger)) {
786 EditorMessageBox("Trigger %d already has this name.", n);
787 goto try_again;
788 }
789
790 strcpy(tp->name, name);
791
792 UpdateDialog();
793}
794
795void CTriggerDialog::OnTrigEditScript() {
796

Callers

nothing calls this directly

Calls 3

InputStringFunction · 0.85
osipf_FindTriggerNameFunction · 0.85

Tested by

no test coverage detected