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