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"));
57 ImGui::AlignTextToFramePadding();
58 ImGui::TextDisabled(
"%d",
id);
60 ImGui::AlignTextToFramePadding();
77 ImGui::Text(
"%s",
_LC(
"ScriptMonitor",
"(terrain)"));
89 if (ImGui::Button(
_LC(
"ScriptMonitor",
"Reload")))
98 if (ImGui::Button(
_LC(
"ScriptMonitor",
"Stop")))
104 bool autoload_set = std::find(autoload.begin(), autoload.end(), filename) != autoload.end();
105 if (ImGui::Checkbox(
_LC(
"ScriptMonitor",
"Autoload"), &autoload_set))
125 for (String& filename : recent)
127 bool is_running = std::find_if(
130 [filename](ScriptUnitMap::const_iterator::value_type pair) {
return filename == pair.second.scriptName; })
145 ImGui::PushID(filename.c_str());
149 ImGui::AlignTextToFramePadding();
150 ImGui::Text(
"%s", filename.c_str());
152 float cursorx = ImGui::GetCursorPosX();
153 if (ImGui::Button(
_LC(
"ScriptMonitor",
"Load")))
161 ImVec2 rem_size = ImGui::CalcTextSize(
_LC(
"ScriptMonitor",
"Remove"));
163 ImGui::SetCursorPosX(((cursorx + 190) - rem_size.x) - 2*ImGui::GetStyle().FramePadding.x);
164 if (ImGui::SmallButton(
_LC(
"ScriptMonitor",
"Remove")))
181 ImVec2 pos = ImGui::GetCursorScreenPos() + ImVec2(10.f, 0.f);
182 ImGui::Dummy(ImVec2(0.1f, 2.5f));
184 ImGui::Dummy(ImVec2(0.1f, 2.5f));
185 ImDrawList* drawlist = ImGui::GetWindowDrawList();
186 ImVec2 padding(5.f, 0.f);
187 ImVec2 rect_max = pos + padding*2 + ImGui::CalcTextSize(text);
188 drawlist->AddRectFilled(pos, rect_max, ImColor(ImGui::GetStyle().Colors[ImGuiCol_PopupBg]), ImGui::GetStyle().WindowRounding);
189 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...
@ 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.
ScriptCategory scriptCategory
Ogre::String scriptName
Name of the '.as' file exclusively.
ActorPtr associatedActor
For ScriptCategory::ACTOR.