CwCheats: Add ms unit, rename to Refresh Interval.

This commit is contained in:
Henrik Rydgård 2024-01-19 14:58:40 +01:00
parent 7a318b46e8
commit b71ccfdb71
49 changed files with 68 additions and 53 deletions

View File

@ -166,6 +166,15 @@ PopupSliderChoice::PopupSliderChoice(int *value, int minValue, int maxValue, int
OnClick.Handle(this, &PopupSliderChoice::HandleClick);
}
void PopupSliderChoice::SetFormat(std::string_view fmt) {
fmt_ = fmt;
if (units_.empty()) {
if (startsWith(fmt_, "%d ")) {
units_ = fmt_.substr(3);
}
}
}
PopupSliderChoiceFloat::PopupSliderChoiceFloat(float *value, float minValue, float maxValue, float defaultValue, const std::string &text, ScreenManager *screenManager, const std::string &units, LayoutParams *layoutParams)
: AbstractChoiceWithValueDisplay(text, layoutParams), value_(value), minValue_(minValue), maxValue_(maxValue), defaultValue_(defaultValue), step_(1.0f), units_(units), screenManager_(screenManager) {
_dbg_assert_(maxValue > minValue);
@ -181,6 +190,15 @@ PopupSliderChoiceFloat::PopupSliderChoiceFloat(float *value, float minValue, flo
OnClick.Handle(this, &PopupSliderChoiceFloat::HandleClick);
}
void PopupSliderChoiceFloat::SetFormat(std::string_view fmt) {
fmt_ = fmt;
if (units_.empty()) {
if (startsWith(fmt_, "%f ")) {
units_ = fmt_.substr(3);
}
}
}
EventReturn PopupSliderChoice::HandleClick(EventParams &e) {
restoreFocus_ = HasFocus();

View File

@ -285,9 +285,7 @@ public:
PopupSliderChoice(int *value, int minValue, int maxValue, int defaultValue, const std::string &text, ScreenManager *screenManager, const std::string &units = "", LayoutParams *layoutParams = 0);
PopupSliderChoice(int *value, int minValue, int maxValue, int defaultValue, const std::string &text, int step, ScreenManager *screenManager, const std::string &units = "", LayoutParams *layoutParams = 0);
void SetFormat(const char *fmt) {
fmt_ = fmt;
}
void SetFormat(std::string_view fmt);
void SetZeroLabel(const std::string &str) {
zeroLabel_ = str;
}
@ -322,9 +320,7 @@ public:
PopupSliderChoiceFloat(float *value, float minValue, float maxValue, float defaultValue, const std::string &text, ScreenManager *screenManager, const std::string &units = "", LayoutParams *layoutParams = 0);
PopupSliderChoiceFloat(float *value, float minValue, float maxValue, float defaultValue, const std::string &text, float step, ScreenManager *screenManager, const std::string &units = "", LayoutParams *layoutParams = 0);
void SetFormat(const char *fmt) {
fmt_ = fmt;
}
void SetFormat(std::string_view fmt);
void SetZeroLabel(const std::string &str) {
zeroLabel_ = str;
}

View File

@ -213,7 +213,7 @@ static const ConfigSetting generalSettings[] = {
ConfigSetting("DisableHTTPS", &g_Config.bDisableHTTPS, false, CfgFlag::DONT_SAVE),
ConfigSetting("AutoLoadSaveState", &g_Config.iAutoLoadSaveState, 0, CfgFlag::PER_GAME),
ConfigSetting("EnableCheats", &g_Config.bEnableCheats, false, CfgFlag::PER_GAME | CfgFlag::REPORT),
ConfigSetting("CwCheatRefreshRate", &g_Config.iCwCheatRefreshRate, 77, CfgFlag::PER_GAME),
ConfigSetting("CwCheatRefreshRate", &g_Config.iCwCheatRefreshIntervalMs, 77, CfgFlag::PER_GAME),
ConfigSetting("CwCheatScrollPosition", &g_Config.fCwCheatScrollPosition, 0.0f, CfgFlag::PER_GAME),
ConfigSetting("GameListScrollPosition", &g_Config.fGameListScrollPosition, 0.0f, CfgFlag::DEFAULT),
ConfigSetting("DebugOverlay", &g_Config.iDebugOverlay, 0, CfgFlag::DONT_SAVE),

View File

@ -237,7 +237,7 @@ public:
int iAutoLoadSaveState; // 0 = off, 1 = oldest, 2 = newest, >2 = slot number + 3
bool bEnableCheats;
bool bReloadCheats;
int iCwCheatRefreshRate;
int iCwCheatRefreshIntervalMs;
float fCwCheatScrollPosition;
float fGameListScrollPosition;
int iBloomHack; //0 = off, 1 = safe, 2 = balanced, 3 = aggressive

View File

@ -270,7 +270,7 @@ static void __CheatStart() {
}
static int GetRefreshMs() {
int refresh = g_Config.iCwCheatRefreshRate;
int refresh = g_Config.iCwCheatRefreshIntervalMs;
if (!cheatsEnabled)
refresh = 1000;

View File

@ -109,7 +109,8 @@ void CwCheatScreen::CreateViews() {
leftColumn->Add(new Choice(cw->T("Edit Cheat File")))->OnClick.Handle(this, &CwCheatScreen::OnEditCheatFile);
#endif
leftColumn->Add(new Choice(di->T("Disable All")))->OnClick.Handle(this, &CwCheatScreen::OnDisableAll);
leftColumn->Add(new PopupSliderChoice(&g_Config.iCwCheatRefreshRate, 1, 1000, 77, cw->T("Refresh Rate"), 1, screenManager()));
leftColumn->Add(new PopupSliderChoice(&g_Config.iCwCheatRefreshIntervalMs, 1, 1000, 77, cw->T("Refresh Interval"), 1, screenManager()))->SetFormat(di->T("%d ms"));
rightScroll_ = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 0.5f));
rightScroll_->SetTag("CwCheats");

View File

@ -183,7 +183,7 @@ Cheats = ‎الشفرات
Edit Cheat File = ‎عدل ملف الشفرة
Import Cheats = ‎إستورد من cheat.db
Import from %s = ‎إستورد من %s
Refresh Rate = ‎معدل التحديث
Refresh interval = ‎معدل التحديث
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Cheats
Edit Cheat File = Edit cheat file
Import Cheats = Import from cheat.db
Import from %s = Import from %s
Refresh Rate = Refresh rate
Refresh interval = Refresh interval
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Чийтове
Edit Cheat File = Edit cheat file
Import Cheats = Внеси от cheat.db
Import from %s = Внеси от %s
Refresh Rate = Refresh rate
Refresh interval = Refresh interval
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Trucs
Edit Cheat File = Editar el fitxer de trucs
Import Cheats = Importar «cheat.db»
Import from %s = Importar %s
Refresh Rate = Freqüència de refrescament
Refresh interval = Freqüència de refrescament
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Cheaty
Edit Cheat File = Upravit soubor s cheaty
Import Cheats = Importovat z cheat.db
Import from %s = Importovat z %s
Refresh Rate = Frekvence obnoveni
Refresh interval = Frekvence obnoveni
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Snyd
Edit Cheat File = Editer snydefil
Import Cheats = Import from cheat.db
Import from %s = Importer fra %s
Refresh Rate = Opdateringsrate
Refresh interval = Opdateringsinterval
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Cheats
Edit Cheat File = Cheatdatei ändern
Import Cheats = Cheats importieren (aus cheat.db)
Import from %s = Import from %s
Refresh Rate = Wiederholfrequenz
Refresh interval = Wiederholfrequenz
[DesktopUI]
# Wenn ihre Sprache nicht gut mit dem normalen Font angezeigt wird, können sie dieses Font mit dem Font ändern.

View File

@ -175,7 +175,7 @@ Cheats = Cheat
Edit Cheat File = Edit cheat file
Import Cheats = Patamanni cheat.db
Import from %s = Patamanni %s
Refresh Rate = Refresh rate
Refresh interval = Refresh interval
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -199,7 +199,7 @@ Cheats = Cheats
Edit Cheat File = Edit cheat file
Import Cheats = Import from cheat.db
Import from %s = Import from %s
Refresh Rate = Refresh rate
Refresh interval = Refresh interval
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Trucos
Edit Cheat File = Editar archivo de trucos
Import Cheats = Importar archivo cheat.db
Import from %s = Importar de %s
Refresh Rate = Frecuencia de actualización
Refresh interval = Frecuencia de actualización
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = trucos
Edit Cheat File = Editar archivo de trucos
Import Cheats = Importar archivo cheat.db
Import from %s = Import from %s
Refresh Rate = Frecuencia de actualización
Refresh interval = Frecuencia de actualización
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = ‎کد های تقلب
Edit Cheat File = ‎ویرایش فایل کد ها
Import Cheats = cheat.db وارد کردن از
Import from %s = Import from %s
Refresh Rate = بازیابی نرخ
Refresh interval = بازیابی نرخ
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Huijaukset
Edit Cheat File = Muokkaa huijaus tiedostoa
Import Cheats = Tuo huijauksia
Import from %s = %s
Refresh Rate = Ruudunpäivitysnopeus
Refresh interval = Ruudunpäivitysnopeus
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Codes de triche
Edit Cheat File = Modifier le fichier de triche
Import Cheats = Importer des codes de triche
Import from %s = Importer de %s
Refresh Rate = Taux de rafraîchissement
Refresh interval = Taux de rafraîchissement
[DesktopUI]
# PPSSPP peut utiliser n'importe quelle police installée sur votre système.

View File

@ -175,7 +175,7 @@ Cheats = Trucos
Edit Cheat File = Editar arquivo de trucos
Import Cheats = Importar cheat.db
Import from %s = Importar %s
Refresh Rate = Frecuencia de actualización
Refresh interval = Frecuencia de actualización
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Κωδικοί
Edit Cheat File = Επεξεργασία αρχείου κωδικών
Import Cheats = Εισαγωγή από cheat.db
Import from %s = Εισαγωγή από %s
Refresh Rate = Ρυθμός ανανέωσης
Refresh interval = Ρυθμός ανανέωσης
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Cheats
Edit Cheat File = Edit cheat file
Import Cheats = Import from cheat.db
Import from %s = Import from %s
Refresh Rate = Refresh rate
Refresh interval = Refresh interval
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Cheats
Edit Cheat File = Edit cheat file
Import Cheats = Import from cheat.db
Import from %s = Import from %s
Refresh Rate = Refresh rate
Refresh interval = Refresh interval
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Šifre
Edit Cheat File = Izmijeni cheat datoteku
Import Cheats = Uvezi iz cheat.db
Import from %s = Uvezi iz %s
Refresh Rate = Brzina osvježavanja
Refresh interval = Brzina osvježavanja
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Csalások
Edit Cheat File = Csalás fájl szerkesztése
Import Cheats = Importálás cheat.db-ből
Import from %s = Importálás %s-ből
Refresh Rate = Frissítési gyakoriság
Refresh interval = Frissítési gyakoriság
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Pengecoh
Edit Cheat File = Edit berkas pengecoh
Import Cheats = Impor dari cheat.db
Import from %s = Impor dari %s
Refresh Rate = Perbarui penyegaran
Refresh interval = Perbarui penyegaran
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Trucchi
Edit Cheat File = Modifica file Trucchi
Import Cheats = Importa da cheat.db
Import from %s = Importa da %s
Refresh Rate = Frequenza di Aggiornamento
Refresh interval = Frequenza di Aggiornamento
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = チート
Edit Cheat File = チートファイルを編集する
Import Cheats = cheat.dbからインポートする
Import from %s = %sからインポートする
Refresh Rate = リフレッシュレート
Refresh interval = リフレッシュレート
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Mbeling
Edit Cheat File = Sunting berkas mbeling
Import Cheats = Import from cheat.db
Import from %s = Njokot soko %s
Refresh Rate = Restar rate
Refresh interval = Restar rate
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = 치트
Edit Cheat File = 치트 파일 수정
Import Cheats = cheat.db에서 가져오기
Import from %s = %s에서 가져오기
Refresh Rate = 주사율
Refresh interval = 주사율
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = ການໃຊ້ສູດໂກງ
Edit Cheat File = ປັບແຕ່ງໄຟລ໌ສູດໂກງ
Import Cheats = Import from cheat.db
Import from %s = ນຳເຂົ້າຈາກໄຟລ໌ສູດໂກງ %s
Refresh Rate = ອັດຕາການຟື້ນຟູ
Refresh interval = ອັດຕາການຟື້ນຟູ
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Kodai
Edit Cheat File = Redaguoti kodų failą
Import Cheats = Importuoti iš cheat.db
Import from %s = Importuoti iš %s
Refresh Rate = Atsinaujinimo dažnis
Refresh interval = Atsinaujinimo dažnis
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Cheat
Edit Cheat File = Ubah cheat file
Import Cheats = Import dari cheat.db
Import from %s = Import dari %s
Refresh Rate = Refresh rate
Refresh interval = Refresh interval
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Cheats
Edit Cheat File = Cheatbestand bewerken
Import Cheats = Importeren van cheat.db
Import from %s = Importeren van %s
Refresh Rate = Vernieuwingsfrequentie
Refresh interval = Vernieuwingsfrequentie
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Cheats
Edit Cheat File = Edit cheat file
Import Cheats = Import from cheat.db
Import from %s = Import from %s
Refresh Rate = Refresh rate
Refresh interval = Refresh interval
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Kody
Edit Cheat File = Edytuj plik kodów
Import Cheats = Importuj z pliku cheat.db
Import from %s = Importuj z pliku %s
Refresh Rate = Szybkość odświeżania
Refresh interval = Szybkość odświeżania
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -199,7 +199,7 @@ Cheats = Trapaças
Edit Cheat File = Editar arquivo de trapaças
Import Cheats = Importar do cheat.db
Import from %s = Importar do %s
Refresh Rate = Taxa de atualização
Refresh interval = Taxa de atualização
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -199,7 +199,7 @@ Cheats = Cheats
Edit Cheat File = Editar ficheiro de Cheats
Import Cheats = Importar de cheat.db
Import from %s = Importar de %s
Refresh Rate = Taxa de atualização
Refresh interval = Taxa de atualização
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -176,7 +176,7 @@ Edit Cheat File = Editare fișier trișare
Import Cheats = Importă din cheat.db
#Import %s = Importă din %s
Import from %s = Import from %s
Refresh Rate = Rată de împrospatare
Refresh interval = Rată de împrospatare
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Читы
Edit Cheat File = Изменить файл чита
Import Cheats = Импортировать из cheat.db
Import from %s = Импортировать из %s
Refresh Rate = Частота обновления
Refresh interval = Частота обновления
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Fusk
Edit Cheat File = Redigera fusk-fil
Import Cheats = Importera från cheat.db
Import from %s = Importera från %s
Refresh Rate = Uppdateringsfrekvens
Refresh interval = Uppdateringsintervall
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Mga Daya
Edit Cheat File = Edit Cheat File
Import Cheats = Import from cheat.db
Import from %s = Import ang mga daya mula sa %s
Refresh Rate = Refresh rate
Refresh interval = Refresh interval
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = การใช้สูตรโกง
Edit Cheat File = ปรับแต่งไฟล์สูตรโกง
Import Cheats = นำเข้าจากไฟล์สูตรโกง
Import from %s = นำเข้าจาก %s
Refresh Rate = อัตรารีเฟรช
Refresh interval = อัตรารีเฟรช
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Hileler
Edit Cheat File = Hile dosyasını düzenle
Import Cheats = cheat.db'den hile al
Import from %s = %s'den hile al
Refresh Rate = Yenileme Hızı
Refresh interval = Yenileme Hızı
[DesktopUI]
# EN: If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Чит-коди
Edit Cheat File = Змінити файл чит-коду
Import Cheats = Імпортувати з cheat.db
Import from %s = Імпортувати з %s
Refresh Rate = Частота оновлення
Refresh interval = Частота оновлення
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = Cheats
Edit Cheat File = Sửa mục cheat
Import Cheats = Nhập mã từ cheat.db
Import from %s = Nhập mã từ %s
Refresh Rate = Tần số làm mới
Refresh interval = Tần số làm mới
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = 金手指
Edit Cheat File = 编辑金手指文件
Import Cheats = 从cheat.db导入
Import from %s = 从%s导入
Refresh Rate = 刷新率
Refresh interval = 刷新率
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.

View File

@ -175,7 +175,7 @@ Cheats = 密技
Edit Cheat File = 編輯密技檔案
Import Cheats = 從 cheat.db 匯入
Import from %s = 從 %s 匯入
Refresh Rate = 重新整理速率
Refresh interval = 重新整理速率
[DesktopUI]
# If your language does not show well with the default font, you can use Font to specify a different one.