MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / DrawLaunchCustomGuiButton

Function DrawLaunchCustomGuiButton

Source/GUI/dimgui/dimgui.cpp:904–934  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

902}
903
904static 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
936static void DrawObjectInfoFlat(Object* obj) {
937 ImGui::Indent(ImGui::GetTreeNodeToLabelSpacing());

Callers 2

DrawObjectInfoFlatFunction · 0.85
DrawObjectInfoFunction · 0.85

Calls 9

ButtonClass · 0.85
HasCustomGUIMethod · 0.80
LaunchCustomGUIMethod · 0.80
HasParamMethod · 0.80
GetScriptParamsMethod · 0.80
GetTypeMethod · 0.45
GetIDMethod · 0.45
MessageMethod · 0.45

Tested by

no test coverage detected