248 using namespace Ogre;
249 FileInfoListPtr files = ResourceGroupManager::getSingleton().findResourceFileInfo(
"Wallpapers",
"*.jpg",
false);
250 if (!files || files->empty())
252 files = ResourceGroupManager::getSingleton().findResourceFileInfo(
"Wallpapers",
"*.png",
false);
254 srand ( time(NULL) );
257 for (
int i = 0; i<Math::RangeRandom(0, 10); i++)
258 num = Math::RangeRandom(0, files->size());
262 Ogre::ResourceManager::ResourceCreateOrRetrieveResult wp_tex_result
263 = Ogre::TextureManager::getSingleton().createOrRetrieve(files->at(num).filename,
"Wallpapers");
264 Ogre::TexturePtr wp_tex = Ogre::static_pointer_cast<Ogre::Texture>(wp_tex_result.first);
266 Ogre::MaterialPtr wp_mat = Ogre::MaterialManager::getSingleton().create(
"rigsofrods/WallpaperMat", Ogre::RGN_DEFAULT);
267 Ogre::TextureUnitState* wp_tus = wp_mat->getTechnique(0)->getPass(0)->createTextureUnitState();
268 wp_tus->setTexture(wp_tex);
271 Ogre::OverlayElement* wp_panel = Ogre::OverlayManager::getSingleton()
272 .createOverlayElement(
"Panel",
"rigsofrods/WallpaperPanel",
false);
273 wp_panel->setMaterial(wp_mat);
274 wp_panel->setDimensions(1.f, 1.f);
276 this->
MenuWallpaper = Ogre::OverlayManager::getSingleton().create(
"rigsofrods/WallpaperOverlay");
277 this->
MenuWallpaper->add2D(
static_cast<Ogre::OverlayContainer*
>(wp_panel));
379 ImGuiStyle& style = ImGui::GetStyle();
380 style = ImGuiStyle();
382 style.Colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f);
383 style.Colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f);
384 style.Colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.06f, 0.06f, 0.90f);
385 style.Colors[ImGuiCol_ChildWindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.1f);
386 style.Colors[ImGuiCol_PopupBg] = ImVec4(0.05f, 0.05f, 0.10f, 0.90f);
387 style.Colors[ImGuiCol_Border] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
388 style.Colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.90f);
389 style.Colors[ImGuiCol_FrameBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
390 style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
391 style.Colors[ImGuiCol_FrameBgActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
392 style.Colors[ImGuiCol_TitleBg] = ImVec4(0.11f, 0.33f, 0.49f, 1.00f);
393 style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.13f, 0.40f, 0.60f, 1.00f);
394 style.Colors[ImGuiCol_TitleBgActive] = ImVec4(0.13f, 0.40f, 0.60f, 1.00f);
395 style.Colors[ImGuiCol_MenuBarBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
396 style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.16f, 0.16f, 0.16f, 0.90f);
397 style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.30f, 0.30f, 0.29f, 0.90f);
398 style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
399 style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
400 style.Colors[ImGuiCol_CheckMark] = ImVec4(0.90f, 0.90f, 0.90f, 0.90f);
401 style.Colors[ImGuiCol_SliderGrab] = ImVec4(0.39f, 0.39f, 0.39f, 0.90f);
402 style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
403 style.Colors[ImGuiCol_Button] = ImVec4(0.26f, 0.26f, 0.25f, 0.90f);
404 style.Colors[ImGuiCol_ButtonHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
405 style.Colors[ImGuiCol_ButtonActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
406 style.Colors[ImGuiCol_Header] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
407 style.Colors[ImGuiCol_HeaderHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
408 style.Colors[ImGuiCol_HeaderActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
409 style.Colors[ImGuiCol_ResizeGrip] = ImVec4(0.22f, 0.22f, 0.21f, 0.90f);
410 style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
411 style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
412 style.Colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 1.00f, 1.00f, 0.90f);
413 style.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
414 style.Colors[ImGuiCol_PlotHistogram] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
415 style.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
416 style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 0.00f, 1.00f, 0.90f);
417 style.Colors[ImGuiCol_ModalWindowDarkening] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
419 style.WindowPadding = ImVec2(10.f, 10.f);
420 style.FrameRounding = 2.f;
421 style.WindowRounding = 4.f;
422 style.WindowTitleAlign = ImVec2(0.5f, 0.5f);
423 style.ItemSpacing = ImVec2(5.f, 5.f);
424 style.GrabRounding = 3.f;
425 style.WindowBorderSize = 0.f;
430 const float font_size = ImGui::GetIO().Fonts->Fonts[0]->FontSize;
System integration layer; inspired by OgreBites::ApplicationContext.
Game state manager and message-queue provider.