File tree Expand file tree Collapse file tree 4 files changed +17
-3
lines changed
Expand file tree Collapse file tree 4 files changed +17
-3
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.4:
20+
21+ - include raw knife (the first tool you craft)
22+
19230.0.3:
2024
2125- fix wrong durability value for iron axe
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ namespace ShowDurability.Patches.Dynamic
77 [ HarmonyPatch ( typeof ( Slot ) ) ]
88 class Slot_Patch
99 {
10+ static float MAX_HEALTH_PRIMITIVE = 200f ;
1011 static float MAX_HEALTH_WOOD = 300f ;
1112 static float MAX_HEALTH_IRON = 600f ;
1213
@@ -30,6 +31,15 @@ public static void Refresh_Postfix(Slot __instance)
3031
3132 bar . SetFillAmount ( __instance . CurrentItem . GetPropertyValue ( "Durability" ) . Float . Current / MAX_HEALTH_IRON ) ;
3233
34+ __instance . Refreshed . Send ( __instance ) ;
35+ }
36+ else if ( __instance ? . CurrentItem ? . Name == "RAW KNIFE" )
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_PRIMITIVE ) ;
42+
3343 __instance . Refreshed . Send ( __instance ) ;
3444 }
3545 }
Original file line number Diff line number Diff line change 66
77namespace ShowDurability
88{
9- [ BepInPlugin ( "com.sp00ktober.ShowDurability" , "ShowDurability" , "0.0.3 " ) ]
9+ [ BepInPlugin ( "com.sp00ktober.ShowDurability" , "ShowDurability" , "0.0.4 " ) ]
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.3 " ) ;
23+ Debug . Log ( "Applying patches from ShowDurability 0.0.4 " ) ;
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.3 " ,
4+ "version_number" : " 0.0.4 " ,
55 "dependencies" : [
66 " BepInEx-BepInExPack_Starsand-5.4.16"
77 ],
You can’t perform that action at this time.
0 commit comments