44 #include <OgreOverlayElement.h>
45 #include <OgreOverlayContainer.h>
46 #include <OgreOverlayManager.h>
48 #define RESOURCE_FILENAME "MyGUI_Core.xml"
56 {
"gfx_surveymap_icons", {
"true",
"true",
"true",
"false"} },
57 {
"gfx_declutter_map", {
"false",
"true",
"false",
"true"} },
58 {
"ui_show_live_repair_controls", {
"true",
"false",
"false",
"false"} },
67 auto mygui_platform =
new MyGUI::OgrePlatform();
68 mygui_platform->initialise(
71 Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME,
73 auto mygui =
new MyGUI::Gui();
76 mygui->initialise(
"");
79 MyGUI::FactoryManager::getInstance().registerFactory<
MyGUI::RTTLayer>(
"Layer");
84 MyGUI::ResourceManager::getInstance().load(
"MyGUI_FontsEnglish.xml");
88 MyGUI::PointerManager::getInstance().setVisible(
false);
131 !this->GameControls.IsHovered() &&
132 !this->FrictionSettings.IsHovered() &&
133 !this->TextureToolWindow.IsHovered() &&
134 !this->NodeBeamUtils.IsHovered() &&
135 !this->CollisionsDebug.IsHovered() &&
136 !this->MainSelector.IsHovered() &&
137 !this->SurveyMap.IsHovered() &&
138 !this->FlexbodyDebug.IsHovered());
234 _result = MyGUI::LanguageManager::getInstance().getTag(_tag);
240 using namespace Ogre;
241 FileInfoListPtr
files = ResourceGroupManager::getSingleton().findResourceFileInfo(
"Wallpapers",
"*.jpg",
false);
244 files = ResourceGroupManager::getSingleton().findResourceFileInfo(
"Wallpapers",
"*.png",
false);
246 srand ( time(NULL) );
249 for (
int i = 0; i<Math::RangeRandom(0, 10); i++)
250 num = Math::RangeRandom(0,
files->size());
254 Ogre::ResourceManager::ResourceCreateOrRetrieveResult wp_tex_result
255 = Ogre::TextureManager::getSingleton().createOrRetrieve(
files->at(num).filename,
"Wallpapers");
256 Ogre::TexturePtr wp_tex = wp_tex_result.first.staticCast<Ogre::Texture>();
258 Ogre::MaterialPtr wp_mat = Ogre::MaterialManager::getSingleton().create(
"rigsofrods/WallpaperMat", Ogre::RGN_DEFAULT);
259 Ogre::TextureUnitState* wp_tus = wp_mat->getTechnique(0)->getPass(0)->createTextureUnitState();
260 wp_tus->setTexture(wp_tex);
263 Ogre::OverlayElement* wp_panel = Ogre::OverlayManager::getSingleton()
264 .createOverlayElement(
"Panel",
"rigsofrods/WallpaperPanel",
false);
265 wp_panel->setMaterial(wp_mat);
266 wp_panel->setDimensions(1.f, 1.f);
268 this->
MenuWallpaper = Ogre::OverlayManager::getSingleton().create(
"rigsofrods/WallpaperOverlay");
269 this->
MenuWallpaper->add2D(
static_cast<Ogre::OverlayContainer*
>(wp_panel));
295 ImGui::GetIO().MouseDrawCursor =
true;
300 ImGui::GetIO().MouseDrawCursor =
false;
304 ImGui::GetIO().MouseDrawCursor =
false;
320 ImGuiIO& io = ImGui::GetIO();
324 io.KeyCtrl = kb->isKeyDown(OIS::KC_LCONTROL);
326 io.KeyAlt = kb->isKeyDown(OIS::KC_LMENU);
331 ev.timeSinceLastFrame = dt;
342 ImGuiStyle& style = ImGui::GetStyle();
343 style.Colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f);
344 style.Colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f);
345 style.Colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.06f, 0.06f, 0.90f);
346 style.Colors[ImGuiCol_ChildWindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.1f);
347 style.Colors[ImGuiCol_PopupBg] = ImVec4(0.05f, 0.05f, 0.10f, 0.90f);
348 style.Colors[ImGuiCol_Border] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
349 style.Colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.90f);
350 style.Colors[ImGuiCol_FrameBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
351 style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
352 style.Colors[ImGuiCol_FrameBgActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
353 style.Colors[ImGuiCol_TitleBg] = ImVec4(0.11f, 0.33f, 0.49f, 1.00f);
354 style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.13f, 0.40f, 0.60f, 1.00f);
355 style.Colors[ImGuiCol_TitleBgActive] = ImVec4(0.13f, 0.40f, 0.60f, 1.00f);
356 style.Colors[ImGuiCol_MenuBarBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
357 style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.16f, 0.16f, 0.16f, 0.90f);
358 style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.30f, 0.30f, 0.29f, 0.90f);
359 style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
360 style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
361 style.Colors[ImGuiCol_CheckMark] = ImVec4(0.90f, 0.90f, 0.90f, 0.90f);
362 style.Colors[ImGuiCol_SliderGrab] = ImVec4(0.39f, 0.39f, 0.39f, 0.90f);
363 style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
364 style.Colors[ImGuiCol_Button] = ImVec4(0.26f, 0.26f, 0.25f, 0.90f);
365 style.Colors[ImGuiCol_ButtonHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
366 style.Colors[ImGuiCol_ButtonActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
367 style.Colors[ImGuiCol_Header] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
368 style.Colors[ImGuiCol_HeaderHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
369 style.Colors[ImGuiCol_HeaderActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
370 style.Colors[ImGuiCol_ResizeGrip] = ImVec4(0.22f, 0.22f, 0.21f, 0.90f);
371 style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
372 style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
373 style.Colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 1.00f, 1.00f, 0.90f);
374 style.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
375 style.Colors[ImGuiCol_PlotHistogram] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
376 style.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
377 style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 0.00f, 1.00f, 0.90f);
378 style.Colors[ImGuiCol_ModalWindowDarkening] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
380 style.WindowPadding = ImVec2(10.f, 10.f);
381 style.FrameRounding = 2.f;
382 style.WindowRounding = 4.f;
383 style.WindowTitleAlign = ImVec2(0.5f, 0.5f);
384 style.ItemSpacing = ImVec2(5.f, 5.f);
385 style.GrabRounding = 3.f;
386 style.WindowBorderSize = 0.f;