36 ImGui::SetColumnWidth(0, 25);
37 ImGui::SetColumnWidth(1, 200);
38 ImGui::SetColumnWidth(2, 200);
41 ImGui::TextDisabled(
_LC(
"ScriptMonitor",
"ID"));
43 ImGui::TextDisabled(
_LC(
"ScriptMonitor",
"File name"));
45 ImGui::TextDisabled(
_LC(
"ScriptMonitor",
"Options"));
47 this->DrawCommentedSeparator(
_LC(
"ScriptMonitor",
"Active"));
57 ImGui::AlignTextToFramePadding();
58 ImGui::TextDisabled(
"%d",
id);
60 ImGui::AlignTextToFramePadding();
70 ImGui::Text(
"%s",
_LC(
"ScriptMonitor",
"(terrain)"));
75 if (ImGui::Button(
_LC(
"ScriptMonitor",
"Reload")))
84 if (ImGui::Button(
_LC(
"ScriptMonitor",
"Stop")))
90 bool autoload_set = std::find(autoload.begin(), autoload.end(), unit.
scriptName) != autoload.end();
91 if (ImGui::Checkbox(
_LC(
"ScriptMonitor",
"Autoload"), &autoload_set))
109 m_recent_displaylist.clear();
111 for (String& filename : recent)
113 bool is_running = std::find_if(
116 [filename](ScriptUnitMap::const_iterator::value_type pair) {
return filename == pair.second.scriptName; })
120 m_recent_displaylist.push_back(filename);
125 if (m_recent_displaylist.size() > 0)
127 this->DrawCommentedSeparator(
_LC(
"ScriptMonitor",
"Recent"));
129 for (String& filename : m_recent_displaylist)
131 ImGui::PushID(filename.c_str());
135 ImGui::AlignTextToFramePadding();
136 ImGui::Text(
"%s", filename.c_str());
138 float cursorx = ImGui::GetCursorPosX();
139 if (ImGui::Button(
_LC(
"ScriptMonitor",
"Load")))
147 ImVec2 rem_size = ImGui::CalcTextSize(
_LC(
"ScriptMonitor",
"Remove"));
149 ImGui::SetCursorPosX(((cursorx + 190) - rem_size.x) - 2*ImGui::GetStyle().FramePadding.x);
150 if (ImGui::SmallButton(
_LC(
"ScriptMonitor",
"Remove")))
167 ImVec2 pos = ImGui::GetCursorScreenPos() + ImVec2(10.f, 0.f);
168 ImGui::Dummy(ImVec2(0.1f, 2.5f));
170 ImGui::Dummy(ImVec2(0.1f, 2.5f));
171 ImDrawList* drawlist = ImGui::GetWindowDrawList();
172 ImVec2 padding(5.f, 0.f);
173 ImVec2 rect_max = pos + padding*2 + ImGui::CalcTextSize(text);
174 drawlist->AddRectFilled(pos, rect_max, ImColor(ImGui::GetStyle().Colors[ImGuiCol_PopupBg]), ImGui::GetStyle().WindowRounding);
175 drawlist->AddText(pos + padding, ImColor(ImGui::GetStyle().Colors[ImGuiCol_TextDisabled]), text);