File tree Expand file tree Collapse file tree 4 files changed +10
-16
lines changed
Expand file tree Collapse file tree 4 files changed +10
-16
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ For support or to discuss any other modding related topic you can join our [Star
1616
1717## Changelog
1818
19+ 0.0.3:
20+
21+ - fix wrong durability value for iron axe
22+
19230.0.2:
2024
2125- also include metal tools
Original file line number Diff line number Diff line change @@ -8,8 +8,7 @@ namespace ShowDurability.Patches.Dynamic
88 class Slot_Patch
99 {
1010 static float MAX_HEALTH_WOOD = 300f ;
11- static float MAX_HEALTH_IRON_PICKAXE = 600f ;
12- static float MAX_HEALTH_IRON_AXE = 540f ;
11+ static float MAX_HEALTH_IRON = 600f ;
1312
1413 [ HarmonyPostfix ]
1514 [ HarmonyPatch ( typeof ( Slot ) , "Refresh" ) ]
@@ -24,21 +23,12 @@ public static void Refresh_Postfix(Slot __instance)
2423
2524 __instance . Refreshed . Send ( __instance ) ;
2625 }
27- else if ( __instance ? . CurrentItem ? . Name == "METAL PICKAXE" )
26+ else if ( __instance ? . CurrentItem ? . Name == "METAL PICKAXE" || __instance ? . CurrentItem ? . Name == "METAL AX" )
2827 {
2928 DurabilityBar bar = ( DurabilityBar ) AccessTools . Field ( typeof ( Slot ) , "m_DurabilityBar" ) . GetValue ( __instance ) ;
3029 bar . SetActive ( true ) ;
3130
32- bar . SetFillAmount ( __instance . CurrentItem . GetPropertyValue ( "Durability" ) . Float . Current / MAX_HEALTH_IRON_PICKAXE ) ;
33-
34- __instance . Refreshed . Send ( __instance ) ;
35- }
36- else if ( __instance ? . CurrentItem ? . Name == "METAL AX" )
37- {
38- DurabilityBar bar = ( DurabilityBar ) AccessTools . Field ( typeof ( Slot ) , "m_DurabilityBar" ) . GetValue ( __instance ) ;
39- bar . SetActive ( true ) ;
40-
41- bar . SetFillAmount ( __instance . CurrentItem . GetPropertyValue ( "Durability" ) . Float . Current / MAX_HEALTH_IRON_AXE ) ;
31+ bar . SetFillAmount ( __instance . CurrentItem . GetPropertyValue ( "Durability" ) . Float . Current / MAX_HEALTH_IRON ) ;
4232
4333 __instance . Refreshed . Send ( __instance ) ;
4434 }
Original file line number Diff line number Diff line change 66
77namespace ShowDurability
88{
9- [ BepInPlugin ( "com.sp00ktober.ShowDurability" , "ShowDurability" , "0.0.2 " ) ]
9+ [ BepInPlugin ( "com.sp00ktober.ShowDurability" , "ShowDurability" , "0.0.3 " ) ]
1010 public class ShowDurability : BaseUnityPlugin
1111 {
1212 private void Awake ( )
@@ -20,7 +20,7 @@ private static void InitPatches()
2020
2121 try
2222 {
23- Debug . Log ( "Applying patches from ShowDurability 0.0.2 " ) ;
23+ Debug . Log ( "Applying patches from ShowDurability 0.0.3 " ) ;
2424
2525 Harmony . CreateAndPatchAll ( Assembly . GetExecutingAssembly ( ) , "com.sp00ktober.de" ) ;
2626
Original file line number Diff line number Diff line change 11{
22 "name" : " ShowDurability" ,
33 "description" : " BepInEx mod for Starsand to show the durability of some tools which have it normally hidden." ,
4- "version_number" : " 0.0.2 " ,
4+ "version_number" : " 0.0.3 " ,
55 "dependencies" : [
66 " BepInEx-BepInExPack_Starsand-5.4.16"
77 ],
You can’t perform that action at this time.
0 commit comments