Skip to content

Commit 139b72e

Browse files
no message
1 parent a4fdfd5 commit 139b72e

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

LSQuickScripts/Example Project/LSQuickScripts Examples/Assets/LSQuickScripts/LSQuickScripts.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ui {"widget":"label"}
22
//@ui {"widget":"separator"}
3-
//@ui {"widget":"label", "label":"<big><b>📜 LSQuickScripts 2.26</b> <small>by Max van Leeuwen"}
3+
//@ui {"widget":"label", "label":"<big><b>📜 LSQuickScripts 2.27</b> <small>by Max van Leeuwen"}
44
//@ui {"widget":"label", "label":"See this script for more info!"}
55
//@ui {"widget":"label"}
66
//@ui {"widget":"label", "label":"<small><a href=\"https://www.maxvanleeuwen.com/lsquickscripts\">maxvanleeuwen.com/LSQuickScripts</a>"}
@@ -3476,15 +3476,15 @@ global.VisualizePoints = function(showPointsOnStart){
34763476
global.rankedAction = function(label, prio, func){
34773477
// store a given action/prio combo (creates store and label if not already there)
34783478
function store(){
3479-
if(!global.rankedActionStore) global.rankedActionStore = {}; // create store
3480-
if(!global.rankedActionStore[label]) global.rankedActionStore[label] = {}; // create label
3481-
global.rankedActionStore[label].func = func; // assign function
3482-
global.rankedActionStore[label].prio = prio; // assign prio
3479+
if(!script.rankedActionStore) script.rankedActionStore = {}; // create store
3480+
if(!script.rankedActionStore[label]) script.rankedActionStore[label] = {}; // create label
3481+
script.rankedActionStore[label].func = func; // assign function
3482+
script.rankedActionStore[label].prio = prio; // assign prio
34833483
}
34843484

3485-
if(global.rankedActionStore){ // if a store was already made by another script
3486-
if(global.rankedActionStore[label]){ // if this specific label already exists in the store
3487-
if(prio > global.rankedActionStore[label].prio) store(); // store this new action if new prio is greater than existing
3485+
if(script.rankedActionStore){ // if a store was already made by another script
3486+
if(script.rankedActionStore[label]){ // if this specific label already exists in the store
3487+
if(prio > script.rankedActionStore[label].prio) store(); // store this new action if new prio is greater than existing
34883488
}else{ // if label does not exist yet
34893489
store(); // store new action under new label
34903490
}
@@ -3495,9 +3495,9 @@ global.rankedAction = function(label, prio, func){
34953495
// do check at end of frame
34963496
var rankedActionEvent = script.createEvent("LateUpdateEvent");
34973497
rankedActionEvent.bind(function(){ // the end-of-frame check
3498-
for(const thisLabel in global.rankedActionStore){ // go through all labels' stored data
3499-
if(global.rankedActionStore[thisLabel].func) global.rankedActionStore[thisLabel].func(); // call winner
3500-
delete global.rankedActionStore[thisLabel]; // remove from list (but keep the overall store)
3498+
for(const thisLabel in script.rankedActionStore){ // go through all labels' stored data
3499+
if(script.rankedActionStore[thisLabel].func) script.rankedActionStore[thisLabel].func(); // call winner
3500+
delete script.rankedActionStore[thisLabel]; // remove from list (but keep the overall store)
35013501
}
35023502
script.removeEvent(rankedActionEvent); // only do this for one frame
35033503
});

LSQuickScripts/LSQuickScripts.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ui {"widget":"label"}
22
//@ui {"widget":"separator"}
3-
//@ui {"widget":"label", "label":"<big><b>📜 LSQuickScripts 2.26</b> <small>by Max van Leeuwen"}
3+
//@ui {"widget":"label", "label":"<big><b>📜 LSQuickScripts 2.27</b> <small>by Max van Leeuwen"}
44
//@ui {"widget":"label", "label":"See this script for more info!"}
55
//@ui {"widget":"label"}
66
//@ui {"widget":"label", "label":"<small><a href=\"https://www.maxvanleeuwen.com/lsquickscripts\">maxvanleeuwen.com/LSQuickScripts</a>"}
@@ -3476,15 +3476,15 @@ global.VisualizePoints = function(showPointsOnStart){
34763476
global.rankedAction = function(label, prio, func){
34773477
// store a given action/prio combo (creates store and label if not already there)
34783478
function store(){
3479-
if(!global.rankedActionStore) global.rankedActionStore = {}; // create store
3480-
if(!global.rankedActionStore[label]) global.rankedActionStore[label] = {}; // create label
3481-
global.rankedActionStore[label].func = func; // assign function
3482-
global.rankedActionStore[label].prio = prio; // assign prio
3479+
if(!script.rankedActionStore) script.rankedActionStore = {}; // create store
3480+
if(!script.rankedActionStore[label]) script.rankedActionStore[label] = {}; // create label
3481+
script.rankedActionStore[label].func = func; // assign function
3482+
script.rankedActionStore[label].prio = prio; // assign prio
34833483
}
34843484

3485-
if(global.rankedActionStore){ // if a store was already made by another script
3486-
if(global.rankedActionStore[label]){ // if this specific label already exists in the store
3487-
if(prio > global.rankedActionStore[label].prio) store(); // store this new action if new prio is greater than existing
3485+
if(script.rankedActionStore){ // if a store was already made by another script
3486+
if(script.rankedActionStore[label]){ // if this specific label already exists in the store
3487+
if(prio > script.rankedActionStore[label].prio) store(); // store this new action if new prio is greater than existing
34883488
}else{ // if label does not exist yet
34893489
store(); // store new action under new label
34903490
}
@@ -3495,9 +3495,9 @@ global.rankedAction = function(label, prio, func){
34953495
// do check at end of frame
34963496
var rankedActionEvent = script.createEvent("LateUpdateEvent");
34973497
rankedActionEvent.bind(function(){ // the end-of-frame check
3498-
for(const thisLabel in global.rankedActionStore){ // go through all labels' stored data
3499-
if(global.rankedActionStore[thisLabel].func) global.rankedActionStore[thisLabel].func(); // call winner
3500-
delete global.rankedActionStore[thisLabel]; // remove from list (but keep the overall store)
3498+
for(const thisLabel in script.rankedActionStore){ // go through all labels' stored data
3499+
if(script.rankedActionStore[thisLabel].func) script.rankedActionStore[thisLabel].func(); // call winner
3500+
delete script.rankedActionStore[thisLabel]; // remove from list (but keep the overall store)
35013501
}
35023502
script.removeEvent(rankedActionEvent); // only do this for one frame
35033503
});

0 commit comments

Comments
 (0)