• R/O
  • HTTP
  • SSH
  • HTTPS

automap: Commit

Automap (OSS) GIT software repository


Commit MetaInfo

Revisionfabec3e99852e26734177455a7c8745f87533308 (tree)
Time2021-06-30 08:28:32
Authormelchior <melchior@user...>
Commitermelchior

Log Message

Added assists aiding Aspiring Apiarists

Change Summary

Incremental Difference

--- a/Automap/AutomapMod.cs
+++ b/Automap/AutomapMod.cs
@@ -1,6 +1,8 @@
1-using Vintagestory.API.Client;
2-using Vintagestory.API.Common;
1+using System.Collections.ObjectModel;
2+using System.Linq;
33
4+using Vintagestory.API.Client;
5+using Vintagestory.API.Common;
46
57
68 namespace Automap
@@ -46,7 +48,7 @@ namespace Automap
4648
4749 public override double ExecuteOrder()
4850 {
49- return 0.2;
51+ return 1.2;
5052 }
5153
5254 private bool ToggleAM_Dialog(KeyCombination comb)
@@ -89,6 +91,29 @@ namespace Automap
8991 ClientAPI.StoreModConfig<PersistedConfiguration>(this.CachedConfiguration, _configFilename);
9092 }
9193
94+ #region External Interfaces
95+ //Perhaps Other mods can make use of POI / EOI?
96+
97+ public ReadOnlyCollection<PointOfInterest> PointsOfInterest {
98+ get
99+ {
100+ return _localAutomap.POIs.ToList().AsReadOnly();
101+ }
102+ }
103+
104+ public ReadOnlyCollection<EntityOfInterest> EntitiesOfInterest {
105+ get
106+ {
107+ return _localAutomap.EOIs.ToList().AsReadOnly();
108+ }
109+ }
110+
111+ public CommandType Status
112+ {
113+ get { return _localAutomap.CurrentState; }
114+ }
115+
116+ #endregion
92117
93118
94119 }
--- a/Automap/Designators/DefaultDesignators.cs
+++ b/Automap/Designators/DefaultDesignators.cs
@@ -72,6 +72,14 @@ namespace Automap
7272 KeepTrackOfMerchant
7373 );
7474
75+ public static BlockDesignator Wildbeehives =
76+ new BlockDesignator(
77+ new AssetLocation("game", "wildbeehive"),
78+ Color.Honeydew,
79+ EnumBlockMaterial.Other,
80+ NoteWildbeehive
81+ );
82+
7583 /// <summary>
7684 /// Not just blocks, but block-entities as well!
7785 /// </summary>
@@ -87,6 +95,7 @@ namespace Automap
8795 DefaultDesignators.PostSigns,
8896 DefaultDesignators.Translocators,
8997 DefaultDesignators.Teleporters,
98+ DefaultDesignators.Wildbeehives,
9099 };
91100 }
92101 }
@@ -271,6 +280,32 @@ namespace Automap
271280 }
272281 }
273282
283+ internal static void NoteWildbeehive(ICoreClientAPI clientAPI, PointsOfInterest poi, BlockPos posn, Block block)
284+ {
285+ #if DEBUG
286+ clientAPI.Logger.VerboseDebug("Wild bee hive Designator Invoked!");
287+ #endif
288+
289+ BlockEntityBeehive bees = clientAPI.World.BlockAccessor.GetBlockEntity(posn) as BlockEntityBeehive;
290+
291+ if (bees != null) {
292+ EnumHivePopSize hiveSize = AccessTools.FieldRefAccess<BlockEntityBeehive, EnumHivePopSize>(bees, @"hivePopSize");//TeleporterLocation tpLocation;
293+
294+ StringBuilder textTarget = new StringBuilder( );
295+ textTarget.AppendLine($" Population: {(hiveSize != null? hiveSize.ToString() : "?")} ");
296+
297+ poi.AddReplace(
298+ new PointOfInterest {
299+ Name = "Wildbeehive",
300+ PrettyLocation = posn.PrettyCoords(clientAPI),
301+ Location = posn.Copy( ),
302+ Notes = textTarget.ToString( ),
303+ Timestamp = DateTime.UtcNow,
304+ }
305+ );
306+ }
307+ }
308+
274309 #endregion
275310 }
276311 }
--- a/Automap/Subsystems/AutomapSystem.cs
+++ b/Automap/Subsystems/AutomapSystem.cs
@@ -44,9 +44,8 @@ namespace Automap
4444
4545 private ConcurrentDictionary<Vec2i, ColumnCounter> columnCounters = new ConcurrentDictionary<Vec2i, ColumnCounter>(3, 150);
4646 private ColumnsMetadata chunkTopMetadata;
47- private PointsOfInterest POIs = new PointsOfInterest();
48- private EntitiesOfInterest EOIs = new EntitiesOfInterest();
49- private Dictionary<int, ulong> blockTally;//TODO: TOTAL Road Tally
47+ internal PointsOfInterest POIs = new PointsOfInterest();
48+ internal EntitiesOfInterest EOIs = new EntitiesOfInterest();
5049
5150 internal Dictionary<int, BlockDesignator> BlockID_Designators { get; private set; }
5251 internal Dictionary<AssetLocation, EntityDesignator> Entity_Designators { get; private set; }
@@ -470,6 +469,9 @@ namespace Automap
470469 mdWriter.WriteLine("AMVersion '{0}'", ClientAPI.Self().Info.Version);
471470 mdWriter.WriteLine("PlayTime {0:F1}", ClientAPI.InWorldEllapsedMilliseconds / 1000);
472471 mdWriter.WriteLine("GameDate {0}", ClientAPI.World.Calendar.PrettyDate());
472+ mdWriter.WriteLine("Chunks {0:D}", chunkTopMetadata.Count);
473+ mdWriter.WriteLine("Chunks Updated {0:D}", updatedChunksTotal);
474+ mdWriter.WriteLine("Null Chunks {0:D}", nullChunkCount);
473475 mdWriter.Flush( );
474476 }
475477 }
--- a/Automap/modinfo.json
+++ b/Automap/modinfo.json
@@ -4,7 +4,7 @@
44 "description" : "Automap; Generates a static HTML5 map dynamically, with P.O.I. Tracking & more.",
55 "authors": ["Melchior","VeryGoodDog"],
66 "contributors":["VeryGoodDog"],
7- "version": "0.1.6",
7+ "version": "0.1.7",
88 "side":"Client",
99 "dependencies": {
1010 "game": "1.14.10"
Show on old repository browser