From 019a9e2923c255853850cdb2ecbf3a6d29bf54a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 6 Apr 2023 12:33:40 +0200 Subject: [PATCH] MacOS build fixes --- Common/UI/PopupScreens.h | 2 +- SDL/CocoaBarItems.mm | 10 +++++----- UI/GameSettingsScreen.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Common/UI/PopupScreens.h b/Common/UI/PopupScreens.h index 72ed60baff..d0babc3d56 100644 --- a/Common/UI/PopupScreens.h +++ b/Common/UI/PopupScreens.h @@ -1,6 +1,6 @@ #pragma once -#include "Common/Data/Text/I18N.h" +#include "Common/Data/Text/I18n.h" #include "Common/UI/UIScreen.h" #include "Common/UI/UI.h" #include "Common/UI/View.h" diff --git a/SDL/CocoaBarItems.mm b/SDL/CocoaBarItems.mm index 349ba033c7..d60d4b9892 100644 --- a/SDL/CocoaBarItems.mm +++ b/SDL/CocoaBarItems.mm @@ -24,8 +24,8 @@ extern "C" { +(instancetype)sharedInstance; -(void)setupAppBarItems; @property (assign) NSMenu *openMenu; -@property (assign) std::shared_ptr mainSettingsLocalization; -@property (assign) std::shared_ptr graphicsLocalization; +@property (assign) I18NCategory *mainSettingsLocalization; +@property (assign) I18NCategory *graphicsLocalization; @end void initBarItemsForApp() { @@ -38,7 +38,7 @@ void initBarItemsForApp() { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ stub = [BarItemsManager new]; - stub.mainSettingsLocalization = GetI18NCategory("MainSettings"); + stub.mainSettingsLocalization = GetI18NCategory(I18NCat::MAINSETTINGS); }); return stub; @@ -106,7 +106,7 @@ void initBarItemsForApp() { } } --(NSString *)localizedString: (const char *)key category: (std::shared_ptr)cat { +-(NSString *)localizedString: (const char *)key category: (I18NCategory *)cat { return @(self.mainSettingsLocalization->T(key)); } @@ -147,7 +147,7 @@ void initBarItemsForApp() { NSMenu *parent = [[NSMenu alloc] initWithTitle:@(self.mainSettingsLocalization->T("Graphics"))]; NSMenu *backendsMenu = [[NSMenu alloc] init]; - self.graphicsLocalization = GetI18NCategory("Graphics"); + self.graphicsLocalization = GetI18NCategory(I18NCat::GRAPHICS); #define GRAPHICS_LOCALIZED(key) @(self.graphicsLocalization->T(key)) NSMenuItem *gpuBackendItem = [[NSMenuItem alloc] initWithTitle:GRAPHICS_LOCALIZED("Backend") action:nil keyEquivalent:@""]; diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index a05a755c9b..26fcd5dfae 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -646,7 +646,7 @@ void GameSettingsScreen::CreateAudioSettings(UI::ViewGroup *audioSettings) { std::vector audioDeviceList; SplitString(System_GetProperty(SYSPROP_AUDIO_DEVICE_LIST), '\0', audioDeviceList); audioDeviceList.insert(audioDeviceList.begin(), a->T("Auto")); - PopupMultiChoiceDynamic *audioDevice = audioSettings->Add(new PopupMultiChoiceDynamic(&g_Config.sAudioDevice, a->T("Device"), audioDeviceList, nullptr, screenManager())); + PopupMultiChoiceDynamic *audioDevice = audioSettings->Add(new PopupMultiChoiceDynamic(&g_Config.sAudioDevice, a->T("Device"), audioDeviceList, I18NCat::NONE, screenManager())); audioDevice->OnChoice.Handle(this, &GameSettingsScreen::OnAudioDevice); sdlAudio = true; #endif