Automap (client) [VS plugin mod]
Revisão | fabec3e99852e26734177455a7c8745f87533308 (tree) |
---|---|
Hora | 2021-06-30 08:28:32 |
Autor | melchior <melchior@user...> |
Commiter | melchior |
Added assists aiding Aspiring Apiarists
@@ -1,6 +1,8 @@ | ||
1 | -using Vintagestory.API.Client; | |
2 | -using Vintagestory.API.Common; | |
1 | +using System.Collections.ObjectModel; | |
2 | +using System.Linq; | |
3 | 3 | |
4 | +using Vintagestory.API.Client; | |
5 | +using Vintagestory.API.Common; | |
4 | 6 | |
5 | 7 | |
6 | 8 | namespace Automap |
@@ -46,7 +48,7 @@ namespace Automap | ||
46 | 48 | |
47 | 49 | public override double ExecuteOrder() |
48 | 50 | { |
49 | - return 0.2; | |
51 | + return 1.2; | |
50 | 52 | } |
51 | 53 | |
52 | 54 | private bool ToggleAM_Dialog(KeyCombination comb) |
@@ -89,6 +91,29 @@ namespace Automap | ||
89 | 91 | ClientAPI.StoreModConfig<PersistedConfiguration>(this.CachedConfiguration, _configFilename); |
90 | 92 | } |
91 | 93 | |
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 | |
92 | 117 | |
93 | 118 | |
94 | 119 | } |
@@ -72,6 +72,14 @@ namespace Automap | ||
72 | 72 | KeepTrackOfMerchant |
73 | 73 | ); |
74 | 74 | |
75 | + public static BlockDesignator Wildbeehives = | |
76 | + new BlockDesignator( | |
77 | + new AssetLocation("game", "wildbeehive"), | |
78 | + Color.Honeydew, | |
79 | + EnumBlockMaterial.Other, | |
80 | + NoteWildbeehive | |
81 | + ); | |
82 | + | |
75 | 83 | /// <summary> |
76 | 84 | /// Not just blocks, but block-entities as well! |
77 | 85 | /// </summary> |
@@ -87,6 +95,7 @@ namespace Automap | ||
87 | 95 | DefaultDesignators.PostSigns, |
88 | 96 | DefaultDesignators.Translocators, |
89 | 97 | DefaultDesignators.Teleporters, |
98 | + DefaultDesignators.Wildbeehives, | |
90 | 99 | }; |
91 | 100 | } |
92 | 101 | } |
@@ -271,6 +280,32 @@ namespace Automap | ||
271 | 280 | } |
272 | 281 | } |
273 | 282 | |
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 | + | |
274 | 309 | #endregion |
275 | 310 | } |
276 | 311 | } |
@@ -44,9 +44,8 @@ namespace Automap | ||
44 | 44 | |
45 | 45 | private ConcurrentDictionary<Vec2i, ColumnCounter> columnCounters = new ConcurrentDictionary<Vec2i, ColumnCounter>(3, 150); |
46 | 46 | 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(); | |
50 | 49 | |
51 | 50 | internal Dictionary<int, BlockDesignator> BlockID_Designators { get; private set; } |
52 | 51 | internal Dictionary<AssetLocation, EntityDesignator> Entity_Designators { get; private set; } |
@@ -470,6 +469,9 @@ namespace Automap | ||
470 | 469 | mdWriter.WriteLine("AMVersion '{0}'", ClientAPI.Self().Info.Version); |
471 | 470 | mdWriter.WriteLine("PlayTime {0:F1}", ClientAPI.InWorldEllapsedMilliseconds / 1000); |
472 | 471 | 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); | |
473 | 475 | mdWriter.Flush( ); |
474 | 476 | } |
475 | 477 | } |
@@ -4,7 +4,7 @@ | ||
4 | 4 | "description" : "Automap; Generates a static HTML5 map dynamically, with P.O.I. Tracking & more.", |
5 | 5 | "authors": ["Melchior","VeryGoodDog"], |
6 | 6 | "contributors":["VeryGoodDog"], |
7 | - "version": "0.1.6", | |
7 | + "version": "0.1.7", | |
8 | 8 | "side":"Client", |
9 | 9 | "dependencies": { |
10 | 10 | "game": "1.14.10" |