 |
RigsofRods
2023.09
Soft-body Physics Simulation
|
Go to the documentation of this file.
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();
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))
123 m_recent_displaylist.clear();
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; })
134 m_recent_displaylist.push_back(filename);
139 if (m_recent_displaylist.size() > 0)
141 this->DrawCommentedSeparator(
_LC(
"ScriptMonitor",
"Recent"));
143 for (String& filename : m_recent_displaylist)
149 ImGui::AlignTextToFramePadding();
150 ImGui::Text(
"%s", filename.c_str());
152 float cursorx = ImGui::GetCursorPosX();
153 if (ImGui::Button(
_LC(
"ScriptMonitor",
"Load")))
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);
188 drawlist->AddRectFilled(pos, rect_max, ImColor(ImGui::GetStyle().Colors[
ImGuiCol_PopupBg]), ImGui::GetStyle().WindowRounding);
Represents a loaded script and all associated resources/handles.
Game state manager and message-queue provider.
void Columns(int=1, const string &in=string(), bool=true)
ScriptUnitMap const & getScriptUnits() const
std::string lsr_filename
Load from resource ('.as' file or '.gadget' file); If buffer is supplied, use this as display name on...
enum Script2Game::ImGuiStyleVar ImGuiCol_TextDisabled
CacheEntryPtr originatingGadget
For ScriptCategory::GADGET ~ determines resource group.
void DrawCommentedSeparator(const char *text)
unsigned int ar_vector_index
Sim attr; actor element index in std::vector<m_actors>
vector2 CalcTextSize(const string &in, bool hide_text_after_double_hash=false, float wrap_width=-1.0f)
@ MSG_APP_LOAD_SCRIPT_REQUESTED
Payload = RoR::LoadScriptRequest* (owner)
ScriptEngine * GetScriptEngine()
ScriptCategory lsr_category
void ChainMessage(Message m)
Add to last pushed message's chain.
Ogre::String scriptName
Name of the '.as' file exclusively.
void PushID(const string &in)
ScriptCategory scriptCategory
void PushMessage(Message m)
Doesn't guarantee order! Use ChainMessage() if order matters.
GameContext * GetGameContext()
void CvarAddFileToList(CVar *cvar, const std::string &filename)
@ TERRAIN
Defined in terrn2 file under '[Scripts]', receives terrain eventbox notifications.
ActorPtr associatedActor
For ScriptCategory::ACTOR.
void CvarRemoveFileFromList(CVar *cvar, const std::string &filename)
CVar * app_recent_scripts
Unified game event system - all requests and state changes are reported using a message.
@ ACTOR
Defined in truck file under 'scripts', contains global variable BeamClass@ thisActor.
@ MSG_APP_UNLOAD_SCRIPT_REQUESTED
Payload = RoR::ScriptUnitId_t* (owner)
int ScriptUnitID_t
Unique sequentially generated ID of a loaded and running scriptin session. Use ScriptEngine::getScrip...
@ GADGET
Associated with a .gadget mod file, launched via UI or any method given below for CUSTOM scripts (use...
std::string getTruckName()
CVar * app_custom_scripts
enum Script2Game::ImGuiStyleVar ImGuiCol_PopupBg
Background of popups, menus, tooltips windows.
@ CUSTOM
Loaded by user via either: A) ingame console 'loadscript'; B) RoR.cfg 'app_custom_scripts'; C) comman...
Ogre::String fname
filename