Skip to content

Commit

Permalink
UI Alterations
Browse files Browse the repository at this point in the history
- Replaced the menu Icon with the Exploded PS2.
- Adjusted the Grid View.
- Changed the display of the FPS counter to something more simplified.
- Interlaced/Progressive now display as either i/p.
- Removed settings that aren't needed for UWP.
- Added a default Quick Menu hotkey and controller mappings.
  • Loading branch information
TheRhysWyrill committed Jul 9, 2023
1 parent 5429f21 commit 8c97906
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 28 deletions.
Binary file modified bin/resources/fullscreenui/media-cdrom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified bin/resources/icons/AppIconLarge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pcsx2/Counters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ const char* ReportVideoMode()
const char* ReportInterlaceMode()
{
const u64& smode2 = *(u64*)PS2GS_BASE(GS_SMODE2);
return !IsProgressiveVideoMode() ? ((smode2 & 2) ? "Interlaced (Frame)" : "Interlaced (Field)") : "Progressive";
return !IsProgressiveVideoMode() ? ((smode2 & 2) ? "i" : "i") : "p";
}

double GetVerticalFrequency()
Expand Down
45 changes: 28 additions & 17 deletions pcsx2/ImGui/FullscreenUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ void FullscreenUI::DrawLandingWindow()

