Skip to content
This repository has been archived by the owner on Aug 7, 2022. It is now read-only.

Commit

Permalink
[Change] メニュータイマーの表示を切替可能に
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiro527 committed Jan 19, 2022
1 parent d41ecf1 commit eb4eeb8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/js/preload/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const injectExitBtn = () => {
const initMenuTimer = () => {
const instructions = document.getElementById('instructions');
const menuTimerText = `
<div id='menuTimer' style='position:absolute;top:55%;left:50%;margin-right:50%;transform:translate(-50%,-50%);font-size:50px;color:rgba(255, 255, 255, 0.8);'>00:00</div>
<div id='menuTimer' style='display:${config.get('enableTimer') ? 'block' : 'none'};position:absolute;top:55%;left:50%;margin-right:50%;transform:translate(-50%,-50%);font-size:50px;color:rgba(255, 255, 255, 0.8);'>00:00</div>
`;
instructions.insertAdjacentHTML('afterend', menuTimerText);

Expand Down Expand Up @@ -208,7 +208,7 @@ ipcRenderer.on('didFinishLoad', () => {
injectWaterMark();
initDiscordRPC();
if (isEnabledAltManager) injectAltManager();
if (isEnabledTimer) initMenuTimer();
initMenuTimer();
});

ipcRenderer.on('getLink', (e) => {
Expand Down
3 changes: 2 additions & 1 deletion app/js/util/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ module.exports = {
cat: 'General',
type: 'checkbox',
val: config.get('enableTimer', true),
restart: true,
restart: false,
default: true,
onchange: 'window.gt.toggleDisplay("menuTimer")',
},
autoPlay: {
id: 'autoPlay',
Expand Down
4 changes: 4 additions & 0 deletions app/js/util/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,4 +429,8 @@ exports.gameTools = class {
break;
}
}
toggleDisplay(id) {
const el = document.getElementById(id);
el.style.display = el.style.display != 'none' ? 'none' : 'block';
}
};

0 comments on commit eb4eeb8

Please sign in to comment.