diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-03-28 07:41:46 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-03-28 07:41:46 +0800 |
commit | 6b4a3494453850abbda11dd1f3a2e40274ee4c3e (patch) | |
tree | a695086bd1149e335439244466886f793a395189 | |
parent | 58c6efd5ee94d8daf3a2bd19426de466d454b690 (diff) | |
download | SoopyV2-6b4a3494453850abbda11dd1f3a2e40274ee4c3e.tar.gz SoopyV2-6b4a3494453850abbda11dd1f3a2e40274ee4c3e.tar.bz2 SoopyV2-6b4a3494453850abbda11dd1f3a2e40274ee4c3e.zip |
Improvements to loading waypoints for diana
-rw-r--r-- | features/dataLoader/index.js | 7 | ||||
-rw-r--r-- | features/events/index.js | 18 | ||||
-rw-r--r-- | metadata.json | 4 |
3 files changed, 15 insertions, 14 deletions
diff --git a/features/dataLoader/index.js b/features/dataLoader/index.js index f320ea6..e06925c 100644 --- a/features/dataLoader/index.js +++ b/features/dataLoader/index.js @@ -32,11 +32,15 @@ class DataLoader extends Feature { "player_raw": undefined } + this.worldLoaded = true + this.loadApi() } worldLoad(){ this.area = undefined + + this.worldLoaded = true } loadApi(){ @@ -57,8 +61,9 @@ class DataLoader extends Feature { if(!key) return if(this.loadedApiDatas[type] !== undefined){ - if(Date.now()-this.loadedApiDatas[type] < 5000) return + if(Date.now()-this.loadedApiDatas[type] < 5000 && !this.worldLoaded) return } + this.worldLoaded =false this.loadedApiDatas[type] = Date.now() diff --git a/features/events/index.js b/features/events/index.js index 96a3de0..af8a664 100644 --- a/features/events/index.js +++ b/features/events/index.js @@ -175,9 +175,7 @@ class Events extends Feature { step_5s(){ if(this.showingWaypoints){ if(this.burrialWaypointsPath.getValue() || this.burrialWaypointsNearest.getValue()){ - new Thread(()=>{ //TODO: make 5head thing to re-use threads - this.updateBurrialPath() - }).start() + this.updateBurrialPath() } } this.sortBurrialLocations() @@ -191,6 +189,7 @@ class Events extends Feature { this.burrialData.points = [] this.burrialData.locations = [] this.burrialData.historicalLocations = [] + this.lastRequestTime = 0 this.nextUpdateApprox = Date.now() @@ -202,9 +201,9 @@ class Events extends Feature { } apiLoad(data, dataType, isSoopyServer, isLatest){ - if(!this.showingWaypoints) return; if(isSoopyServer || dataType !== "skyblock" || !isLatest) return this.lastRequest = Date.now() + ChatLib.chat("loading api ") let profileData = data.profiles[0].members[Player.getUUID().toString().replace(/-/g,"")] @@ -257,6 +256,7 @@ class Events extends Feature { } } }) + ChatLib.chat("Loaeded " +newLocs.length) this.burrialData.locations = newLocs this.sortBurrialLocations() @@ -369,7 +369,7 @@ class Events extends Feature { this.potentialParticleLocs[locstr].timestamp = Date.now() - if(this.potentialParticleLocs[locstr].enchant > 2 && this.potentialParticleLocs[locstr].step > 5){ + if(this.potentialParticleLocs[locstr].enchant > 4 && this.potentialParticleLocs[locstr].step > 10){ this.burrialData.locations.push({ "x": locarr[0], "y": locarr[1], @@ -379,9 +379,7 @@ class Events extends Feature { "chain": -1, "fromApi": false }) - new Thread(()=>{ - this.updateBurrialPath() - }).start() + this.updateBurrialPath() } } } @@ -413,9 +411,7 @@ class Events extends Feature { }) if(this.burrialData.historicalLocations.length > 10) this.burrialData.historicalLocations.pop() if(this.lastPathCords) this.lastPathCords.shift() - new Thread(()=>{ - this.updateBurrialPath() - }).start() + this.updateBurrialPath() } updateBurrialPath(){ if(this.burrialWaypointsPath.getValue() || this.burrialWaypointsNearest.getValue()){ diff --git a/metadata.json b/metadata.json index fec309c..c21c297 100644 --- a/metadata.json +++ b/metadata.json @@ -5,7 +5,7 @@ "entry": "index.js", "description": "Soopy addons v2", "name": "SoopyV2", - "version": "2.1.40", - "versionId": 167, + "version": "2.1.41", + "versionId": 168, "requires": ["soopyApis", "soopyAddonsData", "CustomTabCompletions", "guimanager", "mappings"] } |