From 8350f673322705a1f9a41b20aaa8d7d3fbc46272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 4 Feb 2026 01:27:49 +0100 Subject: [PATCH] Fix typos, minor translation updates --- UI/GamepadEmu.cpp | 10 +++++----- UI/GamepadEmu.h | 21 +++++++++++---------- UI/NativeApp.cpp | 2 +- assets/lang/sv_SE.ini | 4 ++-- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/UI/GamepadEmu.cpp b/UI/GamepadEmu.cpp index 29eb80962e..0427728264 100644 --- a/UI/GamepadEmu.cpp +++ b/UI/GamepadEmu.cpp @@ -85,7 +85,7 @@ static u32 GetButtonColor() { return g_Config.iTouchButtonStyle != 0 ? 0xFFFFFF : 0xc0b080; } -GamepadComponent::GamepadComponent(const char *key, UI::LayoutParams *layoutParams) : UI::View(layoutParams), key_(key) {} +GamepadComponent::GamepadComponent(std::string_view key, UI::LayoutParams *layoutParams) : UI::View(layoutParams), key_(key) {} std::string GamepadComponent::DescribeText() const { auto co = GetI18NCategory(I18NCat::CONTROLS); @@ -213,7 +213,7 @@ bool CustomButton::IsDown() const { void CustomButton::GetContentDimensions(const UIContext &dc, float &w, float &h) const { MultiTouchButton::GetContentDimensions(dc, w, h); - if (invertedContextDimension_) { + if (invertedContentDimension_) { float tmp = w; w = h; h = tmp; @@ -285,7 +285,7 @@ bool PSPButton::IsDown() const { return (__CtrlPeekButtonsVisual() & pspButtonBit_) != 0; } -PSPDpad::PSPDpad(ImageID arrowIndex, const char *key, ImageID arrowDownIndex, ImageID overlayIndex, float scale, float spacing, UI::LayoutParams *layoutParams) +PSPDpad::PSPDpad(ImageID arrowIndex, std::string_view key, ImageID arrowDownIndex, ImageID overlayIndex, float scale, float spacing, UI::LayoutParams *layoutParams) : GamepadComponent(key, layoutParams), arrowIndex_(arrowIndex), arrowDownIndex_(arrowDownIndex), overlayIndex_(overlayIndex), scale_(scale), spacing_(spacing), dragPointerId_(-1), down_(0) { } @@ -429,7 +429,7 @@ void PSPDpad::Draw(UIContext &dc) { } } -PSPStick::PSPStick(ImageID bgImg, const char *key, ImageID stickImg, ImageID stickDownImg, int stick, float scale, UI::LayoutParams *layoutParams) +PSPStick::PSPStick(ImageID bgImg, std::string_view key, ImageID stickImg, ImageID stickDownImg, int stick, float scale, UI::LayoutParams *layoutParams) : GamepadComponent(key, layoutParams), bgImg_(bgImg), stickImageIndex_(stickImg), stickDownImg_(stickDownImg), stick_(stick), scale_(scale) { stick_size_ = 50; } @@ -920,7 +920,7 @@ GamepadEmuView::GamepadEmuView(const TouchControlConfig &config, float xres, flo return new AnchorLayoutParams(touch.x * xres + off.x, touch.y * yres + off.y, NONE, NONE, Centering::Both); }; - // Space between the PSP buttons (traingle, circle, square and cross) + // Space between the PSP buttons (triangle, circle, square and cross) const float actionButtonSpacing = config.fActionButtonSpacing * baseActionButtonSpacing; // Position of the circle button (the PSP circle button). It is the farthest to the right. ButtonOffset circleOffset{ actionButtonSpacing, 0.0f }; diff --git a/UI/GamepadEmu.h b/UI/GamepadEmu.h index 59276114b9..db96cee0fa 100644 --- a/UI/GamepadEmu.h +++ b/UI/GamepadEmu.h @@ -37,7 +37,7 @@ public: class GamepadComponent : public UI::View { public: - GamepadComponent(const char *key, UI::LayoutParams *layoutParams); + GamepadComponent(std::string_view key, UI::LayoutParams *layoutParams); bool Key(const KeyInput &input) override { return false; @@ -51,7 +51,7 @@ protected: class MultiTouchButton : public GamepadComponent { public: - MultiTouchButton(const char *key, ImageID bgImg, ImageID bgDownImg, ImageID img, float scale, UI::LayoutParams *layoutParams) + MultiTouchButton(std::string_view key, ImageID bgImg, ImageID bgDownImg, ImageID img, float scale, UI::LayoutParams *layoutParams) : GamepadComponent(key, layoutParams), scale_(scale), bgImg_(bgImg), bgDownImg_(bgDownImg), img_(img) { } @@ -83,7 +83,7 @@ private: class BoolButton : public MultiTouchButton { public: - BoolButton(bool *value, const char *key, ImageID bgImg, ImageID bgDownImg, ImageID img, float scale, UI::LayoutParams *layoutParams) + BoolButton(bool *value, std::string_view key, ImageID bgImg, ImageID bgDownImg, ImageID img, float scale, UI::LayoutParams *layoutParams) : MultiTouchButton(key, bgImg, bgDownImg, img, scale, layoutParams), value_(value) { } bool Touch(const TouchInput &input) override; @@ -97,7 +97,7 @@ private: class PSPButton : public MultiTouchButton { public: - PSPButton(int pspButtonBit, const char *key, ImageID bgImg, ImageID bgDownImg, ImageID img, float scale, UI::LayoutParams *layoutParams) + PSPButton(int pspButtonBit, std::string_view key, ImageID bgImg, ImageID bgDownImg, ImageID img, float scale, UI::LayoutParams *layoutParams) : MultiTouchButton(key, bgImg, bgDownImg, img, scale, layoutParams), pspButtonBit_(pspButtonBit) { } bool Touch(const TouchInput &input) override; @@ -109,7 +109,7 @@ private: class PSPDpad : public GamepadComponent { public: - PSPDpad(ImageID arrowIndex, const char *key, ImageID arrowDownIndex, ImageID overlayIndex, float scale, float spacing, UI::LayoutParams *layoutParams); + PSPDpad(ImageID arrowIndex, std::string_view key, ImageID arrowDownIndex, ImageID overlayIndex, float scale, float spacing, UI::LayoutParams *layoutParams); bool Touch(const TouchInput &input) override; void Draw(UIContext &dc) override; @@ -131,7 +131,7 @@ private: class PSPStick : public GamepadComponent { public: - PSPStick(ImageID bgImg, const char *key, ImageID stickImg, ImageID stickDownImg, int stick, float scale, UI::LayoutParams *layoutParams); + PSPStick(ImageID bgImg, std::string_view key, ImageID stickImg, ImageID stickDownImg, int stick, float scale, UI::LayoutParams *layoutParams); bool Touch(const TouchInput &input) override; void Draw(UIContext &dc) override; @@ -178,10 +178,11 @@ UI::ViewGroup *CreatePadLayout(const TouchControlConfig &config, float xres, flo const int D_pad_Radius = 50; const int baseActionButtonSpacing = 60; +// D-PAD (up down left right) (aka PSP cross)---------------------------- class CustomButton : public MultiTouchButton { public: - CustomButton(uint64_t pspButtonBit, const char *key, bool toggle, bool repeat, ControlMapper* controllMapper, ImageID bgImg, ImageID bgDownImg, ImageID img, float scale, bool invertedContextDimension, UI::LayoutParams *layoutParams) - : MultiTouchButton(key, bgImg, bgDownImg, img, scale, layoutParams), pspButtonBit_(pspButtonBit), toggle_(toggle), repeat_(repeat), controlMapper_(controllMapper), on_(false), invertedContextDimension_(invertedContextDimension) { + CustomButton(uint64_t pspButtonBit, std::string_view key, bool toggle, bool repeat, ControlMapper* controllMapper, ImageID bgImg, ImageID bgDownImg, ImageID img, float scale, bool invertedContentDimension, UI::LayoutParams *layoutParams) + : MultiTouchButton(key, bgImg, bgDownImg, img, scale, layoutParams), pspButtonBit_(pspButtonBit), toggle_(toggle), repeat_(repeat), controlMapper_(controllMapper), on_(false), invertedContentDimension_(invertedContentDimension) { } bool Touch(const TouchInput &input) override; void Update() override; @@ -195,12 +196,12 @@ private: int pressedFrames_ = 0; ControlMapper* controlMapper_; bool on_; - bool invertedContextDimension_; // Swap width and height + bool invertedContentDimension_; // Swap width and height }; class GestureGamepad : public UI::View { public: - explicit GestureGamepad(ControlMapper* controllMapper) : controlMapper_(controllMapper) {} + explicit GestureGamepad(ControlMapper* controlMapper) : controlMapper_(controlMapper) {} bool Touch(const TouchInput &input) override; void Update() override; diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 68065ef606..6cbc84647e 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -1384,7 +1384,7 @@ bool NativeKey(const KeyInput &key) { #ifdef _DEBUG // Debug hack: Randomize the language with F9! - if (false && (key.keyCode == NKCODE_F9 && (key.flags & KeyInputFlags::DOWN))) { + if ((key.keyCode == NKCODE_F9 && (key.flags & KeyInputFlags::DOWN))) { std::vector tempLangs; g_VFS.GetFileListing("lang", &tempLangs, "ini"); int x = rand() % tempLangs.size(); diff --git a/assets/lang/sv_SE.ini b/assets/lang/sv_SE.ini index 14a43d9ad4..b7bfdb7e00 100644 --- a/assets/lang/sv_SE.ini +++ b/assets/lang/sv_SE.ini @@ -72,13 +72,13 @@ Audio file format not supported. Must be WAV or MP3. = Ljudformatet stöds inte. Audio playback = Ljuduppspelning AudioBufferingForBluetooth = Bluetooth-vänlig buffert (långsammare) Auto = Auto -Buffer size = Buffer size +Buffer size = Buffertstorlek Classic (lowest latency) = Klassisk (lägsta latens) Device = Enhet Disabled = Inaktiverad Enable Sound = Ljud på Fill audio gaps = Fyll ljudluckor -Game preview volume = Game preview volume +Game preview volume = Previewvolym Game volume = Spelvolym Microphone = Mikrofon Microphone Device = Mikrofonenhet