Skip to content

Commit

Permalink
App: implement option to not hook on game process after launching
Browse files Browse the repository at this point in the history
  • Loading branch information
themitosan committed Sep 15, 2024
1 parent eb477e3 commit 4834335
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions App/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@
</div>
<div class="SEPARATOR_0"></div>

<div class="DIV_CHECKBOX">
<input type="checkbox" id="CHECKBOX_hookAfterGameStart" checked="true">
<label title="Set this checkbox active to start reading data after game launch." onclick="APP.tools.processCheckbox('CHECKBOX_hookAfterGameStart', APP.graphics.toggleHookAfterGameStart);"> - Auto hook game</label>
</div>

<div class="DIV_CHECKBOX">
<input type="checkbox" id="CHECKBOX_isBioRand">
<label title="Set this checkbox active if you are playing BioRand mod." onclick="APP.tools.processCheckbox('CHECKBOX_isBioRand', APP.graphics.updateGuiLabel);"> - Is BioRand?</label>
Expand Down
6 changes: 6 additions & 0 deletions App/js/graphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,12 @@ temp_GRAPHICS = {

},

// Toggle hook after game start
toggleHookAfterGameStart: function(){
APP.options.hookAfterGameStart = document.getElementById('CHECKBOX_hookAfterGameStart').checked;
localStorage.setItem('hookAfterGameStart', document.getElementById('CHECKBOX_hookAfterGameStart').checked);
},

// Toggle show game data
toggleShowGameData: function(){

Expand Down
4 changes: 3 additions & 1 deletion App/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ const APP = {

// Seek game process
setTimeout(function(){
APP.gameHook.seekGame(!0);
if (APP.options.hookAfterGameStart === !0){
APP.gameHook.seekGame(!0);
}
APP.graphics.updateGuiLabel();
if (JSON.parse(localStorage.getItem('showGameData')) === !0){
TMS.css('APP_GAME_DATA', { 'display': 'block' });
Expand Down
4 changes: 3 additions & 1 deletion App/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ temp_OPTIONS = {
showGameHints: !1,
enableTabletMode: !1,
isMenuRightClosed: !1,
hookAfterGameStart: !0,
enableBgObjectiveAnimation: !0,
bioRandObjectives: {
reset: !1,
Expand Down Expand Up @@ -616,14 +617,15 @@ temp_OPTIONS = {
/*
Get localStorage settings
*/
const lStorageSettingsList = [
[
'enableGrid',
'hideTopMenu',
'alwaysOnTop',
'showGameData',
'enableCamHint',
'showGameHints',
'enableTabletMode',
'hookAfterGameStart',
'enableBgObjectiveAnimation'
].forEach(function(cSettings){

Expand Down

0 comments on commit 4834335

Please sign in to comment.