36 ImGui::SetColumnWidth(0, ImGui::GetFontSize() * 1.5625f);
37 ImGui::SetColumnWidth(1, ImGui::GetFontSize() * 12.5f);
38 ImGui::SetColumnWidth(2, ImGui::GetFontSize() * 12.5f);
41 ImGui::TextDisabled(
_LC(
"ScriptMonitor",
"ID"));
43 ImGui::TextDisabled(
_LC(
"ScriptMonitor",
"File name"));
45 ImGui::TextDisabled(
_LC(
"ScriptMonitor",
"Options"));
57 ImGui::AlignTextToFramePadding();
58 ImGui::TextDisabled(
"%d",
id);
60 ImGui::AlignTextToFramePadding();
77 ImGui::Text(
"%s",
_LC(
"ScriptMonitor",
"(terrain)"));
83 if (ImGui::Button(
_LC(
"ScriptMonitor",
"Kill")))
98 if (ImGui::Button(
_LC(
"ScriptMonitor",
"Reload")))
107 if (ImGui::Button(
_LC(
"ScriptMonitor",
"Stop")))
113 bool autoload_set = std::find(autoload.begin(), autoload.end(), filename) != autoload.end();
114 if (ImGui::Checkbox(
_LC(
"ScriptMonitor",
"Autoload"), &autoload_set))
134 for (String& filename : recent)
136 bool is_running = std::find_if(
139 [filename](ScriptUnitMap::const_iterator::value_type pair) {
return filename == pair.second.scriptName; })
154 ImGui::PushID(filename.c_str());
158 ImGui::AlignTextToFramePadding();
159 ImGui::Text(
"%s", filename.c_str());
161 float cursorx = ImGui::GetCursorPosX();
162 if (ImGui::Button(
_LC(
"ScriptMonitor",
"Load")))
170 ImVec2 rem_size = ImGui::CalcTextSize(
_LC(
"ScriptMonitor",
"Remove"));
172 ImGui::SetCursorPosX(((cursorx + ImGui::GetFontSize() * 11.875f) - rem_size.x) - 2*ImGui::GetStyle().FramePadding.x);
173 if (ImGui::SmallButton(
_LC(
"ScriptMonitor",
"Remove")))
190 ImVec2 pos = ImGui::GetCursorScreenPos() + ImVec2(ImGui::GetFontSize() * 0.625f, 0.f);
191 ImGui::Dummy(ImVec2(0.1f, ImGui::GetFontSize() * 0.15625f));
193 ImGui::Dummy(ImVec2(0.1f, ImGui::GetFontSize() * 0.15625f));
194 ImDrawList* drawlist = ImGui::GetWindowDrawList();
195 ImVec2 padding(ImGui::GetFontSize() * 0.3125f, 0.f);
196 ImVec2 rect_max = pos + padding*2 + ImGui::CalcTextSize(text);
197 drawlist->AddRectFilled(pos, rect_max, ImColor(ImGui::GetStyle().Colors[ImGuiCol_PopupBg]), ImGui::GetStyle().WindowRounding);
198 drawlist->AddText(pos + padding, ImColor(ImGui::GetStyle().Colors[ImGuiCol_TextDisabled]), text);
Game state manager and message-queue provider.
unsigned int ar_vector_index
Sim attr; actor element index in std::vector<m_actors>
std::string getTruckName()
Ogre::String fname
filename
void DrawCommentedSeparator(const char *text)
Ogre::StringVector m_recent_displaylist
void PushMessage(Message m)
Doesn't guarantee order! Use ChainMessage() if order matters.
void ChainMessage(Message m)
Add to last pushed message's chain.
ScriptUnitMap const & getScriptUnits() const
@ MSG_APP_UNLOAD_SCRIPT_REQUESTED
Payload = RoR::ScriptUnitId_t* (owner)
@ MSG_APP_LOAD_SCRIPT_REQUESTED
Payload = RoR::LoadScriptRequest* (owner)
@ CUSTOM
Loaded by user via either: A) ingame console 'loadscript'; B) RoR.cfg 'app_custom_scripts'; C) comman...
@ AI_BOT
Only valid under MpState::LOCAL_SCRIPT; registers as RoRnet user in the server script (i....
@ GADGET
Associated with a .gadget mod file, launched via UI or any method given below for CUSTOM scripts (use...
@ TERRAIN
Defined in terrn2 file under '[Scripts]', receives terrain eventbox notifications.
@ ACTOR
Defined in truck file under 'scripts', contains global variable BeamClass@ thisActor.
CVar * app_recent_scripts
GameContext * GetGameContext()
ScriptEngine * GetScriptEngine()
CVar * app_custom_scripts
void CvarAddFileToList(CVar *cvar, const std::string &filename)
int ScriptUnitID_t
Unique sequentially generated ID of a loaded and running scriptin session. Use ScriptEngine::getScrip...
void CvarRemoveFileFromList(CVar *cvar, const std::string &filename)
std::string lsr_filename
Load from resource ('.as' file or '.gadget' file); If buffer is supplied, use this as display name on...
ScriptCategory lsr_category
Unified game event system - all requests and state changes are reported using a message.
Represents a loaded script and all associated resources/handles.
CacheEntryPtr originatingGadget
For ScriptCategory::GADGET ~ determines resource group.
int32_t associatedNetUid
For ScriptCategory::AI_BOT ~ used to identify the bot in the server script.
ScriptCategory scriptCategory
Ogre::String scriptName
Name of the '.as' file exclusively.
ActorPtr associatedActor
For ScriptCategory::ACTOR.