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

Method UpdateGUI

Source/Scripting/angelscript/asdebugger.cpp:650–775  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

648static ImGuiTextFilter local_filter;
649static ImGuiTextFilter global_filter;
650ASDebugger::BreakAction ASDebugger::UpdateGUI() {
651 BreakAction action = NONE;
652
653 ImGui::SetNextWindowSize(ImVec2(1024.0f, 768.0f), ImGuiCond_FirstUseEver);
654 ImGui::Begin("Angelscript debugger", &show_performance);
655
656 ImGui::Text("Currently executing %s", current_file.resolved);
657
658 if (ImGui::Button("Continue")) {
659 action = CONTINUE;
660 }
661 ImGui::SameLine();
662 if (ImGui::Button("Step over")) {
663 action = OVER;
664 }
665 ImGui::SameLine();
666 if (ImGui::Button("Step into")) {
667 action = INTO;
668 }
669 ImGui::SameLine();
670 if (ImGui::Button("Step out")) {
671 action = LEAVE;
672 }
673
674 ImGui::Checkbox("Show local variables", &show_local_variables);
675 ImGui::SameLine();
676 ImGui::Checkbox("Show global variables", &show_global_variables);
677 ImGui::SameLine();
678 ImGui::Checkbox("Show stack trace", &show_stack_trace);
679
680 const ScriptFile* script = ScriptFileUtil::GetScriptFile(current_file);
681 const char* file_name = script->file_path.GetFullPath();
682 int last_slash = 0;
683 for (size_t i = 0; i < std::strlen(file_name); ++i) {
684 if (file_name[i] == '\\' || file_name[i] == '/')
685 last_slash = i;
686 }
687 file_name += last_slash + 1;
688
689 const std::string& script_source = script->unexpanded_contents;
690 int start_index = 0;
691 int end_index = 0;
692
693 ImGui::BeginChild("ASSourceMain", ImVec2(0, 0), false, 0);
694 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.0f, 0.0f, 0.0f, 0.0f));
695 ImGui::Columns(2);
696
697 int line_nr = 1;
698
699 const int MAX_LINE_LENGTH = 255;
700 char line[MAX_LINE_LENGTH + 1];
701
702 const std::vector<int>* breakpoints = GetBreakpoints(file_name);
703
704 ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0.0f, 0.5f));
705 ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0.0f, 0.0f));
706 while (end_index != (int)script_source.size()) {
707 end_index = std::min(script_source.find('\n', start_index), script_source.size());

Callers

nothing calls this directly

Calls 15

TextClass · 0.85
ButtonClass · 0.85
PushStyleColorFunction · 0.85
PushStyleVarFunction · 0.85
PopStyleColorFunction · 0.85
PopStyleVarFunction · 0.85
GetFullPathMethod · 0.80
GetCallstackSizeMethod · 0.80
GetOriginalPathMethod · 0.80
GetDeclarationMethod · 0.80
ImVec2Function · 0.50
CheckboxClass · 0.50

Tested by

no test coverage detected