Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit 1f0a179

Browse files
authored
Merge pull request #20 from igor725/dev
Fixes
2 parents ae8f14d + 6a20fff commit 1f0a179

File tree

9 files changed

+41
-13
lines changed

9 files changed

+41
-13
lines changed

libs/settings.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ module.exports.Config = class Config {
5454

5555
const cp = path.join(this.getValue('emu_path'), '/config');
5656

57+
fs.mkdirSync(cp, { recursive: true });
58+
5759
this.#emuconfpath = {
5860
controls: path.join(cp, '/controls.json'),
5961
general: path.join(cp, '/general.json'),

main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,18 +268,22 @@ const commandHandler = (channel, cmd, info) => {
268268
genericWarnMsg('{$tr:main.actions.alrun}', true);
269269
return;
270270
}
271-
win.send('ingame', true);
272271
const emuargs = [`--file=${info.path}\\eboot.bin`];
273272
const patch = getGameSummary(info, false).patch;
274273
if (patch) emuargs.push(`--update=${patch}`);
275274

276275
const emupath = config.getValue('emu_path');
276+
if (!binname) {
277+
genericWarnMsg('{$tr:main.actions.execerror}');
278+
return;
279+
}
277280
gameproc = spawn(path.join(emupath, binname), emuargs, { cwd: emupath });
278281
gameproc.stdout.on('data', terminalListener);
279282
gameproc.stderr.on('data', terminalListener);
280283
gameproc._gameID = info.gid;
281284
gameproc._startTime = Date.now();
282285
discordRPC.setGame(info.gtitle);
286+
win.send('ingame', true);
283287

284288
gameproc.on('error', (err) => {
285289
genericWarnMsg('{$tr:main.actions.gerror}', true, { error: err.toString() });

webroot/css/warnmsg.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
}
1818

1919
#warnmsg p {
20-
margin-bottom: 15px;
20+
margin: 0;
21+
padding: 15px;
2122
}
2223

2324
#warnmsg progress {

webroot/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<div id="gameinfo">
4848
<div id="gamesummary" style="opacity: 0;">
4949
<div class="info lrun">
50-
<p class="title" eo-translator="main.gamesummary.lastrun"></p>
50+
<p class="title" eo-translator="main.gamesummary.lastrun.label"></p>
5151
<p>5/9/2024</p>
5252
</div>
5353
<div class="info lplay">

webroot/js/main/gamelist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@
238238
const lplay = gsummary.$('.lplay p:nth-child(2)');
239239
window.trophyAPI.updateAchieved(data.trophies);
240240
if (data.patch) getGameBadgeById(data.gid).dataset.gipatch = data.patch;
241-
lrun.innerText = data.lastrun === -1 ? 'Never' : (new Date(data.lastrun)).toLocaleDateString();
241+
lrun.innerText = data.lastrun === -1 ? window.trAPI.get('main.gamesummary.lastrun.null') : (new Date(data.lastrun)).toLocaleDateString();
242242
lplay.innerText = formatTime(data.playtime);
243243
gsummary.style.opacity = 1;
244244
});

webroot/js/main/trophies.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
if (cgameid < 0) cgameid += gamecnt;
2929
trlist.$('.multiple>.mult-list>a').innerText = names[cgameid];
3030
trlist.$$('.multiple>.mult-content>div').forEach((elem, idx) => {
31+
elem.scrollTo(0, 0); // todo Address bug: sometimes scroll won't reset 0, no matter what
3132
elem.style.display = cgameid === idx ? null : 'none';
3233
});
3334
});

