RigsofRods
Soft-body Physics Simulation
GUI_TopMenubar.cpp
Go to the documentation of this file.
1 /*
2  This source file is part of Rigs of Rods
3  Copyright 2005-2012 Pierre-Michel Ricordel
4  Copyright 2007-2012 Thomas Fischer
5  Copyright 2016-2020 Petr Ohlidal
6 
7  For more information, see http://www.rigsofrods.org/
8 
9  Rigs of Rods is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License version 3, as
11  published by the Free Software Foundation.
12 
13  Rigs of Rods is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
25 
26 #include "GUI_TopMenubar.h"
27 
28 #include "Application.h"
29 #include "Actor.h"
30 #include "ActorManager.h"
31 #include "CameraManager.h"
32 #include "DashBoardManager.h"
33 #include "FlexBody.h"
34 #include "GameContext.h"
35 #include "GfxScene.h"
36 #include "GUIManager.h"
37 #include "GUIUtils.h"
38 #include "GUI_MainSelector.h"
39 #include "InputEngine.h"
40 #include "Language.h"
41 #include "Network.h"
42 #include "PlatformUtils.h"
43 #include "Replay.h"
44 #include "SkyManager.h"
45 #include "Terrain.h"
46 #include "Terrn2FileFormat.h"
47 #include "TuneupFileFormat.h"
48 #include "Water.h"
49 #include "ScriptEngine.h"
50 #include "Console.h"
51 #include "ContentManager.h"
52 
53 #include <algorithm>
54 #include <fmt/format.h>
55 
56 
57 #ifdef USE_CURL
58 # include <curl/curl.h>
59 # include <curl/easy.h>
60 #endif //USE_CURL
61 
62 #if defined(_MSC_VER) && defined(GetObject) // This MS Windows macro from <wingdi.h> (Windows Kit 8.1) clashes with RapidJSON
63 # undef GetObject
64 #endif
65 
66 using namespace RoR;
67 using namespace GUI;
68 
69 #if defined(USE_CURL)
70 
71 static size_t CurlWriteFunc(void *ptr, size_t size, size_t nmemb, std::string* data)
72 {
73  data->append((char*)ptr, size * nmemb);
74  return size * nmemb;
75 }
76 
78 {
79  // If local file 'savegames/waypoints.json' exists, load it; otherwise download from GitHub.
80  // -----------------------------------------------------------------------------------------
81 
82  if (FileExists(PathCombine(App::sys_savegames_dir->getStr(), "waypoints.json")))
83  {
84  try
85  {
86  Ogre::DataStreamPtr stream = Ogre::ResourceGroupManager::getSingleton().openResource("waypoints.json", RGN_SAVEGAMES);
88  m.description = stream->getAsString();
90  }
91  catch (...)
92  {
93  RoR::HandleGenericException("Top menubar / AI presets");
95  m.description = "Failed to load local AI presets.";
97  }
98 
99  return; // DONE
100  }
101 
102  std::string url = "https://raw.githubusercontent.com/RigsOfRods-Community/ai-waypoints/main/waypoints.json";
103  std::string response_payload;
104  long response_code = 0;
105 
106  CURL *curl = curl_easy_init();
107  curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
108  curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
109 #ifdef _WIN32
110  curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NATIVE_CA);
111 #endif // _WIN32
112  curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CurlWriteFunc);
113  curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response_payload);
114 
115  CURLcode curl_result = curl_easy_perform(curl);
116  curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
117 
118  curl_easy_cleanup(curl);
119  curl = nullptr;
120 
121  if (curl_result != CURLE_OK || response_code != 200)
122  {
123  Ogre::LogManager::getSingleton().stream()
124  << "[RoR|Repository] Failed to download AI presets;"
125  << " Error: '" << curl_easy_strerror(curl_result) << "'; HTTP status code: " << response_code;
127  m.description = "Failed to download AI presets.";
129  }
130  else
131  {
133  m.description = response_payload;
135  }
136 }
137 
138 #endif // defined(USE_CURL)
139 
141 {
142  // Constructs `ActorPtr` - doesn't compile without `#include Actor.h` - not pretty if in header (even if auto-generated by C++).
143 
144  ai_presets_all.SetArray();
145  ai_presets_bundled.SetArray();
146  ai_presets_extern.SetArray();
147 }
148 
150 {
151  // Destructs `ActorPtr` - doesn't compile without `#include Actor.h` - not pretty if in header (even if auto-generated by C++).
152 }
153 
154 void TopMenubar::Draw(float dt)
155 {
156  // ## ImGui's 'menubar' and 'menuitem' features won't quite cut it...
157  // ## Let's do our own menus and menuitems using buttons and coloring tricks.
158 
160 
161  int num_playable_actors = 0;
162  for (ActorPtr& actor: App::GetGameContext()->GetActorManager()->GetActors())
163  {
164  if (!actor->ar_hide_in_actor_list)
165  {
166  num_playable_actors++;
167  }
168  }
169 
170  std::string sim_title = _LC("TopMenubar", "Simulation");
171  std::string actors_title = fmt::format("{} ({})", _LC("TopMenubar", "Vehicles"), num_playable_actors);
172  std::string savegames_title = _LC("TopMenubar", "Saves");
173  std::string settings_title = _LC("TopMenubar", "Settings");
174  std::string tools_title = _LC("TopMenubar", "Tools");
175  std::string ai_title = _LC("TopMenubar", "Vehicle AI");
176  std::string tuning_title = _LC("TopMenubar", "Tuning");
177 
178  int menubar_num_buttons = 5;
179  float menubar_content_width =
180  ImGui::CalcTextSize(sim_title.c_str()).x +
181  ImGui::CalcTextSize(actors_title.c_str()).x +
182  ImGui::CalcTextSize(savegames_title.c_str()).x +
183  ImGui::CalcTextSize(settings_title.c_str()).x +
184  ImGui::CalcTextSize(tools_title.c_str()).x;
185 
187  {
188  menubar_num_buttons += 1;
189  menubar_content_width += ImGui::CalcTextSize(ai_title.c_str()).x;
190  }
191 
193  {
194  menubar_num_buttons += 1;
195  menubar_content_width += ImGui::CalcTextSize(tuning_title.c_str()).x;
196  }
197 
198  menubar_content_width +=
199  (ImGui::GetStyle().ItemSpacing.x * (menubar_num_buttons - 1)) +
200  (ImGui::GetStyle().FramePadding.x * (menubar_num_buttons * 2));
201 
202  ImVec2 window_target_pos = ImVec2((ImGui::GetIO().DisplaySize.x/2.f) - (menubar_content_width / 2.f), theme.screen_edge_padding.y);
203  if (!this->ShouldDisplay(window_target_pos))
204  {
206  m_confirm_remove_all = false;
207  this->DrawSpecialStateBox(10.f);
208  return;
209  }
210 
211  ImGui::PushStyleColor(ImGuiCol_WindowBg, theme.semitransparent_window_bg);
212  ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0,0,0,0)); // Fully transparent
213 
214  // The panel
215  int flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove
216  | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_AlwaysAutoResize;
217  ImGui::SetNextWindowContentSize(ImVec2(menubar_content_width, 0.f));
218  ImGui::SetNextWindowPos(window_target_pos);
219  ImGui::Begin("Top menubar", nullptr, flags);
220 
221  if (ImGui::IsWindowHovered())
222  {
223  ai_menu = false;
224  }
225 
226  // The 'simulation' button
227  ImVec2 window_pos = ImGui::GetWindowPos();
228  ImVec2 sim_cursor = ImGui::GetCursorPos();
229  ImGui::Button(sim_title.c_str());
230  if ((m_open_menu != TopMenu::TOPMENU_SIM) && ImGui::IsItemHovered())
231  {
233  }
234 
235  // The 'Tuning' button - only shown if enabled
236  ImVec2 tuning_cursor = ImVec2(0, 0);
238  {
239  ImGui::SameLine();
240  tuning_cursor = ImGui::GetCursorPos();
241  ImGui::Button(tuning_title.c_str());
242  if ((m_open_menu != TopMenu::TOPMENU_TUNING) && ImGui::IsItemHovered())
243  {
245  }
246  }
247 
248  // The 'AI' button - only shown in singleplayer
249  ImVec2 ai_cursor = ImVec2(0, 0);
251  {
252  ImGui::SameLine();
253  ai_cursor = ImGui::GetCursorPos();
254  ImGui::Button(ai_title.c_str());
255  if ((m_open_menu != TopMenu::TOPMENU_AI) && ImGui::IsItemHovered())
256  {
258  }
259  }
260 
261  ImGui::SameLine();
262 
263  // The 'vehicles' button
264  ImVec2 actors_cursor = ImGui::GetCursorPos();
265  ImGui::Button(actors_title.c_str());
266  if ((m_open_menu != TopMenu::TOPMENU_ACTORS) && ImGui::IsItemHovered())
267  {
269  }
270 
271  ImGui::SameLine();
272 
273  // The 'savegames' button
274  ImVec2 savegames_cursor = ImGui::GetCursorPos();
275  ImGui::Button(savegames_title.c_str());
276  if ((m_open_menu != TopMenu::TOPMENU_SAVEGAMES) && ImGui::IsItemHovered())
277  {
281  m_savegame_names.clear();
282  for (int i = 0; i <= 9; i++)
283  {
284  Ogre::String filename = Ogre::StringUtil::format("quicksave-%d.sav", i);
285  m_savegame_names.push_back(App::GetGameContext()->ExtractSceneName(filename));
286  }
287  }
288 
289  ImGui::SameLine();
290 
291  // The 'settings' button
292  ImVec2 settings_cursor = ImGui::GetCursorPos();
293  ImGui::Button(settings_title.c_str());
294  if ((m_open_menu != TopMenu::TOPMENU_SETTINGS) && ImGui::IsItemHovered())
295  {
297 #ifdef USE_CAELUM
298  if (App::gfx_sky_mode->getEnum<GfxSkyMode>() == GfxSkyMode::CAELUM)
300 #endif // USE_CAELUM
301  }
302 
303  ImGui::SameLine();
304 
305  // The 'tools' button
306  ImVec2 tools_cursor = ImGui::GetCursorPos();
307  ImGui::Button(tools_title.c_str());
308  if ((m_open_menu != TopMenu::TOPMENU_TOOLS) && ImGui::IsItemHovered())
309  {
311  }
312 
313  ImVec2 topmenu_final_size = ImGui::GetWindowSize();
314  App::GetGuiManager()->RequestGuiCaptureKeyboard(ImGui::IsWindowHovered());
315  ImGui::End();
316 
317  this->DrawSpecialStateBox(window_target_pos.y + topmenu_final_size.y + 10.f);
318 
319  ImVec2 menu_pos;
320  ActorPtr current_actor = App::GetGameContext()->GetPlayerActor();
321  switch (m_open_menu)
322  {
324  menu_pos.y = window_pos.y + sim_cursor.y + MENU_Y_OFFSET;
325  menu_pos.x = sim_cursor.x + window_pos.x - ImGui::GetStyle().WindowPadding.x;
326  ImGui::SetNextWindowPos(menu_pos);
327  if (ImGui::Begin(_LC("TopMenubar", "Sim menu"), nullptr, static_cast<ImGuiWindowFlags_>(flags)))
328  {
329  // TODO: Display hotkeys on the right side of the menu (with different text color)
330 
331  if (ImGui::Button(_LC("TopMenubar", "Get new vehicle")))
332  {
334 
336  m.payload = reinterpret_cast<void*>(new LoaderType(LT_AllBeam));
338  }
339 
340  if (current_actor != nullptr)
341  {
342  if (ImGui::Button(_LC("TopMenubar", "Show vehicle description")))
343  {
345  }
346 
347  if (current_actor->ar_state != ActorState::NETWORKED_OK)
348  {
349  if (ImGui::Button(_LC("TopMenubar", "Reload current vehicle")))
350  {
353  rq->amr_actor = current_actor->ar_instance_id;
355  }
356 
357  if (ImGui::Button(_LC("TopMenubar", "Remove current vehicle")))
358  {
359  App::GetGameContext()->PushMessage(Message(MSG_SIM_DELETE_ACTOR_REQUESTED, static_cast<void*>(new ActorPtr(current_actor))));
360  }
361  }
362  }
363  else if (App::GetGameContext()->GetLastSpawnedActor())
364  {
365  if (ImGui::Button(_LC("TopMenubar", "Activate last spawned vehicle")))
366  {
369  rq->amr_actor = App::GetGameContext()->GetLastSpawnedActor()->ar_instance_id;
371  }
372 
373  if (ImGui::Button(_LC("TopMenubar", "Reload last spawned vehicle")))
374  {
377  rq->amr_actor = App::GetGameContext()->GetLastSpawnedActor()->ar_instance_id;
379  }
380 
381  if (ImGui::Button(_LC("TopMenubar", "Remove last spawned vehicle")))
382  {
383  ActorPtr actor = App::GetGameContext()->GetLastSpawnedActor();
385  }
386  }
387 
388  if (!App::GetGameContext()->GetActorManager()->GetLocalActors().empty())
389  {
390  if (ImGui::Button(_LC("TopMenubar", "Remove all vehicles")))
391  {
392  m_confirm_remove_all = true;
393  }
395  {
396  ImGui::PushStyleColor(ImGuiCol_Text, ORANGE_TEXT);
397  if (ImGui::Button(_LC("TopMenubar", " [!] Confirm removal")))
398  {
399  for (ActorPtr& actor : App::GetGameContext()->GetActorManager()->GetLocalActors())
400  {
401  if (!actor->ar_hide_in_actor_list && !actor->isPreloadedWithTerrain() &&
402  actor->ar_state != ActorState::NETWORKED_OK)
403  {
405  }
406  }
407  m_confirm_remove_all = false;
408  }
409  ImGui::PopStyleColor();
410  }
411 
412  if (ImGui::Button(_LC("TopMenubar", "Activate all vehicles")))
413  {
415  }
416 
417  bool force_trucks_active = App::GetGameContext()->GetActorManager()->AreTrucksForcedAwake();
418  if (ImGui::Checkbox(_LC("TopMenubar", "Activated vehicles never sleep"), &force_trucks_active))
419  {
420  App::GetGameContext()->GetActorManager()->SetTrucksForcedAwake(force_trucks_active);
421  }
422 
423  if (ImGui::Button(_LC("TopMenubar", "Send all vehicles to sleep")))
424  {
426  }
427  }
428 
429  if (App::mp_state->getEnum<MpState>() != MpState::CONNECTED)
430  {
431  if (ImGui::Button(_LC("TopMenubar", "Reload current terrain")))
432  {
434  // Order is required - create chain.
436  new CacheEntryPtr(App::GetGameContext()->GetTerrain()->getCacheEntry())));
438  App::GetGameContext()->GetTerrain()->getCacheEntry()->fname));
439  }
440  }
441 
442  ImGui::Separator();
443 
444  if (ImGui::Button(_LC("TopMenubar", "Back to menu")))
445  {
446  if (App::mp_state->getEnum<MpState>() == MpState::CONNECTED)
447  {
449  }
452  }
453 
454  if (ImGui::Button(_LC("TopMenubar", "Exit")))
455  {
457  }
458 
460  m_open_menu_hoverbox_max.x = menu_pos.x + ImGui::GetWindowWidth() + MENU_HOVERBOX_PADDING.x;
461  m_open_menu_hoverbox_max.y = menu_pos.y + ImGui::GetWindowHeight() + MENU_HOVERBOX_PADDING.y;
462  App::GetGuiManager()->RequestGuiCaptureKeyboard(ImGui::IsWindowHovered());
463  ImGui::End();
464  }
465  break;
466 
468  menu_pos.y = window_pos.y + actors_cursor.y + MENU_Y_OFFSET;
469  menu_pos.x = actors_cursor.x + window_pos.x - ImGui::GetStyle().WindowPadding.x;
470  ImGui::SetNextWindowPos(menu_pos);
471  if (ImGui::Begin(_LC("TopMenubar", "Actors menu"), nullptr, static_cast<ImGuiWindowFlags_>(flags)))
472  {
473  if (App::mp_state->getEnum<MpState>() != MpState::CONNECTED)
474  {
476  }
477  else
478  {
479 #ifdef USE_SOCKETW
481  this->DrawMpUserToActorList(net_user_info);
482 
483  std::vector<RoRnet::UserInfo> remote_users = App::GetNetwork()->GetUserInfos();
484  for (auto& user: remote_users)
485  {
486  this->DrawMpUserToActorList(user);
487  }
488 #endif // USE_SOCKETW
489  }
491  m_open_menu_hoverbox_max.x = menu_pos.x + ImGui::GetWindowWidth() + MENU_HOVERBOX_PADDING.x;
492  m_open_menu_hoverbox_max.y = menu_pos.y + ImGui::GetWindowHeight() + MENU_HOVERBOX_PADDING.y;
493  App::GetGuiManager()->RequestGuiCaptureKeyboard(ImGui::IsWindowHovered());
494  ImGui::End();
495  }
496  break;
497 
499  menu_pos.y = window_pos.y + savegames_cursor.y + MENU_Y_OFFSET;
500  menu_pos.x = savegames_cursor.x + window_pos.x - ImGui::GetStyle().WindowPadding.x;
501  ImGui::SetNextWindowPos(menu_pos);
502  if (ImGui::Begin(_LC("TopMenubar", "Savegames"), nullptr, static_cast<ImGuiWindowFlags_>(flags)))
503  {
504  if (ImGui::Button(_LC("TopMenubar", "Quicksave")))
505  {
508  }
509  ImGui::SameLine();
510  ImGui::TextColored(GRAY_HINT_TEXT, "(NUMPAD: /)");
511 
512  if (m_quickload)
513  {
514  if (ImGui::Button(_LC("TopMenubar", "Quickload")))
515  {
518  }
519  ImGui::SameLine();
520  ImGui::TextColored(GRAY_HINT_TEXT, "(NUMPAD: *)");
521  }
522 
523  ImGui::Separator();
524 
525  ImGui::TextColored(GRAY_HINT_TEXT, "%s", _LC("TopMenubar", "(Save with CTRL+ALT+1..5)"));
526  for (int i = 1; i <= 5; i++)
527  {
528  Ogre::String name = _LC("TopMenubar", "Empty Slot");
529  if (!m_savegame_names[i].empty())
530  {
531  name = m_savegame_names[i];
532  }
533  Ogre::String caption = Ogre::StringUtil::format("%d. %s##Save", i, name.c_str());
534  if (ImGui::Button(caption.c_str()))
535  {
536  Ogre::String filename = Ogre::StringUtil::format("quicksave-%d.sav", i);
539  }
540  }
541 
542  ImGui::TextColored(GRAY_HINT_TEXT, "%s", _LC("TopMenubar", "(Load with ALT+1..5)"));
543  for (int i = 1; i <= 5; i++)
544  {
545  if (!m_savegame_names[i].empty())
546  {
547  Ogre::String name = m_savegame_names[i];
548  Ogre::String caption = Ogre::StringUtil::format("%d. %s##Load", i, name.c_str());
549  if (ImGui::Button(caption.c_str()))
550  {
551  Ogre::String filename = Ogre::StringUtil::format("quicksave-%d.sav", i);
554  }
555  }
556  }
557 
559  m_open_menu_hoverbox_max.x = menu_pos.x + ImGui::GetWindowWidth() + MENU_HOVERBOX_PADDING.x;
560  m_open_menu_hoverbox_max.y = menu_pos.y + ImGui::GetWindowHeight() + MENU_HOVERBOX_PADDING.y;
561  App::GetGuiManager()->RequestGuiCaptureKeyboard(ImGui::IsWindowHovered());
562  ImGui::End();
563  }
564  break;
565 
567  menu_pos.y = window_pos.y + settings_cursor.y + MENU_Y_OFFSET;
568  menu_pos.x = settings_cursor.x + window_pos.x - ImGui::GetStyle().WindowPadding.x;
569  ImGui::SetNextWindowPos(menu_pos);
570  if (ImGui::Begin(_LC("TopMenubar", "Settings menu"), nullptr, static_cast<ImGuiWindowFlags_>(flags)))
571  {
572  // AUDIO SETTINGS
573  ImGui::Separator();
574  ImGui::PushItemWidth(125.f); // Width includes [+/-] buttons
575  ImGui::TextColored(GRAY_HINT_TEXT, "%s", _LC("TopMenubar", "Audio:"));
576  DrawGFloatSlider(App::audio_master_volume, _LC("TopMenubar", "Volume"), 0, 1);
577 
578  // RENDER SETTINGS
579  ImGui::Separator();
580  ImGui::TextColored(GRAY_HINT_TEXT, "%s", _LC("TopMenubar", "Frames per second:"));
581  if (App::gfx_envmap_enabled->getBool())
582  {
583  DrawGIntSlider(App::gfx_envmap_rate, _LC("TopMenubar", "Reflections"), 0, 6);
584  }
585  DrawGIntSlider(App::gfx_fps_limit, _LC("TopMenubar", "Game"), 0, 240);
586 
587  // SIM SETTINGS
588  ImGui::Separator();
589  ImGui::TextColored(GRAY_HINT_TEXT, "%s", _LC("TopMenubar", "Simulation:"));
590  float slowmotion = std::min(App::GetGameContext()->GetActorManager()->GetSimulationSpeed(), 1.0f);
591  if (ImGui::SliderFloat(_LC("TopMenubar", "Slow motion"), &slowmotion, 0.01f, 1.0f))
592  {
594  }
595  float timelapse = std::max(App::GetGameContext()->GetActorManager()->GetSimulationSpeed(), 1.0f);
596  if (ImGui::SliderFloat(_LC("TopMenubar", "Time lapse"), &timelapse, 1.0f, 10.0f))
597  {
599  }
600 
601  // CAMERA SETTINGS
602  if (App::GetCameraManager()->GetCurrentBehavior() == CameraManager::CAMERA_BEHAVIOR_STATIC)
603  {
604  ImGui::Separator();
605  ImGui::TextColored(GRAY_HINT_TEXT, "%s", _LC("TopMenubar", "Camera:"));
606  DrawGFloatSlider(App::gfx_static_cam_fov_exp, _LC("TopMenubar", "FOV"), 0.8f, 1.5f);
607  DrawGIntSlider(App::gfx_camera_height, _LC("TopMenubar", "Height"), 1, 50);
608  }
609  else
610  {
611  ImGui::Separator();
612  ImGui::TextColored(GRAY_HINT_TEXT, "%s", _LC("TopMenubar", "Camera:"));
614  {
615  int fov = App::gfx_fov_internal->getInt();
616  if (ImGui::SliderInt(_LC("TopMenubar", "FOV"), &fov, 10, 120))
617  {
619  }
620  }
621  else
622  {
623  int fov = App::gfx_fov_external->getInt();
624  if (ImGui::SliderInt(_LC("TopMenubar", "FOV"), &fov, 10, 120))
625  {
627  }
628  }
629  if (App::GetCameraManager()->GetCurrentBehavior() == CameraManager::CAMERA_BEHAVIOR_FIXED)
630  {
631  DrawGCheckbox(App::gfx_fixed_cam_tracking, _LC("TopMenubar", "Tracking"));
632  }
633  }
634 
635  // SKY SETTINGS
636 #ifdef USE_CAELUM
637  if (App::gfx_sky_mode->getEnum<GfxSkyMode>() == GfxSkyMode::CAELUM)
638  {
639  ImGui::Separator();
640  ImGui::TextColored(GRAY_HINT_TEXT, "%s", _LC("TopMenubar", "Time of day:"));
641  float time = App::GetGameContext()->GetTerrain()->getSkyManager()->GetTime();
642  if (ImGui::SliderFloat("", &time, m_daytime - 0.5f, m_daytime + 0.5f, ""))
643  {
644  App::GetGameContext()->GetTerrain()->getSkyManager()->SetTime(time);
645  }
646  ImGui::SameLine();
647  DrawGCheckbox(App::gfx_sky_time_cycle, _LC("TopMenubar", "Cycle"));
648  if (App::gfx_sky_time_cycle->getBool())
649  {
650  DrawGIntSlider(App::gfx_sky_time_speed, _LC("TopMenubar", "Speed"), 10, 2000);
651  }
652  }
653 #endif // USE_CAELUM
654 
655  // WATER SETTINGS
656  if (RoR::App::gfx_water_waves->getBool() && App::mp_state->getEnum<MpState>() != MpState::CONNECTED && App::GetGameContext()->GetTerrain()->getWater())
657  {
658  if (App::gfx_water_mode->getEnum<GfxWaterMode>() != GfxWaterMode::HYDRAX && App::gfx_water_mode->getEnum<GfxWaterMode>() != GfxWaterMode::NONE)
659  {
660  ImGui::PushID("waves");
661  ImGui::TextColored(GRAY_HINT_TEXT, "%s", _LC("TopMenubar", "Waves Height:"));
662  if(ImGui::SliderFloat("", &m_waves_height, 0.f, 4.f, ""))
663  {
665  }
666  ImGui::PopID();
667  }
668  }
669 
670  // VEHICLE CONTROL SETTINGS
671  if (current_actor != nullptr)
672  {
673  ImGui::Separator();
674  ImGui::TextColored(GRAY_HINT_TEXT, "%s", _LC("TopMenubar", "Vehicle control options:"));
675  DrawGCheckbox(App::io_hydro_coupling, _LC("TopMenubar", "Keyboard steering speed coupling"));
676  }
677 
678  // MULTIPLAYER SETTINGS
679  if (App::mp_state->getEnum<MpState>() == MpState::CONNECTED)
680  {
681  ImGui::Separator();
682  ImGui::TextColored(GRAY_HINT_TEXT, "%s", _LC("TopMenubar", "Multiplayer:"));
683  DrawGCheckbox(App::mp_pseudo_collisions, _LC("TopMenubar", "Collisions"));
684  DrawGCheckbox(App::mp_hide_net_labels, _LC("TopMenubar", "Hide labels"));
685  }
686  ImGui::PopItemWidth();
688  m_open_menu_hoverbox_max.x = menu_pos.x + ImGui::GetWindowWidth() + MENU_HOVERBOX_PADDING.x;
689  m_open_menu_hoverbox_max.y = menu_pos.y + ImGui::GetWindowHeight() + MENU_HOVERBOX_PADDING.y;
690  App::GetGuiManager()->RequestGuiCaptureKeyboard(ImGui::IsWindowHovered());
691  ImGui::End();
692  }
693  break;
694 
696  menu_pos.y = window_pos.y + tools_cursor.y + MENU_Y_OFFSET;
697  menu_pos.x = tools_cursor.x + window_pos.x - ImGui::GetStyle().WindowPadding.x;
698  ImGui::SetNextWindowPos(menu_pos);
699  if (ImGui::Begin(_LC("TopMenubar", "Tools menu"), nullptr, static_cast<ImGuiWindowFlags_>(flags)))
700  {
701  if (ImGui::Button(_LC("TopMenubar", "Friction settings")))
702  {
705  }
706 
707  if (ImGui::Button(_LC("TopMenubar", "Show console")))
708  {
711  }
712 
713  if (ImGui::Button(_LC("TopMenubar", "Texture tool")))
714  {
717  }
718 
719  if (ImGui::Button(_LC("TopMenubar", "Collisions debug")))
720  {
723  }
724 
725  if (current_actor != nullptr)
726  {
727  if (ImGui::Button(_LC("TopMenubar", "Node / Beam utility")))
728  {
731  }
732 
733  if (ImGui::Button(_LC("TopMenubar", "FlexBody debug")))
734  {
737  }
738  }
739 
740  ImGui::Separator();
741  ImGui::TextColored(GRAY_HINT_TEXT, "%s", _LC("TopMenubar", "Pre-spawn diag. options:"));
742 
743  bool diag_mass = App::diag_truck_mass->getBool();
744  if (ImGui::Checkbox(_LC("TopMenubar", "Node mass recalc. logging"), &diag_mass))
745  {
746  App::diag_truck_mass->setVal(diag_mass);
747  }
748  if (ImGui::IsItemHovered())
749  {
750  ImGui::BeginTooltip();
751  ImGui::Text("%s", _LC("TopMenubar", "Extra logging on runtime - mass recalculation"));
752  ImGui::EndTooltip();
753  }
754 
755  bool diag_break = App::diag_log_beam_break->getBool();
756  if (ImGui::Checkbox(_LC("TopMenubar", "Beam break logging"), &diag_break))
757  {
758  App::diag_log_beam_break->setVal(diag_break);
759  }
760  if (ImGui::IsItemHovered())
761  {
762  ImGui::BeginTooltip();
763  ImGui::Text("%s", _LC("TopMenubar", "Extra logging on runtime"));
764  ImGui::EndTooltip();
765  }
766 
767  bool diag_deform = App::diag_log_beam_deform->getBool();
768  if (ImGui::Checkbox(_LC("TopMenubar", "Beam deform. logging"), &diag_deform))
769  {
770  App::diag_log_beam_deform->setVal(diag_deform);
771  }
772  if (ImGui::IsItemHovered())
773  {
774  ImGui::BeginTooltip();
775  ImGui::Text("%s", _LC("TopMenubar", "Extra logging on runtime"));
776  ImGui::EndTooltip();
777  }
778 
779  bool diag_trig = App::diag_log_beam_trigger->getBool();
780  if (ImGui::Checkbox(_LC("TopMenubar", "Trigger logging"), &diag_trig))
781  {
783  }
784  if (ImGui::IsItemHovered())
785  {
786  ImGui::BeginTooltip();
787  ImGui::Text("%s", _LC("TopMenubar", "Extra logging on runtime - trigger beams activity"));
788  ImGui::EndTooltip();
789  }
790 
791  bool diag_vcam = App::diag_videocameras->getBool();
792  if (ImGui::Checkbox(_LC("TopMenubar", "VideoCamera direction marker"), &diag_vcam))
793  {
794  App::diag_videocameras->setVal(diag_vcam);
795  }
796  if (ImGui::IsItemHovered())
797  {
798  ImGui::BeginTooltip();
799  ImGui::Text("%s", _LC("TopMenubar", "Visual marker of VideoCameras direction"));
800  ImGui::EndTooltip();
801  }
802 
803  ImGui::PushItemWidth(125.f); // Width includes [+/-] buttons
804  ImGui::Separator();
805  ImGui::TextColored(GRAY_HINT_TEXT, _LC("TopMenubar", "Visual options:"));
806  DrawGIntSlider(App::gfx_polygon_mode, _LC("TopMenubar", "Polygon mode"), 1, 3);
807  if (ImGui::IsItemHovered())
808  {
809  ImGui::BeginTooltip();
810  ImGui::Text("%s", _LC("TopMenubar", "1 = Solid"));
811  ImGui::Text("%s", _LC("TopMenubar", "2 = Wireframe"));
812  ImGui::Text("%s", _LC("TopMenubar", "3 = Points"));
813  ImGui::EndTooltip();
814  }
815 
817  m_open_menu_hoverbox_max.x = menu_pos.x + ImGui::GetWindowWidth() + MENU_HOVERBOX_PADDING.x;
818  m_open_menu_hoverbox_max.y = menu_pos.y + ImGui::GetWindowHeight() + MENU_HOVERBOX_PADDING.y;
819  App::GetGuiManager()->RequestGuiCaptureKeyboard(ImGui::IsWindowHovered());
820  ImGui::End();
821  }
822  break;
823 
824  case TopMenu::TOPMENU_AI:
825  menu_pos.y = window_pos.y + ai_cursor.y + MENU_Y_OFFSET;
826  menu_pos.x = ai_cursor.x + window_pos.x - ImGui::GetStyle().WindowPadding.x;
827  ImGui::SetNextWindowPos(menu_pos);
828  if (ImGui::Begin(_LC("TopMenubar", "AI menu"), nullptr, static_cast<ImGuiWindowFlags_>(flags)))
829  {
830  if (ImGui::IsWindowHovered())
831  {
832  ai_menu = false;
833  }
834 
835  ImGui::PushItemWidth(125.f); // Width includes [+/-] buttons
836  ImGui::TextColored(GRAY_HINT_TEXT, "%s", _LC("TopMenubar", "General options:"));
837 
838  if (ai_num < 1)
839  ai_num = 1;
840 
841 
842  if (ai_mode == 2 || ai_mode == 3) // Drag Race or Crash driving mode
843  {
844  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
845  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
846  }
847 
848  ImGui::InputInt(_LC("TopMenubar", "Vehicle count"), &ai_num, 1, 100);
849  if (ImGui::IsItemHovered())
850  {
851  ImGui::BeginTooltip();
852  ImGui::Text("%s", _LC("TopMenubar", "Number of vehicles"));
853  ImGui::EndTooltip();
854  }
855 
856  if (ai_mode == 2 || ai_mode == 3) // Drag Race or Crash driving mode
857  {
858  ImGui::PopItemFlag();
859  ImGui::PopStyleVar();
860  }
861 
862  if (ai_num < 2)
863  {
864  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
865  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
866  }
867 
868  if (ai_mode == 3) // Crash driving mode
869  {
870  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
871  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
872  }
873 
874  ImGui::InputInt(_LC("TopMenubar", "Distance"), &ai_distance, 1, 100);
875  if (ImGui::IsItemHovered())
876  {
877  ImGui::BeginTooltip();
878  ImGui::Text("%s", _LC("TopMenubar", "Following distance in meters"));
879  ImGui::EndTooltip();
880  }
881 
882  if (ai_mode == 3) // Crash driving mode
883  {
884  ImGui::PopItemFlag();
885  ImGui::PopStyleVar();
886  }
887 
888  std::string label1 = "Behind";
889  if (ai_position_scheme == 1)
890  {
891  label1 = "Parallel";
892  }
893  else if (ai_position_scheme == 2)
894  {
895  label1 = "Opposite";
896  }
897 
898  if (ai_mode == 2 || ai_mode == 3) // Drag Race or Crash driving mode
899  {
900  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
901  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
902  }
903 
904  if (ImGui::BeginCombo("Position", label1.c_str()))
905  {
906  if (ImGui::Selectable("Behind"))
907  {
908  ai_position_scheme = 0;
909  }
910  if (ImGui::Selectable("Parallel"))
911  {
912  ai_position_scheme = 1;
913  }
914  ImGui::EndCombo();
915  }
916  if (ImGui::IsItemHovered())
917  {
918  ImGui::BeginTooltip();
919  ImGui::Text("%s", _LC("TopMenubar", "Positioning scheme"));
920  ImGui::Separator();
921  ImGui::Text("%s", _LC("TopMenubar", "Behind: Set vehicle behind vehicle, in line"));
922  ImGui::Text("%s", _LC("TopMenubar", "Parallel: Set vehicles in parallel, useful for certain scenarios like drag races"));
923  ImGui::EndTooltip();
924  }
925 
926  if (ai_num < 2)
927  {
928  ImGui::PopItemFlag();
929  ImGui::PopStyleVar();
930  }
931 
932  if (ai_times < 1)
933  ai_times = 1;
934 
935  if (ai_mode == 4) // Chase driving mode
936  {
937  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
938  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
939  }
940 
941  ImGui::InputInt(_LC("TopMenubar", "Repeat times"), &ai_times, 1, 100);
942  if (ImGui::IsItemHovered())
943  {
944  ImGui::BeginTooltip();
945  ImGui::Text("%s", _LC("TopMenubar", "How many times to loop the path"));
946  ImGui::EndTooltip();
947  }
948 
949  if (ai_mode == 4) // Chase driving mode
950  {
951  ImGui::PopItemFlag();
952  ImGui::PopStyleVar();
953  }
954 
955  if (ai_mode == 2 || ai_mode == 3) // Drag Race or Crash driving mode
956  {
957  ImGui::PopItemFlag();
958  ImGui::PopStyleVar();
959  }
960 
961  ImGui::Separator();
962  ImGui::TextColored(GRAY_HINT_TEXT, "%s", _LC("TopMenubar", "Vehicle options:"));
963 
964  std::string label2 = "Normal";
965  if (ai_mode == 1)
966  {
967  label2 = "Race";
968  }
969  else if (ai_mode == 2)
970  {
971  label2 = "Drag Race";
972  }
973  else if (ai_mode == 3)
974  {
975  label2 = "Crash";
976  }
977  else if (ai_mode == 4)
978  {
979  label2 = "Chase";
980  }
981 
982  for (auto actor : App::GetGameContext()->GetActorManager()->GetLocalActors())
983  {
984  if (actor->ar_driveable == AI)
985  {
986  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
987  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
988  break;
989  }
990  }
991 
992  if (ImGui::BeginCombo("Mode", label2.c_str()))
993  {
994  if (ImGui::Selectable("Normal"))
995  {
996  ai_mode = 0;
997 
998  if (ai_mode_prev == 2 || ai_mode_prev == 3)
999  {
1000  ai_num = ai_num_prev;
1004  }
1006  }
1007  if (ImGui::Selectable("Race"))
1008  {
1009  ai_mode = 1;
1010 
1011  if (ai_mode_prev == 2 || ai_mode_prev == 3)
1012  {
1013  ai_num = ai_num_prev;
1017  }
1019  }
1020  if (ImGui::Selectable("Drag Race"))
1021  {
1022  ai_mode = 2;
1023 
1024  if (ai_mode_prev != 3)
1025  {
1026  ai_num_prev = ai_num;
1030  }
1032  ai_num = 2;
1033  ai_speed = 1000;
1034  ai_position_scheme = 1;
1035  ai_times = 1;
1036  }
1037  if (ImGui::Selectable("Crash"))
1038  {
1039  ai_mode = 3;
1040  if (ai_mode_prev != 2)
1041  {
1042  ai_num_prev = ai_num;
1046  }
1048  ai_num = 2;
1049  ai_speed = 100;
1050  ai_position_scheme = 2;
1051  ai_times = 1;
1052  }
1053  if (ImGui::Selectable("Chase"))
1054  {
1055  ai_mode = 4;
1056 
1057  if (ai_mode_prev == 2 || ai_mode_prev == 3)
1058  {
1059  ai_num = ai_num_prev;
1063  }
1065  }
1066  ImGui::EndCombo();
1067  }
1068  if (ImGui::IsItemHovered())
1069  {
1070  ImGui::BeginTooltip();
1071  ImGui::Text("%s", _LC("TopMenubar", "Land vehicle driving mode"));
1072  ImGui::Separator();
1073  ImGui::Text("%s", _LC("TopMenubar", "Normal: Modify speed according to turns, other vehicles and character"));
1074  ImGui::Text("%s", _LC("TopMenubar", "Race: Always keep defined speed"));
1075  ImGui::Text("%s", _LC("TopMenubar", "Drag Race: Two vehicles performing a drag race"));
1076  ImGui::Text("%s", _LC("TopMenubar", "Crash: Two vehicles driving in opposite direction"));
1077  ImGui::Text("%s", _LC("TopMenubar", "Chase: Follow character and player vehicle"));
1078  ImGui::EndTooltip();
1079  }
1080 
1081  for (auto actor : App::GetGameContext()->GetActorManager()->GetLocalActors())
1082  {
1083  if (actor->ar_driveable == AI)
1084  {
1085  ImGui::PopItemFlag();
1086  ImGui::PopStyleVar();
1087  break;
1088  }
1089  }
1090 
1091  if (ai_speed < 1)
1092  ai_speed = 1;
1093 
1094  ImGui::InputInt(_LC("TopMenubar", "Speed"), &ai_speed, 1, 100);
1095  if (ImGui::IsItemHovered())
1096  {
1097  ImGui::BeginTooltip();
1098  ImGui::Text("%s", _LC("TopMenubar", "Speed in km/h for land vehicles or knots/s for boats"));
1099  ImGui::EndTooltip();
1100  }
1101 
1102  if (ai_altitude < 1)
1103  ai_altitude = 1;
1104 
1105  ImGui::InputInt(_LC("TopMenubar", "Altitude"), &ai_altitude, 1, 100);
1106  if (ImGui::IsItemHovered())
1107  {
1108  ImGui::BeginTooltip();
1109  ImGui::Text("%s", _LC("TopMenubar", "Airplane maximum altitude in feet"));
1110  ImGui::EndTooltip();
1111  }
1112 
1113  ImGui::Separator();
1114 
1115  if (ImGui::Button(StripColorMarksFromText(ai_dname).c_str(), ImVec2(250, 0)))
1116  {
1117  ai_select = true;
1118 
1120  m.payload = reinterpret_cast<void*>(new LoaderType(LT_AllBeam));
1122  }
1123  if (ImGui::IsItemHovered())
1124  {
1125  ImGui::BeginTooltip();
1126  ImGui::Text("%s", _LC("TopMenubar", "Land vehicles, boats and airplanes"));
1127  ImGui::EndTooltip();
1128  }
1129 
1130  if (ai_mode == 2 || ai_mode == 3) // Drag Race or Crash driving mode
1131  {
1132  ImGui::PushID("vehicle2");
1133  if (ImGui::Button(StripColorMarksFromText(ai_dname2).c_str(), ImVec2(250, 0)))
1134  {
1135  ai_select2 = true;
1136 
1138  m.payload = reinterpret_cast<void*>(new LoaderType(LT_AllBeam));
1140  }
1141  if (ImGui::IsItemHovered())
1142  {
1143  ImGui::BeginTooltip();
1144  ImGui::Text("%s", _LC("TopMenubar", "Land vehicles, boats and airplanes"));
1145  ImGui::EndTooltip();
1146  }
1147  ImGui::PopID();
1148  }
1149 
1150  ImGui::Separator();
1151 
1152  if (ai_rec)
1153  {
1154  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
1155  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
1156  }
1157 
1158  if (!ai_waypoints.empty() || ai_mode == 4) // Waypoints provided or Chase driving mode
1159  {
1160  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
1161  }
1162 
1163  if (ImGui::Button(_LC("TopMenubar", "Start"), ImVec2(80, 0)))
1164  {
1165  if (ai_mode == 4) // Chase driving mode
1166  {
1167  ai_waypoints.clear();
1168  if (App::GetGameContext()->GetPlayerActor()) // We are in vehicle
1169  {
1170  ai_events waypoint;
1171  waypoint.position = App::GetGameContext()->GetPlayerActor()->getPosition() + Ogre::Vector3(20, 0, 0);
1172  ai_waypoints.push_back(waypoint);
1173  }
1174  else // We are in feet
1175  {
1176  ai_events waypoint;
1177  waypoint.position = App::GetGameContext()->GetPlayerCharacter()->getPosition() + Ogre::Vector3(20, 0, 0);
1178  ai_waypoints.push_back(waypoint);
1179  }
1181  }
1182  else
1183  {
1184  if (ai_waypoints.empty())
1185  {
1187  fmt::format(_LC("TopMenubar", "Select a preset, record or open survey map ({}) to set waypoints."),
1188  App::GetInputEngine()->getEventCommandTrimmed(EV_SURVEY_MAP_CYCLE)), "lightbulb.png");
1189  }
1190  else
1191  {
1193  }
1194  }
1195  }
1196 
1197  if (!ai_waypoints.empty() || ai_mode == 4) // Waypoints provided or Chase driving mode
1198  {
1199  ImGui::PopStyleColor();
1200  }
1201 
1202  ImGui::SameLine();
1203 
1204  if (ImGui::Button(_LC("TopMenubar", "Stop"), ImVec2(80, 0)))
1205  {
1206  if (ai_mode == 4) // Chase driving mode
1207  {
1208  ai_waypoints.clear();
1209  }
1210 
1211  for (ActorPtr& actor : App::GetGameContext()->GetActorManager()->GetLocalActors())
1212  {
1213  if (actor->ar_driveable == AI)
1214  {
1215  App::GetGameContext()->PushMessage(Message(MSG_SIM_DELETE_ACTOR_REQUESTED, static_cast<void*>(new ActorPtr(actor))));
1216  }
1217  }
1218  }
1219 
1220  if (ai_rec)
1221  {
1222  ImGui::PopItemFlag();
1223  ImGui::PopStyleVar();
1224  }
1225 
1226  ImGui::SameLine();
1227 
1228  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
1229  std::string label = "Record";
1230  if (ai_rec)
1231  {
1232  label = "Recording";
1233  ImGui::PushStyleColor(ImGuiCol_Button, RED_TEXT);
1234  }
1235 
1236  if (ImGui::Button(label.c_str(), ImVec2(80, 0)))
1237  {
1238  if (!ai_rec)
1239  {
1240  ai_waypoints.clear();
1241  ai_rec = true;
1242  }
1243  else
1244  {
1245  ai_rec = false;
1246  }
1247  }
1248 
1249  ImGui::PopStyleColor();
1250  ImGui::Separator();
1251 
1252  if (ImGui::CollapsingHeader(_LC("TopMenubar", "Presets")))
1253  {
1254  // Draw whatever we already have (i.e. presets bundled with terrain, see '[AI Presets]' in terrn2 format).
1255  size_t num_rows = ai_presets_all.GetArray().Size();
1256  int display_count = 0;
1257  for (size_t i = 0; i < num_rows; i++)
1258  {
1259  rapidjson::Value& j_row = ai_presets_all[static_cast<rapidjson::SizeType>(i)];
1260 
1261  if (j_row.HasMember("terrain") && App::sim_terrain_name->getStr() == j_row["terrain"].GetString())
1262  {
1263  display_count++;
1264  if (ImGui::Button(j_row["preset"].GetString(), ImVec2(250, 0)))
1265  {
1266  ai_waypoints.clear();
1267 
1268  for (size_t i = 0; i < j_row["waypoints"].Size(); i++)
1269  {
1270  float x = j_row["waypoints"][i][0].GetFloat();
1271  float y = j_row["waypoints"][i][1].GetFloat();
1272  float z = j_row["waypoints"][i][2].GetFloat();
1273 
1274  ai_events waypoint;
1275  waypoint.position = Ogre::Vector3(x, y, z);
1276 
1277  int speed = -1;
1278  if (j_row["waypoints"][i].Size() == 4) // Custom speed defined
1279  {
1280  speed = j_row["waypoints"][i][3].GetInt();
1281  if (speed < 5)
1282  {
1283  speed = -1;
1284  }
1285  }
1286  waypoint.speed = speed;
1287  ai_waypoints.push_back(waypoint);
1288  }
1289  }
1290  }
1291  }
1292 
1293  // Fetch additional presets, or display error if failed
1294  if (ai_presets_extern.Empty())
1295  {
1297  {
1298  float spinner_size = 8.f;
1299  ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.f) - spinner_size);
1300  LoadingIndicatorCircle("spinner", spinner_size, theme.value_blue_text_color, theme.value_blue_text_color, 10, 10);
1301  }
1302  else if (ai_presets_extern_error != "")
1303  {
1304  ImGui::TextColored(RED_TEXT, "%s", _LC("TopMenubar", "Failed to fetch external presets."));
1305  if (ImGui::Button(_LC("TopMenubar", "Retry")))
1306  {
1307  this->FetchExternAiPresetsOnBackground(); // Will post `MSG_NET_REFRESH_AI_PRESETS` when done.
1308  }
1309  }
1310  else
1311  {
1312  this->FetchExternAiPresetsOnBackground(); // Will post `MSG_NET_REFRESH_AI_PRESETS` when done.
1313  }
1314  }
1315 
1316  // If no presets found, display message
1317  if (display_count == 0 && !ai_presets_extern_fetching && ai_presets_extern_error == "")
1318  {
1319  ImGui::Text("%s", _LC("TopMenubar", "No presets found for this terrain :("));
1320  ImGui::Text("%s", _LC("TopMenubar", "Supported terrains:"));
1321  ImGui::Separator();
1322 
1323  ImGui::BeginChild("terrains-scrolling", ImVec2(0.f, 200), false);
1324 
1325  for (size_t i = 0; i < num_rows; i++)
1326  {
1327  rapidjson::Value& j_row_terrains = ai_presets_all[static_cast<rapidjson::SizeType>(i)];
1328  if (j_row_terrains.HasMember("terrains"))
1329  {
1330  for (size_t i = 0; i < j_row_terrains["terrains"].Size(); i++)
1331  {
1332  ImGui::Text("%s", j_row_terrains["terrains"][i].GetString());
1333  }
1334  }
1335  }
1336 
1337  ImGui::EndChild();
1338  }
1339  }
1340 
1341  if (ImGui::CollapsingHeader(_LC("TopMenubar", "Waypoints")))
1342  {
1343  if (ai_waypoints.empty())
1344  {
1345  ImGui::Text("%s", _LC("TopMenubar", "No waypoints defined."));
1346  }
1347  else
1348  {
1349  if (ImGui::Button(_LC("TopMenubar", "Export"), ImVec2(250, 0)))
1350  {
1351  std::string s;
1352 
1353  for (int i = 0; i < ai_waypoints.size(); i++)
1354  {
1355  // Write position
1356  s += "\n [" + std::to_string(ai_waypoints[i].position.x) + ", " + std::to_string(ai_waypoints[i].position.y) + ", " + std::to_string(ai_waypoints[i].position.z);
1357 
1358  // Write custom speed
1359  if (ai_waypoints[i].speed >= 5)
1360  {
1361  s += ", " + std::to_string(ai_waypoints[i].speed);
1362  }
1363 
1364  // Close
1365  s += "]";
1366  if (i != ai_waypoints.size() - 1)
1367  {
1368  s += ",";
1369  }
1370  }
1371 
1372  std::string json = fmt::format("\n {{\n \"terrain\":\"{}\",\n \"preset\":\"Preset name\",\n \"waypoints\":\n [{}\n ]\n }}", App::sim_terrain_name->getStr(), s);
1373  RoR::Log(json.c_str());
1374 
1376  fmt::format(_LC("TopMenubar", "{} waypoints exported to RoR.log"),
1377  ai_waypoints.size()), "lightbulb.png");
1378  }
1379 
1380  ImGui::BeginChild("waypoints-scrolling", ImVec2(0.f, 200), false);
1381 
1382  for (int i = 0; i < ai_waypoints.size(); i++)
1383  {
1384  ImGui::PushID(i);
1385  ImGui::AlignTextToFramePadding();
1386  ImGui::Text("%d", i);
1387  ImGui::SameLine();
1388  if (ImGui::Button("teleport", ImVec2(60, 0)))
1389  {
1390  Ogre::Vector3* payload = new Ogre::Vector3(ai_waypoints[i].position);
1392  }
1393  if (ImGui::IsItemHovered())
1394  {
1395  ImGui::BeginTooltip();
1396  std::string w = "x:" + std::to_string(ai_waypoints[i].position.x) + " y:" + std::to_string(ai_waypoints[i].position.y) + " z:" + std::to_string(ai_waypoints[i].position.z);
1397  ImGui::Text(w.c_str());
1398  ImGui::EndTooltip();
1399  }
1400  ImGui::SameLine();
1401  ImGui::SetNextItemWidth(90);
1402 
1403  if (ai_waypoints[i].speed < -1)
1404  {
1405  ai_waypoints[i].speed = -1;
1406  }
1407  ImGui::InputInt(_LC("TopMenubar", "speed"), &ai_waypoints[i].speed, 1, 100);
1408  if (ImGui::IsItemHovered())
1409  {
1410  ImGui::BeginTooltip();
1411  ImGui::Text(_LC("TopMenubar", "Set waypoint speed in km/h for land vehicles"));
1412  ImGui::Separator();
1413  ImGui::Text(_LC("TopMenubar", "Value -1: Ignore, vehicle will use default speed"));
1414  ImGui::Text(_LC("TopMenubar", "Value >= 5: Override default speed"));
1415  ImGui::EndTooltip();
1416  }
1417  ImGui::PopID();
1418  }
1419 
1420  ImGui::EndChild();
1421  }
1422  }
1423 
1424  ImGui::PopItemWidth();
1426  m_open_menu_hoverbox_max.x = menu_pos.x + ImGui::GetWindowWidth() + MENU_HOVERBOX_PADDING.x;
1427  m_open_menu_hoverbox_max.y = menu_pos.y + ImGui::GetWindowHeight() + MENU_HOVERBOX_PADDING.y;
1428  App::GetGuiManager()->RequestGuiCaptureKeyboard(ImGui::IsWindowHovered());
1429  ImGui::End();
1430  }
1431  break;
1432 
1434  menu_pos.y = window_pos.y + tuning_cursor.y + MENU_Y_OFFSET;
1435  menu_pos.x = tuning_cursor.x + window_pos.x - ImGui::GetStyle().WindowPadding.x;
1436  ImGui::SetNextWindowPos(menu_pos);
1437  if (ImGui::Begin(_LC("TopMenubar", "Tuning menu"), nullptr, static_cast<ImGuiWindowFlags_>(flags)))
1438  {
1439  this->RefreshTuningMenu(); // make sure our local context is valid
1440  if (!tuning_actor)
1441  {
1442  ImGui::PushStyleColor(ImGuiCol_Text, GRAY_HINT_TEXT);
1443  ImGui::Text("%s", _LC("Tuning", "You are on foot."));
1444  ImGui::Text("%s", _LC("Tuning", "Enter a vehicle to tune it."));
1445  ImGui::PopStyleColor();
1446  }
1447  else
1448  {
1451 
1452  // SAVED TUNEUPS
1453  ImGui::TextDisabled(fmt::format(_LC("Tuning", "Saved tuneups ({})"), tuning_saves.cqy_results.size()).c_str());
1454  for (CacheQueryResult& tuneup_result: tuning_saves.cqy_results)
1455  {
1456  ImGui::PushID(tuneup_result.cqr_entry->fname.c_str());
1457 
1458  ImGui::AlignTextToFramePadding();
1459  ImGui::Bullet();
1460 
1461  // Load button (with tuneup name)
1462  ImGui::SameLine();
1463  if (ImGui::Button(tuneup_result.cqr_entry->dname.c_str()))
1464  {
1467  req->mpr_subject = tuneup_result.cqr_entry->fname;
1470  // Why 'MODIFY_PROJECT_REQUESTED' for loading?
1471  // Instead of loading with the saved tuneup directly, we keep the autogenerated and sync it with the save.
1472  // That way, subsequent editing doesn't modify the save until user saves again.
1473  }
1474 
1475  // Delete button (right-aligned)
1476  ImGui::SameLine();
1477  if (tuning_rwidget_cursorx_min < ImGui::GetCursorPosX()) // Make sure button won't draw over item name
1478  tuning_rwidget_cursorx_min = ImGui::GetCursorPosX();
1479  std::string delbtn_text = _LC("Tuning", "Delete");
1480  float delbtn_w = ImGui::CalcTextSize(delbtn_text.c_str()).x + ImGui::GetStyle().FramePadding.x * 2;
1481  float delbtn_cursorx = ImGui::GetWindowContentRegionWidth() - delbtn_w;
1482  if (delbtn_cursorx < tuning_rwidget_cursorx_min)
1483  delbtn_cursorx = tuning_rwidget_cursorx_min;
1484  ImGui::SetCursorPosX(delbtn_cursorx);
1485  ImGui::PushStyleColor(ImGuiCol_Button, TUNING_HOLDTOCONFIRM_COLOR);
1486  bool delbtn_pressed = RoR::ImButtonHoldToConfirm(delbtn_text, /*small:*/true, TUNING_HOLDTOCONFIRM_TIMELIMIT);
1487  ImGui::PopStyleColor(); //ImGuiCol_Button
1488  if (delbtn_pressed)
1489  {
1491  }
1492 
1493  ImGui::PopID(); // tuneup_result.cqr_entry->fname.c_str()
1494  }
1495 
1496  // WORKING TUNEUP
1497  ImGui::Separator();
1498  ImGui::AlignTextToFramePadding();
1499  ImGui::TextDisabled(_LC("Tuning", "Working tuneup"));
1501  {
1502  ImGui::InputText(_LC("Tuning", "Name"), tuning_savebox_buf.GetBuffer(), tuning_savebox_buf.GetCapacity());
1503 
1504  if (ImGui::Button(_LC("Tuning","Save")))
1505  {
1513  }
1514  ImGui::SameLine();
1515  ImGui::Checkbox(_LC("Tuning", "Overwrite"), &tuning_savebox_overwrite);
1516 
1517  // Cancel button (right-aligned)
1518  if (tuning_rwidget_cursorx_min < ImGui::GetCursorPosX()) // Make sure button won't draw over save button
1519  tuning_rwidget_cursorx_min = ImGui::GetCursorPosX();
1520  std::string cancelbtn_text = _LC("Tuning", "Cancel");
1521  float cancelbtn_w = ImGui::CalcTextSize(cancelbtn_text.c_str()).x + ImGui::GetStyle().FramePadding.x * 2;
1522  float cancelbtn_cursorx = ImGui::GetWindowContentRegionWidth() - cancelbtn_w;
1523  if (cancelbtn_cursorx < tuning_rwidget_cursorx_min)
1524  cancelbtn_cursorx = tuning_rwidget_cursorx_min;
1525  ImGui::SetCursorPosX(cancelbtn_cursorx);
1526  if (ImGui::SmallButton(_LC("Tuning", "Cancel")))
1527  {
1528  tuning_savebox_visible = false;
1529  }
1530  ImGui::Separator();
1531  }
1532  else if (tuneup_def)
1533  {
1534  ImGui::SameLine();
1535  if (ImGui::Button(_LC("Tuning", "Save as...")))
1536  {
1537  tuning_savebox_visible = true;
1538  }
1539 
1540  // Reset button (right-aligned)
1541  ImGui::SameLine();
1542  if (tuning_rwidget_cursorx_min < ImGui::GetCursorPosX()) // Make sure button won't draw over save button
1543  tuning_rwidget_cursorx_min = ImGui::GetCursorPosX();
1544  ImGui::AlignTextToFramePadding();
1545  std::string resetbtn_text = _LC("Tuning", "Reset");
1546  float delbtn_w = ImGui::CalcTextSize(resetbtn_text.c_str()).x + ImGui::GetStyle().FramePadding.x * 2;
1547  float delbtn_cursorx = ImGui::GetWindowContentRegionWidth() - delbtn_w;
1548  if (delbtn_cursorx < tuning_rwidget_cursorx_min)
1549  delbtn_cursorx = tuning_rwidget_cursorx_min;
1550  ImGui::SetCursorPosX(delbtn_cursorx);
1551  ImGui::PushStyleColor(ImGuiCol_Button, TUNING_HOLDTOCONFIRM_COLOR);
1552  bool resetbtn_pressed = ImButtonHoldToConfirm(resetbtn_text, /*small:*/false, TUNING_HOLDTOCONFIRM_TIMELIMIT);
1553  ImGui::PopStyleColor(); //ImGuiCol_Button
1554  if (resetbtn_pressed)
1555  {
1556  ModifyProjectRequest* request = new ModifyProjectRequest();
1557  request->mpr_target_actor = tuning_actor;
1560  }
1561  }
1562 
1563  // ADDONPARTS
1564 
1565  ImGui::SetNextItemOpen(true, ImGuiCond_FirstUseEver);
1566  std::string addonparts_title = fmt::format(_LC("TopMenubar", "Addon parts ({})"), tuning_addonparts.size());
1567  if (ImGui::CollapsingHeader(addonparts_title.c_str()))
1568  {
1569  for (size_t i = 0; i < tuning_addonparts.size(); i++)
1570  {
1571  const CacheEntryPtr& addonpart_entry = tuning_addonparts[i];
1572 
1573  ImGui::PushID(addonpart_entry->fname.c_str());
1574  const bool conflict_w_hovered = tuning_hovered_addonpart
1575  && (addonpart_entry != tuning_hovered_addonpart)
1577  bool used = TuneupUtil::isAddonPartUsed(tuneup_def, addonpart_entry->fname);
1578  const ImVec2 checkbox_cursor = ImGui::GetCursorScreenPos();
1579  if (ImGui::Checkbox(addonpart_entry->dname.c_str(), &used)
1580  && !conflict_w_hovered
1582  {
1584  req->mpr_type = (used)
1587  req->mpr_subject = addonpart_entry->fname;
1590  }
1591  // Draw conflict markers
1593  {
1594  // Gray-ish X inside the checkbox
1595  const float square_sz = ImGui::GetFrameHeight();
1596  const ImVec2 min = checkbox_cursor + ImGui::GetStyle().FramePadding*1.4f;
1597  const ImVec2 max = checkbox_cursor + (ImVec2(square_sz, square_sz) - ImGui::GetStyle().FramePadding*1.5f);
1598  const ImColor X_COLOR(0.5f, 0.48f, 0.45f);
1599  ImGui::GetWindowDrawList()->AddLine(min, max, X_COLOR, 4.f);
1600  ImGui::GetWindowDrawList()->AddLine(ImVec2(min.x, max.y), ImVec2(max.x, min.y), X_COLOR, 4.f);
1601  }
1602  if (conflict_w_hovered)
1603  {
1604  // Red unrounded square around the checkbox
1605  const float square_sz = ImGui::GetFrameHeight();
1606  const ImVec2 min = checkbox_cursor;
1607  const ImVec2 max = checkbox_cursor + ImVec2(square_sz + 0.5f, square_sz);
1608  const ImColor SQ_COLOR(0.7f, 0.1f, 0.f);
1609  ImGui::GetWindowDrawList()->AddRect(min, max, SQ_COLOR, 0.f, ImDrawCornerFlags_None, 3.f);
1610  }
1611  // Record when checkbox is hovered - for drawing conflict markers
1612  if (ImGui::IsItemHovered())
1613  {
1614  tuning_hovered_addonpart = addonpart_entry;
1615  }
1616  else if (tuning_hovered_addonpart == addonpart_entry)
1617  {
1618  tuning_hovered_addonpart = nullptr;
1619  }
1620  // Reload button (right-aligned)
1621  ImGui::SameLine();
1622  if (tuning_rwidget_cursorx_min < ImGui::GetCursorPosX()) // Make sure button won't draw over save button
1623  tuning_rwidget_cursorx_min = ImGui::GetCursorPosX();
1624  ImGui::AlignTextToFramePadding();
1625  std::string reloadbtn_text = _LC("Tuning", "Reload");
1626  const float reloadbtn_w = ImGui::CalcTextSize(reloadbtn_text.c_str()).x + ImGui::GetStyle().FramePadding.x * 2;
1627  const float reloadbtn_cursorx = std::max(ImGui::GetWindowContentRegionWidth() - reloadbtn_w, tuning_rwidget_cursorx_min);
1628  ImGui::SetCursorPosX(reloadbtn_cursorx);
1629  const bool reloadbtn_pressed = ImGui::SmallButton(reloadbtn_text.c_str());
1630  if (reloadbtn_pressed)
1631  {
1632  // Create spawn request while actor still exists
1633  // Note we don't use `ActorModifyRequest::Type::RELOAD` because we don't need the bundle reloaded.
1636  srq->asr_rotation = Ogre::Quaternion(Ogre::Degree(270) - Ogre::Radian(tuning_actor->getRotation()), Ogre::Vector3::UNIT_Y);
1643 
1644  // Request bundle reloading and chain the actor delete/spawn messages to it.
1648  }
1649 
1650  ImGui::PopID(); //(addonpart_entry->fname.c_str());
1651  }
1652 
1653  if (ImGui::Button(_LC("Tuning", "Browse all parts")))
1654  {
1656  }
1657 
1658  ImGui::Separator();
1659  }
1660 
1661  // Draw props
1662  size_t total_props = tuning_actor->GetGfxActor()->getProps().size();
1663  std::string props_title = fmt::format(_LC("Tuning", "Props ({})"), total_props);
1664  if (ImGui::CollapsingHeader(props_title.c_str()))
1665  {
1666  // Draw all props (those removed by addonparts are also present as placeholders)
1667  for (Prop const& p: tuning_actor->GetGfxActor()->getProps())
1668  {
1669  ImGui::PushID(p.pp_id);
1670  ImGui::AlignTextToFramePadding();
1671 
1672  this->DrawTuningBoxedSubjectIdInline(p.pp_id);
1673 
1675  p.pp_id,
1676  p.pp_media[0],
1677  tuneup_def && tuneup_def->isPropUnwanted(p.pp_id),
1678  tuneup_def && tuneup_def->isPropForceRemoved(p.pp_id),
1681 
1682  // Draw special prop tooltip
1683  if (p.pp_beacon_type == 'L' || p.pp_beacon_type == 'R' || p.pp_beacon_type == 'w')
1684  {
1685  ImGui::SameLine();
1686  ImGui::TextDisabled("(special!)");
1687  if (ImGui::IsItemHovered())
1688  {
1689  ImGui::BeginTooltip();
1690  ImGui::Text("special prop - aerial nav light");
1691  ImGui::EndTooltip();
1692  }
1693  }
1694  else if (p.pp_wheel_mesh_obj)
1695  {
1696  ImGui::SameLine();
1697  ImGui::TextDisabled("(special!)");
1698  if (ImGui::IsItemHovered())
1699  {
1700  ImGui::BeginTooltip();
1701  ImGui::Text("special prop - dashboard + dirwheel");
1702  ImGui::EndTooltip();
1703  }
1704 
1705  }
1706 
1708  p.pp_id,
1709  tuneup_def && tuneup_def->isPropProtected(p.pp_id),
1712 
1713  ImGui::PopID(); // p.pp_id
1714  }
1715 
1716  ImGui::Separator();
1717  }
1718 
1719  // Ditto for flexbodies
1720  size_t total_flexbodies = tuning_actor->GetGfxActor()->GetFlexbodies().size();
1721  std::string flexbodies_title = fmt::format(_LC("Tuning", "Flexbodies ({})"), total_flexbodies);
1722  if (ImGui::CollapsingHeader(flexbodies_title.c_str()))
1723  {
1724  // Draw all flexbodies (those removed by addonparts are also present as placeholders)
1725  for (FlexBody* flexbody: tuning_actor->GetGfxActor()->GetFlexbodies())
1726  {
1727  ImGui::PushID(flexbody->getID());
1728  ImGui::AlignTextToFramePadding();
1729 
1730  this->DrawTuningBoxedSubjectIdInline(flexbody->getID());
1731 
1733  flexbody->getID(),
1734  flexbody->getOrigMeshName(),
1735  tuneup_def && tuneup_def->isFlexbodyUnwanted(flexbody->getID()),
1736  tuneup_def && tuneup_def->isFlexbodyForceRemoved(flexbody->getID()),
1739 
1741  flexbody->getID(),
1742  tuneup_def && tuneup_def->isFlexbodyProtected(flexbody->getID()),
1745 
1746  ImGui::PopID(); // flexbody->getID()
1747  }
1748  }
1749 
1750  // Draw wheels
1751  const int total_wheels = tuning_actor->ar_num_wheels;
1752  std::string wheels_title = fmt::format(_LC("TopMenubar", "Wheels ({})"), total_wheels);
1753  if (ImGui::CollapsingHeader(wheels_title.c_str()))
1754  {
1755  for (WheelID_t i = 0; i < total_wheels; i++)
1756  {
1757  ImGui::PushID(i);
1758  ImGui::AlignTextToFramePadding();
1759 
1761 
1762  // Draw R/L radio buttons
1763  WheelSide forced_side = WheelSide::INVALID;
1764  if (tuneup_def && tuneup_def->isWheelSideForced(i, /*[out]*/forced_side))
1765  {
1766  ImGui::PushStyleColor(ImGuiCol_Border, ORANGE_TEXT);
1767  ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.f);
1768  }
1769  const RoR::WheelSide active_side = TuneupUtil::getTweakedWheelSide(tuneup_def, i, tuning_actor->GetGfxActor()->getWheelSide(i));
1770  RoR::WheelSide selected_side = active_side;
1771  if (ImGui::RadioButton("##L", active_side == WheelSide::LEFT))
1772  selected_side = WheelSide::LEFT;
1773  ImGui::SameLine();
1774  ImGui::TextDisabled("|");
1775  ImGui::SameLine();
1776  if (ImGui::RadioButton("##R", active_side == WheelSide::RIGHT))
1777  selected_side = WheelSide::RIGHT;
1778 
1779  // Draw rim mesh name
1780  ImGui::SameLine();
1781  ImGui::Text("%s", tuning_actor->GetGfxActor()->getWheelRimMeshName(i).c_str());
1782 
1783  // Draw reset button
1784 
1785  bool resetPressed = false;
1786  if (tuneup_def && tuneup_def->isWheelSideForced(i, forced_side))
1787  {
1788  ImGui::SameLine();
1789  ImGui::SameLine();
1790  ImGui::PushStyleColor(ImGuiCol_Text, GRAY_HINT_TEXT);
1791  resetPressed = ImGui::SmallButton(_LC("Tuning", "Reset"));
1792  ImGui::PopStyleColor(); //ImGuiCol_Text, GRAY_HINT_TEXT
1793  ImGui::PopStyleVar(); //ImGuiStyleVar_FrameBorderSize, 1.f
1794  ImGui::PopStyleColor(); //ImGuiCol_Border, ORANGE_TEXT
1795  }
1796 
1797  // modify project if needed
1798  if (selected_side != active_side)
1799  {
1802  req->mpr_subject_id = i;
1803  req->mpr_value_int = (int)selected_side;
1806  }
1807  else if (resetPressed)
1808  {
1811  req->mpr_subject_id = i;
1814  }
1815 
1817  i,
1818  tuneup_def && tuneup_def->isWheelProtected(i),
1821 
1822  ImGui::PopID(); // i
1823  }
1824  }
1825 
1826  // Draw flares
1827  size_t total_flares = tuning_actor->ar_flares.size();
1828  std::string flares_title = fmt::format(_LC("Tuning", "Flares ({})"), total_flares);
1829  if (ImGui::CollapsingHeader(flares_title.c_str()))
1830  {
1831  // Draw all flares (those removed by addonparts are also present as placeholders)
1832  for (FlareID_t flareid = 0; flareid < (int)tuning_actor->ar_flares.size(); flareid++)
1833  {
1834  ImGui::PushID(flareid);
1835  ImGui::AlignTextToFramePadding();
1836 
1837  this->DrawTuningBoxedSubjectIdInline(flareid);
1838 
1839  // Compose flare description string
1840  const FlareType flaretype = tuning_actor->ar_flares[flareid].fl_type;
1841  std::string flarename;
1842  if (flaretype == FlareType::USER)
1843  {
1844  int controlnumber = tuning_actor->ar_flares[flareid].controlnumber + 1; // Convert range 0-9 to 1-10
1845  flarename = fmt::format("{} {}", (char)flaretype, controlnumber);
1846  }
1847  else if (flaretype == FlareType::DASHBOARD)
1848  {
1849  std::string linkname = tuning_actor->ar_dashboard->getLinkNameForID((DashData)tuning_actor->ar_flares[flareid].dashboard_link);
1850  flarename = fmt::format("{} {}", (char)flaretype, linkname);
1851  }
1852  else
1853  {
1854  flarename = fmt::format("{}", (char)flaretype);
1855  }
1856 
1858  flareid,
1859  flarename,
1860  tuneup_def && tuneup_def->isFlareUnwanted(flareid),
1861  tuneup_def && tuneup_def->isFlareForceRemoved(flareid),
1864 
1866  flareid,
1867  tuneup_def && tuneup_def->isFlareProtected(flareid),
1870 
1871  ImGui::PopID(); // flareid
1872  }
1873  }
1874 
1875  // Draw exhausts
1876  size_t total_exhausts = tuning_actor->GetGfxActor()->getExhausts().size();
1877  std::string exhausts_title = fmt::format(_LC("Tuning", "Exhausts ({})"), total_exhausts);
1878  if (ImGui::CollapsingHeader(exhausts_title.c_str()))
1879  {
1880  // Draw all exhausts (those removed by addonparts are also present as placeholders)
1881  for (ExhaustID_t exhaustid = 0; exhaustid < (int)total_exhausts; exhaustid++)
1882  {
1883  ImGui::PushID(exhaustid);
1884  ImGui::AlignTextToFramePadding();
1885 
1886  this->DrawTuningBoxedSubjectIdInline(exhaustid);
1887 
1889  exhaustid,
1890  tuning_actor->GetGfxActor()->getExhausts()[exhaustid].particleSystemName,
1891  tuneup_def && tuneup_def->isExhaustUnwanted(exhaustid),
1892  tuneup_def && tuneup_def->isExhaustForceRemoved(exhaustid),
1895 
1897  exhaustid,
1898  tuneup_def && tuneup_def->isExhaustProtected(exhaustid),
1901 
1902  ImGui::PopID(); // exhaustid
1903  }
1904  }
1905 
1906  // Draw managed materials
1907  size_t total_materials = tuning_actor->ar_managed_materials.size();
1908  std::string materials_title = fmt::format(_LC("Tuning", "Managed Materials ({})"), total_materials);
1909  if (ImGui::CollapsingHeader(materials_title.c_str()))
1910  {
1911  // Draw all materials (those removed by addonparts are also present as placeholders)
1912  for (auto mm_pair: tuning_actor->ar_managed_materials)
1913  {
1914  const std::string& material_name = mm_pair.first;
1915  ImGui::PushID(material_name.c_str());
1916  ImGui::AlignTextToFramePadding();
1917 
1920  material_name,
1921  tuneup_def && tuneup_def->isManagedMatUnwanted(material_name),
1922  tuneup_def && tuneup_def->isManagedMatForceRemoved(material_name),
1925 
1928  tuneup_def && tuneup_def->isManagedMatProtected(material_name),
1931  material_name);
1932 
1933  ImGui::PopID(); // material_name.c_str()
1934  }
1935  }
1936  }
1937 
1939  m_open_menu_hoverbox_max.x = menu_pos.x + ImGui::GetWindowWidth() + MENU_HOVERBOX_PADDING.x;
1940  m_open_menu_hoverbox_max.y = menu_pos.y + ImGui::GetWindowHeight() + MENU_HOVERBOX_PADDING.y;
1941  App::GetGuiManager()->RequestGuiCaptureKeyboard(ImGui::IsWindowHovered());
1942  ImGui::End();
1943  }
1944  break;
1945 
1946  default:
1947  m_open_menu_hoverbox_min = ImVec2(0,0);
1948  m_open_menu_hoverbox_max = ImVec2(0,0);
1949  }
1950 
1951  ImGui::PopStyleColor(2); // WindowBg, Button
1952 }
1953 
1954 bool TopMenubar::ShouldDisplay(ImVec2 window_pos)
1955 {
1956  if (!App::GetGuiManager()->AreStaticMenusAllowed())
1957  {
1958  return false;
1959  }
1960 
1961  if (ImGui::IsMouseDown(1))
1962  {
1963  return false;
1964  }
1965 
1966  if (ai_menu)
1967  {
1969  return true;
1970  }
1971 
1972  ImVec2 box_min(0,0);
1973  ImVec2 box_max(ImGui::GetIO().DisplaySize.x, ImGui::GetStyle().WindowPadding.y + PANEL_HOVERBOX_HEIGHT);
1974  ImVec2 mouse_pos = ImGui::GetIO().MousePos;
1975  const bool window_hovered ((mouse_pos.x >= box_min.x) && (mouse_pos.x <= box_max.x) &&
1976  (mouse_pos.y >= box_min.y) && (mouse_pos.y <= box_max.y));
1977  bool result = window_hovered;
1978 
1979  bool menu_hovered = false;
1981  {
1982  menu_hovered = ((mouse_pos.x >= m_open_menu_hoverbox_min.x) && (mouse_pos.x <= m_open_menu_hoverbox_max.x) &&
1983  (mouse_pos.y >= m_open_menu_hoverbox_min.y) && (mouse_pos.y <= m_open_menu_hoverbox_max.y));
1984  }
1985  result |= menu_hovered;
1986 
1987  bool box_hovered = false;
1989  {
1990  box_hovered = ((mouse_pos.x >= m_state_box_hoverbox_min.x) && (mouse_pos.x <= m_state_box_hoverbox_max.x) &&
1991  (mouse_pos.y >= m_state_box_hoverbox_min.y) && (mouse_pos.y <= m_state_box_hoverbox_max.y));
1992  result |= box_hovered;
1993  }
1994 
1995  if (box_hovered && !menu_hovered)
1996  {
1998  }
1999 
2000  return result;
2001 }
2002 
2004 {
2005  // Count actors owned by the player
2006  unsigned int num_actors_player = 0;
2007  for (ActorPtr& actor : App::GetGameContext()->GetActorManager()->GetActors())
2008  {
2009  if (actor->ar_net_source_id == user.uniqueid)
2010  {
2011  ++num_actors_player;
2012  }
2013  }
2014 
2015  // Display user in list
2016 #ifdef USE_SOCKETW
2017  const Ogre::ColourValue player_color = App::GetNetwork()->GetPlayerColor(user.colournum);
2018  ImVec4 player_gui_color(player_color.r, player_color.g, player_color.b, 1.f);
2019  ImGui::PushStyleColor(ImGuiCol_Text, player_gui_color);
2020  ImGui::Text("%s: %u (%s, Ver: %s, Lang: %s)",
2021  user.username, num_actors_player,
2022  App::GetNetwork()->UserAuthToStringShort(user).c_str(),
2023  user.clientversion, user.language);
2024  ImGui::PopStyleColor();
2025 #endif // USE_SOCKETW
2026 
2027  // Display actor list
2028  Ogre::TexturePtr tex1 = FetchIcon("control_pause.png");
2029  Ogre::TexturePtr tex2 = FetchIcon("control_play.png");
2030  int i = 0;
2031  for (ActorPtr& actor : App::GetGameContext()->GetActorManager()->GetActors())
2032  {
2033  if ((!actor->ar_hide_in_actor_list) && (actor->ar_net_source_id == user.uniqueid))
2034  {
2035  std::string id = fmt::format("{}:{}", i++, user.uniqueid);
2036  ImGui::PushID(id.c_str());
2037  if (actor->ar_state == ActorState::NETWORKED_OK)
2038  {
2039  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(tex1->getHandle()), ImVec2(16, 16)))
2040  {
2042  }
2043  }
2044  else if (actor->ar_state == ActorState::NETWORKED_HIDDEN)
2045  {
2046  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(tex2->getHandle()), ImVec2(16, 16)))
2047  {
2049  }
2050  }
2051  else // Our actor(s)
2052  {
2053  std::string text_buf_rem = fmt::format(" X ##[{}]", i);
2054  ImGui::PushStyleColor(ImGuiCol_Text, RED_TEXT);
2055  if (ImGui::Button(text_buf_rem.c_str()))
2056  {
2057  App::GetGameContext()->PushMessage(Message(MSG_SIM_DELETE_ACTOR_REQUESTED, static_cast<void*>(new ActorPtr(actor))));
2058  }
2059  ImGui::PopStyleColor();
2060  }
2061  ImGui::PopID();
2062  ImGui::SameLine();
2063 
2064  std::string actortext_buf = fmt::format("{} ({}) ##[{}:{}]", StripColorMarksFromText(actor->ar_design_name).c_str(), actor->ar_filename.c_str(), i++, user.uniqueid);
2065  if (ImGui::Button(actortext_buf.c_str())) // Button clicked?
2066  {
2067  App::GetGameContext()->PushMessage(Message(MSG_SIM_SEAT_PLAYER_REQUESTED, static_cast<void*>(new ActorPtr(actor))));
2068  }
2069  }
2070  }
2071 }
2072 
2074 {
2075  std::vector<ActorPtr> actor_list;
2076  for (ActorPtr& actor : App::GetGameContext()->GetActorManager()->GetActors())
2077  {
2078  if (!actor->ar_hide_in_actor_list)
2079  {
2080  actor_list.emplace_back(actor);
2081  }
2082  }
2083  if (actor_list.empty())
2084  {
2085  ImGui::PushStyleColor(ImGuiCol_Text, GRAY_HINT_TEXT);
2086  ImGui::Text("%s", _LC("TopMenubar", "None spawned yet"));
2087  ImGui::Text("%s", _LC("TopMenubar", "Use [Simulation] menu"));
2088  ImGui::PopStyleColor();
2089  }
2090  else
2091  {
2092  ActorPtr player_actor = App::GetGameContext()->GetPlayerActor();
2093  int i = 0;
2094  for (ActorPtr& actor : actor_list)
2095  {
2096  std::string text_buf_rem = fmt::format("X ##[{}]", i);
2097  ImGui::PushStyleColor(ImGuiCol_Text, RED_TEXT);
2098  if (ImGui::Button(text_buf_rem.c_str()))
2099  {
2100  App::GetGameContext()->PushMessage(Message(MSG_SIM_DELETE_ACTOR_REQUESTED, static_cast<void*>(new ActorPtr(actor))));
2101  }
2102  ImGui::PopStyleColor();
2103  ImGui::SameLine();
2104 
2105  std::string text_buf = fmt::format( "[{}] {}", i++, StripColorMarksFromText(actor->ar_design_name).c_str());
2106  if (actor == player_actor)
2107  {
2108  ImGui::PushStyleColor(ImGuiCol_Text, GREEN_TEXT);
2109  }
2110  else if (std::find(actor->ar_linked_actors.begin(), actor->ar_linked_actors.end(), player_actor) != actor->ar_linked_actors.end())
2111  {
2112  ImGui::PushStyleColor(ImGuiCol_Text, ORANGE_TEXT);
2113  }
2114  else if (actor->ar_state == ActorState::LOCAL_SIMULATED)
2115  {
2116  ImGui::PushStyleColor(ImGuiCol_Text, WHITE_TEXT);
2117  }
2118  else
2119  {
2120  ImGui::PushStyleColor(ImGuiCol_Text, GRAY_HINT_TEXT);
2121  }
2122  if (ImGui::Button(text_buf.c_str())) // Button clicked?
2123  {
2124  App::GetGameContext()->PushMessage(Message(MSG_SIM_SEAT_PLAYER_REQUESTED, static_cast<void*>(new ActorPtr(actor))));
2125  }
2126  ImGui::PopStyleColor();
2127  }
2128  }
2129 }
2130 
2131 void DrawRepairBoxEvent(events ev, std::string const& desc)
2132 {
2133  ImDrawEventHighlighted(ev); ImGui::SameLine(); ImGui::TextDisabled(desc.c_str()); ImGui::NextColumn();
2134 }
2135 
2136 void DrawRepairBoxModkey(OIS::KeyCode modkey, std::string const& desc)
2137 {
2138  ImDrawModifierKeyHighlighted(modkey); ImGui::SameLine(); ImGui::TextDisabled(desc.c_str()); ImGui::NextColumn();
2139 }
2140 
2141 void TopMenubar::DrawSpecialStateBox(float top_offset)
2142 {
2143  float content_width = 0.f;
2144  // Always drawn on top:
2145  std::string special_text;
2146  ImVec4 special_color = ImGui::GetStyle().Colors[ImGuiCol_Text]; // Regular color
2147  float special_text_centering_weight = 1.f; // 0 = no centering
2148  // Only for race_box:
2149  std::string special_text_b;
2150  std::string special_text_c;
2151  std::string special_text_d;
2152  ImVec4 special_color_c = ImVec4(0,0,0,0);
2154 
2155  // Gather state info
2156  if (App::GetGameContext()->GetActorManager()->IsSimulationPaused() && !App::GetGuiManager()->IsGuiHidden())
2157  {
2158  special_color = ORANGE_TEXT;
2159  special_text = fmt::format(_LC("TopMenubar", "All physics paused, press {} to resume"),
2160  App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_TOGGLE_PHYSICS));
2161  content_width = ImGui::CalcTextSize(special_text.c_str()).x;
2162  }
2163  else if (App::GetGameContext()->GetPlayerActor() &&
2164  App::GetGameContext()->GetPlayerActor()->ar_physics_paused &&
2165  !App::GetGuiManager()->IsGuiHidden())
2166  {
2167  special_color = GREEN_TEXT;
2168  special_text = fmt::format(_LC("TopMenubar", "Vehicle physics paused, press {} to resume"),
2169  App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_TOGGLE_PHYSICS));
2170  content_width = ImGui::CalcTextSize(special_text.c_str()).x;
2171  }
2172  else if (App::GetGameContext()->GetPlayerActor() &&
2173  App::GetGameContext()->GetPlayerActor()->ar_state == ActorState::LOCAL_REPLAY)
2174  {
2175  content_width = 300;
2177  special_text = _LC("TopMenubar", "Replay");
2178  }
2179  else if (App::GetGameContext()->GetRepairMode().IsLiveRepairActive())
2180  {
2181  special_text = fmt::format(_LC("TopMenubar", "Live repair mode, hit '{}' to stop"),
2182  App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_REPAIR_TRUCK));
2183  content_width = 450;
2185  special_color = GREEN_TEXT;
2186  special_text_centering_weight = 0.7f;
2187  }
2188  else if (App::GetGameContext()->GetRepairMode().IsQuickRepairActive())
2189  {
2190  special_text = fmt::format(_LC("TopMenubar", "Quick repair ('{}' for Live repair)"),
2191  App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_LIVE_REPAIR_MODE));
2192  content_width = 450;
2194  special_color = ORANGE_TEXT;
2195  special_text_centering_weight = 0.7f;
2196  }
2197  else if (App::GetGfxScene()->GetSimDataBuffer().simbuf_dir_arrow_visible)
2198  {
2200 
2201  // Calculate distance
2203  GUIManager::GuiTheme const& theme = App::GetGuiManager()->GetTheme();
2204  float distance = 0.0f;
2206  if (player_actor != nullptr && App::GetGameContext()->GetPlayerActor() &&
2208  {
2209  distance = player_actor->GetGfxActor()->GetSimDataBuffer().simbuf_pos.distance(data.simbuf_dir_arrow_target);
2210  }
2211  else
2212  {
2213  distance = data.simbuf_character_pos.distance(data.simbuf_dir_arrow_target);
2214  }
2215 
2216  // format text
2218  special_text_b = fmt::format("{:.1f} {}", distance, _LC("DirectionArrow", "meter"));
2219  content_width = ImGui::CalcTextSize(special_text.c_str()).x + ImGui::CalcTextSize(special_text_b.c_str()).x;
2220 
2222  special_text_c = fmt::format("{:02d}.{:02d}.{:02d}", (int)(time) / 60, (int)(time) % 60, (int)(time * 100.0) % 100);
2224  special_color_c = (time_diff > 0.0f)
2225  ? theme.value_red_text_color
2226  : ((time_diff < 0.0f) ? theme.success_text_color : theme.value_blue_text_color);
2227 
2229  {
2231  special_text_d = fmt::format("{:02d}.{:02d}.{:02d}", (int)(best_time) / 60, (int)(best_time) % 60, (int)(best_time * 100.0) % 100);
2232  }
2233  }
2234  else if (App::sim_state->getEnum<SimState>() == SimState::EDITOR_MODE)
2235  {
2236  special_color = GREEN_TEXT;
2237  if (App::GetGameContext()->GetTerrain()->getCacheEntry()->resource_bundle_type == "Zip")
2238  {
2239  // This is a read-only (ZIPped) terrain; offer the importer script.
2240  special_text = fmt::format(_LC("TopMenubar", "Terrain editing mode, press {} to exit"),
2241  App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_TOGGLE_TERRAIN_EDITOR));
2242  content_width = ImGui::CalcTextSize(special_text.c_str()).x + 25.f;
2244  }
2245  else
2246  {
2247  special_text = fmt::format(_LC("TopMenubar", "Terrain editing mode, press {} to save and exit"),
2248  App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_TOGGLE_TERRAIN_EDITOR));
2249  content_width = ImGui::CalcTextSize(special_text.c_str()).x;
2250  }
2251  }
2252 
2253  // Draw box if needed
2254  if (!special_text.empty())
2255  {
2256  ImVec2 box_pos;
2257  box_pos.y = top_offset;
2258  box_pos.x = (ImGui::GetIO().DisplaySize.x / 2) - ((content_width / 2) + ImGui::GetStyle().FramePadding.x);
2259  ImGui::SetNextWindowPos(box_pos);
2260  ImGui::SetNextWindowSize(ImVec2(0.f, 0.f));
2261  ImGui::SetNextWindowContentWidth(content_width);
2262  ImGuiWindowFlags flags = ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove |
2263  ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse;
2264  ImGui::PushStyleColor(ImGuiCol_WindowBg, App::GetGuiManager()->GetTheme().semitransparent_window_bg);
2265  if (ImGui::Begin(special_text.c_str(), nullptr, flags))
2266  {
2268  {
2269  // Center the text, the box may be wider
2270  float text_w = ImGui::CalcTextSize(special_text.c_str()).x;
2271  ImGui::SetCursorPosX(((content_width / 2) - (text_w / 2)) * special_text_centering_weight);
2272  }
2273  ImGui::TextColored(special_color, "%s", special_text.c_str());
2274 
2276  {
2277  ImGui::SameLine();
2278 
2279  // Progress bar with frame index/count
2281  float fraction = (float)std::abs(replay->getCurrentFrame())/(float)replay->getNumFrames();
2282  Str<100> pbar_text; pbar_text << replay->getCurrentFrame() << "/" << replay->getNumFrames();
2283  float pbar_width = content_width - (ImGui::GetStyle().ItemSpacing.x + ImGui::CalcTextSize(special_text.c_str()).x);
2284  ImGui::ProgressBar(fraction, ImVec2(pbar_width, ImGui::GetTextLineHeight()), pbar_text.ToCStr());
2285 
2286  // Game time text
2287  float time_sec = replay->getLastReadTime() / 1000000.0;
2288  char str[200];
2289  int str_pos = 0;
2290  if (time_sec > 60)
2291  {
2292  int min = (int)time_sec / 60;
2293  str_pos = snprintf(str, 200, "%dmin ", min);
2294  time_sec -= (float)min * 60.f;
2295  }
2296  snprintf(str+str_pos, 200-str_pos, "%.2fsec", time_sec);
2297  ImGui::TextDisabled("%s: %s", _LC("TopMenubar", "Time"), str);
2298 
2299  }
2301  {
2302  ImGui::SameLine();
2303  ImGui::Text(special_text_b.c_str());
2304  ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2) - (ImGui::CalcTextSize(special_text_c.c_str()).x / 2));
2305  ImGui::TextColored(special_color_c,"%s", special_text_c.c_str());
2306 
2307  Str<300> text;
2308  text << "Best Time: " << special_text_d.c_str();
2309  ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2) - (ImGui::CalcTextSize(text).x / 2));
2310 
2311  if (!special_text_d.empty())
2312  {
2313  ImGui::TextDisabled(text);
2314  }
2315  }
2317  {
2318  // Draw special element on the right
2319  ImGui::SameLine();
2320  ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.f, 0.f));
2322  {
2324  ImGui::ProgressBar(fraction, ImVec2(15.f, ImGui::GetTextLineHeight() / 2.f), "");
2325  ImGui::SameLine();
2326  }
2327  DrawGCheckbox(App::ui_show_live_repair_controls, _LC("LiveRepair", "Show controls"));
2328  ImGui::PopStyleVar(); // FramePadding
2329 
2330  const ImVec2 MINI_SPACING = ImVec2(2.f,0.f);
2331  ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, MINI_SPACING);
2332 
2333  if (App::ui_show_live_repair_controls->getBool())
2334  {
2335  const float INDENT = 15.f;
2336  ImGui::Separator();
2337  ImGui::TextDisabled("%s:", _LC("LiveRepair", "Movement"));
2338  ImGui::Columns(3);
2339  ImGui::SetColumnWidth(0, INDENT);
2340  ImGui::NextColumn();
2341  DrawRepairBoxEvent(EV_CHARACTER_FORWARD,_LC("LiveRepair", "Forward"));
2342  DrawRepairBoxEvent(EV_CHARACTER_BACKWARDS,_LC("LiveRepair", "Backward"));
2343  ImGui::NextColumn();
2344  DrawRepairBoxEvent(EV_CHARACTER_SIDESTEP_LEFT,_LC("LiveRepair", "Left"));
2345  DrawRepairBoxEvent(EV_CHARACTER_SIDESTEP_RIGHT,_LC("LiveRepair", "Right"));
2346  ImGui::NextColumn();
2347  DrawRepairBoxEvent(EV_TRUCK_ACCELERATE,_LC("LiveRepair", "Up"));
2348  DrawRepairBoxEvent(EV_TRUCK_BRAKE,_LC("LiveRepair", "Down"));
2349  ImGui::Columns(1);
2350 
2351  ImGui::TextDisabled("%s:", _LC("LiveRepair", "Rotation"));
2352  ImGui::Columns(3);
2353  ImGui::SetColumnWidth(0, INDENT);
2354  ImGui::NextColumn();
2355  DrawRepairBoxEvent(EV_TRUCK_STEER_LEFT,_LC("LiveRepair", "Rot. left"));
2356  DrawRepairBoxEvent(EV_TRUCK_STEER_RIGHT,_LC("LiveRepair", "Rot. right"));
2357  ImGui::Columns(1);
2358 
2359  ImGui::TextDisabled("%s:", _LC("LiveRepair", "Modifiers"));
2360  ImGui::Columns(4);
2361  ImGui::SetColumnWidth(0, INDENT);
2362  ImGui::SetColumnWidth(1, 125);
2363  ImGui::SetColumnWidth(2, 125);
2364  ImGui::NextColumn();
2365  DrawRepairBoxModkey(OIS::KC_LMENU,_LC("LiveRepair", "Slow step")); // Left alt
2366  DrawRepairBoxModkey(OIS::KC_LSHIFT,_LC("LiveRepair", "Fast step"));
2367  DrawRepairBoxModkey(OIS::KC_LCONTROL,_LC("LiveRepair", "10x step")); // Left ctrl
2368  ImGui::Columns(1);
2369 
2371  ImGui::TextDisabled("%s (%s):", _LC("LiveRepair", "Reset mode"), ToLocalizedString(resetmode).c_str());
2372  ImGui::Dummy(ImVec2(INDENT, 1.f));
2373  ImGui::SameLine();
2374  DrawRepairBoxEvent(EV_COMMON_TOGGLE_RESET_MODE,_LC("LiveRepair", "Switch reset mode"));
2375  }
2376  ImGui::PopStyleVar(); // ItemSpacing
2377  }
2379  {
2380  ImGui::Separator();
2381  // notice text
2382  std::string lbl_readonly = _LC("TopMenubar", "This terrain is read only.");
2383  ImGui::SetCursorPosX(ImGui::GetCursorPosX()
2384  + (ImGui::GetWindowContentRegionWidth() / 2 - ImGui::CalcTextSize(lbl_readonly.c_str()).x/2));
2385  ImGui::TextDisabled("%s", lbl_readonly.c_str());
2386  // import button
2387  ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.2, 0.2, 0.2, 1.0));
2388  std::string btn_import = _LC("TopMenubar", "Import as editable project.");
2389  ImGui::SetCursorPosX(ImGui::GetCursorPosX()
2390  + ((ImGui::GetWindowContentRegionWidth() / 2 - ImGui::CalcTextSize(btn_import.c_str()).x / 2) - ImGui::GetStyle().FramePadding.x));
2391  if (!m_terrn_import_started && ImGui::Button(btn_import.c_str()))
2392  {
2394  rq->lsr_filename = "terrain_project_importer.as";
2397  m_terrn_import_started = true;
2398  }
2399  ImGui::PopStyleColor(); // ImGuiCol_Button
2400  }
2401  const ImVec2 PAD = ImVec2(5, 5); // To bridge top menubar hoverbox and statebox hoverbox
2402  m_state_box_hoverbox_min = box_pos - PAD;
2403  m_state_box_hoverbox_max.x = box_pos.x + ImGui::GetWindowWidth();
2404  m_state_box_hoverbox_max.y = box_pos.y + ImGui::GetWindowHeight();
2405  m_state_box_hoverbox_max += PAD;
2406  // DO NOT `RequestGuiCaptureKeyboard()` - we want to use the hotkeys through it.
2407  ImGui::End();
2408  }
2409  ImGui::PopStyleColor(1); // WindowBg
2410  }
2411 
2412  if (App::sim_state->getEnum<SimState>() != SimState::EDITOR_MODE)
2413  {
2414  m_terrn_import_started = false;
2415  }
2416 }
2417 
2419 {
2420  // Load 'bundled' AI presets - see section `[AI Presets]` in terrn2 file format
2421  // ----------------------------------------------------------------------------
2422 
2424 
2425  for (const std::string& filename: terrain->GetDef()->ai_presets_files)
2426  {
2427  rapidjson::Document j_doc;
2428  if (Ogre::ResourceGroupManager::getSingleton().resourceExists(terrain->getTerrainFileResourceGroup(), filename))
2429  {
2431  }
2432  else
2433  {
2434  LOG(fmt::format("[RoR|Terrain] AI presets file '{}' declared in '{}' not found!", filename, terrain->getTerrainFileName()));
2435  }
2436 
2437  // Ensure the format is about right
2438  if (!j_doc.IsArray())
2439  {
2440  LOG(fmt::format("[RoR|Terrain] AI presets file '{}' declared in '{}' has wrong format - the root element is not an array!",
2441  filename, terrain->getTerrainFileName()));
2442  }
2443  else
2444  {
2445  // Finally add the presets to the list
2446  for (const rapidjson::Value& j_bundled_preset: j_doc.GetArray())
2447  {
2448  rapidjson::Value preset_copy(j_bundled_preset, App::GetGuiManager()->TopMenubar.ai_presets_bundled.GetAllocator());
2450  }
2451  }
2452  }
2453 
2455 }
2456 
2458 {
2459 #if defined(USE_CURL)
2460  std::packaged_task<void()> task(FetchAiPresetsThreadFunc);
2461  std::thread(std::move(task)).detach();
2463 #endif // defined(USE_CURL)
2464 }
2465 
2467 {
2468  // Combine external and bundled presets into one JSON doc
2469  // -------------------------------------------------------
2470 
2471  ai_presets_all.Clear();
2472  ai_presets_all.SetArray();
2473 
2474  for (rapidjson::Value& bundled_preset: ai_presets_bundled.GetArray())
2475  {
2476  rapidjson::Value preset_copy(bundled_preset, ai_presets_all.GetAllocator());
2477  ai_presets_all.PushBack(preset_copy, ai_presets_all.GetAllocator());
2478  }
2479 
2480  for (const rapidjson::Value& extern_preset: ai_presets_extern.GetArray())
2481  {
2482  rapidjson::Value preset_copy(extern_preset, ai_presets_all.GetAllocator());
2483  ai_presets_all.PushBack(preset_copy, ai_presets_all.GetAllocator());
2484  }
2485 }
2486 
2488 {
2489  // Updates/resets the tuning menu for the current vehicle driven by player (if any).
2490  // -------------------------------------------------------------------------------
2491 
2492  if (App::sim_tuning_enabled->getBool()
2493  && (App::mp_state->getEnum<MpState>() != MpState::CONNECTED)
2494  && App::GetGameContext()->GetPlayerActor()
2495  && (tuning_actor != App::GetGameContext()->GetPlayerActor()))
2496  {
2499 
2500  tuning_addonparts.clear();
2502 
2503  // Addonparts matched by GUID
2504  if (tuning_actor->getUsedActorEntry()->guid != "")
2505  {
2506  CacheQuery query_addonparts;
2507  query_addonparts.cqy_filter_type = LT_AddonPart;
2508  query_addonparts.cqy_filter_guid = tuning_actor->getUsedActorEntry()->guid;
2509  query_addonparts.cqy_filter_target_filename = tuning_actor->getTruckFileName(); // Addonparts without any filenames listed will just pass.
2510  App::GetCacheSystem()->Query(query_addonparts);
2511  for (CacheQueryResult& res: query_addonparts.cqy_results)
2512  {
2513  tuning_addonparts.push_back(res.cqr_entry);
2514  }
2515  }
2516 
2517  // Addonparts force-installed via [browse all] button; watch for duplicates.
2519  {
2520  for (std::string const& use_addonpart_fname: tuning_actor->getWorkingTuneupDef()->use_addonparts)
2521  {
2522  CacheEntryPtr entry = App::GetCacheSystem()->FindEntryByFilename(LT_AddonPart, /*partial:*/false, use_addonpart_fname);
2523  if (entry)
2524  {
2525  if (std::find(tuning_addonparts.begin(), tuning_addonparts.end(), entry) == tuning_addonparts.end())
2526  {
2527  tuning_addonparts.push_back(entry);
2528  }
2529  }
2530  }
2531  }
2532 
2536  tuning_saves.cqy_filter_category_id = CID_Tuneups; // Exclude auto-generated entries
2539 
2540  // Refresh `tuning_conflicts` database ~ test eligible addonparts each with each once.
2541  tuning_conflicts.clear();
2542  for (size_t i1 = 0; i1 < tuning_addonparts.size(); i1++)
2543  {
2544  for (size_t i2 = i1; i2 < tuning_addonparts.size(); i2++)
2545  {
2546  if (i1 != i2)
2547  {
2549  }
2550  }
2551  }
2552 
2553  // Refresh `tuning_addonparts_conflicting` listing ~ test used addonparts against unused.
2557  {
2558  for (const std::string& use_addonpart_fname: tuning_actor->getWorkingTuneupDef()->use_addonparts)
2559  {
2560  CacheEntryPtr use_addonpart_entry = App::GetCacheSystem()->FindEntryByFilename(LT_AddonPart, /*partial:*/false, use_addonpart_fname);
2561  for (size_t i = 0; i < tuning_addonparts.size(); i++)
2562  {
2563  if (tuning_addonparts[i] != use_addonpart_entry)
2564  {
2567  }
2568  }
2569  }
2570  }
2571 
2573  }
2574  else if (!App::sim_tuning_enabled->getBool() || !App::GetGameContext()->GetPlayerActor())
2575  {
2576  tuning_addonparts.clear();
2578  tuning_actor = nullptr;
2579  }
2580 }
2581 
2582 void TopMenubar::DrawTuningProtectedChkRightAligned(const int subject_id, bool protectchk_value, ModifyProjectRequestType request_type_set, ModifyProjectRequestType request_type_reset, const std::string& subject /* ="" */)
2583 {
2584  // > resolve the alignment
2585  ImGui::SameLine();
2586  if (tuning_rwidget_cursorx_min < ImGui::GetCursorPosX()) // Make sure button won't draw over item name
2587  tuning_rwidget_cursorx_min = ImGui::GetCursorPosX();
2588  std::string protectchk_text = _LC("Tuning", "Protected");
2589  float protectchk_w = ImGui::CalcTextSize(protectchk_text.c_str()).x + ImGui::GetStyle().FramePadding.x * 2;
2590  float protectchk_cursorx = (ImGui::GetWindowContentRegionWidth() - protectchk_w) - 20.f;
2591  if (protectchk_cursorx < tuning_rwidget_cursorx_min)
2592  protectchk_cursorx = tuning_rwidget_cursorx_min;
2593  ImGui::SetCursorPosX(protectchk_cursorx);
2594 
2595  // > set styling and draw
2596  ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0.0f, 0.0f));
2597  bool chk_pressed = ImGui::Checkbox(protectchk_text.c_str(), &protectchk_value);
2598  ImGui::PopStyleVar(1); // ImGuiStyleVar_FramePadding
2599 
2600  // > handle user action
2601  if (chk_pressed)
2602  {
2603  ModifyProjectRequest* request = new ModifyProjectRequest();
2604  request->mpr_target_actor = tuning_actor;
2605  if (subject_id == TUNING_SUBJECTID_USE_NAME)
2606  {
2607  request->mpr_subject = subject;
2608  }
2609  else
2610  {
2611  request->mpr_subject_id = subject_id;
2612  }
2613  request->mpr_type = (protectchk_value) ? request_type_set : request_type_reset;
2615  }
2616 }
2617 
2619 {
2620  // Draw subject ID in outlined box
2621  // -------------------------------
2622  ImGui::GetWindowDrawList()->AddRect(
2623  ImGui::GetCursorScreenPos(),
2624  ImGui::GetCursorScreenPos() + ImGui::CalcTextSize("00") + ImGui::GetStyle().FramePadding*2,
2625  ImColor(ImGui::GetStyle().Colors[ImGuiCol_TextDisabled]),
2626  ImGui::GetStyle().FrameRounding);
2627  ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetStyle().FramePadding.x);
2628  ImGui::Text("%02d", subject_id);
2629  ImGui::SameLine();
2630  ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetStyle().FramePadding.x);
2631 }
2632 
2633 void TopMenubar::DrawTuningForceRemoveControls(const int subject_id, const std::string& name, const bool is_unwanted, const bool is_force_removed, ModifyProjectRequestType request_type_set, ModifyProjectRequestType request_type_reset)
2634 {
2635  // Common for props and flexbodies: draws the force-remove checkbox and the reset button
2636  // ------------------------------------------------------------------------------------
2637 
2638  // Draw the checkbox for force-removing.
2639  bool isEnabled = !is_unwanted && !is_force_removed;
2640  if (is_force_removed)
2641  {
2642  ImGui::PushStyleColor(ImGuiCol_Border, ORANGE_TEXT);
2643  ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.f);
2644  }
2645  bool chkPressed = ImGui::Checkbox(name.c_str(), &isEnabled);
2646  bool resetPressed = false;
2647  if (is_force_removed)
2648  {
2649  ImGui::SameLine();
2650  ImGui::PushStyleColor(ImGuiCol_Text, GRAY_HINT_TEXT);
2651  resetPressed = ImGui::SmallButton(_LC("Tuning", "Reset"));
2652  ImGui::PopStyleColor(); //ImGuiCol_Text, GRAY_HINT_TEXT
2653  ImGui::PopStyleVar(); //ImGuiStyleVar_FrameBorderSize, 1.f
2654  ImGui::PopStyleColor(); //ImGuiCol_Border, ORANGE_TEXT
2655  }
2656 
2657  // perform project modification if needed
2658  if (chkPressed && !isEnabled)
2659  {
2661  req->mpr_type = request_type_set;
2662  if (subject_id == TUNING_SUBJECTID_USE_NAME)
2663  {
2664  req->mpr_subject = name;
2665  }
2666  else
2667  {
2668  req->mpr_subject_id = subject_id;
2669  }
2672  }
2673  else if ((chkPressed && isEnabled) || resetPressed)
2674  {
2676  req->mpr_type = request_type_reset;
2677  if (subject_id == TUNING_SUBJECTID_USE_NAME)
2678  {
2679  req->mpr_subject = name;
2680  }
2681  else
2682  {
2683  req->mpr_subject_id = subject_id;
2684  }
2687  }
2688 
2689 }
2690 
2692 {
2693  switch (which)
2694  {
2695  case TopMenu::TOPMENU_AI:
2699  default:
2700  return true;
2701  }
2702 }
RoR::GUI::TopMenubar::m_quickload
bool m_quickload
Definition: GUI_TopMenubar.h:149
RoR::MSG_EDI_MODIFY_PROJECT_REQUESTED
@ MSG_EDI_MODIFY_PROJECT_REQUESTED
Payload = RoR::UpdateProjectRequest* (owner)
Definition: Application.h:156
ROR_ASSERT
#define ROR_ASSERT(_EXPR)
Definition: Application.h:40
GameContext.h
Game state manager and message-queue provider.
RoR::GUI::TopMenubar::m_confirm_remove_all
bool m_confirm_remove_all
Definition: GUI_TopMenubar.h:145
RoR::App::diag_truck_mass
CVar * diag_truck_mass
Definition: Application.cpp:137
RoR::GUIManager::VehicleInfoTPanel
GUI::VehicleInfoTPanel VehicleInfoTPanel
Definition: GUIManager.h:118
RoR::MSG_SIM_LOAD_TERRN_REQUESTED
@ MSG_SIM_LOAD_TERRN_REQUESTED
Definition: Application.h:118
RoR::App::gfx_envmap_rate
CVar * gfx_envmap_rate
Definition: Application.cpp:233
RoR::GUI::TopMenubar::ShouldDisplay
bool ShouldDisplay(ImVec2 window_pos)
Definition: GUI_TopMenubar.cpp:1954
RoR::GUI::TopMenubar::GRAY_HINT_TEXT
const ImVec4 GRAY_HINT_TEXT
Definition: GUI_TopMenubar.h:51
DrawRepairBoxEvent
void DrawRepairBoxEvent(events ev, std::string const &desc)
Definition: GUI_TopMenubar.cpp:2131
RoR::App::gfx_polygon_mode
CVar * gfx_polygon_mode
Definition: Application.cpp:216
RoR::GUI::ConsoleWindow::IsVisible
bool IsVisible() const
Definition: GUI_ConsoleWindow.h:47
RoR::EV_SURVEY_MAP_CYCLE
@ EV_SURVEY_MAP_CYCLE
cycle overview-map mode
Definition: InputEngine.h:292
RoR::App::GetNetwork
Network * GetNetwork()
Definition: Application.cpp:287
RoR::TuneupDef::isFlexbodyForceRemoved
bool isFlexbodyForceRemoved(FlexbodyID_t flexbodyid)
Definition: TuneupFileFormat.h:170
RoR::GUI::TopMenubar::MENU_HOVERBOX_PADDING
const ImVec2 MENU_HOVERBOX_PADDING
Definition: GUI_TopMenubar.h:56
RoR::LoadScriptRequest::lsr_filename
std::string lsr_filename
Load from resource (file). If buffer is supplied, use this as display name only.
Definition: ScriptEngine.h:92
RoR::App::GetContentManager
ContentManager * GetContentManager()
Definition: Application.cpp:270
RoR::GUI::TopMenubar::StateBox::STATEBOX_NONE
@ STATEBOX_NONE
RoR::Terrain::GetDef
Terrn2DocumentPtr GetDef()
Definition: Terrain.cpp:578
RoR::GUI::TopMenubar::ai_presets_extern
rapidjson::Document ai_presets_extern
Externally provided presets (GitHub repo or local 'savegames/waypoints.json' file).
Definition: GUI_TopMenubar.h:105
RoR::ModifyProjectRequest::mpr_subject
std::string mpr_subject
Definition: CacheSystem.h:271
RoR::SimResetMode
SimResetMode
Definition: Application.h:280
RoR::GUI::TopMenubar::DrawTuningBoxedSubjectIdInline
void DrawTuningBoxedSubjectIdInline(int subject_id)
Definition: GUI_TopMenubar.cpp:2618
RoR::TuneupUtil::isAddonPartUsed
static bool isAddonPartUsed(TuneupDefPtr &tuneup_entry, const std::string &filename)
Definition: TuneupFileFormat.cpp:540
RoR::GUI::TopMenubar::FetchExternAiPresetsOnBackground
void FetchExternAiPresetsOnBackground()
Initiate threaded (down)load of 'extern' waypoints from GitHub repo.
Definition: GUI_TopMenubar.cpp:2457
RoR::CacheEntry::dname
Ogre::String dname
name parsed from the file
Definition: CacheSystem.h:70
RoR::GUI::TopMenubar::tuning_savebox_buf
Str< 200 > tuning_savebox_buf
Buffer for tuneup name to be saved.
Definition: GUI_TopMenubar.h:116
ai_events::position
Ogre::Vector3 position
Definition: GUI_TopMenubar.h:39
RoR::GUI::TopMenubar::GREEN_TEXT
const ImVec4 GREEN_TEXT
Definition: GUI_TopMenubar.h:53
RoR::ActorModifyRequest::Type::WAKE_UP
@ WAKE_UP
RoR::App::gfx_fov_internal
CVar * gfx_fov_internal
Definition: Application.cpp:240
y
float y
Definition: (ValueTypes) quaternion.h:6
RoR::ModifyProjectRequestType::TUNEUP_FORCEREMOVE_PROP_SET
@ TUNEUP_FORCEREMOVE_PROP_SET
'subject_id' is prop ID.
RoR::Network::GetUserInfos
std::vector< RoRnet::UserInfo > GetUserInfos()
Definition: Network.cpp:709
RoR::GUI::TopMenubar::ai_num
int ai_num
Definition: GUI_TopMenubar.h:72
RoR::ModifyProjectRequest::mpr_subject_id
int mpr_subject_id
Definition: CacheSystem.h:272
RoR::GUIManager::GuiTheme::value_red_text_color
ImVec4 value_red_text_color
Definition: GUIManager.h:85
RoR::MSG_SIM_MODIFY_ACTOR_REQUESTED
@ MSG_SIM_MODIFY_ACTOR_REQUESTED
Payload = RoR::ActorModifyRequest* (owner)
Definition: Application.h:122
RoR::App::mp_hide_net_labels
CVar * mp_hide_net_labels
Definition: Application.cpp:118
RoR::StripColorMarksFromText
std::string StripColorMarksFromText(std::string const &text)
Definition: GUIUtils.cpp:199
RoR::DrawGFloatSlider
void DrawGFloatSlider(CVar *cvar, const char *label, float v_min, float v_max)
Definition: GUIUtils.cpp:300
RoR::FetchIcon
Ogre::TexturePtr FetchIcon(const char *name)
Definition: GUIUtils.cpp:346
RoR::EV_COMMON_REPAIR_TRUCK
@ EV_COMMON_REPAIR_TRUCK
repair truck to original condition
Definition: InputEngine.h:250
RoR::RepairMode::GetLiveRepairTimer
float GetLiveRepairTimer() const
Definition: RepairMode.h:44
RoR::EV_COMMON_TOGGLE_PHYSICS
@ EV_COMMON_TOGGLE_PHYSICS
toggle physics on/off
Definition: InputEngine.h:271
RoR::TuneupDef::isManagedMatProtected
bool isManagedMatProtected(const std::string &matname) const
Definition: TuneupFileFormat.h:155
RoR::MSG_EDI_RELOAD_BUNDLE_REQUESTED
@ MSG_EDI_RELOAD_BUNDLE_REQUESTED
Payload = RoR::CacheEntryPtr* (owner)
Definition: Application.h:153
RoR::GUI::TopMenubar::TopMenubar
TopMenubar()
Definition: GUI_TopMenubar.cpp:140
RoR::ActorManager::SaveScene
bool SaveScene(Ogre::String filename)
Definition: Savegame.cpp:418
RoR::MpState::CONNECTED
@ CONNECTED
RoR::Network::UserAuthToStringShort
std::string UserAuthToStringShort(RoRnet::UserInfo const &user)
Definition: Network.cpp:857
RoR::GUIManager::FrictionSettings
GUI::FrictionSettings FrictionSettings
Definition: GUIManager.h:125
RoR::GUI::TopMenubar::TopMenu::TOPMENU_TUNING
@ TOPMENU_TUNING
RoR::Str::GetBuffer
char * GetBuffer()
Definition: Str.h:48
RoR::GfxScene::GetSimDataBuffer
GameContextSB & GetSimDataBuffer()
Definition: GfxScene.h:66
RoR::CacheQuery::cqy_filter_category_id
int cqy_filter_category_id
Definition: CacheSystem.h:185
RoR::GUI::TopMenubar::ai_presets_all
rapidjson::Document ai_presets_all
The full list of presets, used for display. Needs to be refreshed when terrain is loaded.
Definition: GUI_TopMenubar.h:104
RoR::GameContextSB
Definition: SimBuffers.h:198
RoR::LT_AddonPart
@ LT_AddonPart
Definition: Application.h:321
RoR::GUIManager::GuiTheme
Definition: GUIManager.h:79
RoR::App::GetCameraManager
CameraManager * GetCameraManager()
Definition: Application.cpp:278
RoR::ModifyProjectRequestType::TUNEUP_PROTECTED_FLEXBODY_SET
@ TUNEUP_PROTECTED_FLEXBODY_SET
'subject_id' is flexbody ID.
RoR::ActorSpawnRequest::asr_origin
Origin asr_origin
Definition: SimData.h:839
RoR::GUI::TopMenubar::DrawSpecialStateBox
void DrawSpecialStateBox(float top_offset)
Definition: GUI_TopMenubar.cpp:2141
RoR::CacheEntryPtr
RefCountingObjectPtr< CacheEntry > CacheEntryPtr
Definition: ForwardDeclarations.h:220
RoR::GameContextSB::simbuf_race_time
float simbuf_race_time
Definition: SimBuffers.h:211
RoR::ModifyProjectRequestType
ModifyProjectRequestType
Definition: CacheSystem.h:232
RoR::App::GetGuiManager
GUIManager * GetGuiManager()
Definition: Application.cpp:272
RoR::GUIManager::GuiTheme::value_blue_text_color
ImVec4 value_blue_text_color
Definition: GUIManager.h:86
RoR::MSG_EDI_CREATE_PROJECT_REQUESTED
@ MSG_EDI_CREATE_PROJECT_REQUESTED
Payload = RoR::CreateProjectRequest* (owner)
Definition: Application.h:155
RoR::App::sim_soft_reset_mode
CVar * sim_soft_reset_mode
Definition: Application.cpp:109
RoR::GUI::VehicleInfoTPanel::TPANELMODE_OPAQUE
@ TPANELMODE_OPAQUE
Definition: GUI_VehicleInfoTPanel.h:37
DrawRepairBoxModkey
void DrawRepairBoxModkey(OIS::KeyCode modkey, std::string const &desc)
Definition: GUI_TopMenubar.cpp:2136
RoRnet::UserInfo
Definition: RoRnet.h:178
RoR::ModifyProjectRequestType::TUNEUP_FORCEREMOVE_PROP_RESET
@ TUNEUP_FORCEREMOVE_PROP_RESET
'subject_id' is prop ID.
RoR::GUI::TopMenubar::ai_position_scheme
int ai_position_scheme
Definition: GUI_TopMenubar.h:77
RoR::EV_COMMON_TOGGLE_RESET_MODE
@ EV_COMMON_TOGGLE_RESET_MODE
toggle truck reset truck mode (soft vs. hard)
Definition: InputEngine.h:258
DashBoardManager.h
RoR::Actor::ar_instance_id
ActorInstanceID_t ar_instance_id
Static attr; session-unique ID.
Definition: Actor.h:373
RoR::ModifyProjectRequestType::TUNEUP_FORCEREMOVE_FLEXBODY_SET
@ TUNEUP_FORCEREMOVE_FLEXBODY_SET
'subject_id' is flexbody ID.
z
float z
Definition: (ValueTypes) quaternion.h:7
RoR::GUI::TopMenubar::ai_position_scheme_prev
int ai_position_scheme_prev
Definition: GUI_TopMenubar.h:96
SkyManager.h
RoR::App::gfx_fixed_cam_tracking
CVar * gfx_fixed_cam_tracking
Definition: Application.cpp:243
RoR::MSG_SIM_UNLOAD_TERRN_REQUESTED
@ MSG_SIM_UNLOAD_TERRN_REQUESTED
Definition: Application.h:120
RoR::DashData
DashData
Definition: DashBoardManager.h:84
RoR::GUI::TopMenubar::m_quicksave_name
std::string m_quicksave_name
Definition: GUI_TopMenubar.h:151
ContentManager.h
GUI_TopMenubar.h
RoR::CreateProjectRequestType::SAVE_TUNEUP
@ SAVE_TUNEUP
Dumps .tuneup file with CID_Tuneup from source actor, will not overwrite existing unless explicitly i...
RoR::Terrain::getTerrainFileResourceGroup
std::string getTerrainFileResourceGroup()
Definition: Terrain.cpp:556
RoR::ActorState::LOCAL_REPLAY
@ LOCAL_REPLAY
RoR::App::sim_live_repair_interval
CVar * sim_live_repair_interval
Hold EV_COMMON_REPAIR_TRUCK to enter LiveRepair mode. 0 or negative interval disables.
Definition: Application.cpp:111
format
Truck file format(technical spec)
GUIUtils.h
RoR::Terrain::getSkyManager
SkyManager * getSkyManager()
Definition: Terrain.cpp:514
RoR::ActorManager::AreTrucksForcedAwake
bool AreTrucksForcedAwake() const
Definition: ActorManager.h:90
CurlWriteFunc
static size_t CurlWriteFunc(void *ptr, size_t size, size_t nmemb, std::string *data)
Definition: GUI_TopMenubar.cpp:71
RoR::GUI::TopMenubar::MENU_Y_OFFSET
const float MENU_Y_OFFSET
Definition: GUI_TopMenubar.h:49
RoR::HandleGenericException
void HandleGenericException(const std::string &from, BitMask_t flags)
Definition: Application.cpp:372
Terrn2FileFormat.h
RoR::LT_Tuneup
@ LT_Tuneup
Definition: Application.h:322
RoR::CreateProjectRequest::cpr_type
CreateProjectRequestType cpr_type
Definition: CacheSystem.h:228
RoR::GUIManager::TextureToolWindow
GUI::TextureToolWindow TextureToolWindow
Definition: GUIManager.h:126
RoR::GameContext::GetPlayerCharacter
Character * GetPlayerCharacter()
Definition: GameContext.cpp:893
RoR::ImDrawModifierKeyHighlighted
void ImDrawModifierKeyHighlighted(OIS::KeyCode key)
Definition: GUIUtils.cpp:453
RoR::Str::GetCapacity
size_t GetCapacity() const
Definition: Str.h:49
RoR::GUI::TopMenubar::ai_altitude
int ai_altitude
Definition: GUI_TopMenubar.h:75
RoR::CVar::getBool
bool getBool() const
Definition: CVar.h:98
RoR::SimState::EDITOR_MODE
@ EDITOR_MODE
Hacky, but whatever... added by Ulteq, 2016.
RoR::ModifyProjectRequestType::TUNEUP_USE_ADDONPART_RESET
@ TUNEUP_USE_ADDONPART_RESET
'subject' is addonpart filename.
RoR::MpState
MpState
Definition: Application.h:174
RoR::GUI::ConsoleWindow::SetVisible
void SetVisible(bool visible)
Definition: GUI_ConsoleWindow.h:46
RoR::FlareType::USER
@ USER
RoR::CacheQuery
Definition: CacheSystem.h:182
RoR::EV_CHARACTER_BACKWARDS
@ EV_CHARACTER_BACKWARDS
step backwards with the character
Definition: InputEngine.h:129
CameraManager.h
RoR::ModifyProjectRequestType::TUNEUP_PROTECTED_WHEEL_RESET
@ TUNEUP_PROTECTED_WHEEL_RESET
'subject_id' is wheel ID.
RoR::GameContextSB::simbuf_dir_arrow_text
std::string simbuf_dir_arrow_text
Definition: SimBuffers.h:217
RoR::EV_COMMON_LIVE_REPAIR_MODE
@ EV_COMMON_LIVE_REPAIR_MODE
toggles live repair and recovery mode, controlled by keyboard
Definition: InputEngine.h:251
RoR::GUI::TopMenubar::PANEL_HOVERBOX_HEIGHT
const float PANEL_HOVERBOX_HEIGHT
Definition: GUI_TopMenubar.h:50
RoR::ModifyProjectRequestType::TUNEUP_PROTECTED_FLEXBODY_RESET
@ TUNEUP_PROTECTED_FLEXBODY_RESET
'subject_id' is flexbody ID.
Console.h
RoR::GfxWaterMode::NONE
@ NONE
None.
RoR::TuneupDef::isFlexbodyProtected
bool isFlexbodyProtected(FlexbodyID_t flexbodyid) const
Definition: TuneupFileFormat.h:150
RoR::Console::putMessage
void putMessage(MessageArea area, MessageType type, std::string const &msg, std::string icon="")
Definition: Console.cpp:103
RoR::GUI::TopMenubar::TopMenu
TopMenu
Definition: GUI_TopMenubar.h:59
RoR::GUI::TopMenubar::TopMenu::TOPMENU_SAVEGAMES
@ TOPMENU_SAVEGAMES
RoR::DrawGIntSlider
void DrawGIntSlider(CVar *cvar, const char *label, int v_min, int v_max)
Definition: GUIUtils.cpp:290
RoR::ActorSpawnRequest::asr_working_tuneup
TuneupDefPtr asr_working_tuneup
Only filled when editing tuneup via Tuning menu.
Definition: SimData.h:838
RoR::FlareType
FlareType
Definition: SimData.h:229
TuneupFileFormat.h
The vehicle tuning system; applies addonparts and user overrides to vehicles.
RoR::GameContextSB::simbuf_character_pos
Ogre::Vector3 simbuf_character_pos
Definition: SimBuffers.h:204
RoR::App::gfx_static_cam_fov_exp
CVar * gfx_static_cam_fov_exp
Definition: Application.cpp:242
RoR::MSG_APP_LOAD_SCRIPT_REQUESTED
@ MSG_APP_LOAD_SCRIPT_REQUESTED
Payload = RoR::LoadScriptRequest* (owner)
Definition: Application.h:92
RoR::Actor::GetGfxActor
GfxActor * GetGfxActor()
Definition: Actor.h:275
RoR::TuneupDef::use_addonparts
std::set< std::string > use_addonparts
Addonpart filenames.
Definition: TuneupFileFormat.h:109
RoR::ModifyProjectRequestType::TUNEUP_USE_ADDONPART_SET
@ TUNEUP_USE_ADDONPART_SET
'subject' is addonpart filename.
RoR::ModifyProjectRequestType::TUNEUP_PROTECTED_EXHAUST_RESET
@ TUNEUP_PROTECTED_EXHAUST_RESET
'subject_id' is exhaust ID.
RoR::GUI::TopMenubar::ai_waypoints
std::vector< ai_events > ai_waypoints
Definition: GUI_TopMenubar.h:68
RoR::GUI::TopMenubar::m_terrn_import_started
bool m_terrn_import_started
Definition: GUI_TopMenubar.h:150
RoR::TuneupDef::isExhaustUnwanted
bool isExhaustUnwanted(ExhaustID_t exhaustid)
Definition: TuneupFileFormat.h:163
RoR::TuneupDef::isPropUnwanted
bool isPropUnwanted(PropID_t propid)
Definition: TuneupFileFormat.h:160
RoR::ModifyProjectRequestType::TUNEUP_PROTECTED_MANAGEDMAT_SET
@ TUNEUP_PROTECTED_MANAGEDMAT_SET
'subject' is managed material name.
RoR::ActorState::LOCAL_SIMULATED
@ LOCAL_SIMULATED
simulated (local) actor
RoR::App::sim_state
CVar * sim_state
Definition: Application.cpp:96
RoR::GUI::TopMenubar::TopMenu::TOPMENU_NONE
@ TOPMENU_NONE
Language.h
RoR::App::sys_savegames_dir
CVar * sys_savegames_dir
Definition: Application.cpp:170
RoR::GUIManager::GuiTheme::semitransparent_window_bg
ImVec4 semitransparent_window_bg
Definition: GUIManager.h:92
RoR::GameContextSB::simbuf_player_actor
ActorPtr simbuf_player_actor
Definition: SimBuffers.h:203
RoR::Actor::ar_dashboard
DashBoardManager * ar_dashboard
Definition: Actor.h:430
RoR::CacheQueryResult::cqr_entry
CacheEntryPtr cqr_entry
Definition: CacheSystem.h:168
RoR::GUI::TopMenubar::LoadBundledAiPresets
void LoadBundledAiPresets(TerrainPtr terrain)
Loads JSON files from [AI Presets] section in .terrn2 file format.
Definition: GUI_TopMenubar.cpp:2418
RefCountingObjectPtr< Actor >
RoR::GUI::TopMenubar::m_waves_height
float m_waves_height
Definition: GUI_TopMenubar.h:148
RoR::DashBoardManager::getLinkNameForID
std::string getLinkNameForID(DashData id)
Definition: DashBoardManager.cpp:161
GUIManager.h
RoR::CreateProjectRequest::cpr_source_entry
CacheEntryPtr cpr_source_entry
The original mod to copy files from.
Definition: CacheSystem.h:226
ActorManager.h
RoR::GUI::TopMenubar::tuning_conflicts
AddonPartConflictVec tuning_conflicts
Conflicts between eligible addonparts tweaking the same element.
Definition: GUI_TopMenubar.h:114
Actor.h
RoR::CreateProjectRequest::cpr_name
std::string cpr_name
Directory and also the mod file (without extension).
Definition: CacheSystem.h:224
RoR::ExhaustID_t
int ExhaustID_t
Index into GfxActor::m_exhausts, use RoR::EXHAUSTID_INVALID as empty value.
Definition: ForwardDeclarations.h:73
RoR::ModifyProjectRequestType::TUNEUP_FORCEREMOVE_MANAGEDMAT_SET
@ TUNEUP_FORCEREMOVE_MANAGEDMAT_SET
'subject' is managed material name.
RoR::App::GetScriptEngine
ScriptEngine * GetScriptEngine()
Definition: Application.cpp:282
w
float w
Definition: (ValueTypes) quaternion.h:4
RoR::GUI::TopMenubar::DrawTuningProtectedChkRightAligned
void DrawTuningProtectedChkRightAligned(const int subject_id, bool is_protected, ModifyProjectRequestType request_type_set, ModifyProjectRequestType request_type_reset, const std::string &subject="")
Definition: GUI_TopMenubar.cpp:2582
RoR::GUI::TopMenubar::ai_menu
bool ai_menu
Definition: GUI_TopMenubar.h:85
RoR::Console::CONSOLE_SYSTEM_NOTICE
@ CONSOLE_SYSTEM_NOTICE
Definition: Console.h:51
RoR::ActorSpawnRequest
Definition: SimData.h:813
RoR::ActorManager::SendAllActorsSleeping
void SendAllActorsSleeping()
Definition: ActorManager.cpp:797
RoR::Terrain::getTerrainFileName
std::string getTerrainFileName()
Definition: Terrain.cpp:551
RoR::GUI::TopMenubar::tuning_savebox_visible
bool tuning_savebox_visible
User pressed 'save active' to open savebox.
Definition: GUI_TopMenubar.h:117
RoR::GUI::TopMenubar::ai_num_prev
int ai_num_prev
Definition: GUI_TopMenubar.h:94
RoR::TuneupDef::isPropProtected
bool isPropProtected(PropID_t propid) const
Definition: TuneupFileFormat.h:149
RoR::GUI::TopMenubar::StateBox::STATEBOX_QUICK_REPAIR
@ STATEBOX_QUICK_REPAIR
RoR::App::sim_tuning_enabled
CVar * sim_tuning_enabled
Definition: Application.cpp:112
RoR::GameContextSB::simbuf_race_best_time
float simbuf_race_best_time
Definition: SimBuffers.h:212
RoR::GUI::TopMenubar::ai_rec
bool ai_rec
Definition: GUI_TopMenubar.h:83
RoR::App::mp_state
CVar * mp_state
Definition: Application.cpp:115
RoR::ModifyProjectRequestType::TUNEUP_FORCED_WHEEL_SIDE_SET
@ TUNEUP_FORCED_WHEEL_SIDE_SET
'subject_id' is wheel ID, 'value_int' is RoR::WheelSide
RoR::GUI::TopMenubar::ai_speed
int ai_speed
Definition: GUI_TopMenubar.h:73
Replay.h
RoR::ActorModifyRequest::amr_actor
ActorInstanceID_t amr_actor
Definition: SimData.h:871
RoR::Actor::getReplay
Replay * getReplay()
Definition: Actor.cpp:4516
RoR::EV_TRUCK_STEER_LEFT
@ EV_TRUCK_STEER_LEFT
steer left
Definition: InputEngine.h:360
RoR::ModifyProjectRequestType::TUNEUP_PROTECTED_FLARE_RESET
@ TUNEUP_PROTECTED_FLARE_RESET
'subject_id' is flare ID.
RoR::App::gfx_camera_height
CVar * gfx_camera_height
Definition: Application.cpp:237
RoR::CameraManager::CAMERA_BEHAVIOR_STATIC
@ CAMERA_BEHAVIOR_STATIC
Definition: CameraManager.h:47
RoR::App::audio_master_volume
CVar * audio_master_volume
Definition: Application.cpp:209
RoR::GUI::TopMenubar::TopMenu::TOPMENU_SIM
@ TOPMENU_SIM
Script2Game::KC_LSHIFT
enum Script2Game::inputEvents KC_LSHIFT
RoR::LoadScriptRequest::lsr_category
ScriptCategory lsr_category
Definition: ScriptEngine.h:94
RoR::MSG_NET_FETCH_AI_PRESETS_FAILURE
@ MSG_NET_FETCH_AI_PRESETS_FAILURE
Description = message.
Definition: Application.h:112
RoR::GUIManager::GetTheme
GuiTheme & GetTheme()
Definition: GUIManager.h:166
RoR::ActorSpawnRequest::asr_config
Ogre::String asr_config
Definition: SimData.h:832
RoR::GUI::TopMenubar::tuning_rwidget_cursorx_min
float tuning_rwidget_cursorx_min
Avoid drawing right-side widgets ('Delete' button or 'Protected' chk) over saved tuneup names.
Definition: GUI_TopMenubar.h:121
RoR::GUI::TopMenubar::WHITE_TEXT
const ImVec4 WHITE_TEXT
Definition: GUI_TopMenubar.h:52
RoR::FlareType::DASHBOARD
@ DASHBOARD
RoR::ModifyProjectRequestType::TUNEUP_FORCEREMOVE_FLARE_RESET
@ TUNEUP_FORCEREMOVE_FLARE_RESET
'subject_id' is flare ID.
RoR::ToLocalizedString
std::string ToLocalizedString(SimGearboxMode e)
Definition: Application.cpp:443
RoR::ModifyProjectRequestType::TUNEUP_PROTECTED_FLARE_SET
@ TUNEUP_PROTECTED_FLARE_SET
'subject_id' is flare ID.
RoR::GameContext::ChainMessage
void ChainMessage(Message m)
Add to last pushed message's chain.
Definition: GameContext.cpp:73
RoR::GUI::TopMenubar::ai_presets_bundled
rapidjson::Document ai_presets_bundled
Presets bundled with the terrain, see [AI Presets] section in .terrn2 file format.
Definition: GUI_TopMenubar.h:108
RoR::GUI::TopMenubar::m_open_menu
TopMenu m_open_menu
Definition: GUI_TopMenubar.h:139
RoR::GUI::TopMenubar::ai_dname2
Ogre::String ai_dname2
Definition: GUI_TopMenubar.h:90
RoR::GfxSkyMode::CAELUM
@ CAELUM
Caelum (best looking, slower)
RoR::Actor::getMinHeight
float getMinHeight(bool skip_virtual_nodes=true)
Definition: Actor.cpp:1479
RoR::CVar::getStr
std::string const & getStr() const
Definition: CVar.h:95
RoR::App::diag_log_beam_break
CVar * diag_log_beam_break
Definition: Application.cpp:147
RoR::GUI::TopMenubar::TopMenu::TOPMENU_TOOLS
@ TOPMENU_TOOLS
RoR::GUI::TopMenubar::RED_TEXT
const ImVec4 RED_TEXT
Definition: GUI_TopMenubar.h:55
RoR::Str
Wrapper for classic c-string (local buffer) Refresher: strlen() excludes '\0' terminator; strncat() A...
Definition: Str.h:35
RoR::CacheSystem::FindEntryByFilename
CacheEntryPtr FindEntryByFilename(RoR::LoaderType type, bool partial, const std::string &_filename_maybe_bundlequalified)
Returns NULL if none found; "Bundle-qualified" format also specifies the ZIP/directory in modcache,...
Definition: CacheSystem.cpp:184
RoR::Actor::ar_flares
std::vector< flare_t > ar_flares
Definition: Actor.h:309
RoR::TuneupDef::isManagedMatForceRemoved
bool isManagedMatForceRemoved(const std::string &matname)
Definition: TuneupFileFormat.h:174
RoR::ActorModifyRequest
Definition: SimData.h:853
RoR::PathCombine
std::string PathCombine(std::string a, std::string b)
Definition: PlatformUtils.h:48
RoR::MSG_SIM_SEAT_PLAYER_REQUESTED
@ MSG_SIM_SEAT_PLAYER_REQUESTED
Payload = RoR::ActorPtr (owner) | nullptr.
Definition: Application.h:124
RoR::AddonPartUtility::RecordAddonpartConflicts
static void RecordAddonpartConflicts(CacheEntryPtr addonpart1, CacheEntryPtr addonpart2, AddonPartConflictVec &conflicts)
Definition: AddonPartFileFormat.cpp:813
RoR::GUI::TopMenubar::DrawTuningForceRemoveControls
void DrawTuningForceRemoveControls(const int subject_id, const std::string &name, const bool is_unwanted, const bool is_force_removed, ModifyProjectRequestType request_type_set, ModifyProjectRequestType request_type_reset)
Definition: GUI_TopMenubar.cpp:2633
RoR::App::gfx_fps_limit
CVar * gfx_fps_limit
Definition: Application.cpp:244
RoR::ModifyProjectRequestType::TUNEUP_PROTECTED_EXHAUST_SET
@ TUNEUP_PROTECTED_EXHAUST_SET
'subject_id' is exhaust ID.
RoR::GUI::TopMenubar::m_daytime
float m_daytime
Definition: GUI_TopMenubar.h:147
GUI_MainSelector.h
RoR::GUIManager::CollisionsDebug
GUI::CollisionsDebug CollisionsDebug
Definition: GUIManager.h:114
RoR::EV_CHARACTER_SIDESTEP_RIGHT
@ EV_CHARACTER_SIDESTEP_RIGHT
sidestep to the right
Definition: InputEngine.h:138
RoR::GUI::TopMenubar::ai_times
int ai_times
Definition: GUI_TopMenubar.h:74
RoR::GameContextSB::simbuf_race_time_diff
float simbuf_race_time_diff
Definition: SimBuffers.h:213
RoR::ActorSpawnRequest::asr_cache_entry
CacheEntryPtr asr_cache_entry
Optional, overrides 'asr_filename' and 'asr_cache_entry_num'.
Definition: SimData.h:830
RoR::CacheQueryResult
Definition: CacheSystem.h:162
ScriptEngine.h
RoR::GUI::TextureToolWindow::SetVisible
void SetVisible(bool visible)
Definition: GUI_TextureToolWindow.h:34
RoR::App::diag_log_beam_trigger
CVar * diag_log_beam_trigger
Definition: Application.cpp:149
RoR::GameContext::PushMessage
void PushMessage(Message m)
Doesn't guarantee order! Use ChainMessage() if order matters.
Definition: GameContext.cpp:66
RoR::WheelID_t
int WheelID_t
Index to Actor::ar_wheels, use RoR::WHEELID_INVALID as empty value.
Definition: ForwardDeclarations.h:58
RoR::Replay
Definition: Replay.h:39
RoR::GUI::TopMenubar::Draw
void Draw(float dt)
Definition: GUI_TopMenubar.cpp:154
RoR::Actor::getSectionConfig
Ogre::String getSectionConfig()
Definition: Actor.h:236
RoR::Str::ToCStr
const char * ToCStr() const
Definition: Str.h:46
RoR::GUI::TopMenubar::ai_times_prev
int ai_times_prev
Definition: GUI_TopMenubar.h:97
RoR::App::sim_terrain_name
CVar * sim_terrain_name
Definition: Application.cpp:97
RoR::GUI::TopMenubar::StateBox::STATEBOX_IMPORT_TERRAIN
@ STATEBOX_IMPORT_TERRAIN
RoR::ImButtonHoldToConfirm
bool ImButtonHoldToConfirm(const std::string &btn_idstr, const bool smallbutton, const float time_limit)
Definition: GUIUtils.cpp:476
RoR::ModifyProjectRequestType::TUNEUP_FORCEREMOVE_MANAGEDMAT_RESET
@ TUNEUP_FORCEREMOVE_MANAGEDMAT_RESET
'subject' is managed material name.
RoR::Actor::getTruckFileName
std::string getTruckFileName()
Definition: Actor.h:233
RoR::Actor::getPosition
Ogre::Vector3 getPosition()
Definition: Actor.cpp:371
RoR::ContentManager::LoadAndParseJson
bool LoadAndParseJson(std::string const &filename, std::string const &rg_name, rapidjson::Document &j_doc)
Definition: ContentManager.cpp:455
GfxScene.h
RoR::GUI::TopMenubar::ai_presets_extern_fetching
bool ai_presets_extern_fetching
True if the (down)load of 'extern' waypoints is in progress.
Definition: GUI_TopMenubar.h:106
RoR::TuneupDef::isWheelProtected
bool isWheelProtected(WheelID_t wheelid) const
Definition: TuneupFileFormat.h:151
PlatformUtils.h
Platform-specific utilities. We use narrow UTF-8 encoded strings as paths. Inspired by http://utf8eve...
RoR::GUI::TopMenubar::ai_mode_prev
int ai_mode_prev
Definition: GUI_TopMenubar.h:98
RoR::App::ui_show_live_repair_controls
CVar * ui_show_live_repair_controls
bool
Definition: Application.cpp:263
RoR::MSG_GUI_OPEN_SELECTOR_REQUESTED
@ MSG_GUI_OPEN_SELECTOR_REQUESTED
Payload = LoaderType* (owner), Description = GUID | empty.
Definition: Application.h:139
RoR::App::diag_log_beam_deform
CVar * diag_log_beam_deform
Definition: Application.cpp:148
RoR::TuneupDef::isFlareUnwanted
bool isFlareUnwanted(FlareID_t flareid)
Definition: TuneupFileFormat.h:162
RoR::WheelSide::RIGHT
@ RIGHT
RoR::WheelSide::LEFT
@ LEFT
RoR::MSG_SIM_HIDE_NET_ACTOR_REQUESTED
@ MSG_SIM_HIDE_NET_ACTOR_REQUESTED
Payload = ActorPtr* (owner)
Definition: Application.h:126
RoR::LoaderType
LoaderType
< Search mode for ModCache::Query() & Operation mode for GUI::MainSelector
Definition: Application.h:306
RoR::ModifyProjectRequestType::TUNEUP_FORCEREMOVE_EXHAUST_RESET
@ TUNEUP_FORCEREMOVE_EXHAUST_RESET
'subject_id' is exhaust ID.
RoR::Prop
A mesh attached to vehicle frame via 3 nodes.
Definition: GfxData.h:162
RoR::GUI::TopMenubar
Definition: GUI_TopMenubar.h:46
RoR::ModifyProjectRequest::mpr_target_actor
ActorPtr mpr_target_actor
Definition: CacheSystem.h:267
Application.h
Central state/object manager and communications hub.
RoR::App::GetConsole
Console * GetConsole()
Definition: Application.cpp:273
RoR::GUI::TopMenubar::tuning_addonparts
std::vector< CacheEntryPtr > tuning_addonparts
Addonparts eligible for current actor, both matched by GUID and force-installed by user via [browse a...
Definition: GUI_TopMenubar.h:112
RoR::Replay::getCurrentFrame
int getCurrentFrame() const
Definition: Replay.h:54
RoR::Message::payload
void * payload
Definition: GameContext.h:59
RoR::Network::GetLocalUserData
RoRnet::UserInfo GetLocalUserData()
Definition: Network.cpp:703
RoR::CameraManager::CAMERA_BEHAVIOR_FIXED
@ CAMERA_BEHAVIOR_FIXED
Definition: CameraManager.h:53
FlexBody.h
RoR::GUI::TopMenubar::TUNING_HOLDTOCONFIRM_COLOR
const ImVec4 TUNING_HOLDTOCONFIRM_COLOR
Definition: GUI_TopMenubar.h:119
RoR::App::GetGameContext
GameContext * GetGameContext()
Definition: Application.cpp:283
RoR::CVar::getEnum
T getEnum() const
Definition: CVar.h:99
RoR::GUI::FrictionSettings::SetVisible
void SetVisible(bool visible)
Definition: GUI_FrictionSettings.h:51
RoR::GUIManager::RequestGuiCaptureKeyboard
void RequestGuiCaptureKeyboard(bool val)
Pass true during frame to prevent input passing to application.
Definition: GUIManager.cpp:464
RoR::Character::getPosition
Ogre::Vector3 getPosition()
Definition: Character.cpp:92
RoR::EV_CHARACTER_FORWARD
@ EV_CHARACTER_FORWARD
step forward with the character
Definition: InputEngine.h:130
RoR::GUI::TopMenubar::StateBox::STATEBOX_RACE
@ STATEBOX_RACE
RoR::GUI::FlexbodyDebug::SetVisible
void SetVisible(bool value)
Definition: GUI_FlexbodyDebug.h:37
RoR::App::gfx_envmap_enabled
CVar * gfx_envmap_enabled
Definition: Application.cpp:232
RoR::App::diag_videocameras
CVar * diag_videocameras
Definition: Application.cpp:139
RoR::ActorSB::simbuf_actor_state
ActorState simbuf_actor_state
Definition: SimBuffers.h:115
RoR::Replay::getNumFrames
int getNumFrames() const
Definition: Replay.h:53
RoR::GUIManager::GuiTheme::success_text_color
ImVec4 success_text_color
Definition: GUIManager.h:88
RoR::GUIManager::NodeBeamUtils
GUI::NodeBeamUtils NodeBeamUtils
Definition: GUIManager.h:129
RoR::GUIManager::ConsoleWindow
GUI::ConsoleWindow ConsoleWindow
Definition: GUIManager.h:132
RoRnet::UserInfo::clientversion
char clientversion[25]
a version number of the client. For example 1 for RoR 0.35
Definition: RoRnet.h:190
RoR::GameContext::GetQuicksaveFilename
std::string GetQuicksaveFilename()
For currently loaded terrain (cvar 'sim_terrain_name')
Definition: Savegame.cpp:56
RoR::GUI::TopMenubar::RefreshTuningMenu
void RefreshTuningMenu()
Definition: GUI_TopMenubar.cpp:2487
RoR::App::gfx_water_mode
CVar * gfx_water_mode
Definition: Application.cpp:224
RoR::GUI::TopMenubar::StateBox::STATEBOX_REPLAY
@ STATEBOX_REPLAY
RoR::EV_COMMON_TOGGLE_TERRAIN_EDITOR
@ EV_COMMON_TOGGLE_TERRAIN_EDITOR
toggle terrain editor
Definition: InputEngine.h:267
RoR::ActorSpawnRequest::asr_skin_entry
CacheEntryPtr asr_skin_entry
Definition: SimData.h:836
RoR::ActorSB::simbuf_pos
Ogre::Vector3 simbuf_pos
Definition: SimBuffers.h:123
RoR::LoadScriptRequest
Definition: ScriptEngine.h:90
RoR::ModifyProjectRequest::mpr_value_int
int mpr_value_int
Definition: CacheSystem.h:273
RoR::ActorManager::SetSimulationSpeed
void SetSimulationSpeed(float speed)
Definition: ActorManager.h:91
RoR::App::gfx_sky_mode
CVar * gfx_sky_mode
Definition: Application.cpp:219
RoR::MSG_SIM_TELEPORT_PLAYER_REQUESTED
@ MSG_SIM_TELEPORT_PLAYER_REQUESTED
Payload = Ogre::Vector3* (owner)
Definition: Application.h:125
RoR::ModifyProjectRequestType::TUNEUP_FORCEREMOVE_EXHAUST_SET
@ TUNEUP_FORCEREMOVE_EXHAUST_SET
'subject_id' is exhaust ID.
RoR::TuneupDef::isFlareForceRemoved
bool isFlareForceRemoved(FlareID_t flareid)
Definition: TuneupFileFormat.h:172
RoR::Message::description
std::string description
Definition: GameContext.h:58
RoR::Actor::getUsedActorEntry
CacheEntryPtr & getUsedActorEntry()
The actor entry itself.
Definition: Actor.cpp:4664
_LC
#define _LC(ctx, str)
Definition: Language.h:42
RoR::GUIManager::TopMenubar
GUI::TopMenubar TopMenubar
Definition: GUIManager.h:131
RoR::GUI::TopMenubar::RefreshAiPresets
void RefreshAiPresets()
Refresh the list of presets, used for display. Needs to be called when terrain is loaded.
Definition: GUI_TopMenubar.cpp:2466
RoR::ModifyProjectRequestType::TUNEUP_FORCEREMOVE_FLARE_SET
@ TUNEUP_FORCEREMOVE_FLARE_SET
'subject_id' is flare ID.
RoR::CacheQuery::resetResults
void resetResults()
Definition: CacheSystem.h:195
RoR::Network::GetPlayerColor
Ogre::ColourValue GetPlayerColor(int color_num)
Definition: Network.cpp:94
RoR::ModifyProjectRequest
Definition: CacheSystem.h:265
RoR::CreateProjectRequest
Creates subdirectory in 'My Games\Rigs of Rods\projects', pre-populates it with files and adds modcac...
Definition: CacheSystem.h:219
RoR::GUIManager::GuiTheme::screen_edge_padding
ImVec2 screen_edge_padding
Definition: GUIManager.h:96
RoR::ModifyProjectRequestType::PROJECT_LOAD_TUNEUP
@ PROJECT_LOAD_TUNEUP
'subject' is tuneup filename. This overwrites the auto-generated tuneup with the save.
RoR::GUI::TopMenubar::m_state_box_hoverbox_min
ImVec2 m_state_box_hoverbox_min
Definition: GUI_TopMenubar.h:141
RoR::GUI::TopMenubar::ai_speed_prev
int ai_speed_prev
Definition: GUI_TopMenubar.h:95
RoR::App::gfx_water_waves
CVar * gfx_water_waves
Definition: Application.cpp:226
RoR::ScriptEngine::loadScript
ScriptUnitID_t loadScript(Ogre::String scriptname, ScriptCategory category=ScriptCategory::TERRAIN, ActorPtr associatedActor=nullptr, std::string buffer="")
Loads a script.
Definition: ScriptEngine.cpp:828
RoR::GUI::TopMenubar::m_savegame_names
std::vector< std::string > m_savegame_names
Definition: GUI_TopMenubar.h:152
RoR::ModifyProjectRequestType::TUNEUP_PROTECTED_PROP_SET
@ TUNEUP_PROTECTED_PROP_SET
'subject_id' is prop ID.
RoR::MSG_NET_FETCH_AI_PRESETS_SUCCESS
@ MSG_NET_FETCH_AI_PRESETS_SUCCESS
Description = JSON string.
Definition: Application.h:111
RoR::AddonPartUtility::CheckForAddonpartConflict
static bool CheckForAddonpartConflict(CacheEntryPtr addonpart1, CacheEntryPtr addonpart2, AddonPartConflictVec &conflicts)
Definition: AddonPartFileFormat.cpp:885
RoR::CreateProjectRequest::cpr_source_actor
ActorPtr cpr_source_actor
Only for type SAVE_TUNEUP
Definition: CacheSystem.h:227
RoR::GUI::TopMenubar::m_state_box_hoverbox_max
ImVec2 m_state_box_hoverbox_max
Definition: GUI_TopMenubar.h:142
RoR::App::GetCacheSystem
CacheSystem * GetCacheSystem()
Definition: Application.cpp:275
RoR::GUI::TopMenubar::TopMenu::TOPMENU_AI
@ TOPMENU_AI
RoR::GfxActor::getWheelRimMeshName
std::string getWheelRimMeshName(WheelID_t wheel_id)
Definition: GfxActor.h:155
RoR::App::gfx_sky_time_speed
CVar * gfx_sky_time_speed
Definition: Application.cpp:221
RoR::GUI::TopMenubar::ai_mode
int ai_mode
Definition: GUI_TopMenubar.h:84
RoR::CID_Tuneups
@ CID_Tuneups
For unsorted tuneup files.
Definition: CacheSystem.h:152
RoRnet::UserInfo::colournum
int32_t colournum
colour set by server
Definition: RoRnet.h:183
RoR::EV_TRUCK_ACCELERATE
@ EV_TRUCK_ACCELERATE
accelerate the truck
Definition: InputEngine.h:297
RoR::GUIManager::FlexbodyDebug
GUI::FlexbodyDebug FlexbodyDebug
Definition: GUIManager.h:135
RoRnet::UserInfo::username
char username[RORNET_MAX_USERNAME_LEN]
the nickname of the user (UTF-8)
Definition: RoRnet.h:185
RoRnet::UserInfo::uniqueid
uint32_t uniqueid
user unique id
Definition: RoRnet.h:180
RoR::GfxActor::GetFlexbodies
std::vector< FlexBody * > & GetFlexbodies()
Definition: GfxActor.h:71
RoR::Actor::getRotation
float getRotation()
Definition: Actor.cpp:356
RoR::CacheQuery::cqy_filter_type
RoR::LoaderType cqy_filter_type
Definition: CacheSystem.h:184
RoR::WheelSide::INVALID
@ INVALID
RoR::MSG_EDI_DELETE_PROJECT_REQUESTED
@ MSG_EDI_DELETE_PROJECT_REQUESTED
Payload = RoR::CacheEntryPtr* (owner)
Definition: Application.h:157
ai_events
Definition: GUI_TopMenubar.h:37
RoR::Message
Unified game event system - all requests and state changes are reported using a message.
Definition: GameContext.h:51
RoR::CVar::setVal
void setVal(T val)
Definition: CVar.h:72
RoR::MSG_GUI_OPEN_MENU_REQUESTED
@ MSG_GUI_OPEN_MENU_REQUESTED
Definition: Application.h:137
RoR::EV_TRUCK_STEER_RIGHT
@ EV_TRUCK_STEER_RIGHT
steer right
Definition: InputEngine.h:361
RoR::Actor::getUsedSkinEntry
CacheEntryPtr & getUsedSkinEntry()
Definition: Actor.cpp:4669
RoR::GUI::TopMenubar::TopMenu::TOPMENU_SETTINGS
@ TOPMENU_SETTINGS
RoR::ModifyProjectRequestType::TUNEUP_FORCEREMOVE_FLEXBODY_RESET
@ TUNEUP_FORCEREMOVE_FLEXBODY_RESET
'subject_id' is flexbody ID.
RoR::GUI::TopMenubar::IsMenuEnabled
bool IsMenuEnabled(TopMenu which)
Definition: GUI_TopMenubar.cpp:2691
RoR::GfxActor::getProps
std::vector< Prop > & getProps()
Definition: GfxActor.h:72
RoR::CreateProjectRequest::cpr_overwrite
bool cpr_overwrite
Definition: CacheSystem.h:229
RoR::GUI::NodeBeamUtils::SetVisible
void SetVisible(bool visible)
Definition: GUI_NodeBeamUtils.cpp:188
RoR::EV_TRUCK_TOGGLE_PHYSICS
@ EV_TRUCK_TOGGLE_PHYSICS
toggle physics simulation
Definition: InputEngine.h:368
RoR::ActorSpawnRequest::asr_debugview
int asr_debugview
Definition: SimData.h:840
RoR::IWater::SetWavesHeight
virtual void SetWavesHeight(float value)
Definition: IWater.h:46
RoR::GUI::CollisionsDebug::SetVisible
void SetVisible(bool v)
Definition: GUI_CollisionsDebug.cpp:564
RoR::FlareID_t
int FlareID_t
Index into Actor::ar_flares, use RoR::FLAREID_INVALID as empty value.
Definition: ForwardDeclarations.h:70
RoR::ActorManager::SetTrucksForcedAwake
void SetTrucksForcedAwake(bool forced)
Definition: ActorManager.h:89
RoR::ModifyProjectRequestType::TUNEUP_PROTECTED_PROP_RESET
@ TUNEUP_PROTECTED_PROP_RESET
'subject_id' is prop ID.
RoR::TuneupUtil::getTweakedWheelSide
static WheelSide getTweakedWheelSide(TuneupDefPtr &tuneup_entry, WheelID_t wheel_id, WheelSide orig_val)
Definition: TuneupFileFormat.cpp:193
RoR::TuneupDef::isFlareProtected
bool isFlareProtected(FlareID_t flareid) const
Definition: TuneupFileFormat.h:153
RoR::MSG_SIM_SPAWN_ACTOR_REQUESTED
@ MSG_SIM_SPAWN_ACTOR_REQUESTED
Payload = RoR::ActorSpawnRequest* (owner)
Definition: Application.h:121
RoR::Actor::ar_num_wheels
int ar_num_wheels
Definition: Actor.h:330
RoR::App::GetInputEngine
InputEngine * GetInputEngine()
Definition: Application.cpp:274
RoR::ModifyProjectRequestType::TUNEUP_PROTECTED_MANAGEDMAT_RESET
@ TUNEUP_PROTECTED_MANAGEDMAT_RESET
'subject' is managed material name.
RoR::TuneupDef::isExhaustForceRemoved
bool isExhaustForceRemoved(ExhaustID_t exhaustid)
Definition: TuneupFileFormat.h:173
RoR::ModifyProjectRequestType::TUNEUP_PROTECTED_WHEEL_SET
@ TUNEUP_PROTECTED_WHEEL_SET
'subject_id' is wheel ID.
RoR::ActorPtr
RefCountingObjectPtr< Actor > ActorPtr
Definition: ForwardDeclarations.h:219
RoR::MSG_SIM_DELETE_ACTOR_REQUESTED
@ MSG_SIM_DELETE_ACTOR_REQUESTED
Payload = RoR::ActorPtr* (owner)
Definition: Application.h:123
RoR::LT_AllBeam
@ LT_AllBeam
Definition: Application.h:320
RoR::GUI::TopMenubar::ai_presets_extern_error
std::string ai_presets_extern_error
Error message from the (down)load of 'extern' waypoints.
Definition: GUI_TopMenubar.h:107
RoR::Replay::getLastReadTime
unsigned long getLastReadTime()
Definition: Replay.cpp:178
RoR::App::gfx_fov_external
CVar * gfx_fov_external
Definition: Application.cpp:238
RoR::EV_CHARACTER_SIDESTEP_LEFT
@ EV_CHARACTER_SIDESTEP_LEFT
sidestep to the left
Definition: InputEngine.h:137
Terrain.h
RoR::ModifyProjectRequestType::PROJECT_RESET_TUNEUP
@ PROJECT_RESET_TUNEUP
'subject' is empty. This resets the auto-generated tuneup to orig. values.
RoR::GUI::TopMenubar::tuning_hovered_addonpart
CacheEntryPtr tuning_hovered_addonpart
Definition: GUI_TopMenubar.h:122
RoR::ActorState::NETWORKED_HIDDEN
@ NETWORKED_HIDDEN
not simulated, not updated (remote)
RoR::GUI::TopMenubar::TopMenu::TOPMENU_ACTORS
@ TOPMENU_ACTORS
InputEngine.h
Handles controller inputs from player. Defines input events and binding mechanism,...
RGN_SAVEGAMES
#define RGN_SAVEGAMES
Definition: Application.h:50
RoR::CacheQuery::cqy_filter_guid
std::string cqy_filter_guid
Exact match (case-insensitive); leave empty to disable.
Definition: CacheSystem.h:186
RoR::CVar::getFloat
float getFloat() const
Definition: CVar.h:96
RoR::GameContextSB::simbuf_dir_arrow_target
Ogre::Vector3 simbuf_dir_arrow_target
Definition: SimBuffers.h:216
RoR::GUI::TopMenubar::ORANGE_TEXT
const ImVec4 ORANGE_TEXT
Definition: GUI_TopMenubar.h:54
RoR::ActorSpawnRequest::Origin::USER
@ USER
Direct selection by user via GUI.
RoR::MSG_SIM_UNHIDE_NET_ACTOR_REQUESTED
@ MSG_SIM_UNHIDE_NET_ACTOR_REQUESTED
Payload = ActorPtr* (owner)
Definition: Application.h:127
RoR::DrawGCheckbox
bool DrawGCheckbox(CVar *cvar, const char *label)
Definition: GUIUtils.cpp:261
RoR::GUI::TopMenubar::DrawActorListSinglePlayer
void DrawActorListSinglePlayer()
Definition: GUI_TopMenubar.cpp:2073
RoR::GUI::TopMenubar::tuning_saves
CacheQuery tuning_saves
Tuneups saved by user, with category ID RoR::CID_AddonpartUser
Definition: GUI_TopMenubar.h:115
RoR::GfxActor::GetDebugView
DebugViewType GetDebugView() const
Definition: GfxActor.h:144
RoR::TuneupDef::isExhaustProtected
bool isExhaustProtected(ExhaustID_t exhaustid) const
Definition: TuneupFileFormat.h:154
RoR::TuneupDef::isFlexbodyUnwanted
bool isFlexbodyUnwanted(FlexbodyID_t flexbodyid)
Definition: TuneupFileFormat.h:161
RoR::GUI::TopMenubar::tuning_addonparts_conflict_w_used
std::vector< bool > tuning_addonparts_conflict_w_used
1:1 with tuning_addonparts; True means the eligible (not used) addonpart conflicts with an used addon...
Definition: GUI_TopMenubar.h:113
RoR::CVar::getInt
int getInt() const
Definition: CVar.h:97
RoR::ImDrawEventHighlighted
void ImDrawEventHighlighted(events input_event)
Definition: GUIUtils.cpp:410
RoR::Console::CONSOLE_MSGTYPE_INFO
@ CONSOLE_MSGTYPE_INFO
Generic message.
Definition: Console.h:60
ai_events::speed
int speed
Definition: GUI_TopMenubar.h:40
RoR::WheelSide
WheelSide
Used by rig-def/addonpart/tuneup formats to specify wheel rim mesh orientation.
Definition: GfxData.h:115
RoR::GUI::TopMenubar::ai_dname
Ogre::String ai_dname
Definition: GUI_TopMenubar.h:79
RoR::ActorSpawnRequest::asr_position
Ogre::Vector3 asr_position
Definition: SimData.h:833
RoR::GUI::VehicleInfoTPanel::SetVisible
void SetVisible(TPanelMode mode, TPanelFocus focus=TPANELFOCUS_NONE)
Definition: GUI_VehicleInfoTPanel.cpp:606
RoR::TuneupDef::isWheelSideForced
bool isWheelSideForced(WheelID_t wheelid, WheelSide &out_val) const
Definition: TuneupFileFormat.cpp:107
RoR::ActorManager::WakeUpAllActors
void WakeUpAllActors()
Definition: ActorManager.cpp:785
RoR::ModifyProjectRequest::mpr_type
ModifyProjectRequestType mpr_type
Definition: CacheSystem.h:268
RoR::FlexBody
Flexbody = A deformable mesh; updated on CPU every frame, then uploaded to video memory.
Definition: FlexBody.h:43
RoR::ModifyProjectRequestType::TUNEUP_FORCED_WHEEL_SIDE_RESET
@ TUNEUP_FORCED_WHEEL_SIDE_RESET
'subject_id' is wheel ID.
RoR::GameContext::GetRepairMode
RepairMode & GetRepairMode()
Definition: GameContext.h:169
RoR::GUI::TopMenubar::ai_select2
bool ai_select2
Definition: GUI_TopMenubar.h:88
RoR::events
events
Definition: InputEngine.h:74
RoR::ActorState::NETWORKED_OK
@ NETWORKED_OK
not simulated (remote) actor
RoR::GfxActor::getExhausts
std::vector< Exhaust > & getExhausts()
Definition: GfxActor.h:74
RoR::GUI::ConsoleWindow
Definition: GUI_ConsoleWindow.h:40
RoR::Actor::ar_state
ActorState ar_state
Definition: Actor.h:453
RoR::ActorManager::LoadScene
bool LoadScene(Ogre::String filename)
Definition: Savegame.cpp:240
RoR::GUI::TopMenubar::StateBox::STATEBOX_LIVE_REPAIR
@ STATEBOX_LIVE_REPAIR
RoR::GUI::TopMenubar::~TopMenubar
~TopMenubar()
Definition: GUI_TopMenubar.cpp:149
RoR::GameContext::GetPlayerActor
const ActorPtr & GetPlayerActor()
Definition: GameContext.h:134
RoR::AI
@ AI
machine controlled by an Artificial Intelligence
Definition: SimData.h:97
RoR::GUI::VehicleInfoTPanel::TPANELFOCUS_COMMANDS
@ TPANELFOCUS_COMMANDS
Definition: GUI_VehicleInfoTPanel.h:38
RoR::App::gfx_sky_time_cycle
CVar * gfx_sky_time_cycle
Definition: Application.cpp:220
RoR::MSG_SIM_LOAD_SAVEGAME_REQUESTED
@ MSG_SIM_LOAD_SAVEGAME_REQUESTED
Definition: Application.h:119
RoR::LoadingIndicatorCircle
void LoadingIndicatorCircle(const char *label, const float indicator_radius, const ImVec4 &main_color, const ImVec4 &backdrop_color, const int circle_count, const float speed)
Draws animated loading spinner.
Definition: GUIUtils.cpp:132
RoR::TuneupDef::isPropForceRemoved
bool isPropForceRemoved(PropID_t propid)
Definition: TuneupFileFormat.h:169
RoR::ActorModifyRequest::amr_type
Type amr_type
Definition: SimData.h:872
RoR::CacheQuery::cqy_filter_target_filename
std::string cqy_filter_target_filename
Exact match (case-insensitive); leave empty to disable (currently only used with addonparts)
Definition: CacheSystem.h:187
RoR::ActorSpawnRequest::asr_rotation
Ogre::Quaternion asr_rotation
Definition: SimData.h:834
RoR::CameraManager::CAMERA_BEHAVIOR_VEHICLE_CINECAM
@ CAMERA_BEHAVIOR_VEHICLE_CINECAM
Definition: CameraManager.h:50
RoR::Actor::getWorkingTuneupDef
TuneupDefPtr & getWorkingTuneupDef()
Definition: Actor.cpp:4674
RoR::GfxActor::GetSimDataBuffer
ActorSB & GetSimDataBuffer()
Definition: GfxActor.h:127
RoR
Definition: AppContext.h:36
Network.h
x
float x
Definition: (ValueTypes) quaternion.h:5
RoR::CacheSystem::Query
size_t Query(CacheQuery &query)
Definition: CacheSystem.cpp:2095
RoR::GUI::TopMenubar::ai_select
bool ai_select
Definition: GUI_TopMenubar.h:82
RoR::Log
void Log(const char *msg)
The ultimate, application-wide logging function. Adds a line (any length) in 'RoR....
Definition: Application.cpp:422
RoR::GUI::TopMenubar::m_open_menu_hoverbox_max
ImVec2 m_open_menu_hoverbox_max
Definition: GUI_TopMenubar.h:138
RoR::TuneupDef::isManagedMatUnwanted
bool isManagedMatUnwanted(const std::string &matname)
Definition: TuneupFileFormat.h:164
Water.h
RoR::ScriptCategory::CUSTOM
@ CUSTOM
Loaded by user via either: A) ingame console 'loadscript'; B) RoR.cfg 'app_custom_scripts'; C) comman...
RoR::App::GetGfxScene
GfxScene * GetGfxScene()
Definition: Application.cpp:279
RoR::GameContext::GetActorManager
ActorManager * GetActorManager()
Definition: GameContext.h:127
RoRnet::UserInfo::language
char language[10]
user's language. For example "de-DE" or "en-US"
Definition: RoRnet.h:188
RoR::EV_TRUCK_BRAKE
@ EV_TRUCK_BRAKE
brake
Definition: InputEngine.h:306
RoR::Actor::ar_managed_materials
std::map< std::string, Ogre::MaterialPtr > ar_managed_materials
Definition: Actor.h:324
RoR::CacheQuery::cqy_results
std::vector< CacheQueryResult > cqy_results
Definition: CacheSystem.h:191
RoR::GUI::TopMenubar::m_open_menu_hoverbox_min
ImVec2 m_open_menu_hoverbox_min
Definition: GUI_TopMenubar.h:137
RoR::MSG_APP_SHUTDOWN_REQUESTED
@ MSG_APP_SHUTDOWN_REQUESTED
Definition: Application.h:85
RoR::GUI::TopMenubar::tuning_savebox_overwrite
bool tuning_savebox_overwrite
Status of "Overwrite?" checkbox.
Definition: GUI_TopMenubar.h:118
RoR::GUI::TopMenubar::TUNING_HOLDTOCONFIRM_TIMELIMIT
const float TUNING_HOLDTOCONFIRM_TIMELIMIT
Delete button must be held for several sec to confirm.
Definition: GUI_TopMenubar.h:120
RoR::GUI::TopMenubar::ai_distance
int ai_distance
Definition: GUI_TopMenubar.h:76
RoR::Terrain::getWater
IWater * getWater()
Definition: Terrain.h:83
RoR::GfxActor::getWheelSide
WheelSide getWheelSide(WheelID_t wheel_id)
Definition: GfxActor.h:154
RoR::FileExists
bool FileExists(const char *path)
Path must be UTF-8 encoded.
Definition: PlatformUtils.cpp:163
RoR::CacheEntry::guid
Ogre::String guid
global unique id; Type "addonpart" leaves this empty and uses addonpart_guids; Always lowercase.
Definition: CacheSystem.h:77
RoR::MSG_NET_DISCONNECT_REQUESTED
@ MSG_NET_DISCONNECT_REQUESTED
Definition: Application.h:103
RoR::GUI::TopMenubar::tuning_actor
ActorPtr tuning_actor
Detecting actor change to update cached values.
Definition: GUI_TopMenubar.h:111
FetchAiPresetsThreadFunc
void FetchAiPresetsThreadFunc()
Definition: GUI_TopMenubar.cpp:77
RoR::App::mp_pseudo_collisions
CVar * mp_pseudo_collisions
Definition: Application.cpp:120
RoR::GameContext::GetTerrain
const TerrainPtr & GetTerrain()
Definition: GameContext.h:117
RoR::CacheEntry::fname
Ogre::String fname
filename
Definition: CacheSystem.h:67
RoR::GUI::TopMenubar::DrawMpUserToActorList
void DrawMpUserToActorList(RoRnet::UserInfo &user)
Definition: GUI_TopMenubar.cpp:2003
RoR::App::io_hydro_coupling
CVar * io_hydro_coupling
Definition: Application.cpp:199
RoR::GfxWaterMode::HYDRAX
@ HYDRAX
HydraX.
RoR::GUI::TopMenubar::m_state_box
StateBox m_state_box
Definition: GUI_TopMenubar.h:143
RoR::ActorModifyRequest::Type::RELOAD
@ RELOAD
Full reload from filesystem, requested by user.
RoR::GUI::TopMenubar::TUNING_SUBJECTID_USE_NAME
const int TUNING_SUBJECTID_USE_NAME
Definition: GUI_TopMenubar.h:57