VS plugin mod for Basic Armour
Révision | 2bd9552a7bf848f28deca99f374fc64ad0572781 (tree) |
---|---|
l'heure | 2019-05-18 08:58:18 |
Auteur | ![]() |
Commiter | melchior |
Re-release cleanup of messages
attempt to fix item names / desc.
Version incriment
@@ -189,10 +189,11 @@ namespace ArmourMod | ||
189 | 189 | |
190 | 190 | //BRUTE FORCE SEARCH! |
191 | 191 | var armourItemsBrute = ClientApi.World.Items.Where( itm => itm.Code != null && itm.Code.BeginsWith( _domain, "clothes" )); |
192 | + #if DEBUG | |
192 | 193 | ClientApi.Logger.VerboseDebug( "****************************************************** " ); |
193 | 194 | ClientApi.Logger.VerboseDebug( "Known Armour variants: {0}", armourItemsBrute.Count() ); |
194 | 195 | ClientApi.Logger.VerboseDebug( "****************************************************** " ); |
195 | - | |
196 | + #endif | |
196 | 197 | |
197 | 198 | foreach(var armourItem in armourItemsBrute) |
198 | 199 | { |
@@ -240,7 +241,9 @@ namespace ArmourMod | ||
240 | 241 | |
241 | 242 | ModelTransform configuredTransform = new JsonObject( tpJsonNode ).AsObject<ModelTransform>( ); |
242 | 243 | fudge_transform = configuredTransform; |
244 | + #if DEBUG | |
243 | 245 | ClientApi.Logger.VerboseDebug( "[{0}] Using JSON Transform parameters = {1}", armourItem.Code.ToShortString( ),configuredTransform.Translation.ToString() ); |
246 | + #endif | |
244 | 247 | } |
245 | 248 | |
246 | 249 | } else { |
@@ -248,7 +251,9 @@ namespace ArmourMod | ||
248 | 251 | } |
249 | 252 | |
250 | 253 | Armoury.Add(armourItem.Code,new ArmourModelData(armourMeshRef, textureId, fudge_transform, fudge_transform.Origin)); |
254 | + #if DEBUG | |
251 | 255 | ClientApi.Logger.VerboseDebug( "Add Armoury entry: {0}", armourItem.Code.ToShortString() ); |
256 | + #endif | |
252 | 257 | } |
253 | 258 | |
254 | 259 | return Armoury; |
@@ -63,9 +63,11 @@ namespace ArmourMod | ||
63 | 63 | public override void OnEntityLoaded() |
64 | 64 | { |
65 | 65 | base.OnEntityLoaded(); |
66 | + #if DEBUG | |
66 | 67 | Logger.VerboseDebug( "OnEntityLoaded - EntityArmourPlayer" ); |
67 | 68 | |
68 | 69 | Logger.VerboseDebug( "Side:{0}, gearInv == null?{1}", CoreAPI.Side.ToString( ), base.GearInventory == null ); |
70 | + #endif | |
69 | 71 | |
70 | 72 | if ( CoreAPI.Side.IsClient() ) { |
71 | 73 |
@@ -83,8 +85,9 @@ namespace ArmourMod | ||
83 | 85 | public override void OnEntitySpawn() |
84 | 86 | { |
85 | 87 | base.OnEntitySpawn(); |
86 | - | |
88 | + #if DEBUG | |
87 | 89 | Logger.VerboseDebug( "OnEntitySpawn - EntityArmourPlayer" ); |
90 | + #endif | |
88 | 91 | |
89 | 92 | if ( CoreAPI.Side.IsServer() ) { |
90 | 93 | //Attach to Inventory events |
@@ -138,7 +141,10 @@ namespace ArmourMod | ||
138 | 141 | public override void Revive() |
139 | 142 | { |
140 | 143 | base.Revive(); |
144 | + #if DEBUG | |
141 | 145 | Logger.VerboseDebug( "Respawned, alive again..." ); |
146 | + #endif | |
147 | + | |
142 | 148 | } |
143 | 149 | |
144 | 150 | /// <summary> |
@@ -248,9 +254,9 @@ namespace ArmourMod | ||
248 | 254 | |
249 | 255 | protected void ClientDelayHook(IClientPlayer byPlayer) |
250 | 256 | { |
251 | - #if DEBUG | |
257 | +#if DEBUG | |
252 | 258 | Logger.Debug("ClientDelayHook: Checking gearInv is null? {0}", base.GearInventory == null); |
253 | - #endif | |
259 | +#endif | |
254 | 260 | |
255 | 261 | //CoreAPI.Event.UnregisterCallback(client_callback); |
256 | 262 | base.GearInventory.SlotModified += ClientWatchSlotModified; |
@@ -260,29 +266,32 @@ namespace ArmourMod | ||
260 | 266 | private void ServerWatchSlotModified (int slotId) |
261 | 267 | { |
262 | 268 | var watchedSlot = base.GearInventory[slotId]; |
263 | - | |
269 | + #if DEBUG | |
264 | 270 | Logger.VerboseDebug( "WatchSlotModified:{0}", slotId ); |
265 | - | |
271 | + #endif | |
266 | 272 | if ( !watchedSlot.Empty ) { |
267 | 273 | |
268 | 274 | if ( watchedSlot.StorageType == EnumItemStorageFlags.Outfit && watchedSlot.Itemstack.Class == EnumItemClass.Item ) { |
269 | - | |
275 | + #if DEBUG | |
270 | 276 | Logger.VerboseDebug( "Equiped a clothing item:{0}", watchedSlot.Itemstack.Item.Code.ToString() ); |
277 | + #endif | |
271 | 278 | //replace / add damage filter when applicable armor item in slot (which ever that is?) |
272 | 279 | |
273 | 280 | if (CheckIfClothesIsArmour(watchedSlot)) |
274 | - { | |
281 | + { | |
275 | 282 | DamageFilter dmgFilt = DamageFilter.ConstructFilter( watchedSlot ); |
276 | - | |
283 | + #if DEBUG | |
277 | 284 | Logger.VerboseDebug( "Armour Filter Props: B{0} P{1} S{2} C{3} F{4}", dmgFilt.bluntPercent, dmgFilt.piercingPercent, dmgFilt.slashingPercent, dmgFilt.crushingPercent, dmgFilt.firePercent ); |
278 | - | |
285 | + #endif | |
279 | 286 | DamageFilters[(EnumCharacterDressType)slotId] = dmgFilt; |
280 | 287 | RecomputeDamageFilterPercents( ); |
281 | 288 | } |
282 | 289 | } |
283 | 290 | } else if (watchedSlot.StorageType == EnumItemStorageFlags.Outfit){ |
284 | 291 | //Clear out filters for what was in slot# X here - if applicable |
292 | + #if DEBUG | |
285 | 293 | Logger.VerboseDebug( "Removed a clothing item from SlotId:{0}",slotId ); |
294 | + #endif | |
286 | 295 | DamageFilters.Remove((EnumCharacterDressType)slotId); |
287 | 296 | RecomputeDamageFilterPercents( ); |
288 | 297 | } |
@@ -290,7 +299,9 @@ namespace ArmourMod | ||
290 | 299 | |
291 | 300 | private void ClientWatchSlotModified (int slotId) |
292 | 301 | { |
302 | + #if DEBUG | |
293 | 303 | Logger.VerboseDebug( "(Client) WatchSlotModified:{0}", slotId ); |
304 | + #endif | |
294 | 305 | var watchedSlot = base.GearInventory[slotId]; |
295 | 306 | |
296 | 307 | if ( !watchedSlot.Empty ) { |
@@ -332,15 +343,15 @@ namespace ArmourMod | ||
332 | 343 | |
333 | 344 | if ( CheckIfClothesIsArmour(itemSlot) ) |
334 | 345 | { |
335 | - #if DEBUG | |
346 | +#if DEBUG | |
336 | 347 | CoreAPI.World.Logger.VerboseDebug( "DF: Consider clothing item:{0}", itemSlot.Itemstack.Item.Code.ToString( ) ); |
337 | - #endif | |
348 | +#endif | |
338 | 349 | |
339 | 350 | DamageFilter dmgFilt = DamageFilter.ConstructFilter( itemSlot); |
340 | 351 | |
341 | - #if DEBUG | |
352 | +#if DEBUG | |
342 | 353 | CoreAPI.World.Logger.VerboseDebug( "Armour Filter Props: B{0} P{1} S{2} C{3} F{4}", dmgFilt.bluntPercent, dmgFilt.piercingPercent, dmgFilt.slashingPercent, dmgFilt.crushingPercent, dmgFilt.firePercent ); |
343 | - #endif | |
354 | +#endif | |
344 | 355 | |
345 | 356 | DamageFilters.Add(slotId,dmgFilt); |
346 | 357 | } |
@@ -383,14 +394,14 @@ namespace ArmourMod | ||
383 | 394 | private void WearArmorModel(int slotId, Item wornArmour) |
384 | 395 | { |
385 | 396 | if ( !RenderableWornArmours.ContainsKey( (EnumCharacterDressType)slotId ) ) { |
386 | - #if DEBUG | |
397 | +#if DEBUG | |
387 | 398 | Logger.VerboseDebug( "Wearing: {0}", wornArmour.Code.ToString( ) ); |
388 | - #endif | |
399 | +#endif | |
389 | 400 | RenderableWornArmours.Add( (EnumCharacterDressType)slotId, wornArmour ); |
390 | 401 | } else { |
391 | - #if DEBUG | |
402 | +#if DEBUG | |
392 | 403 | Logger.VerboseDebug( "Duplicate of SlotId {0} worn Armour: {1}",slotId ,wornArmour.Code.ToString( ) ); |
393 | - #endif | |
404 | +#endif | |
394 | 405 | } |
395 | 406 | } |
396 | 407 |
@@ -398,14 +409,14 @@ namespace ArmourMod | ||
398 | 409 | { |
399 | 410 | if ( RenderableWornArmours.ContainsKey( (EnumCharacterDressType)slotId ) ) { |
400 | 411 | var armourItem = RenderableWornArmours[(EnumCharacterDressType)slotId]; |
401 | - #if DEBUG | |
412 | +#if DEBUG | |
402 | 413 | Logger.VerboseDebug( "UN-Wearing: {0}", armourItem.Code.ToString( ) ); |
403 | - #endif | |
414 | +#endif | |
404 | 415 | RenderableWornArmours.Remove( (EnumCharacterDressType)slotId ); |
405 | 416 | } else { |
406 | - #if DEBUG | |
417 | +#if DEBUG | |
407 | 418 | Logger.VerboseDebug( "Non-armour removed, slotID{0}", slotId ); |
408 | - #endif | |
419 | +#endif | |
409 | 420 | } |
410 | 421 | } |
411 | 422 |
@@ -425,9 +436,9 @@ namespace ArmourMod | ||
425 | 436 | |
426 | 437 | if ( CheckIfClothesIsArmour(itemSlot) ) |
427 | 438 | { |
428 | - #if DEBUG | |
439 | +#if DEBUG | |
429 | 440 | Logger.VerboseDebug( "Now wearing armour:{0}", itemSlot.Itemstack.Item.Code.ToString( ) ); |
430 | - #endif | |
441 | +#endif | |
431 | 442 | |
432 | 443 | if (RenderableWornArmours.ContainsKey(( EnumCharacterDressType )slotId)) { |
433 | 444 | Logger.Warning("DUPLICATE assignment; Armour in slot: {0} named: {1}", slotId, itemSlot.Itemstack.Item.Code.ToString( )); |
@@ -28,12 +28,19 @@ | ||
28 | 28 | </CustomCommands> |
29 | 29 | </PropertyGroup> |
30 | 30 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
31 | - <DebugType>full</DebugType> | |
31 | + <DebugType></DebugType> | |
32 | 32 | <Optimize>true</Optimize> |
33 | 33 | <OutputPath>bin\Release</OutputPath> |
34 | + <DefineConstants>RELEASE</DefineConstants> | |
34 | 35 | <ErrorReport>prompt</ErrorReport> |
35 | 36 | <WarningLevel>4</WarningLevel> |
36 | 37 | <ConsolePause>false</ConsolePause> |
38 | + <CustomCommands> | |
39 | + <CustomCommands> | |
40 | + <Command type="AfterBuild" command="7z -tzip a Armour_${ProjectConfig}.zip" workingdir="${TargetDir}" /> | |
41 | + <Command type="AfterClean" command="rm -f *.zip" workingdir="${TargetDir}" /> | |
42 | + </CustomCommands> | |
43 | + </CustomCommands> | |
37 | 44 | </PropertyGroup> |
38 | 45 | <ItemGroup> |
39 | 46 | <Reference Include="System" /> |
@@ -133,10 +140,12 @@ | ||
133 | 140 | <None Include="assets\armourmod\recipes\grid\vests.json"> |
134 | 141 | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
135 | 142 | </None> |
136 | - <None Include="assets\armourmod\lang\en.json" /> | |
137 | 143 | <None Include="assets\armourmod\recipes\grid\helmets.json"> |
138 | 144 | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
139 | 145 | </None> |
146 | + <None Include="assets\armourmod\lang\en.json"> | |
147 | + <CopyToOutputDirectory>Always</CopyToOutputDirectory> | |
148 | + </None> | |
140 | 149 | </ItemGroup> |
141 | 150 | <ItemGroup> |
142 | 151 | <Folder Include="assets\armourmod\" /> |
@@ -1,15 +1,10 @@ | ||
1 | -{ | |
2 | - "item:clothes-head-potmetal": "Metal Pot Helm", | |
3 | - "item:clothes-upperbodyover-vest-studdedleather": "Studded Leather Vest", | |
4 | - "item:clothes-upperbodyover-vest-scale": "Scale Mail Vest", | |
5 | - "item:clothes-upperbodyover-vest-platechest": "Plate Armour Vest", | |
6 | - "item:clothes-upperbodyover-vest-leather": "Leather Vest", | |
7 | - "item:clothes-upperbodyover-vest-lamellar": "Lamellar Armour Vest", | |
8 | - "item:clothes-upperbodyover-vest-coatofplates": "Coat'o'Plates Armour Vest", | |
9 | - "item:clothes-upperbodyover-vest-chain": "Chainmail" , | |
10 | - | |
11 | - "armourmod:item-clothes-upperbodyover-vest-leather": "2Leather Vest", | |
12 | - "armourmod:clothes-upperbodyover-vest-leather": "3Leather Vest", | |
13 | - "armourmod:item-upperbodyover-vest-leather": "4Leather Vest", | |
14 | - | |
1 | +{ | |
2 | + "item-armourmod:clothes-head-potmetal": "Metal Pot Helm", | |
3 | + "item-armourmod:clothes-upperbodyover-vest-studdedleather": "Studded Leather Vest", | |
4 | + "item-armourmod:clothes-upperbodyover-vest-scale": "Scale Mail Vest", | |
5 | + "item-armourmod:clothes-upperbodyover-vest-platechest": "Plate Armour Vest", | |
6 | + "item-armourmod:clothes-upperbodyover-vest-leather": "Leather Vest", | |
7 | + "item-armourmod:clothes-upperbodyover-vest-lamellar": "Lamellar Armour Vest", | |
8 | + "item-armourmod:clothes-upperbodyover-vest-coatofplates": "Coat'o'Plates Armour Vest", | |
9 | + "item-armourmod:clothes-upperbodyover-vest-chain": "Chainmail", | |
15 | 10 | } |
\ No newline at end of file |
@@ -3,7 +3,7 @@ | ||
3 | 3 | "name": "Basic Armour Mod", |
4 | 4 | "description" : "Leather, Plate, Scale & More", |
5 | 5 | "authors": ["Melchior", "Bunnyviking"], |
6 | - "version": "0.1.2", | |
6 | + "version": "0.1.3", | |
7 | 7 | "dependencies": { |
8 | 8 | "game": "1.9.3", |
9 | 9 | "survival": "" |