44 #include <OgreOverlayElement.h>
45 #include <OgreOverlayContainer.h>
46 #include <OgreOverlayManager.h>
48 #define RESOURCE_FILENAME "MyGUI_Core.xml"
55 auto mygui_platform =
new MyGUI::OgrePlatform();
56 mygui_platform->initialise(
59 Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME,
61 auto mygui =
new MyGUI::Gui();
64 mygui->initialise(
"");
67 MyGUI::FactoryManager::getInstance().registerFactory<
MyGUI::RTTLayer>(
"Layer");
72 MyGUI::ResourceManager::getInstance().load(
"MyGUI_FontsEnglish.xml");
76 MyGUI::PointerManager::getInstance().setVisible(
false);
119 !this->GameControls.IsHovered() &&
120 !this->FrictionSettings.IsHovered() &&
121 !this->TextureToolWindow.IsHovered() &&
122 !this->NodeBeamUtils.IsHovered() &&
123 !this->CollisionsDebug.IsHovered() &&
124 !this->MainSelector.IsHovered() &&
125 !this->SurveyMap.IsHovered() &&
126 !this->FlexbodyDebug.IsHovered());
209 _result = MyGUI::LanguageManager::getInstance().getTag(_tag);
215 using namespace Ogre;
216 FileInfoListPtr
files = ResourceGroupManager::getSingleton().findResourceFileInfo(
"Wallpapers",
"*.jpg",
false);
219 files = ResourceGroupManager::getSingleton().findResourceFileInfo(
"Wallpapers",
"*.png",
false);
221 srand ( time(NULL) );
224 for (
int i = 0; i<Math::RangeRandom(0, 10); i++)
225 num = Math::RangeRandom(0,
files->size());
229 Ogre::ResourceManager::ResourceCreateOrRetrieveResult wp_tex_result
230 = Ogre::TextureManager::getSingleton().createOrRetrieve(
files->at(num).filename,
"Wallpapers");
231 Ogre::TexturePtr wp_tex = wp_tex_result.first.staticCast<Ogre::Texture>();
233 Ogre::MaterialPtr wp_mat = Ogre::MaterialManager::getSingleton().create(
"rigsofrods/WallpaperMat", Ogre::RGN_DEFAULT);
234 Ogre::TextureUnitState* wp_tus = wp_mat->getTechnique(0)->getPass(0)->createTextureUnitState();
235 wp_tus->setTexture(wp_tex);
238 Ogre::OverlayElement* wp_panel = Ogre::OverlayManager::getSingleton()
239 .createOverlayElement(
"Panel",
"rigsofrods/WallpaperPanel",
false);
240 wp_panel->setMaterial(wp_mat);
241 wp_panel->setDimensions(1.f, 1.f);
243 this->
MenuWallpaper = Ogre::OverlayManager::getSingleton().create(
"rigsofrods/WallpaperOverlay");
244 this->
MenuWallpaper->add2D(
static_cast<Ogre::OverlayContainer*
>(wp_panel));
270 ImGui::GetIO().MouseDrawCursor =
true;
275 ImGui::GetIO().MouseDrawCursor =
false;
279 ImGui::GetIO().MouseDrawCursor =
false;
295 ImGuiIO& io = ImGui::GetIO();
299 io.KeyCtrl = kb->isKeyDown(OIS::KC_LCONTROL);
301 io.KeyAlt = kb->isKeyDown(OIS::KC_LMENU);
306 ev.timeSinceLastFrame = dt;
317 ImGuiStyle& style = ImGui::GetStyle();
318 style.Colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f);
319 style.Colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f);
320 style.Colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.06f, 0.06f, 0.90f);
321 style.Colors[ImGuiCol_ChildWindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.1f);
322 style.Colors[ImGuiCol_PopupBg] = ImVec4(0.05f, 0.05f, 0.10f, 0.90f);
323 style.Colors[ImGuiCol_Border] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
324 style.Colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.90f);
325 style.Colors[ImGuiCol_FrameBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
326 style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
327 style.Colors[ImGuiCol_FrameBgActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
328 style.Colors[ImGuiCol_TitleBg] = ImVec4(0.11f, 0.33f, 0.49f, 1.00f);
329 style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.13f, 0.40f, 0.60f, 1.00f);
330 style.Colors[ImGuiCol_TitleBgActive] = ImVec4(0.13f, 0.40f, 0.60f, 1.00f);
331 style.Colors[ImGuiCol_MenuBarBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
332 style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.16f, 0.16f, 0.16f, 0.90f);
333 style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.30f, 0.30f, 0.29f, 0.90f);
334 style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
335 style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
336 style.Colors[ImGuiCol_CheckMark] = ImVec4(0.90f, 0.90f, 0.90f, 0.90f);
337 style.Colors[ImGuiCol_SliderGrab] = ImVec4(0.39f, 0.39f, 0.39f, 0.90f);
338 style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
339 style.Colors[ImGuiCol_Button] = ImVec4(0.26f, 0.26f, 0.25f, 0.90f);
340 style.Colors[ImGuiCol_ButtonHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
341 style.Colors[ImGuiCol_ButtonActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
342 style.Colors[ImGuiCol_Header] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
343 style.Colors[ImGuiCol_HeaderHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
344 style.Colors[ImGuiCol_HeaderActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
345 style.Colors[ImGuiCol_ResizeGrip] = ImVec4(0.22f, 0.22f, 0.21f, 0.90f);
346 style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
347 style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
348 style.Colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 1.00f, 1.00f, 0.90f);
349 style.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
350 style.Colors[ImGuiCol_PlotHistogram] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
351 style.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
352 style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 0.00f, 1.00f, 0.90f);
353 style.Colors[ImGuiCol_ModalWindowDarkening] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
355 style.WindowPadding = ImVec2(10.f, 10.f);
356 style.FrameRounding = 2.f;
357 style.WindowRounding = 4.f;
358 style.WindowTitleAlign = ImVec2(0.5f, 0.5f);
359 style.ItemSpacing = ImVec2(5.f, 5.f);
360 style.GrabRounding = 3.f;
361 style.WindowBorderSize = 0.f;