Skip to content

Commit

Permalink
App: convert hook game after launching to enable read game data
Browse files Browse the repository at this point in the history
  • Loading branch information
themitosan committed Sep 16, 2024
1 parent 4834335 commit 25d2888
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions App/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<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>
<input type="checkbox" id="CHECKBOX_enableReadGameData" checked="true">
<label title="Set this checkbox active to enable reading data from game." onclick="APP.tools.processCheckbox('CHECKBOX_enableReadGameData', APP.options.toggleReadGameData);"> - Read game data</label>
</div>

<div class="DIV_CHECKBOX">
Expand Down
4 changes: 3 additions & 1 deletion App/js/gamehook.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ temp_GAMEHOOK = {
APP.graphics.updateGuiLabel();
APP.graphics.togglehideTopMenu();
APP.gameHook.updateObject = setInterval(function(){
APP.gameHook.updateProcess();
if (APP.options.enableReadGameData === !0){
APP.gameHook.updateProcess();
}
}, 100);

} catch (err) {
Expand Down
6 changes: 0 additions & 6 deletions App/js/graphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -1141,12 +1141,6 @@ 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: 1 addition & 3 deletions App/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,7 @@ const APP = {

// Seek game process
setTimeout(function(){
if (APP.options.hookAfterGameStart === !0){
APP.gameHook.seekGame(!0);
}
APP.gameHook.seekGame(!0);
APP.graphics.updateGuiLabel();
if (JSON.parse(localStorage.getItem('showGameData')) === !0){
TMS.css('APP_GAME_DATA', { 'display': 'block' });
Expand Down
11 changes: 8 additions & 3 deletions App/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ temp_OPTIONS = {
showGameHints: !1,
enableTabletMode: !1,
isMenuRightClosed: !1,
hookAfterGameStart: !0,
enableReadGameData: !0,
enableBgObjectiveAnimation: !0,
bioRandObjectives: {
reset: !1,
Expand Down Expand Up @@ -136,6 +136,12 @@ temp_OPTIONS = {
Functions
*/

// Toggle enable reading game data
toggleReadGameData: function(){
APP.options.enableReadGameData = document.getElementById('CHECKBOX_enableReadGameData').checked;
localStorage.setItem('enableReadGameData', document.getElementById('CHECKBOX_enableReadGameData').checked);
},

// Toggle always on top function
toggleAlwaysOnTop: function(){
APP.options.alwaysOnTop = document.getElementById('CHECKBOX_alwaysOnTop').checked;
Expand All @@ -148,7 +154,6 @@ temp_OPTIONS = {

// Declare variables and switch mode
var dragBarCss;

switch (mode){

case 'open':
Expand Down Expand Up @@ -625,7 +630,7 @@ temp_OPTIONS = {
'enableCamHint',
'showGameHints',
'enableTabletMode',
'hookAfterGameStart',
'enableReadGameData',
'enableBgObjectiveAnimation'
].forEach(function(cSettings){

Expand Down

0 comments on commit 25d2888

Please sign in to comment.