Changeset 423 for binary-improvements2/MapRendering/src/ModApi.cs
- Timestamp:
- Mar 28, 2023, 8:08:01 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/MapRendering/src/ModApi.cs
r406 r423 7 7 public class ModApi : IModApi { 8 8 public void InitMod (Mod _modInstance) { 9 if (ConnectionManager.Instance.IsServer) { 10 ModEvents.GameShutdown.RegisterHandler (GameShutdown); 11 ModEvents.CalcChunkColorsDone.RegisterHandler (CalcChunkColorsDone); 12 } 13 9 ModEvents.GameStartDone.RegisterHandler (GameStartDone); 10 14 11 Web.ServerInitialized += _web => { 12 if (!GamePrefs.GetBool (EnumUtils.Parse<EnumGamePrefs> (nameof (EnumGamePrefs.EnableMapRendering)))) { 13 return; 14 } 15 15 16 _web.RegisterPathHandler ("/map/", new StaticHandler ( 16 17 $"{GameIO.GetSaveGameDir ()}/map", … … 20 21 ); 21 22 }; 23 } 24 25 private void GameStartDone () { 26 if (!ConnectionManager.Instance.IsServer) { 27 return; 28 } 29 30 if (!GamePrefs.GetBool (EnumUtils.Parse<EnumGamePrefs> (nameof (EnumGamePrefs.EnableMapRendering)))) { 31 return; 32 } 33 34 ModEvents.GameShutdown.RegisterHandler (GameShutdown); 35 ModEvents.CalcChunkColorsDone.RegisterHandler (CalcChunkColorsDone); 22 36 } 23 37
Note:
See TracChangeset
for help on using the changeset viewer.