RigsofRods
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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  if (ImGui::Button(_LC("TopMenubar", "Browse gadgets ...")))
741  {
744  }
745 
746  ImGui::Separator();
747  ImGui::TextColored(GRAY_HINT_TEXT, "%s", _LC("TopMenubar", "Pre-spawn diag. options:"));
748 
749  bool diag_mass = App::diag_truck_mass->getBool();
750  if (ImGui::Checkbox(_LC("TopMenubar", "Node mass recalc. logging"), &diag_mass))
751  {
752  App::diag_truck_mass->setVal(diag_mass);
753  }
754  if (ImGui::IsItemHovered())
755  {
756  ImGui::BeginTooltip();
757  ImGui::Text("%s", _LC("TopMenubar", "Extra logging on runtime - mass recalculation"));
758  ImGui::EndTooltip();
759  }
760 
761  bool diag_break = App::diag_log_beam_break->getBool();
762  if (ImGui::Checkbox(_LC("TopMenubar", "Beam break logging"), &diag_break))
763  {
764  App::diag_log_beam_break->setVal(diag_break);
765  }
766  if (ImGui::IsItemHovered())
767  {
768  ImGui::BeginTooltip();
769  ImGui::Text("%s", _LC("TopMenubar", "Extra logging on runtime"));
770  ImGui::EndTooltip();
771  }
772 
773  bool diag_deform = App::diag_log_beam_deform->getBool();
774  if (ImGui::Checkbox(_LC("TopMenubar", "Beam deform. logging"), &diag_deform))
775  {
776  App::diag_log_beam_deform->setVal(diag_deform);
777  }
778  if (ImGui::IsItemHovered())
779  {
780  ImGui::BeginTooltip();
781  ImGui::Text("%s", _LC("TopMenubar", "Extra logging on runtime"));
782  ImGui::EndTooltip();
783  }
784 
785  bool diag_trig = App::diag_log_beam_trigger->getBool();
786  if (ImGui::Checkbox(_LC("TopMenubar", "Trigger logging"), &diag_trig))
787  {
789  }
790  if (ImGui::IsItemHovered())
791  {
792  ImGui::BeginTooltip();
793  ImGui::Text("%s", _LC("TopMenubar", "Extra logging on runtime - trigger beams activity"));
794  ImGui::EndTooltip();
795  }
796 
797  bool diag_vcam = App::diag_videocameras->getBool();
798  if (ImGui::Checkbox(_LC("TopMenubar", "VideoCamera direction marker"), &diag_vcam))
799  {
800  App::diag_videocameras->setVal(diag_vcam);
801  }
802  if (ImGui::IsItemHovered())
803  {
804  ImGui::BeginTooltip();
805  ImGui::Text("%s", _LC("TopMenubar", "Visual marker of VideoCameras direction"));
806  ImGui::EndTooltip();
807  }
808 
809  ImGui::PushItemWidth(125.f); // Width includes [+/-] buttons
810  ImGui::Separator();
811  ImGui::TextColored(GRAY_HINT_TEXT, _LC("TopMenubar", "Visual options:"));
812  DrawGIntSlider(App::gfx_polygon_mode, _LC("TopMenubar", "Polygon mode"), 1, 3);
813  if (ImGui::IsItemHovered())
814  {
815  ImGui::BeginTooltip();
816  ImGui::Text("%s", _LC("TopMenubar", "1 = Solid"));
817  ImGui::Text("%s", _LC("TopMenubar", "2 = Wireframe"));
818  ImGui::Text("%s", _LC("TopMenubar", "3 = Points"));
819  ImGui::EndTooltip();
820  }
821 
823  m_open_menu_hoverbox_max.x = menu_pos.x + ImGui::GetWindowWidth() + MENU_HOVERBOX_PADDING.x;
824  m_open_menu_hoverbox_max.y = menu_pos.y + ImGui::GetWindowHeight() + MENU_HOVERBOX_PADDING.y;
825  App::GetGuiManager()->RequestGuiCaptureKeyboard(ImGui::IsWindowHovered());
826  ImGui::End();
827  }
828  break;
829 
830  case TopMenu::TOPMENU_AI:
831  menu_pos.y = window_pos.y + ai_cursor.y + MENU_Y_OFFSET;
832  menu_pos.x = ai_cursor.x + window_pos.x - ImGui::GetStyle().WindowPadding.x;
833  ImGui::SetNextWindowPos(menu_pos);
834  if (ImGui::Begin(_LC("TopMenubar", "AI menu"), nullptr, static_cast<ImGuiWindowFlags_>(flags)))
835  {
836  if (ImGui::IsWindowHovered())
837  {
838  ai_menu = false;
839  }
840 
841  ImGui::PushItemWidth(125.f); // Width includes [+/-] buttons
842  ImGui::TextColored(GRAY_HINT_TEXT, "%s", _LC("TopMenubar", "General options:"));
843 
844  if (ai_num < 1)
845  ai_num = 1;
846 
847 
848  if (ai_mode == 2 || ai_mode == 3) // Drag Race or Crash driving mode
849  {
850  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
851  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
852  }
853 
854  ImGui::InputInt(_LC("TopMenubar", "Vehicle count"), &ai_num, 1, 100);
855  if (ImGui::IsItemHovered())
856  {
857  ImGui::BeginTooltip();
858  ImGui::Text("%s", _LC("TopMenubar", "Number of vehicles"));
859  ImGui::EndTooltip();
860  }
861 
862  if (ai_mode == 2 || ai_mode == 3) // Drag Race or Crash driving mode
863  {
864  ImGui::PopItemFlag();
865  ImGui::PopStyleVar();
866  }
867 
868  if (ai_num < 2)
869  {
870  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
871  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
872  }
873 
874  if (ai_mode == 3) // Crash driving mode
875  {
876  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
877  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
878  }
879 
880  ImGui::InputInt(_LC("TopMenubar", "Distance"), &ai_distance, 1, 100);
881  if (ImGui::IsItemHovered())
882  {
883  ImGui::BeginTooltip();
884  ImGui::Text("%s", _LC("TopMenubar", "Following distance in meters"));
885  ImGui::EndTooltip();
886  }
887 
888  if (ai_mode == 3) // Crash driving mode
889  {
890  ImGui::PopItemFlag();
891  ImGui::PopStyleVar();
892  }
893 
894  std::string label1 = "Behind";
895  if (ai_position_scheme == 1)
896  {
897  label1 = "Parallel";
898  }
899  else if (ai_position_scheme == 2)
900  {
901  label1 = "Opposite";
902  }
903 
904  if (ai_mode == 2 || ai_mode == 3) // Drag Race or Crash driving mode
905  {
906  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
907  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
908  }
909 
910  if (ImGui::BeginCombo("Position", label1.c_str()))
911  {
912  if (ImGui::Selectable("Behind"))
913  {
914  ai_position_scheme = 0;
915  }
916  if (ImGui::Selectable("Parallel"))
917  {
918  ai_position_scheme = 1;
919  }
920  ImGui::EndCombo();
921  }
922  if (ImGui::IsItemHovered())
923  {
924  ImGui::BeginTooltip();
925  ImGui::Text("%s", _LC("TopMenubar", "Positioning scheme"));
926  ImGui::Separator();
927  ImGui::Text("%s", _LC("TopMenubar", "Behind: Set vehicle behind vehicle, in line"));
928  ImGui::Text("%s", _LC("TopMenubar", "Parallel: Set vehicles in parallel, useful for certain scenarios like drag races"));
929  ImGui::EndTooltip();
930  }
931 
932  if (ai_num < 2)
933  {
934  ImGui::PopItemFlag();
935  ImGui::PopStyleVar();
936  }
937 
938  if (ai_times < 1)
939  ai_times = 1;
940 
941  if (ai_mode == 4) // Chase driving mode
942  {
943  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
944  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
945  }
946 
947  ImGui::InputInt(_LC("TopMenubar", "Repeat times"), &ai_times, 1, 100);
948  if (ImGui::IsItemHovered())
949  {
950  ImGui::BeginTooltip();
951  ImGui::Text("%s", _LC("TopMenubar", "How many times to loop the path"));
952  ImGui::EndTooltip();
953  }
954 
955  if (ai_mode == 4) // Chase driving mode
956  {
957  ImGui::PopItemFlag();
958  ImGui::PopStyleVar();
959  }
960 
961  if (ai_mode == 2 || ai_mode == 3) // Drag Race or Crash driving mode
962  {
963  ImGui::PopItemFlag();
964  ImGui::PopStyleVar();
965  }
966 
967  ImGui::Separator();
968  ImGui::TextColored(GRAY_HINT_TEXT, "%s", _LC("TopMenubar", "Vehicle options:"));
969 
970  std::string label2 = "Normal";
971  if (ai_mode == 1)
972  {
973  label2 = "Race";
974  }
975  else if (ai_mode == 2)
976  {
977  label2 = "Drag Race";
978  }
979  else if (ai_mode == 3)
980  {
981  label2 = "Crash";
982  }
983  else if (ai_mode == 4)
984  {
985  label2 = "Chase";
986  }
987 
988  for (auto actor : App::GetGameContext()->GetActorManager()->GetLocalActors())
989  {
990  if (actor->ar_driveable == AI)
991  {
992  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
993  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
994  break;
995  }
996  }
997 
998  if (ImGui::BeginCombo("Mode", label2.c_str()))
999  {
1000  if (ImGui::Selectable("Normal"))
1001  {
1002  ai_mode = 0;
1003 
1004  if (ai_mode_prev == 2 || ai_mode_prev == 3)
1005  {
1006  ai_num = ai_num_prev;
1010  }
1012  }
1013  if (ImGui::Selectable("Race"))
1014  {
1015  ai_mode = 1;
1016 
1017  if (ai_mode_prev == 2 || ai_mode_prev == 3)
1018  {
1019  ai_num = ai_num_prev;
1023  }
1025  }
1026  if (ImGui::Selectable("Drag Race"))
1027  {
1028  ai_mode = 2;
1029 
1030  if (ai_mode_prev != 3)
1031  {
1032  ai_num_prev = ai_num;
1036  }
1038  ai_num = 2;
1039  ai_speed = 1000;
1040  ai_position_scheme = 1;
1041  ai_times = 1;
1042  }
1043  if (ImGui::Selectable("Crash"))
1044  {
1045  ai_mode = 3;
1046  if (ai_mode_prev != 2)
1047  {
1048  ai_num_prev = ai_num;
1052  }
1054  ai_num = 2;
1055  ai_speed = 100;
1056  ai_position_scheme = 2;
1057  ai_times = 1;
1058  }
1059  if (ImGui::Selectable("Chase"))
1060  {
1061  ai_mode = 4;
1062 
1063  if (ai_mode_prev == 2 || ai_mode_prev == 3)
1064  {
1065  ai_num = ai_num_prev;
1069  }
1071  }
1072  ImGui::EndCombo();
1073  }
1074  if (ImGui::IsItemHovered())
1075  {
1076  ImGui::BeginTooltip();
1077  ImGui::Text("%s", _LC("TopMenubar", "Land vehicle driving mode"));
1078  ImGui::Separator();
1079  ImGui::Text("%s", _LC("TopMenubar", "Normal: Modify speed according to turns, other vehicles and character"));
1080  ImGui::Text("%s", _LC("TopMenubar", "Race: Always keep defined speed"));
1081  ImGui::Text("%s", _LC("TopMenubar", "Drag Race: Two vehicles performing a drag race"));
1082  ImGui::Text("%s", _LC("TopMenubar", "Crash: Two vehicles driving in opposite direction"));
1083  ImGui::Text("%s", _LC("TopMenubar", "Chase: Follow character and player vehicle"));
1084  ImGui::EndTooltip();
1085  }
1086 
1087  for (auto actor : App::GetGameContext()->GetActorManager()->GetLocalActors())
1088  {
1089  if (actor->ar_driveable == AI)
1090  {
1091  ImGui::PopItemFlag();
1092  ImGui::PopStyleVar();
1093  break;
1094  }
1095  }
1096 
1097  if (ai_speed < 1)
1098  ai_speed = 1;
1099 
1100  ImGui::InputInt(_LC("TopMenubar", "Speed"), &ai_speed, 1, 100);
1101  if (ImGui::IsItemHovered())
1102  {
1103  ImGui::BeginTooltip();
1104  ImGui::Text("%s", _LC("TopMenubar", "Speed in km/h for land vehicles or knots/s for boats"));
1105  ImGui::EndTooltip();
1106  }
1107 
1108  if (ai_altitude < 1)
1109  ai_altitude = 1;
1110 
1111  ImGui::InputInt(_LC("TopMenubar", "Altitude"), &ai_altitude, 1, 100);
1112  if (ImGui::IsItemHovered())
1113  {
1114  ImGui::BeginTooltip();
1115  ImGui::Text("%s", _LC("TopMenubar", "Airplane maximum altitude in feet"));
1116  ImGui::EndTooltip();
1117  }
1118 
1119  ImGui::Separator();
1120 
1121  if (ImGui::Button(StripColorMarksFromText(ai_dname).c_str(), ImVec2(250, 0)))
1122  {
1123  ai_select = true;
1124 
1126  m.payload = reinterpret_cast<void*>(new LoaderType(LT_AllBeam));
1128  }
1129  if (ImGui::IsItemHovered())
1130  {
1131  ImGui::BeginTooltip();
1132  ImGui::Text("%s", _LC("TopMenubar", "Land vehicles, boats and airplanes"));
1133  ImGui::EndTooltip();
1134  }
1135 
1136  if (ai_mode == 2 || ai_mode == 3) // Drag Race or Crash driving mode
1137  {
1138  ImGui::PushID("vehicle2");
1139  if (ImGui::Button(StripColorMarksFromText(ai_dname2).c_str(), ImVec2(250, 0)))
1140  {
1141  ai_select2 = true;
1142 
1144  m.payload = reinterpret_cast<void*>(new LoaderType(LT_AllBeam));
1146  }
1147  if (ImGui::IsItemHovered())
1148  {
1149  ImGui::BeginTooltip();
1150  ImGui::Text("%s", _LC("TopMenubar", "Land vehicles, boats and airplanes"));
1151  ImGui::EndTooltip();
1152  }
1153  ImGui::PopID();
1154  }
1155 
1156  ImGui::Separator();
1157 
1158  if (ai_rec)
1159  {
1160  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
1161  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
1162  }
1163 
1164  if (!ai_waypoints.empty() || ai_mode == 4) // Waypoints provided or Chase driving mode
1165  {
1166  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
1167  }
1168 
1169  if (ImGui::Button(_LC("TopMenubar", "Start"), ImVec2(80, 0)))
1170  {
1171  if (ai_mode == 4) // Chase driving mode
1172  {
1173  ai_waypoints.clear();
1174  if (App::GetGameContext()->GetPlayerActor()) // We are in vehicle
1175  {
1176  ai_events waypoint;
1177  waypoint.position = App::GetGameContext()->GetPlayerActor()->getPosition() + Ogre::Vector3(20, 0, 0);
1178  ai_waypoints.push_back(waypoint);
1179  }
1180  else // We are in feet
1181  {
1182  ai_events waypoint;
1183  waypoint.position = App::GetGameContext()->GetPlayerCharacter()->getPosition() + Ogre::Vector3(20, 0, 0);
1184  ai_waypoints.push_back(waypoint);
1185  }
1187  }
1188  else
1189  {
1190  if (ai_waypoints.empty())
1191  {
1193  fmt::format(_LC("TopMenubar", "Select a preset, record or open survey map ({}) to set waypoints."),
1194  App::GetInputEngine()->getEventCommandTrimmed(EV_SURVEY_MAP_CYCLE)), "lightbulb.png");
1195  }
1196  else
1197  {
1199  }
1200  }
1201  }
1202 
1203  if (!ai_waypoints.empty() || ai_mode == 4) // Waypoints provided or Chase driving mode
1204  {
1205  ImGui::PopStyleColor();
1206  }
1207 
1208  ImGui::SameLine();
1209 
1210  if (ImGui::Button(_LC("TopMenubar", "Stop"), ImVec2(80, 0)))
1211  {
1212  if (ai_mode == 4) // Chase driving mode
1213  {
1214  ai_waypoints.clear();
1215  }
1216 
1217  for (ActorPtr& actor : App::GetGameContext()->GetActorManager()->GetLocalActors())
1218  {
1219  if (actor->ar_driveable == AI)
1220  {
1221  App::GetGameContext()->PushMessage(Message(MSG_SIM_DELETE_ACTOR_REQUESTED, static_cast<void*>(new ActorPtr(actor))));
1222  }
1223  }
1224  }
1225 
1226  if (ai_rec)
1227  {
1228  ImGui::PopItemFlag();
1229  ImGui::PopStyleVar();
1230  }
1231 
1232  ImGui::SameLine();
1233 
1234  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
1235  std::string label = "Record";
1236  if (ai_rec)
1237  {
1238  label = "Recording";
1239  ImGui::PushStyleColor(ImGuiCol_Button, RED_TEXT);
1240  }
1241 
1242  if (ImGui::Button(label.c_str(), ImVec2(80, 0)))
1243  {
1244  if (!ai_rec)
1245  {
1246  ai_waypoints.clear();
1247  ai_rec = true;
1248  }
1249  else
1250  {
1251  ai_rec = false;
1252  }
1253  }
1254 
1255  ImGui::PopStyleColor();
1256  ImGui::Separator();
1257 
1258  if (ImGui::CollapsingHeader(_LC("TopMenubar", "Presets")))
1259  {
1260  // Draw whatever we already have (i.e. presets bundled with terrain, see '[AI Presets]' in terrn2 format).
1261  size_t num_rows = ai_presets_all.GetArray().Size();
1262  int display_count = 0;
1263  for (size_t i = 0; i < num_rows; i++)
1264  {
1265  rapidjson::Value& j_row = ai_presets_all[static_cast<rapidjson::SizeType>(i)];
1266 
1267  if (j_row.HasMember("terrain") && App::sim_terrain_name->getStr() == j_row["terrain"].GetString())
1268  {
1269  display_count++;
1270  if (ImGui::Button(j_row["preset"].GetString(), ImVec2(250, 0)))
1271  {
1272  ai_waypoints.clear();
1273 
1274  for (size_t i = 0; i < j_row["waypoints"].Size(); i++)
1275  {
1276  float x = j_row["waypoints"][i][0].GetFloat();
1277  float y = j_row["waypoints"][i][1].GetFloat();
1278  float z = j_row["waypoints"][i][2].GetFloat();
1279 
1280  ai_events waypoint;
1281  waypoint.position = Ogre::Vector3(x, y, z);
1282 
1283  int speed = -1;
1284  if (j_row["waypoints"][i].Size() == 4) // Custom speed defined
1285  {
1286  speed = j_row["waypoints"][i][3].GetInt();
1287  if (speed < 5)
1288  {
1289  speed = -1;
1290  }
1291  }
1292  waypoint.speed = speed;
1293  ai_waypoints.push_back(waypoint);
1294  }
1295  }
1296  }
1297  }
1298 
1299  // Fetch additional presets, or display error if failed
1300  if (ai_presets_extern.Empty())
1301  {
1303  {
1304  float spinner_size = 8.f;
1305  ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.f) - spinner_size);
1306  LoadingIndicatorCircle("spinner", spinner_size, theme.value_blue_text_color, theme.value_blue_text_color, 10, 10);
1307  }
1308  else if (ai_presets_extern_error != "")
1309  {
1310  ImGui::TextColored(RED_TEXT, "%s", _LC("TopMenubar", "Failed to fetch external presets."));
1311  if (ImGui::Button(_LC("TopMenubar", "Retry")))
1312  {
1313  this->FetchExternAiPresetsOnBackground(); // Will post `MSG_NET_REFRESH_AI_PRESETS` when done.
1314  }
1315  }
1316  else
1317  {
1318  this->FetchExternAiPresetsOnBackground(); // Will post `MSG_NET_REFRESH_AI_PRESETS` when done.
1319  }
1320  }
1321 
1322  // If no presets found, display message
1323  if (display_count == 0 && !ai_presets_extern_fetching && ai_presets_extern_error == "")
1324  {
1325  ImGui::Text("%s", _LC("TopMenubar", "No presets found for this terrain :("));
1326  ImGui::Text("%s", _LC("TopMenubar", "Supported terrains:"));
1327  ImGui::Separator();
1328 
1329  ImGui::BeginChild("terrains-scrolling", ImVec2(0.f, 200), false);
1330 
1331  for (size_t i = 0; i < num_rows; i++)
1332  {
1333  rapidjson::Value& j_row_terrains = ai_presets_all[static_cast<rapidjson::SizeType>(i)];
1334  if (j_row_terrains.HasMember("terrains"))
1335  {
1336  for (size_t i = 0; i < j_row_terrains["terrains"].Size(); i++)
1337  {
1338  ImGui::Text("%s", j_row_terrains["terrains"][i].GetString());
1339  }
1340  }
1341  }
1342 
1343  ImGui::EndChild();
1344  }
1345  }
1346 
1347  if (ImGui::CollapsingHeader(_LC("TopMenubar", "Waypoints")))
1348  {
1349  if (ai_waypoints.empty())
1350  {
1351  ImGui::Text("%s", _LC("TopMenubar", "No waypoints defined."));
1352  }
1353  else
1354  {
1355  if (ImGui::Button(_LC("TopMenubar", "Export"), ImVec2(250, 0)))
1356  {
1357  std::string s;
1358 
1359  for (int i = 0; i < ai_waypoints.size(); i++)
1360  {
1361  // Write position
1362  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);
1363 
1364  // Write custom speed
1365  if (ai_waypoints[i].speed >= 5)
1366  {
1367  s += ", " + std::to_string(ai_waypoints[i].speed);
1368  }
1369 
1370  // Close
1371  s += "]";
1372  if (i != ai_waypoints.size() - 1)
1373  {
1374  s += ",";
1375  }
1376  }
1377 
1378  std::string json = fmt::format("\n {{\n \"terrain\":\"{}\",\n \"preset\":\"Preset name\",\n \"waypoints\":\n [{}\n ]\n }}", App::sim_terrain_name->getStr(), s);
1379  RoR::Log(json.c_str());
1380 
1382  fmt::format(_LC("TopMenubar", "{} waypoints exported to RoR.log"),
1383  ai_waypoints.size()), "lightbulb.png");
1384  }
1385 
1386  ImGui::BeginChild("waypoints-scrolling", ImVec2(0.f, 200), false);
1387 
1388  for (int i = 0; i < ai_waypoints.size(); i++)
1389  {
1390  ImGui::PushID(i);
1391  ImGui::AlignTextToFramePadding();
1392  ImGui::Text("%d", i);
1393  ImGui::SameLine();
1394  if (ImGui::Button("teleport", ImVec2(60, 0)))
1395  {
1396  Ogre::Vector3* payload = new Ogre::Vector3(ai_waypoints[i].position);
1398  }
1399  if (ImGui::IsItemHovered())
1400  {
1401  ImGui::BeginTooltip();
1402  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);
1403  ImGui::Text(w.c_str());
1404  ImGui::EndTooltip();
1405  }
1406  ImGui::SameLine();
1407  ImGui::SetNextItemWidth(90);
1408 
1409  if (ai_waypoints[i].speed < -1)
1410  {
1411  ai_waypoints[i].speed = -1;
1412  }
1413  ImGui::InputInt(_LC("TopMenubar", "speed"), &ai_waypoints[i].speed, 1, 100);
1414  if (ImGui::IsItemHovered())
1415  {
1416  ImGui::BeginTooltip();
1417  ImGui::Text(_LC("TopMenubar", "Set waypoint speed in km/h for land vehicles"));
1418  ImGui::Separator();
1419  ImGui::Text(_LC("TopMenubar", "Value -1: Ignore, vehicle will use default speed"));
1420  ImGui::Text(_LC("TopMenubar", "Value >= 5: Override default speed"));
1421  ImGui::EndTooltip();
1422  }
1423  ImGui::PopID();
1424  }
1425 
1426  ImGui::EndChild();
1427  }
1428  }
1429 
1430  ImGui::PopItemWidth();
1432  m_open_menu_hoverbox_max.x = menu_pos.x + ImGui::GetWindowWidth() + MENU_HOVERBOX_PADDING.x;
1433  m_open_menu_hoverbox_max.y = menu_pos.y + ImGui::GetWindowHeight() + MENU_HOVERBOX_PADDING.y;
1434  App::GetGuiManager()->RequestGuiCaptureKeyboard(ImGui::IsWindowHovered());
1435  ImGui::End();
1436  }
1437  break;
1438 
1440  menu_pos.y = window_pos.y + tuning_cursor.y + MENU_Y_OFFSET;
1441  menu_pos.x = tuning_cursor.x + window_pos.x - ImGui::GetStyle().WindowPadding.x;
1442  ImGui::SetNextWindowPos(menu_pos);
1443  if (ImGui::Begin(_LC("TopMenubar", "Tuning menu"), nullptr, static_cast<ImGuiWindowFlags_>(flags)))
1444  {
1445  this->RefreshTuningMenu(); // make sure our local context is valid
1446  if (!tuning_actor)
1447  {
1448  ImGui::PushStyleColor(ImGuiCol_Text, GRAY_HINT_TEXT);
1449  ImGui::Text("%s", _LC("Tuning", "You are on foot."));
1450  ImGui::Text("%s", _LC("Tuning", "Enter a vehicle to tune it."));
1451  ImGui::PopStyleColor();
1452  }
1453  else
1454  {
1457 
1458  // SAVED TUNEUPS
1459  ImGui::TextDisabled(fmt::format(_LC("Tuning", "Saved tuneups ({})"), tuning_saves.cqy_results.size()).c_str());
1460  for (CacheQueryResult& tuneup_result: tuning_saves.cqy_results)
1461  {
1462  ImGui::PushID(tuneup_result.cqr_entry->fname.c_str());
1463 
1464  ImGui::AlignTextToFramePadding();
1465  ImGui::Bullet();
1466 
1467  // Load button (with tuneup name)
1468  ImGui::SameLine();
1469  if (ImGui::Button(tuneup_result.cqr_entry->dname.c_str()))
1470  {
1473  req->mpr_subject = tuneup_result.cqr_entry->fname;
1476  // Why 'MODIFY_PROJECT_REQUESTED' for loading?
1477  // Instead of loading with the saved tuneup directly, we keep the autogenerated and sync it with the save.
1478  // That way, subsequent editing doesn't modify the save until user saves again.
1479  }
1480 
1481  // Delete button (right-aligned)
1482  ImGui::SameLine();
1483  if (tuning_rwidget_cursorx_min < ImGui::GetCursorPosX()) // Make sure button won't draw over item name
1484  tuning_rwidget_cursorx_min = ImGui::GetCursorPosX();
1485  std::string delbtn_text = _LC("Tuning", "Delete");
1486  float delbtn_w = ImGui::CalcTextSize(delbtn_text.c_str()).x + ImGui::GetStyle().FramePadding.x * 2;
1487  float delbtn_cursorx = ImGui::GetWindowContentRegionWidth() - delbtn_w;
1488  if (delbtn_cursorx < tuning_rwidget_cursorx_min)
1489  delbtn_cursorx = tuning_rwidget_cursorx_min;
1490  ImGui::SetCursorPosX(delbtn_cursorx);
1491  ImGui::PushStyleColor(ImGuiCol_Button, TUNING_HOLDTOCONFIRM_COLOR);
1492  bool delbtn_pressed = RoR::ImButtonHoldToConfirm(delbtn_text, /*small:*/true, TUNING_HOLDTOCONFIRM_TIMELIMIT);
1493  ImGui::PopStyleColor(); //ImGuiCol_Button
1494  if (delbtn_pressed)
1495  {
1497  }
1498 
1499  ImGui::PopID(); // tuneup_result.cqr_entry->fname.c_str()
1500  }
1501 
1502  // WORKING TUNEUP
1503  ImGui::Separator();
1504  ImGui::AlignTextToFramePadding();
1505  ImGui::TextDisabled(_LC("Tuning", "Working tuneup"));
1507  {
1508  ImGui::InputText(_LC("Tuning", "Name"), tuning_savebox_buf.GetBuffer(), tuning_savebox_buf.GetCapacity());
1509 
1510  if (ImGui::Button(_LC("Tuning","Save")))
1511  {
1519  }
1520  ImGui::SameLine();
1521  ImGui::Checkbox(_LC("Tuning", "Overwrite"), &tuning_savebox_overwrite);
1522 
1523  // Cancel button (right-aligned)
1524  if (tuning_rwidget_cursorx_min < ImGui::GetCursorPosX()) // Make sure button won't draw over save button
1525  tuning_rwidget_cursorx_min = ImGui::GetCursorPosX();
1526  std::string cancelbtn_text = _LC("Tuning", "Cancel");
1527  float cancelbtn_w = ImGui::CalcTextSize(cancelbtn_text.c_str()).x + ImGui::GetStyle().FramePadding.x * 2;
1528  float cancelbtn_cursorx = ImGui::GetWindowContentRegionWidth() - cancelbtn_w;
1529  if (cancelbtn_cursorx < tuning_rwidget_cursorx_min)
1530  cancelbtn_cursorx = tuning_rwidget_cursorx_min;
1531  ImGui::SetCursorPosX(cancelbtn_cursorx);
1532  if (ImGui::SmallButton(_LC("Tuning", "Cancel")))
1533  {
1534  tuning_savebox_visible = false;
1535  }
1536  ImGui::Separator();
1537  }
1538  else if (tuneup_def)
1539  {
1540  ImGui::SameLine();
1541  if (ImGui::Button(_LC("Tuning", "Save as...")))
1542  {
1543  tuning_savebox_visible = true;
1544  }
1545 
1546  // Reset button (right-aligned)
1547  ImGui::SameLine();
1548  if (tuning_rwidget_cursorx_min < ImGui::GetCursorPosX()) // Make sure button won't draw over save button
1549  tuning_rwidget_cursorx_min = ImGui::GetCursorPosX();
1550  ImGui::AlignTextToFramePadding();
1551  std::string resetbtn_text = _LC("Tuning", "Reset");
1552  float delbtn_w = ImGui::CalcTextSize(resetbtn_text.c_str()).x + ImGui::GetStyle().FramePadding.x * 2;
1553  float delbtn_cursorx = ImGui::GetWindowContentRegionWidth() - delbtn_w;
1554  if (delbtn_cursorx < tuning_rwidget_cursorx_min)
1555  delbtn_cursorx = tuning_rwidget_cursorx_min;
1556  ImGui::SetCursorPosX(delbtn_cursorx);
1557  ImGui::PushStyleColor(ImGuiCol_Button, TUNING_HOLDTOCONFIRM_COLOR);
1558  bool resetbtn_pressed = ImButtonHoldToConfirm(resetbtn_text, /*small:*/false, TUNING_HOLDTOCONFIRM_TIMELIMIT);
1559  ImGui::PopStyleColor(); //ImGuiCol_Button
1560  if (resetbtn_pressed)
1561  {
1562  ModifyProjectRequest* request = new ModifyProjectRequest();
1563  request->mpr_target_actor = tuning_actor;
1566  }
1567  }
1568 
1569  // ADDONPARTS
1570 
1571  ImGui::SetNextItemOpen(true, ImGuiCond_FirstUseEver);
1572  std::string addonparts_title = fmt::format(_LC("TopMenubar", "Addon parts ({})"), tuning_addonparts.size());
1573  if (ImGui::CollapsingHeader(addonparts_title.c_str()))
1574  {
1575  for (size_t i = 0; i < tuning_addonparts.size(); i++)
1576  {
1577  const CacheEntryPtr& addonpart_entry = tuning_addonparts[i];
1578 
1579  ImGui::PushID(addonpart_entry->fname.c_str());
1580  const bool conflict_w_hovered = tuning_hovered_addonpart
1581  && (addonpart_entry != tuning_hovered_addonpart)
1583  bool used = TuneupUtil::isAddonPartUsed(tuneup_def, addonpart_entry->fname);
1584  const ImVec2 checkbox_cursor = ImGui::GetCursorScreenPos();
1585  if (ImGui::Checkbox(addonpart_entry->dname.c_str(), &used)
1586  && !conflict_w_hovered
1588  {
1590  req->mpr_type = (used)
1593  req->mpr_subject = addonpart_entry->fname;
1596  }
1597  // Draw conflict markers
1599  {
1600  // Gray-ish X inside the checkbox
1601  const float square_sz = ImGui::GetFrameHeight();
1602  const ImVec2 min = checkbox_cursor + ImGui::GetStyle().FramePadding*1.4f;
1603  const ImVec2 max = checkbox_cursor + (ImVec2(square_sz, square_sz) - ImGui::GetStyle().FramePadding*1.5f);
1604  const ImColor X_COLOR(0.5f, 0.48f, 0.45f);
1605  ImGui::GetWindowDrawList()->AddLine(min, max, X_COLOR, 4.f);
1606  ImGui::GetWindowDrawList()->AddLine(ImVec2(min.x, max.y), ImVec2(max.x, min.y), X_COLOR, 4.f);
1607  }
1608  if (conflict_w_hovered)
1609  {
1610  // Red unrounded square around the checkbox
1611  const float square_sz = ImGui::GetFrameHeight();
1612  const ImVec2 min = checkbox_cursor;
1613  const ImVec2 max = checkbox_cursor + ImVec2(square_sz + 0.5f, square_sz);
1614  const ImColor SQ_COLOR(0.7f, 0.1f, 0.f);
1615  ImGui::GetWindowDrawList()->AddRect(min, max, SQ_COLOR, 0.f, ImDrawCornerFlags_None, 3.f);
1616  }
1617  // Record when checkbox is hovered - for drawing conflict markers
1618  if (ImGui::IsItemHovered())
1619  {
1620  tuning_hovered_addonpart = addonpart_entry;
1621  }
1622  else if (tuning_hovered_addonpart == addonpart_entry)
1623  {
1624  tuning_hovered_addonpart = nullptr;
1625  }
1626  // Reload button (right-aligned)
1627  ImGui::SameLine();
1628  if (tuning_rwidget_cursorx_min < ImGui::GetCursorPosX()) // Make sure button won't draw over save button
1629  tuning_rwidget_cursorx_min = ImGui::GetCursorPosX();
1630  ImGui::AlignTextToFramePadding();
1631  std::string reloadbtn_text = _LC("Tuning", "Reload");
1632  const float reloadbtn_w = ImGui::CalcTextSize(reloadbtn_text.c_str()).x + ImGui::GetStyle().FramePadding.x * 2;
1633  const float reloadbtn_cursorx = std::max(ImGui::GetWindowContentRegionWidth() - reloadbtn_w, tuning_rwidget_cursorx_min);
1634  ImGui::SetCursorPosX(reloadbtn_cursorx);
1635  const bool reloadbtn_pressed = ImGui::SmallButton(reloadbtn_text.c_str());
1636  if (reloadbtn_pressed)
1637  {
1638  // Create spawn request while actor still exists
1639  // Note we don't use `ActorModifyRequest::Type::RELOAD` because we don't need the bundle reloaded.
1642  srq->asr_rotation = Ogre::Quaternion(Ogre::Degree(270) - Ogre::Radian(tuning_actor->getRotation()), Ogre::Vector3::UNIT_Y);
1649 
1650  // Request bundle reloading and chain the actor delete/spawn messages to it.
1654  }
1655 
1656  ImGui::PopID(); //(addonpart_entry->fname.c_str());
1657  }
1658 
1659  if (ImGui::Button(_LC("Tuning", "Browse all parts")))
1660  {
1662  }
1663 
1664  ImGui::Separator();
1665  }
1666 
1667  // Draw props
1668  size_t total_props = tuning_actor->GetGfxActor()->getProps().size();
1669  std::string props_title = fmt::format(_LC("Tuning", "Props ({})"), total_props);
1670  if (ImGui::CollapsingHeader(props_title.c_str()))
1671  {
1672  // Draw all props (those removed by addonparts are also present as placeholders)
1673  for (Prop const& p: tuning_actor->GetGfxActor()->getProps())
1674  {
1675  ImGui::PushID(p.pp_id);
1676  ImGui::AlignTextToFramePadding();
1677 
1678  this->DrawTuningBoxedSubjectIdInline(p.pp_id);
1679 
1681  p.pp_id,
1682  p.pp_media[0],
1683  tuneup_def && tuneup_def->isPropUnwanted(p.pp_id),
1684  tuneup_def && tuneup_def->isPropForceRemoved(p.pp_id),
1687 
1688  // Draw special prop tooltip
1689  if (p.pp_beacon_type == 'L' || p.pp_beacon_type == 'R' || p.pp_beacon_type == 'w')
1690  {
1691  ImGui::SameLine();
1692  ImGui::TextDisabled("(special!)");
1693  if (ImGui::IsItemHovered())
1694  {
1695  ImGui::BeginTooltip();
1696  ImGui::Text("special prop - aerial nav light");
1697  ImGui::EndTooltip();
1698  }
1699  }
1700  else if (p.pp_wheel_mesh_obj)
1701  {
1702  ImGui::SameLine();
1703  ImGui::TextDisabled("(special!)");
1704  if (ImGui::IsItemHovered())
1705  {
1706  ImGui::BeginTooltip();
1707  ImGui::Text("special prop - dashboard + dirwheel");
1708  ImGui::EndTooltip();
1709  }
1710 
1711  }
1712 
1714  p.pp_id,
1715  tuneup_def && tuneup_def->isPropProtected(p.pp_id),
1718 
1719  ImGui::PopID(); // p.pp_id
1720  }
1721 
1722  ImGui::Separator();
1723  }
1724 
1725  // Ditto for flexbodies
1726  size_t total_flexbodies = tuning_actor->GetGfxActor()->GetFlexbodies().size();
1727  std::string flexbodies_title = fmt::format(_LC("Tuning", "Flexbodies ({})"), total_flexbodies);
1728  if (ImGui::CollapsingHeader(flexbodies_title.c_str()))
1729  {
1730  // Draw all flexbodies (those removed by addonparts are also present as placeholders)
1731  for (FlexBody* flexbody: tuning_actor->GetGfxActor()->GetFlexbodies())
1732  {
1733  ImGui::PushID(flexbody->getID());
1734  ImGui::AlignTextToFramePadding();
1735 
1736  this->DrawTuningBoxedSubjectIdInline(flexbody->getID());
1737 
1739  flexbody->getID(),
1740  flexbody->getOrigMeshName(),
1741  tuneup_def && tuneup_def->isFlexbodyUnwanted(flexbody->getID()),
1742  tuneup_def && tuneup_def->isFlexbodyForceRemoved(flexbody->getID()),
1745 
1747  flexbody->getID(),
1748  tuneup_def && tuneup_def->isFlexbodyProtected(flexbody->getID()),
1751 
1752  ImGui::PopID(); // flexbody->getID()
1753  }
1754  }
1755 
1756  // Draw wheels
1757  const int total_wheels = tuning_actor->ar_num_wheels;
1758  std::string wheels_title = fmt::format(_LC("TopMenubar", "Wheels ({})"), total_wheels);
1759  if (ImGui::CollapsingHeader(wheels_title.c_str()))
1760  {
1761  for (WheelID_t i = 0; i < total_wheels; i++)
1762  {
1763  ImGui::PushID(i);
1764  ImGui::AlignTextToFramePadding();
1765 
1767 
1768  // Draw R/L radio buttons
1769  WheelSide forced_side = WheelSide::INVALID;
1770  if (tuneup_def && tuneup_def->isWheelSideForced(i, /*[out]*/forced_side))
1771  {
1772  ImGui::PushStyleColor(ImGuiCol_Border, ORANGE_TEXT);
1773  ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.f);
1774  }
1775  const RoR::WheelSide active_side = TuneupUtil::getTweakedWheelSide(tuneup_def, i, tuning_actor->GetGfxActor()->getWheelSide(i));
1776  RoR::WheelSide selected_side = active_side;
1777  if (ImGui::RadioButton("##L", active_side == WheelSide::LEFT))
1778  selected_side = WheelSide::LEFT;
1779  ImGui::SameLine();
1780  ImGui::TextDisabled("|");
1781  ImGui::SameLine();
1782  if (ImGui::RadioButton("##R", active_side == WheelSide::RIGHT))
1783  selected_side = WheelSide::RIGHT;
1784 
1785  // Draw rim mesh name
1786  ImGui::SameLine();
1787  ImGui::Text("%s", tuning_actor->GetGfxActor()->getWheelRimMeshName(i).c_str());
1788 
1789  // Draw reset button
1790 
1791  bool resetPressed = false;
1792  if (tuneup_def && tuneup_def->isWheelSideForced(i, forced_side))
1793  {
1794  ImGui::SameLine();
1795  ImGui::SameLine();
1796  ImGui::PushStyleColor(ImGuiCol_Text, GRAY_HINT_TEXT);
1797  resetPressed = ImGui::SmallButton(_LC("Tuning", "Reset"));
1798  ImGui::PopStyleColor(); //ImGuiCol_Text, GRAY_HINT_TEXT
1799  ImGui::PopStyleVar(); //ImGuiStyleVar_FrameBorderSize, 1.f
1800  ImGui::PopStyleColor(); //ImGuiCol_Border, ORANGE_TEXT
1801  }
1802 
1803  // modify project if needed
1804  if (selected_side != active_side)
1805  {
1808  req->mpr_subject_id = i;
1809  req->mpr_value_int = (int)selected_side;
1812  }
1813  else if (resetPressed)
1814  {
1817  req->mpr_subject_id = i;
1820  }
1821 
1823  i,
1824  tuneup_def && tuneup_def->isWheelProtected(i),
1827 
1828  ImGui::PopID(); // i
1829  }
1830  }
1831 
1832  // Draw flares
1833  size_t total_flares = tuning_actor->ar_flares.size();
1834  std::string flares_title = fmt::format(_LC("Tuning", "Flares ({})"), total_flares);
1835  if (ImGui::CollapsingHeader(flares_title.c_str()))
1836  {
1837  // Draw all flares (those removed by addonparts are also present as placeholders)
1838  for (FlareID_t flareid = 0; flareid < (int)tuning_actor->ar_flares.size(); flareid++)
1839  {
1840  ImGui::PushID(flareid);
1841  ImGui::AlignTextToFramePadding();
1842 
1843  this->DrawTuningBoxedSubjectIdInline(flareid);
1844 
1845  // Compose flare description string
1846  const FlareType flaretype = tuning_actor->ar_flares[flareid].fl_type;
1847  std::string flarename;
1848  if (flaretype == FlareType::USER)
1849  {
1850  int controlnumber = tuning_actor->ar_flares[flareid].controlnumber + 1; // Convert range 0-9 to 1-10
1851  flarename = fmt::format("{} {}", (char)flaretype, controlnumber);
1852  }
1853  else if (flaretype == FlareType::DASHBOARD)
1854  {
1855  std::string linkname = tuning_actor->ar_dashboard->getLinkNameForID((DashData)tuning_actor->ar_flares[flareid].dashboard_link);
1856  flarename = fmt::format("{} {}", (char)flaretype, linkname);
1857  }
1858  else
1859  {
1860  flarename = fmt::format("{}", (char)flaretype);
1861  }
1862 
1864  flareid,
1865  flarename,
1866  tuneup_def && tuneup_def->isFlareUnwanted(flareid),
1867  tuneup_def && tuneup_def->isFlareForceRemoved(flareid),
1870 
1872  flareid,
1873  tuneup_def && tuneup_def->isFlareProtected(flareid),
1876 
1877  ImGui::PopID(); // flareid
1878  }
1879  }
1880 
1881  // Draw exhausts
1882  size_t total_exhausts = tuning_actor->GetGfxActor()->getExhausts().size();
1883  std::string exhausts_title = fmt::format(_LC("Tuning", "Exhausts ({})"), total_exhausts);
1884  if (ImGui::CollapsingHeader(exhausts_title.c_str()))
1885  {
1886  // Draw all exhausts (those removed by addonparts are also present as placeholders)
1887  for (ExhaustID_t exhaustid = 0; exhaustid < (int)total_exhausts; exhaustid++)
1888  {
1889  ImGui::PushID(exhaustid);
1890  ImGui::AlignTextToFramePadding();
1891 
1892  this->DrawTuningBoxedSubjectIdInline(exhaustid);
1893 
1895  exhaustid,
1896  tuning_actor->GetGfxActor()->getExhausts()[exhaustid].particleSystemName,
1897  tuneup_def && tuneup_def->isExhaustUnwanted(exhaustid),
1898  tuneup_def && tuneup_def->isExhaustForceRemoved(exhaustid),
1901 
1903  exhaustid,
1904  tuneup_def && tuneup_def->isExhaustProtected(exhaustid),
1907 
1908  ImGui::PopID(); // exhaustid
1909  }
1910  }
1911 
1912  // Draw managed materials
1913  size_t total_materials = tuning_actor->ar_managed_materials.size();
1914  std::string materials_title = fmt::format(_LC("Tuning", "Managed Materials ({})"), total_materials);
1915  if (ImGui::CollapsingHeader(materials_title.c_str()))
1916  {
1917  // Draw all materials (those removed by addonparts are also present as placeholders)
1918  for (auto mm_pair: tuning_actor->ar_managed_materials)
1919  {
1920  const std::string& material_name = mm_pair.first;
1921  ImGui::PushID(material_name.c_str());
1922  ImGui::AlignTextToFramePadding();
1923 
1926  material_name,
1927  tuneup_def && tuneup_def->isManagedMatUnwanted(material_name),
1928  tuneup_def && tuneup_def->isManagedMatForceRemoved(material_name),
1931 
1934  tuneup_def && tuneup_def->isManagedMatProtected(material_name),
1937  material_name);
1938 
1939  ImGui::PopID(); // material_name.c_str()
1940  }
1941  }
1942 
1943  // Draw videocameras
1944  size_t total_videocameras = tuning_actor->GetGfxActor()->getVideoCameras().size();
1945  std::string videocameras_title = fmt::format(_LC("Tuning", "Videocameras ({})"), total_videocameras);
1946  if (ImGui::CollapsingHeader(videocameras_title.c_str()))
1947  {
1948  // Draw all videocameras (those removed by addonparts are also present as placeholders)
1949  for (VideoCameraID_t videocameraid = 0; videocameraid < (int)total_videocameras; videocameraid++)
1950  {
1951  ImGui::PushID(videocameraid);
1952  ImGui::AlignTextToFramePadding();
1953 
1954  this->DrawTuningBoxedSubjectIdInline(videocameraid);
1955 
1956  const VideoCamera& vcam = tuning_actor->GetGfxActor()->getVideoCameras()[videocameraid];
1957 
1958  // Draw RTT material name
1959  ImGui::SameLine();
1960  ImGui::Dummy(ImVec2(3, 3));
1961  ImGui::SameLine();
1962  ImGui::Text("%s", tuning_actor->GetGfxActor()->getVideoCameras()[videocameraid].vcam_mat_name_orig.c_str());
1963 
1964  // Setup the 'forced' state orange styling
1965 
1966  VideoCamRole forced_role_def = VCAM_ROLE_INVALID;
1967  if (tuneup_def && tuneup_def->isVideoCameraRoleForced(videocameraid, /*[out]*/forced_role_def))
1968  {
1969  ImGui::PushStyleColor(ImGuiCol_Border, ORANGE_TEXT);
1970  ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.f);
1971  }
1972 
1973  // Draw the 'flipped' checkbox where applicable
1974  const bool is_mirror_flip = vcam.vcam_role == VCAM_ROLE_MIRROR || vcam.vcam_role == VCAM_ROLE_TRACKING_MIRROR;
1975  const bool is_mirror_noflip = vcam.vcam_role == VCAM_ROLE_MIRROR_NOFLIP || vcam.vcam_role == VCAM_ROLE_TRACKING_MIRROR_NOFLIP;
1976  bool checkbox_pressed = false;
1977  VideoCamRole desired_role = VCAM_ROLE_INVALID;
1978  if ((is_mirror_flip || is_mirror_noflip))
1979  {
1980  ImGui::SameLine();
1981  bool checkbox_checked = is_mirror_flip;
1982  checkbox_pressed = ImGui::Checkbox(_LC("Tuning", "Flipped"), &checkbox_checked);
1983  switch (vcam.vcam_role)
1984  {
1985  case VCAM_ROLE_MIRROR: desired_role = VCAM_ROLE_MIRROR_NOFLIP; break;
1986  case VCAM_ROLE_MIRROR_NOFLIP: desired_role = VCAM_ROLE_MIRROR; break;
1987  case VCAM_ROLE_TRACKING_MIRROR: desired_role = VCAM_ROLE_TRACKING_MIRROR_NOFLIP; break;
1988  case VCAM_ROLE_TRACKING_MIRROR_NOFLIP: desired_role = VCAM_ROLE_TRACKING_MIRROR; break;
1989  default: break;
1990  }
1991  }
1992  else
1993  {
1994  // Inform user why this videocamera isn't flippable
1995  ImGui::SameLine();
1996  switch (vcam.vcam_role)
1997  {
1998  case VCAM_ROLE_MIRROR_PROP_LEFT: ImGui::TextDisabled(_LC("Tuning", "(Mirror prop - Left)")); break;
1999  case VCAM_ROLE_MIRROR_PROP_RIGHT: ImGui::TextDisabled(_LC("Tuning", "(Mirror prop - Right)")); break;
2000  default: ImGui::TextDisabled(_LC("Tuning", "(Videocamera)")); break;
2001  }
2002  }
2003 
2004  // Draw reset button and reset the orange styling
2005 
2006  bool reset_pressed = false;
2007  if (tuneup_def && tuneup_def->isVideoCameraRoleForced(videocameraid, /*[out]*/forced_role_def))
2008  {
2009  ImGui::SameLine();
2010  ImGui::SameLine();
2011  ImGui::PushStyleColor(ImGuiCol_Text, GRAY_HINT_TEXT);
2012  reset_pressed = ImGui::SmallButton(_LC("Tuning", "Reset"));
2013  ImGui::PopStyleColor(); //ImGuiCol_Text, GRAY_HINT_TEXT
2014  ImGui::PopStyleVar(); //ImGuiStyleVar_FrameBorderSize, 1.f
2015  ImGui::PopStyleColor(); //ImGuiCol_Border, ORANGE_TEXT
2016  }
2017 
2018  // modify project if needed
2019  if (checkbox_pressed)
2020  {
2023  req->mpr_subject_id = videocameraid;
2024  req->mpr_value_int = (int)desired_role;
2027  }
2028  else if (reset_pressed)
2029  {
2032  req->mpr_subject_id = videocameraid;
2035  }
2036 
2037 
2038  ImGui::PopID(); // videocameraid
2039  }
2040  }
2041  }
2042 
2044  m_open_menu_hoverbox_max.x = menu_pos.x + ImGui::GetWindowWidth() + MENU_HOVERBOX_PADDING.x;
2045  m_open_menu_hoverbox_max.y = menu_pos.y + ImGui::GetWindowHeight() + MENU_HOVERBOX_PADDING.y;
2046  App::GetGuiManager()->RequestGuiCaptureKeyboard(ImGui::IsWindowHovered());
2047  ImGui::End();
2048  }
2049  break;
2050 
2051  default:
2052  m_open_menu_hoverbox_min = ImVec2(0,0);
2053  m_open_menu_hoverbox_max = ImVec2(0,0);
2054  }
2055 
2056  ImGui::PopStyleColor(2); // WindowBg, Button
2057 }
2058 
2059 bool TopMenubar::ShouldDisplay(ImVec2 window_pos)
2060 {
2061  if (!App::GetGuiManager()->AreStaticMenusAllowed())
2062  {
2063  return false;
2064  }
2065 
2066  if (ImGui::IsMouseDown(1))
2067  {
2068  return false;
2069  }
2070 
2071  if (ai_menu)
2072  {
2074  return true;
2075  }
2076 
2077  ImVec2 box_min(0,0);
2078  ImVec2 box_max(ImGui::GetIO().DisplaySize.x, ImGui::GetStyle().WindowPadding.y + PANEL_HOVERBOX_HEIGHT);
2079  ImVec2 mouse_pos = ImGui::GetIO().MousePos;
2080  const bool window_hovered ((mouse_pos.x >= box_min.x) && (mouse_pos.x <= box_max.x) &&
2081  (mouse_pos.y >= box_min.y) && (mouse_pos.y <= box_max.y));
2082  bool result = window_hovered;
2083 
2084  bool menu_hovered = false;
2086  {
2087  menu_hovered = ((mouse_pos.x >= m_open_menu_hoverbox_min.x) && (mouse_pos.x <= m_open_menu_hoverbox_max.x) &&
2088  (mouse_pos.y >= m_open_menu_hoverbox_min.y) && (mouse_pos.y <= m_open_menu_hoverbox_max.y));
2089  }
2090  result |= menu_hovered;
2091 
2092  bool box_hovered = false;
2094  {
2095  box_hovered = ((mouse_pos.x >= m_state_box_hoverbox_min.x) && (mouse_pos.x <= m_state_box_hoverbox_max.x) &&
2096  (mouse_pos.y >= m_state_box_hoverbox_min.y) && (mouse_pos.y <= m_state_box_hoverbox_max.y));
2097  result |= box_hovered;
2098  }
2099 
2100  if (box_hovered && !menu_hovered)
2101  {
2103  }
2104 
2105  return result;
2106 }
2107 
2109 {
2110  // Count actors owned by the player
2111  unsigned int num_actors_player = 0;
2112  for (ActorPtr& actor : App::GetGameContext()->GetActorManager()->GetActors())
2113  {
2114  if (actor->ar_net_source_id == user.uniqueid)
2115  {
2116  ++num_actors_player;
2117  }
2118  }
2119 
2120  // Display user in list
2121 #ifdef USE_SOCKETW
2122  const Ogre::ColourValue player_color = App::GetNetwork()->GetPlayerColor(user.colournum);
2123  ImVec4 player_gui_color(player_color.r, player_color.g, player_color.b, 1.f);
2124  ImGui::PushStyleColor(ImGuiCol_Text, player_gui_color);
2125  ImGui::Text("%s: %u (%s, Ver: %s, Lang: %s)",
2126  user.username, num_actors_player,
2127  App::GetNetwork()->UserAuthToStringShort(user).c_str(),
2128  user.clientversion, user.language);
2129  ImGui::PopStyleColor();
2130 #endif // USE_SOCKETW
2131 
2132  // Display actor list
2133  Ogre::TexturePtr tex1 = FetchIcon("control_pause.png");
2134  Ogre::TexturePtr tex2 = FetchIcon("control_play.png");
2135  int i = 0;
2136  for (ActorPtr& actor : App::GetGameContext()->GetActorManager()->GetActors())
2137  {
2138  if ((!actor->ar_hide_in_actor_list) && (actor->ar_net_source_id == user.uniqueid))
2139  {
2140  std::string id = fmt::format("{}:{}", i++, user.uniqueid);
2141  ImGui::PushID(id.c_str());
2142  if (actor->ar_state == ActorState::NETWORKED_OK)
2143  {
2144  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(tex1->getHandle()), ImVec2(16, 16)))
2145  {
2147  }
2148  }
2149  else if (actor->ar_state == ActorState::NETWORKED_HIDDEN)
2150  {
2151  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(tex2->getHandle()), ImVec2(16, 16)))
2152  {
2154  }
2155  }
2156  else // Our actor(s)
2157  {
2158  std::string text_buf_rem = fmt::format(" X ##[{}]", i);
2159  ImGui::PushStyleColor(ImGuiCol_Text, RED_TEXT);
2160  if (ImGui::Button(text_buf_rem.c_str()))
2161  {
2162  App::GetGameContext()->PushMessage(Message(MSG_SIM_DELETE_ACTOR_REQUESTED, static_cast<void*>(new ActorPtr(actor))));
2163  }
2164  ImGui::PopStyleColor();
2165  }
2166  ImGui::PopID();
2167  ImGui::SameLine();
2168 
2169  std::string actortext_buf = fmt::format("{} ({}) ##[{}:{}]", StripColorMarksFromText(actor->ar_design_name).c_str(), actor->ar_filename.c_str(), i++, user.uniqueid);
2170  if (ImGui::Button(actortext_buf.c_str())) // Button clicked?
2171  {
2172  App::GetGameContext()->PushMessage(Message(MSG_SIM_SEAT_PLAYER_REQUESTED, static_cast<void*>(new ActorPtr(actor))));
2173  }
2174  }
2175  }
2176 }
2177 
2179 {
2180  std::vector<ActorPtr> actor_list;
2181  for (ActorPtr& actor : App::GetGameContext()->GetActorManager()->GetActors())
2182  {
2183  if (!actor->ar_hide_in_actor_list)
2184  {
2185  actor_list.emplace_back(actor);
2186  }
2187  }
2188  if (actor_list.empty())
2189  {
2190  ImGui::PushStyleColor(ImGuiCol_Text, GRAY_HINT_TEXT);
2191  ImGui::Text("%s", _LC("TopMenubar", "None spawned yet"));
2192  ImGui::Text("%s", _LC("TopMenubar", "Use [Simulation] menu"));
2193  ImGui::PopStyleColor();
2194  }
2195  else
2196  {
2197  ActorPtr player_actor = App::GetGameContext()->GetPlayerActor();
2198  int i = 0;
2199  for (ActorPtr& actor : actor_list)
2200  {
2201  std::string text_buf_rem = fmt::format("X ##[{}]", i);
2202  ImGui::PushStyleColor(ImGuiCol_Text, RED_TEXT);
2203  if (ImGui::Button(text_buf_rem.c_str()))
2204  {
2205  App::GetGameContext()->PushMessage(Message(MSG_SIM_DELETE_ACTOR_REQUESTED, static_cast<void*>(new ActorPtr(actor))));
2206  }
2207  ImGui::PopStyleColor();
2208  ImGui::SameLine();
2209 
2210  std::string text_buf = fmt::format( "[{}] {}", i++, StripColorMarksFromText(actor->ar_design_name).c_str());
2211  if (actor == player_actor)
2212  {
2213  ImGui::PushStyleColor(ImGuiCol_Text, GREEN_TEXT);
2214  }
2215  else if (std::find(actor->ar_linked_actors.begin(), actor->ar_linked_actors.end(), player_actor) != actor->ar_linked_actors.end())
2216  {
2217  ImGui::PushStyleColor(ImGuiCol_Text, ORANGE_TEXT);
2218  }
2219  else if (actor->ar_state == ActorState::LOCAL_SIMULATED)
2220  {
2221  ImGui::PushStyleColor(ImGuiCol_Text, WHITE_TEXT);
2222  }
2223  else
2224  {
2225  ImGui::PushStyleColor(ImGuiCol_Text, GRAY_HINT_TEXT);
2226  }
2227  if (ImGui::Button(text_buf.c_str())) // Button clicked?
2228  {
2229  App::GetGameContext()->PushMessage(Message(MSG_SIM_SEAT_PLAYER_REQUESTED, static_cast<void*>(new ActorPtr(actor))));
2230  }
2231  ImGui::PopStyleColor();
2232  }
2233  }
2234 }
2235 
2236 void DrawRepairBoxEvent(events ev, std::string const& desc)
2237 {
2238  ImDrawEventHighlighted(ev); ImGui::SameLine(); ImGui::TextDisabled(desc.c_str()); ImGui::NextColumn();
2239 }
2240 
2241 void DrawRepairBoxModkey(OIS::KeyCode modkey, std::string const& desc)
2242 {
2243  ImDrawModifierKeyHighlighted(modkey); ImGui::SameLine(); ImGui::TextDisabled(desc.c_str()); ImGui::NextColumn();
2244 }
2245 
2246 void TopMenubar::DrawSpecialStateBox(float top_offset)
2247 {
2248  float content_width = 0.f;
2249  // Always drawn on top:
2250  std::string special_text;
2251  ImVec4 special_color = ImGui::GetStyle().Colors[ImGuiCol_Text]; // Regular color
2252  float special_text_centering_weight = 1.f; // 0 = no centering
2253  // Only for race_box:
2254  std::string special_text_b;
2255  std::string special_text_c;
2256  std::string special_text_d;
2257  ImVec4 special_color_c = ImVec4(0,0,0,0);
2259 
2260  // Gather state info
2261  if (App::GetGameContext()->GetActorManager()->IsSimulationPaused() && !App::GetGuiManager()->IsGuiHidden())
2262  {
2263  special_color = ORANGE_TEXT;
2264  special_text = fmt::format(_LC("TopMenubar", "All physics paused, press {} to resume"),
2265  App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_TOGGLE_PHYSICS));
2266  content_width = ImGui::CalcTextSize(special_text.c_str()).x;
2267  }
2268  else if (App::GetGameContext()->GetPlayerActor() &&
2269  App::GetGameContext()->GetPlayerActor()->ar_physics_paused &&
2270  !App::GetGuiManager()->IsGuiHidden())
2271  {
2272  special_color = GREEN_TEXT;
2273  special_text = fmt::format(_LC("TopMenubar", "Vehicle physics paused, press {} to resume"),
2274  App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_TOGGLE_PHYSICS));
2275  content_width = ImGui::CalcTextSize(special_text.c_str()).x;
2276  }
2277  else if (App::GetGameContext()->GetPlayerActor() &&
2278  App::GetGameContext()->GetPlayerActor()->ar_state == ActorState::LOCAL_REPLAY)
2279  {
2280  content_width = 300;
2282  special_text = _LC("TopMenubar", "Replay");
2283  }
2284  else if (App::GetGameContext()->GetRepairMode().IsLiveRepairActive())
2285  {
2286  special_text = fmt::format(_LC("TopMenubar", "Live repair mode, hit '{}' to stop"),
2287  App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_REPAIR_TRUCK));
2288  content_width = 450;
2290  special_color = GREEN_TEXT;
2291  special_text_centering_weight = 0.7f;
2292  }
2293  else if (App::GetGameContext()->GetRepairMode().IsQuickRepairActive())
2294  {
2295  special_text = fmt::format(_LC("TopMenubar", "Quick repair ('{}' for Live repair)"),
2296  App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_LIVE_REPAIR_MODE));
2297  content_width = 450;
2299  special_color = ORANGE_TEXT;
2300  special_text_centering_weight = 0.7f;
2301  }
2302  else if (App::GetGfxScene()->GetSimDataBuffer().simbuf_dir_arrow_visible)
2303  {
2305 
2306  // Calculate distance
2308  GUIManager::GuiTheme const& theme = App::GetGuiManager()->GetTheme();
2309  float distance = 0.0f;
2311  if (player_actor != nullptr && App::GetGameContext()->GetPlayerActor() &&
2313  {
2314  distance = player_actor->GetGfxActor()->GetSimDataBuffer().simbuf_pos.distance(data.simbuf_dir_arrow_target);
2315  }
2316  else
2317  {
2318  distance = data.simbuf_character_pos.distance(data.simbuf_dir_arrow_target);
2319  }
2320 
2321  // format text
2323  special_text_b = fmt::format("{:.1f} {}", distance, _LC("DirectionArrow", "meter"));
2324  content_width = ImGui::CalcTextSize(special_text.c_str()).x + ImGui::CalcTextSize(special_text_b.c_str()).x;
2325 
2327  special_text_c = fmt::format("{:02d}.{:02d}.{:02d}", (int)(time) / 60, (int)(time) % 60, (int)(time * 100.0) % 100);
2329  special_color_c = (time_diff > 0.0f)
2330  ? theme.value_red_text_color
2331  : ((time_diff < 0.0f) ? theme.success_text_color : theme.value_blue_text_color);
2332 
2334  {
2336  special_text_d = fmt::format("{:02d}.{:02d}.{:02d}", (int)(best_time) / 60, (int)(best_time) % 60, (int)(best_time * 100.0) % 100);
2337  }
2338  }
2339  else if (App::sim_state->getEnum<SimState>() == SimState::EDITOR_MODE)
2340  {
2341  special_color = GREEN_TEXT;
2342  if (App::GetGameContext()->GetTerrain()->getCacheEntry()->resource_bundle_type == "Zip")
2343  {
2344  // This is a read-only (ZIPped) terrain; offer the importer script.
2345  special_text = fmt::format(_LC("TopMenubar", "Terrain editing mode, press {} to exit"),
2346  App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_TOGGLE_TERRAIN_EDITOR));
2347  content_width = ImGui::CalcTextSize(special_text.c_str()).x + 25.f;
2349  }
2350  else
2351  {
2352  special_text = fmt::format(_LC("TopMenubar", "Terrain editing mode, press {} to save and exit"),
2353  App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_TOGGLE_TERRAIN_EDITOR));
2354  content_width = ImGui::CalcTextSize(special_text.c_str()).x;
2355  }
2356  }
2357 
2358  // Draw box if needed
2359  if (!special_text.empty())
2360  {
2361  ImVec2 box_pos;
2362  box_pos.y = top_offset;
2363  box_pos.x = (ImGui::GetIO().DisplaySize.x / 2) - ((content_width / 2) + ImGui::GetStyle().FramePadding.x);
2364  ImGui::SetNextWindowPos(box_pos);
2365  ImGui::SetNextWindowSize(ImVec2(0.f, 0.f));
2366  ImGui::SetNextWindowContentWidth(content_width);
2367  ImGuiWindowFlags flags = ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove |
2368  ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse;
2369  ImGui::PushStyleColor(ImGuiCol_WindowBg, App::GetGuiManager()->GetTheme().semitransparent_window_bg);
2370  if (ImGui::Begin(special_text.c_str(), nullptr, flags))
2371  {
2373  {
2374  // Center the text, the box may be wider
2375  float text_w = ImGui::CalcTextSize(special_text.c_str()).x;
2376  ImGui::SetCursorPosX(((content_width / 2) - (text_w / 2)) * special_text_centering_weight);
2377  }
2378  ImGui::TextColored(special_color, "%s", special_text.c_str());
2379 
2381  {
2382  ImGui::SameLine();
2383 
2384  // Progress bar with frame index/count
2386  float fraction = (float)std::abs(replay->getCurrentFrame())/(float)replay->getNumFrames();
2387  Str<100> pbar_text; pbar_text << replay->getCurrentFrame() << "/" << replay->getNumFrames();
2388  float pbar_width = content_width - (ImGui::GetStyle().ItemSpacing.x + ImGui::CalcTextSize(special_text.c_str()).x);
2389  ImGui::ProgressBar(fraction, ImVec2(pbar_width, ImGui::GetTextLineHeight()), pbar_text.ToCStr());
2390 
2391  // Game time text
2392  float time_sec = replay->getLastReadTime() / 1000000.0;
2393  char str[200];
2394  int str_pos = 0;
2395  if (time_sec > 60)
2396  {
2397  int min = (int)time_sec / 60;
2398  str_pos = snprintf(str, 200, "%dmin ", min);
2399  time_sec -= (float)min * 60.f;
2400  }
2401  snprintf(str+str_pos, 200-str_pos, "%.2fsec", time_sec);
2402  ImGui::TextDisabled("%s: %s", _LC("TopMenubar", "Time"), str);
2403 
2404  }
2406  {
2407  ImGui::SameLine();
2408  ImGui::Text(special_text_b.c_str());
2409  ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2) - (ImGui::CalcTextSize(special_text_c.c_str()).x / 2));
2410  ImGui::TextColored(special_color_c,"%s", special_text_c.c_str());
2411 
2412  Str<300> text;
2413  text << "Best Time: " << special_text_d.c_str();
2414  ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2) - (ImGui::CalcTextSize(text).x / 2));
2415 
2416  if (!special_text_d.empty())
2417  {
2418  ImGui::TextDisabled(text);
2419  }
2420  }
2422  {
2423  // Draw special element on the right
2424  ImGui::SameLine();
2425  ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.f, 0.f));
2427  {
2429  ImGui::ProgressBar(fraction, ImVec2(15.f, ImGui::GetTextLineHeight() / 2.f), "");
2430  ImGui::SameLine();
2431  }
2432  DrawGCheckbox(App::ui_show_live_repair_controls, _LC("LiveRepair", "Show controls"));
2433  ImGui::PopStyleVar(); // FramePadding
2434 
2435  const ImVec2 MINI_SPACING = ImVec2(2.f,0.f);
2436  ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, MINI_SPACING);
2437 
2438  if (App::ui_show_live_repair_controls->getBool())
2439  {
2440  const float INDENT = 15.f;
2441  ImGui::Separator();
2442  ImGui::TextDisabled("%s:", _LC("LiveRepair", "Movement"));
2443  ImGui::Columns(3);
2444  ImGui::SetColumnWidth(0, INDENT);
2445  ImGui::NextColumn();
2446  DrawRepairBoxEvent(EV_CHARACTER_FORWARD,_LC("LiveRepair", "Forward"));
2447  DrawRepairBoxEvent(EV_CHARACTER_BACKWARDS,_LC("LiveRepair", "Backward"));
2448  ImGui::NextColumn();
2449  DrawRepairBoxEvent(EV_CHARACTER_SIDESTEP_LEFT,_LC("LiveRepair", "Left"));
2450  DrawRepairBoxEvent(EV_CHARACTER_SIDESTEP_RIGHT,_LC("LiveRepair", "Right"));
2451  ImGui::NextColumn();
2452  DrawRepairBoxEvent(EV_TRUCK_ACCELERATE,_LC("LiveRepair", "Up"));
2453  DrawRepairBoxEvent(EV_TRUCK_BRAKE,_LC("LiveRepair", "Down"));
2454  ImGui::Columns(1);
2455 
2456  ImGui::TextDisabled("%s:", _LC("LiveRepair", "Rotation"));
2457  ImGui::Columns(3);
2458  ImGui::SetColumnWidth(0, INDENT);
2459  ImGui::NextColumn();
2460  DrawRepairBoxEvent(EV_TRUCK_STEER_LEFT,_LC("LiveRepair", "Rot. left"));
2461  DrawRepairBoxEvent(EV_TRUCK_STEER_RIGHT,_LC("LiveRepair", "Rot. right"));
2462  ImGui::Columns(1);
2463 
2464  ImGui::TextDisabled("%s:", _LC("LiveRepair", "Modifiers"));
2465  ImGui::Columns(4);
2466  ImGui::SetColumnWidth(0, INDENT);
2467  ImGui::SetColumnWidth(1, 125);
2468  ImGui::SetColumnWidth(2, 125);
2469  ImGui::NextColumn();
2470  DrawRepairBoxModkey(OIS::KC_LMENU,_LC("LiveRepair", "Slow step")); // Left alt
2471  DrawRepairBoxModkey(OIS::KC_LSHIFT,_LC("LiveRepair", "Fast step"));
2472  DrawRepairBoxModkey(OIS::KC_LCONTROL,_LC("LiveRepair", "10x step")); // Left ctrl
2473  ImGui::Columns(1);
2474 
2476  ImGui::TextDisabled("%s (%s):", _LC("LiveRepair", "Reset mode"), ToLocalizedString(resetmode).c_str());
2477  ImGui::Dummy(ImVec2(INDENT, 1.f));
2478  ImGui::SameLine();
2479  DrawRepairBoxEvent(EV_COMMON_TOGGLE_RESET_MODE,_LC("LiveRepair", "Switch reset mode"));
2480  }
2481  ImGui::PopStyleVar(); // ItemSpacing
2482  }
2484  {
2485  ImGui::Separator();
2486  // notice text
2487  std::string lbl_readonly = _LC("TopMenubar", "This terrain is read only.");
2488  ImGui::SetCursorPosX(ImGui::GetCursorPosX()
2489  + (ImGui::GetWindowContentRegionWidth() / 2 - ImGui::CalcTextSize(lbl_readonly.c_str()).x/2));
2490  ImGui::TextDisabled("%s", lbl_readonly.c_str());
2491  // import button
2492  ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.2, 0.2, 0.2, 1.0));
2493  std::string btn_import = _LC("TopMenubar", "Import as editable project.");
2494  ImGui::SetCursorPosX(ImGui::GetCursorPosX()
2495  + ((ImGui::GetWindowContentRegionWidth() / 2 - ImGui::CalcTextSize(btn_import.c_str()).x / 2) - ImGui::GetStyle().FramePadding.x));
2496  if (!m_terrn_import_started && ImGui::Button(btn_import.c_str()))
2497  {
2499  rq->lsr_filename = "terrain_project_importer.as";
2502  m_terrn_import_started = true;
2503  }
2504  ImGui::PopStyleColor(); // ImGuiCol_Button
2505  }
2506  const ImVec2 PAD = ImVec2(5, 5); // To bridge top menubar hoverbox and statebox hoverbox
2507  m_state_box_hoverbox_min = box_pos - PAD;
2508  m_state_box_hoverbox_max.x = box_pos.x + ImGui::GetWindowWidth();
2509  m_state_box_hoverbox_max.y = box_pos.y + ImGui::GetWindowHeight();
2510  m_state_box_hoverbox_max += PAD;
2511  // DO NOT `RequestGuiCaptureKeyboard()` - we want to use the hotkeys through it.
2512  ImGui::End();
2513  }
2514  ImGui::PopStyleColor(1); // WindowBg
2515  }
2516 
2517  if (App::sim_state->getEnum<SimState>() != SimState::EDITOR_MODE)
2518  {
2519  m_terrn_import_started = false;
2520  }
2521 }
2522 
2524 {
2525  // Load 'bundled' AI presets - see section `[AI Presets]` in terrn2 file format
2526  // ----------------------------------------------------------------------------
2527 
2529 
2530  for (const std::string& filename: terrain->GetDef()->ai_presets_files)
2531  {
2532  rapidjson::Document j_doc;
2533  if (Ogre::ResourceGroupManager::getSingleton().resourceExists(terrain->getTerrainFileResourceGroup(), filename))
2534  {
2536  }
2537  else
2538  {
2539  LOG(fmt::format("[RoR|Terrain] AI presets file '{}' declared in '{}' not found!", filename, terrain->getTerrainFileName()));
2540  }
2541 
2542  // Ensure the format is about right
2543  if (!j_doc.IsArray())
2544  {
2545  LOG(fmt::format("[RoR|Terrain] AI presets file '{}' declared in '{}' has wrong format - the root element is not an array!",
2546  filename, terrain->getTerrainFileName()));
2547  }
2548  else
2549  {
2550  // Finally add the presets to the list
2551  for (const rapidjson::Value& j_bundled_preset: j_doc.GetArray())
2552  {
2553  rapidjson::Value preset_copy(j_bundled_preset, App::GetGuiManager()->TopMenubar.ai_presets_bundled.GetAllocator());
2555  }
2556  }
2557  }
2558 
2560 }
2561 
2563 {
2564 #if defined(USE_CURL)
2565  std::packaged_task<void()> task(FetchAiPresetsThreadFunc);
2566  std::thread(std::move(task)).detach();
2568 #endif // defined(USE_CURL)
2569 }
2570 
2572 {
2573  // Combine external and bundled presets into one JSON doc
2574  // -------------------------------------------------------
2575 
2576  ai_presets_all.Clear();
2577  ai_presets_all.SetArray();
2578 
2579  for (rapidjson::Value& bundled_preset: ai_presets_bundled.GetArray())
2580  {
2581  rapidjson::Value preset_copy(bundled_preset, ai_presets_all.GetAllocator());
2582  ai_presets_all.PushBack(preset_copy, ai_presets_all.GetAllocator());
2583  }
2584 
2585  for (const rapidjson::Value& extern_preset: ai_presets_extern.GetArray())
2586  {
2587  rapidjson::Value preset_copy(extern_preset, ai_presets_all.GetAllocator());
2588  ai_presets_all.PushBack(preset_copy, ai_presets_all.GetAllocator());
2589  }
2590 }
2591 
2593 {
2594  // Updates/resets the tuning menu for the current vehicle driven by player (if any).
2595  // -------------------------------------------------------------------------------
2596 
2597  if (App::sim_tuning_enabled->getBool()
2598  && (App::mp_state->getEnum<MpState>() != MpState::CONNECTED)
2599  && App::GetGameContext()->GetPlayerActor()
2600  && (tuning_actor != App::GetGameContext()->GetPlayerActor()))
2601  {
2604 
2605  tuning_addonparts.clear();
2607 
2608  // Addonparts matched by GUID
2609  if (tuning_actor->getUsedActorEntry()->guid != "")
2610  {
2611  CacheQuery query_addonparts;
2612  query_addonparts.cqy_filter_type = LT_AddonPart;
2613  query_addonparts.cqy_filter_guid = tuning_actor->getUsedActorEntry()->guid;
2614  query_addonparts.cqy_filter_target_filename = tuning_actor->getTruckFileName(); // Addonparts without any filenames listed will just pass.
2615  App::GetCacheSystem()->Query(query_addonparts);
2616  for (CacheQueryResult& res: query_addonparts.cqy_results)
2617  {
2618  tuning_addonparts.push_back(res.cqr_entry);
2619  }
2620  }
2621 
2622  // Addonparts force-installed via [browse all] button; watch for duplicates.
2624  {
2625  for (std::string const& use_addonpart_fname: tuning_actor->getWorkingTuneupDef()->use_addonparts)
2626  {
2627  CacheEntryPtr entry = App::GetCacheSystem()->FindEntryByFilename(LT_AddonPart, /*partial:*/false, use_addonpart_fname);
2628  if (entry)
2629  {
2630  if (std::find(tuning_addonparts.begin(), tuning_addonparts.end(), entry) == tuning_addonparts.end())
2631  {
2632  tuning_addonparts.push_back(entry);
2633  }
2634  }
2635  }
2636  }
2637 
2641  tuning_saves.cqy_filter_category_id = CID_Tuneups; // Exclude auto-generated entries
2644 
2645  // Refresh `tuning_conflicts` database ~ test eligible addonparts each with each once.
2646  tuning_conflicts.clear();
2647  for (size_t i1 = 0; i1 < tuning_addonparts.size(); i1++)
2648  {
2649  for (size_t i2 = i1; i2 < tuning_addonparts.size(); i2++)
2650  {
2651  if (i1 != i2)
2652  {
2654  }
2655  }
2656  }
2657 
2658  // Refresh `tuning_addonparts_conflicting` listing ~ test used addonparts against unused.
2662  {
2663  for (const std::string& use_addonpart_fname: tuning_actor->getWorkingTuneupDef()->use_addonparts)
2664  {
2665  CacheEntryPtr use_addonpart_entry = App::GetCacheSystem()->FindEntryByFilename(LT_AddonPart, /*partial:*/false, use_addonpart_fname);
2666  for (size_t i = 0; i < tuning_addonparts.size(); i++)
2667  {
2668  if (tuning_addonparts[i] != use_addonpart_entry)
2669  {
2672  }
2673  }
2674  }
2675  }
2676 
2678  }
2679  else if (!App::sim_tuning_enabled->getBool() || !App::GetGameContext()->GetPlayerActor())
2680  {
2681  tuning_addonparts.clear();
2683  tuning_actor = nullptr;
2684  }
2685 }
2686 
2687 void TopMenubar::DrawTuningProtectedChkRightAligned(const int subject_id, bool protectchk_value, ModifyProjectRequestType request_type_set, ModifyProjectRequestType request_type_reset, const std::string& subject /* ="" */)
2688 {
2689  // > resolve the alignment
2690  ImGui::SameLine();
2691  if (tuning_rwidget_cursorx_min < ImGui::GetCursorPosX()) // Make sure button won't draw over item name
2692  tuning_rwidget_cursorx_min = ImGui::GetCursorPosX();
2693  std::string protectchk_text = _LC("Tuning", "Protected");
2694  float protectchk_w = ImGui::CalcTextSize(protectchk_text.c_str()).x + ImGui::GetStyle().FramePadding.x * 2;
2695  float protectchk_cursorx = (ImGui::GetWindowContentRegionWidth() - protectchk_w) - 20.f;
2696  if (protectchk_cursorx < tuning_rwidget_cursorx_min)
2697  protectchk_cursorx = tuning_rwidget_cursorx_min;
2698  ImGui::SetCursorPosX(protectchk_cursorx);
2699 
2700  // > set styling and draw
2701  ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0.0f, 0.0f));
2702  bool chk_pressed = ImGui::Checkbox(protectchk_text.c_str(), &protectchk_value);
2703  ImGui::PopStyleVar(1); // ImGuiStyleVar_FramePadding
2704 
2705  // > handle user action
2706  if (chk_pressed)
2707  {
2708  ModifyProjectRequest* request = new ModifyProjectRequest();
2709  request->mpr_target_actor = tuning_actor;
2710  if (subject_id == TUNING_SUBJECTID_USE_NAME)
2711  {
2712  request->mpr_subject = subject;
2713  }
2714  else
2715  {
2716  request->mpr_subject_id = subject_id;
2717  }
2718  request->mpr_type = (protectchk_value) ? request_type_set : request_type_reset;
2720  }
2721 }
2722 
2724 {
2725  // Draw subject ID in outlined box
2726  // -------------------------------
2727  ImGui::GetWindowDrawList()->AddRect(
2728  ImGui::GetCursorScreenPos(),
2729  ImGui::GetCursorScreenPos() + ImGui::CalcTextSize("00") + ImGui::GetStyle().FramePadding*2,
2730  ImColor(ImGui::GetStyle().Colors[ImGuiCol_TextDisabled]),
2731  ImGui::GetStyle().FrameRounding);
2732  ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetStyle().FramePadding.x);
2733  ImGui::Text("%02d", subject_id);
2734  ImGui::SameLine();
2735  ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetStyle().FramePadding.x);
2736 }
2737 
2738 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)
2739 {
2740  // Common for props and flexbodies: draws the force-remove checkbox and the reset button
2741  // ------------------------------------------------------------------------------------
2742 
2743  // Draw the checkbox for force-removing.
2744  bool isEnabled = !is_unwanted && !is_force_removed;
2745  if (is_force_removed)
2746  {
2747  ImGui::PushStyleColor(ImGuiCol_Border, ORANGE_TEXT);
2748  ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.f);
2749  }
2750  bool chkPressed = ImGui::Checkbox(name.c_str(), &isEnabled);
2751  bool resetPressed = false;
2752  if (is_force_removed)
2753  {
2754  ImGui::SameLine();
2755  ImGui::PushStyleColor(ImGuiCol_Text, GRAY_HINT_TEXT);
2756  resetPressed = ImGui::SmallButton(_LC("Tuning", "Reset"));
2757  ImGui::PopStyleColor(); //ImGuiCol_Text, GRAY_HINT_TEXT
2758  ImGui::PopStyleVar(); //ImGuiStyleVar_FrameBorderSize, 1.f
2759  ImGui::PopStyleColor(); //ImGuiCol_Border, ORANGE_TEXT
2760  }
2761 
2762  // perform project modification if needed
2763  if (chkPressed && !isEnabled)
2764  {
2766  req->mpr_type = request_type_set;
2767  if (subject_id == TUNING_SUBJECTID_USE_NAME)
2768  {
2769  req->mpr_subject = name;
2770  }
2771  else
2772  {
2773  req->mpr_subject_id = subject_id;
2774  }
2777  }
2778  else if ((chkPressed && isEnabled) || resetPressed)
2779  {
2781  req->mpr_type = request_type_reset;
2782  if (subject_id == TUNING_SUBJECTID_USE_NAME)
2783  {
2784  req->mpr_subject = name;
2785  }
2786  else
2787  {
2788  req->mpr_subject_id = subject_id;
2789  }
2792  }
2793 
2794 }
2795 
2797 {
2798  switch (which)
2799  {
2800  case TopMenu::TOPMENU_AI:
2804  default:
2805  return true;
2806  }
2807 }
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:2059
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:2236
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:291
RoR::App::GetNetwork
Network * GetNetwork()
Definition: Application.cpp:288
RoR::TuneupDef::isFlexbodyForceRemoved
bool isFlexbodyForceRemoved(FlexbodyID_t flexbodyid)
Definition: TuneupFileFormat.h:171
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 ('.as' file or '.gadget' file); If buffer is supplied, use this as display name on...
Definition: ScriptEngine.h:94
RoR::App::GetContentManager
ContentManager * GetContentManager()
Definition: Application.cpp:271
RoR::GUI::TopMenubar::StateBox::STATEBOX_NONE
@ STATEBOX_NONE
RoR::Terrain::GetDef
Terrn2DocumentPtr GetDef()
Definition: Terrain.cpp:577
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:258
RoR::SimResetMode
SimResetMode
Definition: Application.h:280
RoR::GUI::TopMenubar::DrawTuningBoxedSubjectIdInline
void DrawTuningBoxedSubjectIdInline(int subject_id)
Definition: GUI_TopMenubar.cpp:2723
RoR::TuneupUtil::isAddonPartUsed
static bool isAddonPartUsed(TuneupDefPtr &tuneup_entry, const std::string &filename)
Definition: TuneupFileFormat.cpp:593
RoR::GUI::TopMenubar::FetchExternAiPresetsOnBackground
void FetchExternAiPresetsOnBackground()
Initiate threaded (down)load of 'extern' waypoints from GitHub repo.
Definition: GUI_TopMenubar.cpp:2562
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:705
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:259
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:249
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:270
RoR::TuneupDef::isManagedMatProtected
bool isManagedMatProtected(const std::string &matname) const
Definition: TuneupFileFormat.h:156
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:853
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:170
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::ModifyProjectRequestType::TUNEUP_FORCED_VCAM_ROLE_RESET
@ TUNEUP_FORCED_VCAM_ROLE_RESET
'subject_id' is video camera ID.
RoR::VCAM_ROLE_INVALID
@ VCAM_ROLE_INVALID
Definition: Application.h:389
RoR::GUIManager::GuiTheme
Definition: GUIManager.h:79
RoR::App::GetCameraManager
CameraManager * GetCameraManager()
Definition: Application.cpp:279
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:838
RoR::GUI::TopMenubar::DrawSpecialStateBox
void DrawSpecialStateBox(float top_offset)
Definition: GUI_TopMenubar.cpp:2246
RoR::CacheEntryPtr
RefCountingObjectPtr< CacheEntry > CacheEntryPtr
Definition: ForwardDeclarations.h:226
RoR::GameContextSB::simbuf_race_time
float simbuf_race_time
Definition: SimBuffers.h:211
RoR::ModifyProjectRequestType
ModifyProjectRequestType
Definition: CacheSystem.h:217
RoR::App::GetGuiManager
GUIManager * GetGuiManager()
Definition: Application.cpp:273
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:2241
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:257
DashBoardManager.h
RoR::Actor::ar_instance_id
ActorInstanceID_t ar_instance_id
Static attr; session-unique ID.
Definition: Actor.h:376
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:557
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:515
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::GfxActor::getVideoCameras
std::vector< VideoCamera > & getVideoCameras()
Definition: GfxActor.h:75
RoR::HandleGenericException
void HandleGenericException(const std::string &from, BitMask_t flags)
Definition: Application.cpp:373
Terrn2FileFormat.h
RoR::LT_Tuneup
@ LT_Tuneup
Definition: Application.h:322
RoR::CreateProjectRequest::cpr_type
CreateProjectRequestType cpr_type
Definition: CacheSystem.h:213
RoR::GUIManager::TextureToolWindow
GUI::TextureToolWindow TextureToolWindow
Definition: GUIManager.h:126
RoR::GameContext::GetPlayerCharacter
Character * GetPlayerCharacter()
Definition: GameContext.cpp:897
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::VideoCamera::vcam_role
VideoCamRole vcam_role
Definition: GfxData.h:223
RoR::GUI::ConsoleWindow::SetVisible
void SetVisible(bool visible)
Definition: GUI_ConsoleWindow.h:46
RoR::FlareType::USER
@ USER
RoR::CacheQuery
Definition: CacheSystem.h:167
RoR::EV_CHARACTER_BACKWARDS
@ EV_CHARACTER_BACKWARDS
step backwards with the character
Definition: InputEngine.h:128
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:250
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:151
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:837
RoR::FlareType
FlareType
Definition: SimData.h:228
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:278
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:164
RoR::TuneupDef::isPropUnwanted
bool isPropUnwanted(PropID_t propid)
Definition: TuneupFileFormat.h:161
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
RoR::VCAM_ROLE_TRACKING_MIRROR_NOFLIP
@ VCAM_ROLE_TRACKING_MIRROR_NOFLIP
A MIRROR_NOFLIP(2) with tracking node set.
Definition: Application.h:384
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:431
RoR::CacheQueryResult::cqr_entry
CacheEntryPtr cqr_entry
Definition: CacheSystem.h:153
RoR::GUI::TopMenubar::LoadBundledAiPresets
void LoadBundledAiPresets(TerrainPtr terrain)
Loads JSON files from [AI Presets] section in .terrn2 file format.
Definition: GUI_TopMenubar.cpp:2523
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:165
GUIManager.h
RoR::CreateProjectRequest::cpr_source_entry
CacheEntryPtr cpr_source_entry
The original mod to copy files from.
Definition: CacheSystem.h:211
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:209
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:283
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:2687
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:812
RoR::ActorManager::SendAllActorsSleeping
void SendAllActorsSleeping()
Definition: ActorManager.cpp:797
RoR::Terrain::getTerrainFileName
std::string getTerrainFileName()
Definition: Terrain.cpp:552
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:150
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::TuneupDef::isVideoCameraRoleForced
bool isVideoCameraRoleForced(VideoCameraID_t camera_id, VideoCamRole &out_val) const
Definition: TuneupFileFormat.cpp:144
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:870
RoR::Actor::getReplay
Replay * getReplay()
Definition: Actor.cpp:4515
RoR::EV_TRUCK_STEER_LEFT
@ EV_TRUCK_STEER_LEFT
steer left
Definition: InputEngine.h:359
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:96
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:831
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:444
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::VideoCameraID_t
int VideoCameraID_t
Index into GfxActor::m_videocameras, use RoR::VIDEOCAMERAID_INVALID as empty value.
Definition: ForwardDeclarations.h:85
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:186
RoR::Actor::ar_flares
std::vector< flare_t > ar_flares
Definition: Actor.h:312
RoR::TuneupDef::isManagedMatForceRemoved
bool isManagedMatForceRemoved(const std::string &matname)
Definition: TuneupFileFormat.h:175
RoR::ActorModifyRequest
Definition: SimData.h:852
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:2738
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:137
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:829
RoR::CacheQueryResult
Definition: CacheSystem.h:147
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:240
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:237
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:459
RoR::IWater::SetWavesHeight
virtual void SetWavesHeight(float)
Definition: IWater.h:46
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:152
PlatformUtils.h
Platform-specific utilities. We use narrow UTF-8 encoded strings as paths. Inspired by http://utf8eve...
RoR::LT_Gadget
@ LT_Gadget
Definition: Application.h:325
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:262
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:163
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::VCAM_ROLE_MIRROR_NOFLIP
@ VCAM_ROLE_MIRROR_NOFLIP
Same as VCAM_ROLE_MIRROR, but without flipping the texture horizontally (expects texcoords to be alre...
Definition: Application.h:380
RoR::ModifyProjectRequest::mpr_target_actor
ActorPtr mpr_target_actor
Definition: CacheSystem.h:254
Application.h
Central state/object manager and communications hub.
RoR::App::GetConsole
Console * GetConsole()
Definition: Application.cpp:274
RoR::VCAM_ROLE_MIRROR
@ VCAM_ROLE_MIRROR
Flips the video output and when not in driver cam, acts like a natural mirror, not a screen.
Definition: Application.h:379
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:699
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:284
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::VCAM_ROLE_MIRROR_PROP_RIGHT
@ VCAM_ROLE_MIRROR_PROP_RIGHT
The classic 'special prop/rear view mirror'.
Definition: Application.h:387
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:129
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:2592
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:266
RoR::VideoCamera
An Ogre::Camera mounted on the actor and rendering into either in-scene texture or external window.
Definition: GfxData.h:221
RoR::ActorSpawnRequest::asr_skin_entry
CacheEntryPtr asr_skin_entry
Definition: SimData.h:835
RoR::VCAM_ROLE_TRACKING_MIRROR
@ VCAM_ROLE_TRACKING_MIRROR
A MIRROR(1) with tracking node set.
Definition: Application.h:383
RoR::ActorSB::simbuf_pos
Ogre::Vector3 simbuf_pos
Definition: SimBuffers.h:123
RoR::LoadScriptRequest
Definition: ScriptEngine.h:92
RoR::ModifyProjectRequest::mpr_value_int
int mpr_value_int
Definition: CacheSystem.h:260
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:173
RoR::Message::description
std::string description
Definition: GameContext.h:58
RoR::Actor::getUsedActorEntry
CacheEntryPtr & getUsedActorEntry()
The actor entry itself.
Definition: Actor.cpp:4663
_LC
#define _LC(ctx, str)
Definition: Language.h:38
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:2571
RoR::ModifyProjectRequestType::TUNEUP_FORCEREMOVE_FLARE_SET
@ TUNEUP_FORCEREMOVE_FLARE_SET
'subject_id' is flare ID.
RoR::CacheQuery::resetResults
void resetResults()
Definition: CacheSystem.h:180
RoR::Network::GetPlayerColor
Ogre::ColourValue GetPlayerColor(int color_num)
Definition: Network.cpp:94
RoR::ModifyProjectRequest
Definition: CacheSystem.h:252
RoR::CreateProjectRequest
Creates subdirectory in 'My Games\Rigs of Rods\projects', pre-populates it with files and adds modcac...
Definition: CacheSystem.h:204
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::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:212
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:276
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: Application.h:341
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:296
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:169
RoR::VideoCamRole
VideoCamRole
Definition: Application.h:373
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:360
RoR::Actor::getUsedSkinEntry
CacheEntryPtr & getUsedSkinEntry()
Definition: Actor.cpp:4668
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:2796
RoR::GfxActor::getProps
std::vector< Prop > & getProps()
Definition: GfxActor.h:72
RoR::CreateProjectRequest::cpr_overwrite
bool cpr_overwrite
Definition: CacheSystem.h:214
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:367
RoR::ActorSpawnRequest::asr_debugview
int asr_debugview
Definition: SimData.h:839
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:230
RoR::TuneupDef::isFlareProtected
bool isFlareProtected(FlareID_t flareid) const
Definition: TuneupFileFormat.h:154
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:333
RoR::App::GetInputEngine
InputEngine * GetInputEngine()
Definition: Application.cpp:275
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:174
RoR::ModifyProjectRequestType::TUNEUP_PROTECTED_WHEEL_SET
@ TUNEUP_PROTECTED_WHEEL_SET
'subject_id' is wheel ID.
RoR::ActorPtr
RefCountingObjectPtr< Actor > ActorPtr
Definition: ForwardDeclarations.h:225
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:136
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:171
RoR::CVar::getFloat
float getFloat() const
Definition: CVar.h:96
RoR::ModifyProjectRequestType::TUNEUP_FORCED_VCAM_ROLE_SET
@ TUNEUP_FORCED_VCAM_ROLE_SET
'subject_id' is video camera ID, 'value_int' is RoR::VideoCamRole
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:2178
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:145
RoR::TuneupDef::isExhaustProtected
bool isExhaustProtected(ExhaustID_t exhaustid) const
Definition: TuneupFileFormat.h:155
RoR::TuneupDef::isFlexbodyUnwanted
bool isFlexbodyUnwanted(FlexbodyID_t flexbodyid)
Definition: TuneupFileFormat.h:162
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::ScriptEngine::loadScript
ScriptUnitID_t loadScript(Ogre::String filename, ScriptCategory category=ScriptCategory::TERRAIN, ActorPtr associatedActor=nullptr, std::string buffer="")
Loads a script.
Definition: ScriptEngine.cpp:828
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:832
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:130
RoR::ActorManager::WakeUpAllActors
void WakeUpAllActors()
Definition: ActorManager.cpp:785
RoR::ModifyProjectRequest::mpr_type
ModifyProjectRequestType mpr_type
Definition: CacheSystem.h:255
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:170
RoR::GUI::TopMenubar::ai_select2
bool ai_select2
Definition: GUI_TopMenubar.h:88
RoR::events
events
Definition: InputEngine.h:73
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:464
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:96
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:170
RoR::ActorModifyRequest::amr_type
Type amr_type
Definition: SimData.h:871
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:172
RoR::ActorSpawnRequest::asr_rotation
Ogre::Quaternion asr_rotation
Definition: SimData.h:833
RoR::CameraManager::CAMERA_BEHAVIOR_VEHICLE_CINECAM
@ CAMERA_BEHAVIOR_VEHICLE_CINECAM
Definition: CameraManager.h:50
RoR::Actor::getWorkingTuneupDef
TuneupDefPtr & getWorkingTuneupDef()
Definition: Actor.cpp:4673
RoR::GfxActor::GetSimDataBuffer
ActorSB & GetSimDataBuffer()
Definition: GfxActor.h:128
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:2213
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:423
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:165
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:280
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:305
RoR::Actor::ar_managed_materials
std::map< std::string, Ogre::MaterialPtr > ar_managed_materials
Definition: Actor.h:327
RoR::CacheQuery::cqy_results
std::vector< CacheQueryResult > cqy_results
Definition: CacheSystem.h:176
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::VCAM_ROLE_MIRROR_PROP_LEFT
@ VCAM_ROLE_MIRROR_PROP_LEFT
The classic 'special prop/rear view mirror'.
Definition: Application.h:386
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:86
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:2108
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