mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-12 17:17:09 -04:00
Cache WoM env and terrain identifiers.
This commit is contained in:
parent
1a61c78ed6
commit
60f0086680
@ -316,7 +316,9 @@ namespace ClassicalSharp {
|
||||
// different world, the environment settings from the last world are not loaded in the
|
||||
// new world if the async 'get request' didn't complete before the new world was loaded.
|
||||
womCounter++;
|
||||
Window.AsyncDownloader.DownloadPage( url, true, "womenv_" + womCounter );
|
||||
womEnvIdentifier = "womenv_" + womCounter;
|
||||
womTerrainIdentifier = "womterrain_" + womCounter;
|
||||
Window.AsyncDownloader.DownloadPage( url, true, womEnvIdentifier );
|
||||
sendWomId = true;
|
||||
}
|
||||
receivedFirstPosition = false;
|
||||
|
@ -7,9 +7,10 @@ namespace ClassicalSharp {
|
||||
|
||||
public partial class NetworkProcessor {
|
||||
|
||||
string womEnvIdentifier = "womenv_0", womTerrainIdentifier = "womterrain_0";
|
||||
void CheckForWomEnvironment() {
|
||||
string page;
|
||||
Window.AsyncDownloader.TryGetPage( "womenv_" + womCounter, out page );
|
||||
Window.AsyncDownloader.TryGetPage( womEnvIdentifier, out page );
|
||||
if( page != null ) {
|
||||
ParseWomConfig( page );
|
||||
}
|
||||
@ -18,7 +19,7 @@ namespace ClassicalSharp {
|
||||
|
||||
void CheckWomBitmaps() {
|
||||
Bitmap terrainBmp;
|
||||
Window.AsyncDownloader.TryGetImage( "womterrain_" + womCounter, out terrainBmp );
|
||||
Window.AsyncDownloader.TryGetImage( womTerrainIdentifier, out terrainBmp );
|
||||
if( terrainBmp != null ) {
|
||||
Window.ChangeTerrainAtlas( terrainBmp );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user