webroot/js/settings.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ window._onLangReady = (() => {
7373
switch (type) {
7474
case 'string': return elem.dataset.cfgvalue;
7575
case 'int': return parseInt(elem.dataset.cfgvalue);
76-
default:
77-
return null;
76+
default: return null;
7877
}
7978
}
8079

webroot/langs/en.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,19 @@
7676
"alrun": "You should close your previous game first!",
7777
"nogame": "You should select the game first!",
7878
"gerror": "psOff process returned the error: {error}",
79+
"execerror": "Failed to find emulator binary in specified path! Please, open Settings window and press \"Force update check\" button.",
7980
"reqrst": "One or more changed settings requires restart!",
8081
"dblrun": "Do you want the launcher to run the game on doubleclick?"
8182
},
8283
"gamesummary": {
83-
"lastrun": "Last run:",
84+
"lastrun": {
85+
"label": "Last run:",
86+
"null": "never"
87+
},
8488
"playtime": {
8589
"label": "Playtime:",
8690
"duration": {
87-
"null": "Unplayed",
91+
"null": "unplayed",
8892
"seconds": "{value} sec.",
8993
"minutes": "{value} min.",
9094
"hours": "{value} hr."

webroot/langs/ru.json

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,25 @@
4848
"mastervol": "Общая громкость:",
4949
"lang": "Язык системы:",
5050
"fullscreen": "Полноэкранный режим:",
51+
"inbackends": "Настройка геймпада:",
5152
"keybinds": "Открыть настройки биндов клавиатуры",
52-
"inbackends": "Настройка геймпада:"
53+
"wkeybind": {
54+
"bindmessage": "Нажмите кнопку для {action}...",
55+
"alerts": {
56+
"multikey": "Далее будет показано {count} сообщений о привязке кнопок, которые пойдут друг за другом. Если вы нажмёте кнопку \"Отмена\" все сделанные в данный момент бинды будут отменены."
57+
},
58+
"buttons": {
59+
"save": "Сохранить и выйти",
60+
"reset": "Сбросить настройки",
61+
"exit": "Выйти без сохранения"
62+
}
63+
}
5364
},
5465
"alerts": {
5566
"ghtoken": "Nightly сборки требуют авторизации на GitHub! Хотите продолжить?\nПриложение откроет страницу для создания токена, вы должны создать fine-grained токен с любым названием и датой истечения. Оставьте все остальные поля без изменения и нажмите кнопку \"Generate token\" внизу страницы. Затем скопируйте сгенерированный токен в соответствующее поле в настройках.",
5667
"unavail": "Эта возможность недоступна в вашей текущей версии эмулятора!",
57-
"unsaved": "Обнаружены несохраненные настройки! Действительно ли вы хотите выйти?"
68+
"unsaved": "Обнаружены несохраненные настройки! Действительно ли вы хотите выйти?",
69+
"multiplekb": "Больше одного бекенда геймпада установлено на значенеи \"keyboard\" так делать не рекомендуется, потому что каждое ваше нажатие будет сообщено всем геймпадам одновременно! Вы хотите продолжить?"
5870
},
5971
"save": "Сохранить и выйти",
6072
"close": "Закрыть без сохранения"
@@ -64,14 +76,19 @@
6476
"alrun": "Предыдущая игра не закрыта!",
6577
"nogame": "Необходимо сначала выбрать игру в списке!",
6678
"gerror": "Процесс psOff вернул ошибку: {error}",
67-
"reqrst": "Некоторые измененные настройки требуют перезагрузки лаунчера!"
79+
"execerror": "Указан неверный путь до директории эмулятора! Пожалуйста, откройте окно \"Настройки\" и нажмите кнопку \"Принудительная проверка обновлений\".",
80+
"reqrst": "Некоторые измененные настройки требуют перезагрузки лаунчера!",
81+
"dblrun": "Включить запуск игр по двойному нажатию?"
6882
},
6983
"gamesummary": {
70-
"lastrun": "Запуск:",
84+
"lastrun": {
85+
"label": "Запуск:",
86+
"null": "никогда"
87+
},
7188
"playtime": {
7289
"label": "Наиграно:",
7390
"duration": {
74-
"null": "Unplayed",
91+
"null": "нисколько",
7592
"seconds": "{value} сек.",
7693
"minutes": "{value} мин.",
7794
"hours": "{value} ч."

0 commit comments

Comments
 (0)