Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings banner for game specific settings #18730

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tools/langtool/src/section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl Section {
}
}

pub fn get_line(&mut self, key: &str) -> Option<String> {
pub fn get_line(&self, key: &str) -> Option<String> {
for line in self.lines.iter() {
let prefix = if let Some(pos) = line.find(" =") {
&line[0..pos]
Expand Down
6 changes: 3 additions & 3 deletions UI/DevScreens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ bool ShaderViewScreen::key(const KeyInput &ki) {
}


const std::string framedumpsBaseUrl = "http://framedump.ppsspp.org/repro/";
const std::string_view framedumpsBaseUrl("http://framedump.ppsspp.org/repro/");

FrameDumpTestScreen::FrameDumpTestScreen() {

Expand Down Expand Up @@ -1053,7 +1053,7 @@ void FrameDumpTestScreen::CreateViews() {
dumps->Add(new ItemHeader("GE Frame Dumps"));

for (auto &file : files_) {
std::string url = framedumpsBaseUrl + file;
std::string url = std::string(framedumpsBaseUrl) + file;
Choice *c = dumps->Add(new Choice(file));
c->SetTag(url);
c->OnClick.Handle<FrameDumpTestScreen>(this, &FrameDumpTestScreen::OnLoadDump);
Expand All @@ -1075,7 +1075,7 @@ void FrameDumpTestScreen::update() {

if (!listing_) {
const char *acceptMime = "text/html, */*; q=0.8";
listing_ = g_DownloadManager.StartDownload(framedumpsBaseUrl, Path(), http::ProgressBarMode::DELAYED, acceptMime);
listing_ = g_DownloadManager.StartDownload(std::string(framedumpsBaseUrl), Path(), http::ProgressBarMode::DELAYED, acceptMime);
}

if (listing_ && listing_->Done() && files_.empty()) {
Expand Down
10 changes: 6 additions & 4 deletions UI/EmuScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,8 @@ void EmuScreen::focusChanged(ScreenFocusChange focusChange) {
void EmuScreen::sendMessage(UIMessage message, const char *value) {
// External commands, like from the Windows UI.
if (message == UIMessage::REQUEST_GAME_PAUSE && screenManager()->topScreen() == this) {
screenManager()->push(new GamePauseScreen(gamePath_));
std::string gameID = g_paramSFO.GetValueString("DISC_ID");
screenManager()->push(new GamePauseScreen(gamePath_, gameID));
} else if (message == UIMessage::REQUEST_GAME_STOP) {
// We will push MainScreen in update().
PSP_Shutdown();
Expand Down Expand Up @@ -603,8 +604,8 @@ void EmuScreen::sendMessage(UIMessage message, const char *value) {
if (!KeyMap::IsKeyMapped(DEVICE_ID_PAD_0, VIRTKEY_PAUSE) || !KeyMap::IsKeyMapped(DEVICE_ID_PAD_1, VIRTKEY_PAUSE)) {
// If it's a TV (so no built-in back button), and there's no back button mapped to a pad,
// use this as the fallback way to get into the menu.

screenManager()->push(new GamePauseScreen(gamePath_));
std::string gameID = g_paramSFO.GetValueString("DISC_ID");
screenManager()->push(new GamePauseScreen(gamePath_, gameID));
}
}
} else if (message == UIMessage::REQUEST_PLAY_SOUND) {
Expand Down Expand Up @@ -1229,7 +1230,8 @@ void EmuScreen::update() {

if (pauseTrigger_) {
pauseTrigger_ = false;
screenManager()->push(new GamePauseScreen(gamePath_));
std::string gameID = g_paramSFO.GetValueString("DISC_ID");
screenManager()->push(new GamePauseScreen(gamePath_, gameID));
}

if (saveStatePreview_ && !bootPending_) {
Expand Down
41 changes: 38 additions & 3 deletions UI/GameSettingsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,32 +233,67 @@ void GameSettingsScreen::PreCreateViews() {
iAlternateSpeedPercentAnalog_ = (g_Config.iAnalogFpsLimit * 100) / 60;
}

void GameSettingsScreen::CreateBanner(UI::LinearLayout *parent, std::string_view category, std::string_view url) {
using namespace UI;
auto ms = GetI18NCategory(I18NCat::MAINSETTINGS);

LinearLayout *banner = new LinearLayout(ORIENT_HORIZONTAL);
std::string title(category);
bool hasGameConfig = false;
if (g_Config.hasGameConfig(gameID_)) {
auto info = g_gameInfoCache->GetInfo(nullptr, gamePath_, GameInfoFlags::PARAM_SFO);
title = info->GetTitle() + " - " + gameID_;
hasGameConfig = true;
}
if (hasGameConfig) {
banner->Add(new ImageView(ImageID("I_GEAR"), "", UI::ImageSizeMode::IS_KEEP_ASPECT, new LinearLayoutParams(50, 50, 0.0f, G_CENTER)));
}
banner->Add(new TextView(title, new LinearLayoutParams(Margins(10, 10))));
banner->Add(new Spacer(0.0f, new LinearLayoutParams(1.0f)));
if (!url.empty()) {
banner->Add(new Button(ms->T("Help"), new LinearLayoutParams(Margins(8, 8))))->OnClick.Add([=](UI::EventParams &e) {
std::string fullUrl = std::string("https://www.ppsspp.org/docs/settings/") + std::string(url);
System_LaunchUrl(LaunchUrlType::BROWSER_URL, fullUrl.c_str());
return UI::EVENT_DONE;
});
}
banner->SetBG(UI::Drawable(0x30000000));
parent->Add(banner);
}

void GameSettingsScreen::CreateTabs() {
using namespace UI;
auto ms = GetI18NCategory(I18NCat::MAINSETTINGS);

LinearLayout *graphicsSettings = AddTab("GameSettingsGraphics", ms->T("Graphics"));
CreateBanner(graphicsSettings, ms->T("Graphics"), "graphics");
CreateGraphicsSettings(graphicsSettings);

LinearLayout *controlsSettings = AddTab("GameSettingsControls", ms->T("Controls"));
CreateBanner(controlsSettings, ms->T("Controls"), "controls");
CreateControlsSettings(controlsSettings);

LinearLayout *audioSettings = AddTab("GameSettingsAudio", ms->T("Audio"));
CreateBanner(audioSettings, ms->T("Audio"), "audio");
CreateAudioSettings(audioSettings);

LinearLayout *networkingSettings = AddTab("GameSettingsNetworking", ms->T("Networking"));
CreateBanner(networkingSettings, ms->T("Networking"), "network");
CreateNetworkingSettings(networkingSettings);

LinearLayout *tools = AddTab("GameSettingsTools", ms->T("Tools"));
CreateToolsSettings(tools);
LinearLayout *toolsSettings = AddTab("GameSettingsTools", ms->T("Tools"));
CreateBanner(toolsSettings, ms->T("Tools"), "tools");
CreateToolsSettings(toolsSettings);

LinearLayout *systemSettings = AddTab("GameSettingsSystem", ms->T("System"));
systemSettings->SetSpacing(0);
CreateBanner(systemSettings, ms->T("System"), "system");
CreateSystemSettings(systemSettings);

int deviceType = System_GetPropertyInt(SYSPROP_DEVICE_TYPE);
if ((deviceType == DEVICE_TYPE_VR) || g_Config.bForceVR) {
LinearLayout *vrSettings = AddTab("GameSettingsVR", ms->T("VR"));
LinearLayout *vrSettings = AddTab("GameSettingsVR", ms->T("VR"), "");
CreateBanner(vrSettings, ms->T("VR"), "");
CreateVRSettings(vrSettings);
}
}
Expand Down
1 change: 1 addition & 0 deletions UI/GameSettingsScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class GameSettingsScreen : public TabbedUIDialogScreenWithGameBackground {

private:
void PreCreateViews() override;
void CreateBanner(UI::LinearLayout *parent, std::string_view category, std::string_view url);

void CreateGraphicsSettings(UI::ViewGroup *graphicsSettings);
void CreateControlsSettings(UI::ViewGroup *tools);
Expand Down
6 changes: 3 additions & 3 deletions UI/PauseScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ void GamePauseScreen::update() {
SetVRAppMode(VRAppMode::VR_MENU_MODE);
}

GamePauseScreen::GamePauseScreen(const Path &filename)
: UIDialogScreenWithGameBackground(filename) {
GamePauseScreen::GamePauseScreen(const Path &filename, std::string gameID)
: UIDialogScreenWithGameBackground(filename), gameID_(gameID) {
// So we can tell if something blew up while on the pause screen.
std::string assertStr = "PauseScreen: " + filename.GetFilename();
SetExtraAssertInfo(assertStr.c_str());
Expand Down Expand Up @@ -467,7 +467,7 @@ void GamePauseScreen::CreateViews() {
}

UI::EventReturn GamePauseScreen::OnGameSettings(UI::EventParams &e) {
screenManager()->push(new GameSettingsScreen(gamePath_));
screenManager()->push(new GameSettingsScreen(gamePath_, gameID_));
return UI::EVENT_DONE;
}

Expand Down
3 changes: 2 additions & 1 deletion UI/PauseScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ enum class PauseScreenMode {

class GamePauseScreen : public UIDialogScreenWithGameBackground {
public:
GamePauseScreen(const Path &filename);
GamePauseScreen(const Path &filename, std::string gameID);
~GamePauseScreen();

void dialogFinished(const Screen *dialog, DialogResult dr) override;
Expand Down Expand Up @@ -70,4 +70,5 @@ class GamePauseScreen : public UIDialogScreenWithGameBackground {
PauseScreenMode mode_ = PauseScreenMode::MAIN;

UI::Button *playButton_ = nullptr;
std::string gameID_;
};
1 change: 1 addition & 0 deletions assets/lang/ar_AE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = ‎الصوت
Controls = ‎التحكم
Graphics = ‎الجرافكس
Help = ‎مساعدة
Networking = ‎الشبكة
Search = البحث
System = ‎النظام
Expand Down
1 change: 1 addition & 0 deletions assets/lang/az_AZ.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = Səs
Controls = Kontrollar
Graphics = Qrafika
Help = Help
Networking = Networking
Search = Search
System = Sistem
Expand Down
1 change: 1 addition & 0 deletions assets/lang/bg_BG.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = Аудио
Controls = Контроли
Graphics = Графика
Help = Помощ
Networking = Networking
Search = Search
System = Система
Expand Down
1 change: 1 addition & 0 deletions assets/lang/ca_ES.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = Àudio
Controls = Controls
Graphics = Gràfics
Help = Ajuda
Networking = Joc en xarxa
Search = Cercar
System = Sistema
Expand Down
1 change: 1 addition & 0 deletions assets/lang/cz_CZ.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = Zvuk
Controls = Ovládání
Graphics = Grafika
Help = Nápověda
Networking = Síť
Search = Search
System = Systém
Expand Down
1 change: 1 addition & 0 deletions assets/lang/da_DK.ini
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@ Networking = Netværk
Search = Search
System = System
Tools = Tools
Help = Help

[MappableControls]
Alt speed 1 = Alt speed 1
Expand Down
1 change: 1 addition & 0 deletions assets/lang/de_DE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = Ton
Controls = Bedienung
Graphics = Grafik
Help = Hilfe
Networking = Netzwerk
Search = Suche
System = System
Expand Down
1 change: 1 addition & 0 deletions assets/lang/dr_ID.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = Suarana
Controls = Tombolna
Graphics = Gambara'na
Help = Pabalian
Networking = Networking
Search = Search
System = Sistemna
Expand Down
1 change: 1 addition & 0 deletions assets/lang/en_US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ Networking = Networking
System = System
Tools = Tools
Search = Search
Help = Help

[MappableControls]
Alt speed 1 = Alt speed 1
Expand Down
1 change: 1 addition & 0 deletions assets/lang/es_ES.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = Sitio oficial
Audio = Sonido
Controls = Controles
Graphics = Gráficos
Help = Ayuda
Networking = Juego en red
Search = Buscar
System = Sistema
Expand Down
1 change: 1 addition & 0 deletions assets/lang/es_LA.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = Audio
Controls = Controles
Graphics = Gráficos
Help = Ayuda
Networking = Juego en red
Search = Buscar
System = Sistema
Expand Down
1 change: 1 addition & 0 deletions assets/lang/fa_IR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = ‎وبسایت شبیه ساز
Audio = ‎صدا
Controls = ‎کنترل‌ها
Graphics = ‎گرافیک
Help = ‎راهنما
Networking = ‎شبکه
Search = جستجو
System = ‎سیستم
Expand Down
1 change: 1 addition & 0 deletions assets/lang/fi_FI.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = Ääni
Controls = Ohjaus
Graphics = Grafiikka
Help = Apua
Networking = Verkko
Search = Haku
System = Järjestelmä
Expand Down
1 change: 1 addition & 0 deletions assets/lang/fr_FR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = Visiter le site officiel
Audio = Son
Controls = Commandes
Graphics = Graphismes
Help = Aide
Networking = Réseau
Search = Search
System = Système
Expand Down
1 change: 1 addition & 0 deletions assets/lang/gl_ES.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = Sitio oficial
Audio = Son
Controls = Controis
Graphics = Gráficos
Help = Axuda
Networking = Xogo en rede
Search = Search
System = Sistema
Expand Down
1 change: 1 addition & 0 deletions assets/lang/gr_EL.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = Ήχος
Controls = Χειριστήριο
Graphics = Γραφικά
Help = Βοήθεια
Networking = Δικτύωση
Search = Search
System = Σύστημα
Expand Down
1 change: 1 addition & 0 deletions assets/lang/he_IL.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = לאתר
Audio = שמע
Controls = מקשים
Graphics = גראפיקה
Help = Help
Networking = Networking
Search = Search
System = מערכת
Expand Down
1 change: 1 addition & 0 deletions assets/lang/he_IL_invert.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = רתאל
Audio = עמש
Controls = םישקמ
Graphics = הקיפארג
Help = Help
Networking = Networking
Search = Search
System = תכרעמ
Expand Down
1 change: 1 addition & 0 deletions assets/lang/hr_HR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = Zvuk
Controls = Kontrole
Graphics = Grafike
Help = Pomoć
Networking = Internet
Search = Search
System = Sistem
Expand Down
1 change: 1 addition & 0 deletions assets/lang/hu_HU.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = Hang
Controls = Irányítás
Graphics = Grafika
Help = Segítség
Networking = Hálózat
Search = Search
System = Rendszer
Expand Down
1 change: 1 addition & 0 deletions assets/lang/id_ID.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = Suara
Controls = Kontrol
Graphics = Grafis
Help = Bantuan
Networking = Koneksi
System = Sistem
Tools = Alat
Expand Down
1 change: 1 addition & 0 deletions assets/lang/it_IT.ini
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = Audio
Controls = Controlli
Graphics = Grafica
Help = Aiuto
Networking = Rete
Search = Ricerca
System = Sistema
Expand Down
1 change: 1 addition & 0 deletions assets/lang/ja_JP.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = オーディオ
Controls = コントロール
Graphics = グラフィックス
Help = ヘルプ(&H)
Networking = ネットワーク
Search = 検索
System = システム
Expand Down
1 change: 1 addition & 0 deletions assets/lang/jv_ID.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = Suoro
Controls = Kontrol
Graphics = Tampilan
Help = Pithulungan
Networking = Jaringan
Search = Search
System = Sistem
Expand Down
1 change: 1 addition & 0 deletions assets/lang/ko_KR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = 오디오
Controls = 조작
Graphics = 그래픽
Help = 도움말(&H)
Networking = 네트워킹
System = 시스템
Tools = 도구
Expand Down
1 change: 1 addition & 0 deletions assets/lang/lo_LA.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = ສຽງ
Controls = ການຄວບຄຸມ
Graphics = ກຣາບຟິກ
Help = ຊ່ອຍເຫຼືອ
Networking = ເຄື່ອຂ່າຍ
Search = Search
System = ລະບົບ
Expand Down
1 change: 1 addition & 0 deletions assets/lang/lt-LT.ini
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ www.ppsspp.org = www.ppsspp.org
Audio = Garsas
Controls = Valdymas
Graphics = Grafika
Help = Help
Networking = Tinklų parametrai
Search = Search
System = Sistema
Expand Down
Loading
Loading