if (BeginFullscreenColumnWindow(0.0f, -710.0f, "logo", UIPrimaryDarkColor))
{
const float image_size = LayoutScale(380.f);
const float image_size = LayoutScale(700.f);
ImGui::SetCursorPos(
ImVec2((ImGui::GetWindowWidth() * 0.5f) - (image_size * 0.5f), (ImGui::GetWindowHeight() * 0.5f) - (image_size * 0.5f)));
ImGui::Image(s_app_icon_texture->GetNativeHandle(), ImVec2(image_size, image_size));
Expand All @@ -1117,7 +1117,7 @@ void FullscreenUI::DrawLandingWindow()
{
ResetFocusHere();

BeginMenuButtons(6, 0.5f);
BeginMenuButtons(5, 0.5f);

if (MenuButton(ICON_FA_LIST " Game List", "Launch a game from images scanned from your game directories."))
{
Expand All @@ -1133,11 +1133,13 @@ void FullscreenUI::DrawLandingWindow()
{
DoStartBIOS();
}

#ifndef WINRT_XBOX
if (MenuButton(ICON_FA_COMPACT_DISC " Start Disc", "Start a game from a disc in your PC's DVD drive."))
{
DoStartDisc();
}
#endif // !WINRT_XBOX


if (MenuButton(ICON_FA_SLIDERS_H " Settings", "Change settings for the emulator."))
SwitchToSettings();
Expand All @@ -1149,18 +1151,21 @@ void FullscreenUI::DrawLandingWindow()

{
ImVec2 fullscreen_pos;
if (FloatingButton(ICON_FA_WINDOW_CLOSE, 0.0f, 0.0f, -1.0f, -1.0f, 1.0f, 0.0f, true, g_large_font, &fullscreen_pos))
DoRequestExit();

if (FloatingButton(ICON_FA_EXPAND, fullscreen_pos.x, 0.0f, -1.0f, -1.0f, -1.0f, 0.0f, true, g_large_font, &fullscreen_pos))
DoToggleFullscreen();

if (FloatingButton(
ICON_FA_QUESTION_CIRCLE, fullscreen_pos.x, 0.0f, -1.0f, -1.0f, -1.0f, 0.0f, true, g_large_font, &fullscreen_pos))
ICON_FA_QUESTION_CIRCLE, 0.0f, 0.0f, -1.0f, -1.0f, 1.0f, 0.0f, true, g_large_font, &fullscreen_pos))
OpenAboutWindow();

if (FloatingButton(ICON_FA_LIGHTBULB, fullscreen_pos.x, 0.0f, -1.0f, -1.0f, -1.0f, 0.0f, true, g_large_font, &fullscreen_pos))
ToggleTheme();

#ifndef WINRT_XBOX
if (FloatingButton(ICON_FA_WINDOW_CLOSE, fullscreen_pos.x, 0.0f, -1.0f, -1.0f, -1.0f, 0.0f, true, g_large_font, &fullscreen_pos))
DoRequestExit();

if (FloatingButton(ICON_FA_EXPAND, fullscreen_pos.x, 0.0f, -1.0f, -1.0f, -1.0f, 0.0f, true, g_large_font, &fullscreen_pos))
DoToggleFullscreen();
#endif // !WINRT_XBOX
}

EndMenuButtons();
Expand Down Expand Up @@ -2711,17 +2716,22 @@ void FullscreenUI::DrawInterfaceSettingsPage()

MenuHeading("Behaviour");

DrawToggleSetting(bsi, ICON_FA_MAGIC " Inhibit Screensaver",
"Prevents the screen saver from activating and the host from sleeping while emulation is running.", "EmuCore", "InhibitScreensaver",
true);

#ifdef WITH_DISCORD_PRESENCE
DrawToggleSetting(bsi, "Enable Discord Presence", "Shows the game you are currently playing as part of your profile on Discord.", "UI",
"DiscordPresence", false);
#endif
DrawToggleSetting(bsi, ICON_FA_PAUSE " Pause On Start", "Pauses the emulator when a game is started.", "UI", "StartPaused", false);

#ifndef WINRT_XBOX
DrawToggleSetting(bsi, ICON_FA_MAGIC " Inhibit Screensaver",
"Prevents the screen saver from activating and the host from sleeping while emulation is running.", "EmuCore", "InhibitScreensaver",
true);
DrawToggleSetting(bsi, ICON_FA_VIDEO " Pause On Focus Loss",
"Pauses the emulator when you minimize the window or switch to another application, and unpauses when you switch back.", "UI",
"PauseOnFocusLoss", false);
#endif

DrawToggleSetting(bsi, ICON_FA_WINDOW_MAXIMIZE " Pause On Menu",
"Pauses the emulator when you open the quick menu, and unpauses when you close it.", "UI", "PauseOnMenu", true);
DrawToggleSetting(bsi, ICON_FA_POWER_OFF " Confirm Shutdown",
Expand All @@ -2743,14 +2753,15 @@ void FullscreenUI::DrawInterfaceSettingsPage()
ImGuiFullscreen::SetTheme(bsi->GetBoolValue("UI", "UseLightFullscreenUITheme", false));
}

#ifndef WINRT_XBOX
MenuHeading("Game Display");
DrawToggleSetting(bsi, ICON_FA_TV " Start Fullscreen", "Automatically switches to fullscreen mode when the program is started.", "UI",
"StartFullscreen", false);
DrawToggleSetting(bsi, ICON_FA_MOUSE " Double-Click Toggles Fullscreen",
"Switches between full screen and windowed when the window is double-clicked.", "UI", "DoubleClickTogglesFullscreen", true);
DrawToggleSetting(bsi, ICON_FA_MOUSE_POINTER " Hide Cursor In Fullscreen",
"Hides the mouse pointer/cursor when the emulator is in fullscreen mode.", "UI", "HideMouseCursor", false);

#endif
MenuHeading("On-Screen Display");
DrawIntSpinBoxSetting(bsi, ICON_FA_SEARCH " OSD Scale", "Determines how large the on-screen messages and monitor are.", "EmuCore/GS",
"OsdScale", 100, 25, 500, 1, "%d%%");
Expand Down Expand Up @@ -3817,7 +3828,7 @@ void FullscreenUI::DrawControllerSettingsPage()
DrawToggleSetting(bsi, ICON_FA_COG " SDL Raw Input", "Allow SDL to use raw access to input devices.", "InputSources", "SDLRawInput",
false, bsi->GetBoolValue("InputSources", "SDL", true), false);
#endif
#ifdef _WIN32
#if _WIN32 && !WINRT_XBOX
DrawToggleSetting(bsi, ICON_FA_COG " Enable XInput Input Source",
"The XInput source provides support for XBox 360/XBox One/XBox Series controllers.", "InputSources", "XInput", false, true, false);
#endif
Expand Down Expand Up @@ -5563,9 +5574,9 @@ void FullscreenUI::DrawGameGrid(const ImVec2& heading_size)

const ImGuiStyle& style = ImGui::GetStyle();

const float title_spacing = LayoutScale(10.0f);
const float item_spacing = LayoutScale(20.0f);
const float item_width_with_spacing = std::floor(LayoutScale(LAYOUT_SCREEN_WIDTH / 5.0f));
const float title_spacing = LayoutScale(5.0f);
const float item_spacing = LayoutScale(10.0f);
const float item_width_with_spacing = std::floor(LayoutScale(LAYOUT_SCREEN_WIDTH / 7.5f));
const float item_width = item_width_with_spacing - item_spacing;
const float image_width = item_width - (style.FramePadding.x * 2.0f);
const float image_height = image_width * 1.33f;
Expand Down
16 changes: 8 additions & 8 deletions pcsx2/ImGui/ImGuiOverlays.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,31 +137,31 @@ void ImGuiManager::DrawPerformanceOverlay()
switch (PerformanceMetrics::GetInternalFPSMethod())
{
case PerformanceMetrics::InternalFPSMethod::GSPrivilegedRegister:
fmt::format_to(std::back_inserter(text), "G: {:.2f} [P] | V: {:.2f}", PerformanceMetrics::GetInternalFPS(),
fmt::format_to(std::back_inserter(text), "{:.2f} FPS", PerformanceMetrics::GetInternalFPS(),
PerformanceMetrics::GetFPS());
break;

case PerformanceMetrics::InternalFPSMethod::DISPFBBlit:
fmt::format_to(std::back_inserter(text), "G: {:.2f} [B] | V: {:.2f}", PerformanceMetrics::GetInternalFPS(),
fmt::format_to(std::back_inserter(text), "{:.2f} FPS", PerformanceMetrics::GetInternalFPS(),
PerformanceMetrics::GetFPS());
break;

case PerformanceMetrics::InternalFPSMethod::None:
default:
fmt::format_to(std::back_inserter(text), "V: {:.2f}", PerformanceMetrics::GetFPS());
fmt::format_to(std::back_inserter(text), "{:.2f} FPS", PerformanceMetrics::GetFPS());
break;
}
first = false;
}
if (GSConfig.OsdShowSpeed)
{
fmt::format_to(std::back_inserter(text), "{}{}%", first ? "" : " | ", static_cast<u32>(std::round(speed)));
fmt::format_to(std::back_inserter(text), " ({}%)", static_cast<u32>(std::round(speed)));

// We read the main config here, since MTGS doesn't get updated with speed toggles.
if (EmuConfig.GS.LimitScalar == 0.0f)
/* if (EmuConfig.GS.LimitScalar == 0.0f)
text += " (Max)";
else
fmt::format_to(std::back_inserter(text), " ({:.0f}%)", EmuConfig.GS.LimitScalar * 100.0f);
fmt::format_to(std::back_inserter(text), " ({:.0f}%)", EmuConfig.GS.LimitScalar * 100.0f); */
}
if (!text.empty())
{
Expand Down Expand Up @@ -194,14 +194,14 @@ void ImGuiManager::DrawPerformanceOverlay()
GSgetInternalResolution(&width, &height);

text.clear();
fmt::format_to(std::back_inserter(text), "{}x{} {} {}", width, height, ReportVideoMode(), ReportInterlaceMode());
fmt::format_to(std::back_inserter(text), "{}x{}{} {}", width, height, ReportInterlaceMode(), ReportVideoMode());
DRAW_LINE(fixed_font, text.c_str(), IM_COL32(255, 255, 255, 255));
}

if (GSConfig.OsdShowCPU)
{
text.clear();
fmt::format_to(std::back_inserter(text), "{:.2f}ms | {:.2f}ms | {:.2f}ms", PerformanceMetrics::GetMinimumFrameTime(),
fmt::format_to(std::back_inserter(text), "Frame Time: {:.2f}ms", PerformanceMetrics::GetMinimumFrameTime(),
PerformanceMetrics::GetAverageFrameTime(), PerformanceMetrics::GetMaximumFrameTime());
DRAW_LINE(fixed_font, text.c_str(), IM_COL32(255, 255, 255, 255));

Expand Down
2 changes: 1 addition & 1 deletion pcsx2/MTGS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ void MTGS::SwitchRenderer(GSRendererType renderer, bool display_message /* = tru

if (display_message)
{
Host::AddIconOSDMessage("SwitchRenderer", ICON_FA_MAGIC, fmt::format("Switching to {} renderer...",
Host::AddIconOSDMessage("SwitchRenderer", ICON_FA_MAGIC, fmt::format("{} Renderer.",
Pcsx2Config::GSOptions::GetRendererName(renderer)), Host::OSD_INFO_DURATION);
}

Expand Down
31 changes: 30 additions & 1 deletion pcsx2/PAD/Host/PAD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,35 @@ void PAD::SetDefaultControllerConfig(SettingsInterface& si)

void PAD::SetDefaultHotkeyConfig(SettingsInterface& si)
{
//XBSX2.0 Controller Mappings
si.SetStringValue("Pad1", "Type", "DualShock2");
si.SetStringValue("Pad1", "Up", "XInput-0/DPadUp");
si.SetStringValue("Pad1", "Right", "XInput-0/DPadRight");
si.SetStringValue("Pad1", "Down", "XInput-0/DPadDown");
si.SetStringValue("Pad1", "Left", "XInput-0/DPadLeft");
si.SetStringValue("Pad1", "Triangle", "XInput-0/Y");
si.SetStringValue("Pad1", "Circle", "XInput-0/B");
si.SetStringValue("Pad1", "Cross", "XInput-0/A");
si.SetStringValue("Pad1", "Square", "XInput-0/X");
si.SetStringValue("Pad1", "Select", "XInput-0/Back");
si.SetStringValue("Pad1", "Start", "XInput-0/Start");
si.SetStringValue("Pad1", "L1", "XInput-0/LeftShoulder");
si.SetStringValue("Pad1", "L2", "XInput-0/+LeftTrigger");
si.SetStringValue("Pad1", "R1", "XInput-0/RightShoulder");
si.SetStringValue("Pad1", "R2", "XInput-0/+RightTrigger");
si.SetStringValue("Pad1", "L3", "XInput-0/LeftStick");
si.SetStringValue("Pad1", "R3", "XInput-0/RightStick");
si.SetStringValue("Pad1", "LUp", "XInput-0/-LeftY");
si.SetStringValue("Pad1", "LRight", "XInput-0/+LeftX");
si.SetStringValue("Pad1", "LDown", "XInput-0/+LeftY");
si.SetStringValue("Pad1", "LLeft", "XInput-0/-LeftX");
si.SetStringValue("Pad1", "RUp", "XInput-0/-RightY");
si.SetStringValue("Pad1", "RRight", "XInput-0/+RightX");
si.SetStringValue("Pad1", "RDown", "XInput-0/+RightY");
si.SetStringValue("Pad1", "RLeft", "XInput-0/-RightX");
si.SetStringValue("Pad1", "SmallMotor", "XInput-0/SmallMotor");
si.SetStringValue("Pad1", "LargeMotor", "XInput-0/LargeMotor");

// PCSX2 Controller Settings - Hotkeys

// PCSX2 Controller Settings - Hotkeys - General
Expand Down Expand Up @@ -340,7 +369,7 @@ void PAD::SetDefaultHotkeyConfig(SettingsInterface& si)
// si.SetStringValue("Hotkeys", "IncreaseSpeed", "Keyboard"); TBD
// si.SetStringValue("Hotkeys", "ResetVM", "Keyboard"); TBD
// si.SetStringValue("Hotkeys", "ShutdownVM", "Keyboard"); TBD
si.SetStringValue("Hotkeys", "OpenPauseMenu", "Keyboard/Escape");
si.SetStringValue("Hotkeys", "OpenPauseMenu", "XInput-0/Back & XInput-0/Start");
si.SetStringValue("Hotkeys", "ToggleFrameLimit", "Keyboard/F4");
si.SetStringValue("Hotkeys", "TogglePause", "Keyboard/Space");
si.SetStringValue("Hotkeys", "ToggleSlowMotion", "Keyboard/Shift & Keyboard/Backtab");
Expand Down

0 comments on commit 8c97906

Please sign in to comment.