Improve client script load a bit
This commit is contained in:
@@ -16,9 +16,6 @@ function initEventScript() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function addAllEventHandlers() {
|
function addAllEventHandlers() {
|
||||||
addEventHandler("OnResourceStart", onResourceStart);
|
|
||||||
addEventHandler("OnResourceReady", onResourceReady);
|
|
||||||
addEventHandler("OnResourceStop", onResourceStop);
|
|
||||||
addEventHandler("OnProcess", onProcess);
|
addEventHandler("OnProcess", onProcess);
|
||||||
addEventHandler("OnKeyUp", onKeyUp);
|
addEventHandler("OnKeyUp", onKeyUp);
|
||||||
addEventHandler("OnDrawnHUD", onDrawnHUD);
|
addEventHandler("OnDrawnHUD", onDrawnHUD);
|
||||||
@@ -94,8 +91,11 @@ function onResourceStop(event, resource) {
|
|||||||
function onResourceReady(event, resource) {
|
function onResourceReady(event, resource) {
|
||||||
if (resource == thisResource) {
|
if (resource == thisResource) {
|
||||||
logToConsole(LOG_DEBUG | LOG_WARN, `[V.RP.Event] onResourceReady called - Sending signal to server`);
|
logToConsole(LOG_DEBUG | LOG_WARN, `[V.RP.Event] onResourceReady called - Sending signal to server`);
|
||||||
loadLocaleConfig();
|
|
||||||
sendResourceReadySignalToServer();
|
setTimeout(function () {
|
||||||
|
initClientScripts();
|
||||||
|
sendResourceReadySignalToServer();
|
||||||
|
}, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ function initClientScripts() {
|
|||||||
initPayPhoneScript();
|
initPayPhoneScript();
|
||||||
initTimersScript();
|
initTimersScript();
|
||||||
initJobScript();
|
initJobScript();
|
||||||
|
initItemScript();
|
||||||
|
initBusinessScript();
|
||||||
|
initHouseScript();
|
||||||
|
|
||||||
|
loadLocaleConfig();
|
||||||
|
|
||||||
addAllNetworkHandlers();
|
addAllNetworkHandlers();
|
||||||
|
|
||||||
@@ -203,6 +208,8 @@ function setUpInitialGame() {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
initClientScripts();
|
addEventHandler("OnResourceStart", onResourceStart);
|
||||||
|
addEventHandler("OnResourceReady", onResourceReady);
|
||||||
|
addEventHandler("OnResourceStop", onResourceStop);
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
Reference in New Issue
Block a user