| 766 | extern bool StripLeadingTrailingSpaces(char *s); |
| 767 | |
| 768 | void 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 | |
| 777 | try_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 | |
| 795 | void CTriggerDialog::OnTrigEditScript() { |
| 796 |
nothing calls this directly
no test coverage detected