forked from NG-SD-Plugins/PowerTools
Move wait periods to const file, increase period of periodic backend updates
This commit is contained in:
parent
cb3ec8d3a2
commit
324b290d35
2 changed files with 8 additions and 2 deletions
|
@ -33,3 +33,6 @@ export const PATH_GEN = "GENERAL_path";
|
||||||
|
|
||||||
export const MESSAGE_LIST = "MESSAGE_messages";
|
export const MESSAGE_LIST = "MESSAGE_messages";
|
||||||
|
|
||||||
|
export const PERIODICAL_BACKEND_PERIOD = 5000; // milliseconds
|
||||||
|
export const AUTOMATIC_REAPPLY_WAIT = 2000; // milliseconds
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,9 @@ import {
|
||||||
PATH_GEN,
|
PATH_GEN,
|
||||||
|
|
||||||
MESSAGE_LIST,
|
MESSAGE_LIST,
|
||||||
|
|
||||||
|
PERIODICAL_BACKEND_PERIOD,
|
||||||
|
AUTOMATIC_REAPPLY_WAIT,
|
||||||
} from "./consts";
|
} from "./consts";
|
||||||
import { set_value, get_value } from "usdpl-front";
|
import { set_value, get_value } from "usdpl-front";
|
||||||
import { Debug } from "./components/debug";
|
import { Debug } from "./components/debug";
|
||||||
|
@ -196,7 +199,7 @@ const reload = function() {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
endHook = SteamClient.Apps.RegisterForGameActionEnd((actionType) => {
|
endHook = SteamClient.Apps.RegisterForGameActionEnd((actionType) => {
|
||||||
backend.log(backend.LogLevel.Info, "RegisterForGameActionEnd callback(" + actionType + ")");
|
backend.log(backend.LogLevel.Info, "RegisterForGameActionEnd callback(" + actionType + ")");
|
||||||
setTimeout(() => backend.forceApplySettings(), 2000 /* ms */);
|
setTimeout(() => backend.forceApplySettings(), AUTOMATIC_REAPPLY_WAIT);
|
||||||
});
|
});
|
||||||
|
|
||||||
backend.log(backend.LogLevel.Debug, "Registered PowerTools callbacks, hello!");
|
backend.log(backend.LogLevel.Debug, "Registered PowerTools callbacks, hello!");
|
||||||
|
@ -230,7 +233,7 @@ const Content: VFC<{ serverAPI: ServerAPI }> = ({}) => {
|
||||||
periodicHook = setInterval(function() {
|
periodicHook = setInterval(function() {
|
||||||
periodicals();
|
periodicals();
|
||||||
reloadGUI("periodic" + (new Date()).getTime().toString());
|
reloadGUI("periodic" + (new Date()).getTime().toString());
|
||||||
}, 1000);
|
}, PERIODICAL_BACKEND_PERIOD);
|
||||||
|
|
||||||
if (!usdplReady || !get_value(LIMITS_INFO)) {
|
if (!usdplReady || !get_value(LIMITS_INFO)) {
|
||||||
// Not translated on purpose (to avoid USDPL issues)
|
// Not translated on purpose (to avoid USDPL issues)
|
||||||
|
|
Loading…
Reference in a new issue