Misc: Use lightgun controller icon

This commit is contained in:
Stenzek
2024-08-25 13:57:05 +10:00
parent 599800dfa1
commit f2c0303875
12 changed files with 24 additions and 30 deletions

View File

@ -1,12 +1,8 @@
// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin <stenzek@gmail.com>
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#pragma once
#ifndef IMGUI_DEFINE_MATH_OPERATORS
#define IMGUI_DEFINE_MATH_OPERATORS
#endif
#include "common/easing.h"
#include "imgui.h"

View File

@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#define IMGUI_DEFINE_MATH_OPERATORS
#include "imgui_fullscreen.h"
#include "gpu_device.h"
#include "image.h"

View File

@ -1,5 +1,5 @@
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
// SPDX-License-Identifier: (GPL-3.0 OR PolyForm-Strict-1.0.0)
#include "imgui_manager.h"
#include "gpu_device.h"
@ -26,6 +26,7 @@
#include <cmath>
#include <deque>
#include <mutex>
#include <type_traits>
#include <unordered_map>
Log_SetChannel(ImGuiManager);
@ -57,6 +58,8 @@ struct OSDMessage
} // namespace
static_assert(std::is_same_v<WCharType, ImWchar>);
static void UpdateScale();
static void SetStyle();
static void SetKeyMap();
@ -76,7 +79,7 @@ static float s_global_prescale = 1.0f; // before window scale
static float s_global_scale = 1.0f;
static std::string s_font_path;
static std::vector<ImWchar> s_font_range;
static std::vector<WCharType> s_font_range;
static ImFont* s_standard_font;
static ImFont* s_fixed_font;
@ -111,7 +114,7 @@ static bool s_scale_changed = false;
static std::array<ImGuiManager::SoftwareCursor, InputManager::MAX_SOFTWARE_CURSORS> s_software_cursors = {};
} // namespace ImGuiManager
void ImGuiManager::SetFontPathAndRange(std::string path, std::vector<u16> range)
void ImGuiManager::SetFontPathAndRange(std::string path, std::vector<WCharType> range)
{
if (s_font_path == path && s_font_range == range)
return;
@ -552,11 +555,11 @@ bool ImGuiManager::AddIconFonts(float size)
0xf7a0, 0xf7a0, 0xf7c2, 0xf7c2, 0xf807, 0xf807, 0xf815, 0xf815, 0xf818, 0xf818, 0xf84c, 0xf84c, 0xf8cc, 0xf8cc,
0x0, 0x0};
static constexpr ImWchar range_pf[] = {
0x2196, 0x2199, 0x219e, 0x21a1, 0x21b0, 0x21b3, 0x21ba, 0x21c3, 0x21c7, 0x21ca, 0x21d0, 0x21d4, 0x21dc,
0x21dd, 0x21e0, 0x21e3, 0x21ed, 0x21ee, 0x21f3, 0x21f3, 0x21f7, 0x21f8, 0x21fa, 0x21fb, 0x227a, 0x227f,
0x2284, 0x2284, 0x235e, 0x235e, 0x2360, 0x2361, 0x2364, 0x2366, 0x23b2, 0x23b4, 0x23ce, 0x23ce, 0x23f4,
0x23f7, 0x2427, 0x243a, 0x243c, 0x243e, 0x2460, 0x246b, 0x24f5, 0x24fd, 0x24ff, 0x24ff, 0x2717, 0x2717,
0x278a, 0x278e, 0x27fc, 0x27fc, 0xe001, 0xe001, 0xff21, 0xff3a, 0x0, 0x0};
0x2196, 0x2199, 0x219e, 0x21a1, 0x21b0, 0x21b3, 0x21ba, 0x21c3, 0x21c7, 0x21ca, 0x21d0, 0x21d4, 0x21dc,
0x21dd, 0x21e0, 0x21e3, 0x21ed, 0x21ee, 0x21f7, 0x21f8, 0x21fa, 0x21fb, 0x227a, 0x227f, 0x2284, 0x2284,
0x235e, 0x235e, 0x2360, 0x2361, 0x2364, 0x2366, 0x23b2, 0x23b4, 0x23ce, 0x23ce, 0x23f4, 0x23f7, 0x2427,
0x243a, 0x243c, 0x243e, 0x2460, 0x246b, 0x24f5, 0x24fd, 0x24ff, 0x24ff, 0x2717, 0x2717, 0x278a, 0x278e,
0x27fc, 0x27fc, 0xe001, 0xe001, 0xff21, 0xff3a, 0x1f52b, 0x1f52b, 0x0, 0x0};
{
ImFontConfig cfg;

View File

@ -15,8 +15,11 @@ union InputBindingKey;
enum class GenericInputBinding : u8;
namespace ImGuiManager {
using WCharType = u32;
/// Sets the path to the font to use. Empty string means to use the default.
void SetFontPathAndRange(std::string path, std::vector<u16> range);
void SetFontPathAndRange(std::string path, std::vector<WCharType> range);
/// Changes the global scale.
void SetGlobalScale(float global_scale);