| 902 | } |
| 903 | |
| 904 | static void DrawLaunchCustomGuiButton(Object* obj, bool& are_script_params_read_only, int button_instance_id = -1) { |
| 905 | if (button_instance_id != -1) { |
| 906 | ImGui::PushID(button_instance_id); |
| 907 | } |
| 908 | |
| 909 | if (obj->GetType() == _hotspot_object) { |
| 910 | Hotspot* hotspot = (Hotspot*)obj; |
| 911 | |
| 912 | if (hotspot->HasCustomGUI() && ImGui::Button("Open custom editor")) { |
| 913 | hotspot->LaunchCustomGUI(); |
| 914 | } |
| 915 | |
| 916 | are_script_params_read_only = hotspot->ObjectInspectorReadOnly(); |
| 917 | } else if (obj->GetType() == _placeholder_object) { |
| 918 | PlaceholderObject* placeholder = (PlaceholderObject*)obj; |
| 919 | |
| 920 | if (placeholder->GetScriptParams()->HasParam("Dialogue")) { |
| 921 | if (ImGui::Button("Launch dialogue editor")) { |
| 922 | char buffer[64]; |
| 923 | sprintf(buffer, "edit_dialogue_id%i", placeholder->GetID()); |
| 924 | placeholder->scenegraph_->level->Message(buffer); |
| 925 | } |
| 926 | |
| 927 | are_script_params_read_only = true; |
| 928 | } |
| 929 | } |
| 930 | |
| 931 | if (button_instance_id != -1) { |
| 932 | ImGui::PopID(); |
| 933 | } |
| 934 | } |
| 935 | |
| 936 | static void DrawObjectInfoFlat(Object* obj) { |
| 937 | ImGui::Indent(ImGui::GetTreeNodeToLabelSpacing()); |
no test coverage detected