mirror of
https://github.com/hedge-dev/UnleashedRecomp
synced 2026-08-31 18:02:51 -04:00
options_menu: implemented thumbnails
This commit is contained in:
@@ -627,9 +627,9 @@ void AchievementMenu::Init()
|
||||
g_fntNewRodinDB = ImFontAtlasSnapshot::GetFont("FOT-NewRodinPro-DB.otf", 20.0f * FONT_SCALE);
|
||||
g_fntNewRodinUB = ImFontAtlasSnapshot::GetFont("FOT-NewRodinPro-UB.otf", 20.0f * FONT_SCALE);
|
||||
|
||||
g_upTrophyIcon = LoadTexture(decompressZstd(g_trophy, g_trophy_uncompressed_size).get(), g_trophy_uncompressed_size);
|
||||
g_upSelectionCursor = LoadTexture(decompressZstd(g_select_fill, g_select_fill_uncompressed_size).get(), g_select_fill_uncompressed_size);
|
||||
g_upWindow = LoadTexture(decompressZstd(g_general_window, g_general_window_uncompressed_size).get(), g_general_window_uncompressed_size);
|
||||
g_upTrophyIcon = LOAD_ZSTD_TEXTURE(g_trophy);
|
||||
g_upSelectionCursor = LOAD_ZSTD_TEXTURE(g_select_fill);
|
||||
g_upWindow = LOAD_ZSTD_TEXTURE(g_general_window);
|
||||
}
|
||||
|
||||
void AchievementMenu::Draw()
|
||||
|
||||
@@ -80,7 +80,7 @@ void AchievementOverlay::Init()
|
||||
|
||||
g_fntSeurat = ImFontAtlasSnapshot::GetFont("FOT-SeuratPro-M.otf", 24.0f * FONT_SCALE);
|
||||
|
||||
g_upWindow = LoadTexture(decompressZstd(g_general_window, g_general_window_uncompressed_size).get(), g_general_window_uncompressed_size);
|
||||
g_upWindow = LOAD_ZSTD_TEXTURE(g_general_window);
|
||||
}
|
||||
|
||||
void AchievementOverlay::Draw()
|
||||
|
||||
@@ -218,13 +218,8 @@ void ButtonGuide::Init()
|
||||
g_fntNewRodin = ImFontAtlasSnapshot::GetFont("FOT-NewRodinPro-M.otf", 24.0f * FONT_SCALE);
|
||||
g_fntNewRodinLQ = ImFontAtlasSnapshot::GetFont("FOT-NewRodinPro-M.otf", 19.0f);
|
||||
|
||||
g_upControllerIcons = LoadTexture(
|
||||
decompressZstd(g_controller, g_controller_uncompressed_size).get(),
|
||||
g_controller_uncompressed_size);
|
||||
|
||||
g_upKBMIcons = LoadTexture(
|
||||
decompressZstd(g_kbm, g_kbm_uncompressed_size).get(),
|
||||
g_kbm_uncompressed_size);
|
||||
g_upControllerIcons = LOAD_ZSTD_TEXTURE(g_controller);
|
||||
g_upKBMIcons = LOAD_ZSTD_TEXTURE(g_kbm);
|
||||
}
|
||||
|
||||
void ButtonGuide::Draw()
|
||||
|
||||
@@ -1338,17 +1338,17 @@ void InstallerWizard::Init()
|
||||
g_seuratFont = ImFontAtlasSnapshot::GetFont("FOT-SeuratPro-M.otf", 24.0f * FONT_SCALE);
|
||||
g_dfsogeistdFont = ImFontAtlasSnapshot::GetFont("DFSoGeiStd-W7.otf", 48.0f * FONT_SCALE);
|
||||
g_newRodinFont = ImFontAtlasSnapshot::GetFont("FOT-NewRodinPro-DB.otf", 20.0f * FONT_SCALE);
|
||||
g_installTextures[0] = LoadTexture(decompressZstd(g_install_001, g_install_001_uncompressed_size).get(), g_install_001_uncompressed_size);
|
||||
g_installTextures[1] = LoadTexture(decompressZstd(g_install_002, g_install_002_uncompressed_size).get(), g_install_002_uncompressed_size);
|
||||
g_installTextures[2] = LoadTexture(decompressZstd(g_install_003, g_install_003_uncompressed_size).get(), g_install_003_uncompressed_size);
|
||||
g_installTextures[3] = LoadTexture(decompressZstd(g_install_004, g_install_004_uncompressed_size).get(), g_install_004_uncompressed_size);
|
||||
g_installTextures[4] = LoadTexture(decompressZstd(g_install_005, g_install_005_uncompressed_size).get(), g_install_005_uncompressed_size);
|
||||
g_installTextures[5] = LoadTexture(decompressZstd(g_install_006, g_install_006_uncompressed_size).get(), g_install_006_uncompressed_size);
|
||||
g_installTextures[6] = LoadTexture(decompressZstd(g_install_007, g_install_007_uncompressed_size).get(), g_install_007_uncompressed_size);
|
||||
g_installTextures[7] = LoadTexture(decompressZstd(g_install_008, g_install_008_uncompressed_size).get(), g_install_008_uncompressed_size);
|
||||
g_milesElectricIcon = LoadTexture(decompressZstd(g_miles_electric_icon, g_miles_electric_icon_uncompressed_size).get(), g_miles_electric_icon_uncompressed_size);
|
||||
g_arrowCircle = LoadTexture(decompressZstd(g_arrow_circle, g_arrow_circle_uncompressed_size).get(), g_arrow_circle_uncompressed_size);
|
||||
g_pulseInstall = LoadTexture(decompressZstd(g_pulse_install, g_pulse_install_uncompressed_size).get(), g_pulse_install_uncompressed_size);
|
||||
g_installTextures[0] = LOAD_ZSTD_TEXTURE(g_install_001);
|
||||
g_installTextures[1] = LOAD_ZSTD_TEXTURE(g_install_002);
|
||||
g_installTextures[2] = LOAD_ZSTD_TEXTURE(g_install_003);
|
||||
g_installTextures[3] = LOAD_ZSTD_TEXTURE(g_install_004);
|
||||
g_installTextures[4] = LOAD_ZSTD_TEXTURE(g_install_005);
|
||||
g_installTextures[5] = LOAD_ZSTD_TEXTURE(g_install_006);
|
||||
g_installTextures[6] = LOAD_ZSTD_TEXTURE(g_install_007);
|
||||
g_installTextures[7] = LOAD_ZSTD_TEXTURE(g_install_008);
|
||||
g_milesElectricIcon = LOAD_ZSTD_TEXTURE(g_miles_electric_icon);
|
||||
g_arrowCircle = LOAD_ZSTD_TEXTURE(g_arrow_circle);
|
||||
g_pulseInstall = LOAD_ZSTD_TEXTURE(g_pulse_install);
|
||||
}
|
||||
|
||||
void InstallerWizard::Draw()
|
||||
|
||||
@@ -260,11 +260,8 @@ void MessageWindow::Init()
|
||||
|
||||
g_fntSeurat = ImFontAtlasSnapshot::GetFont("FOT-SeuratPro-M.otf", 24.0f * FONT_SCALE);
|
||||
|
||||
g_upSelectionCursor = LoadTexture(decompressZstd(g_select_fade,
|
||||
g_select_fade_uncompressed_size).get(), g_select_fade_uncompressed_size);
|
||||
|
||||
g_upWindow = LoadTexture(decompressZstd(g_general_window,
|
||||
g_general_window_uncompressed_size).get(), g_general_window_uncompressed_size);
|
||||
g_upSelectionCursor = LOAD_ZSTD_TEXTURE(g_select_fade);
|
||||
g_upWindow = LOAD_ZSTD_TEXTURE(g_general_window);
|
||||
}
|
||||
|
||||
void MessageWindow::Draw()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "options_menu.h"
|
||||
#include "options_menu_thumbnails.h"
|
||||
#include "imgui_utils.h"
|
||||
#include "window.h"
|
||||
#include "exports.h"
|
||||
@@ -939,13 +940,12 @@ static void DrawInfoPanel()
|
||||
|
||||
ImVec2 thumbnailMax = { clipRectMin.x + ScaleX(343.0f), clipRectMin.y + ScaleY(198.0f) };
|
||||
|
||||
// Thumbnail box
|
||||
drawList->AddRectFilled(clipRectMin, thumbnailMax, IM_COL32(0, 0, 0, 255));
|
||||
|
||||
if (g_selectedItem)
|
||||
{
|
||||
auto desc = g_selectedItem->GetDescription();
|
||||
|
||||
drawList->AddImage(GetThumbnail(g_selectedItem->GetName()), clipRectMin, thumbnailMax);
|
||||
|
||||
if (g_inaccessibleReason)
|
||||
{
|
||||
desc = *g_inaccessibleReason;
|
||||
@@ -995,6 +995,8 @@ void OptionsMenu::Init()
|
||||
g_seuratFont = ImFontAtlasSnapshot::GetFont("FOT-SeuratPro-M.otf", 24.0f * FONT_SCALE);
|
||||
g_dfsogeistdFont = ImFontAtlasSnapshot::GetFont("DFSoGeiStd-W7.otf", 48.0f * FONT_SCALE);
|
||||
g_newRodinFont = ImFontAtlasSnapshot::GetFont("FOT-NewRodinPro-DB.otf", 20.0f * FONT_SCALE);
|
||||
|
||||
LoadThumbnails();
|
||||
}
|
||||
|
||||
void OptionsMenu::Draw()
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
#pragma once
|
||||
|
||||
#include <gpu/video.h>
|
||||
#include <user/config.h>
|
||||
#include <decompressor.h>
|
||||
|
||||
#include <res/images/options_menu/thumbnails/achievement_notifications.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/allow_background_input.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/antialiasing.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/aspect_ratio.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/battle_theme.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/brightness.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/control_tutorial.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/controller_icons.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/effects_volume.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/fps.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/fullscreen.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/gi_texture_filtering.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/hints.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/invert_camera_x.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/invert_camera_y.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/language.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/monitor.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/motion_blur.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/movie_scale_mode.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/music_attenuation.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/music_volume.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/resolution_scale.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/shadow_resolution.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/subtitles.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/time_of_day_transition.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/transparency_antialiasing.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/ui_scale_mode.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/voice_language.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/vsync.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/window_size.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/xbox_color_correction.dds.h>
|
||||
|
||||
static std::unordered_map<std::string_view, std::unique_ptr<GuestTexture>> g_thumbnails;
|
||||
|
||||
static void LoadThumbnails()
|
||||
{
|
||||
g_thumbnails[Config::Language.Name] = LOAD_ZSTD_TEXTURE(g_language);
|
||||
g_thumbnails[Config::Hints.Name] = LOAD_ZSTD_TEXTURE(g_hints);
|
||||
g_thumbnails[Config::ControlTutorial.Name] = LOAD_ZSTD_TEXTURE(g_control_tutorial);
|
||||
g_thumbnails[Config::AchievementNotifications.Name] = LOAD_ZSTD_TEXTURE(g_achievement_notifications);
|
||||
g_thumbnails[Config::TimeOfDayTransition.Name] = LOAD_ZSTD_TEXTURE(g_time_of_day_transition);
|
||||
g_thumbnails[Config::InvertCameraX.Name] = LOAD_ZSTD_TEXTURE(g_invert_camera_x);
|
||||
g_thumbnails[Config::InvertCameraY.Name] = LOAD_ZSTD_TEXTURE(g_invert_camera_y);
|
||||
g_thumbnails[Config::AllowBackgroundInput.Name] = LOAD_ZSTD_TEXTURE(g_allow_background_input);
|
||||
g_thumbnails[Config::ControllerIcons.Name] = LOAD_ZSTD_TEXTURE(g_controller_icons);
|
||||
g_thumbnails[Config::MusicVolume.Name] = LOAD_ZSTD_TEXTURE(g_music_volume);
|
||||
g_thumbnails[Config::EffectsVolume.Name] = LOAD_ZSTD_TEXTURE(g_effects_volume);
|
||||
g_thumbnails[Config::VoiceLanguage.Name] = LOAD_ZSTD_TEXTURE(g_voice_language);
|
||||
g_thumbnails[Config::Subtitles.Name] = LOAD_ZSTD_TEXTURE(g_subtitles);
|
||||
g_thumbnails[Config::MusicAttenuation.Name] = LOAD_ZSTD_TEXTURE(g_music_attenuation);
|
||||
g_thumbnails[Config::BattleTheme.Name] = LOAD_ZSTD_TEXTURE(g_battle_theme);
|
||||
g_thumbnails["WindowSize"] = LOAD_ZSTD_TEXTURE(g_window_size);
|
||||
g_thumbnails["Monitor"] = LOAD_ZSTD_TEXTURE(g_monitor);
|
||||
g_thumbnails[Config::AspectRatio.Name] = LOAD_ZSTD_TEXTURE(g_aspect_ratio);
|
||||
g_thumbnails[Config::ResolutionScale.Name] = LOAD_ZSTD_TEXTURE(g_resolution_scale);
|
||||
g_thumbnails[Config::Fullscreen.Name] = LOAD_ZSTD_TEXTURE(g_fullscreen);
|
||||
g_thumbnails[Config::VSync.Name] = LOAD_ZSTD_TEXTURE(g_vsync);
|
||||
g_thumbnails[Config::FPS.Name] = LOAD_ZSTD_TEXTURE(g_fps);
|
||||
g_thumbnails[Config::Brightness.Name] = LOAD_ZSTD_TEXTURE(g_brightness);
|
||||
g_thumbnails[Config::AntiAliasing.Name] = LOAD_ZSTD_TEXTURE(g_antialiasing);
|
||||
g_thumbnails[Config::TransparencyAntiAliasing.Name] = LOAD_ZSTD_TEXTURE(g_transparency_antialiasing);
|
||||
g_thumbnails[Config::ShadowResolution.Name] = LOAD_ZSTD_TEXTURE(g_shadow_resolution);
|
||||
g_thumbnails[Config::GITextureFiltering.Name] = LOAD_ZSTD_TEXTURE(g_gi_texture_filtering);
|
||||
g_thumbnails[Config::MotionBlur.Name] = LOAD_ZSTD_TEXTURE(g_motion_blur);
|
||||
g_thumbnails[Config::XboxColourCorrection.Name] = LOAD_ZSTD_TEXTURE(g_xbox_color_correction);
|
||||
g_thumbnails[Config::MovieScaleMode.Name] = LOAD_ZSTD_TEXTURE(g_movie_scale_mode);
|
||||
g_thumbnails[Config::UIScaleMode.Name] = LOAD_ZSTD_TEXTURE(g_ui_scale_mode);
|
||||
}
|
||||
|
||||
static GuestTexture* GetThumbnail(const std::string_view name)
|
||||
{
|
||||
if (!g_thumbnails.count(name))
|
||||
return nullptr;
|
||||
|
||||
return g_thumbnails[name].get();
|
||||
}
|
||||
Reference in New Issue
Block a user