Skip to content

Commit

Permalink
Merge pull request #55 from StarCoreSE/invalid-hudscript
Browse files Browse the repository at this point in the history
put some climbing cost related stuff back to floats for a cleaner dif…
  • Loading branch information
InvalidArgument3 authored Sep 12, 2024
2 parents c71737b + a2cd5e8 commit 368653a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion TLBGridPoints/Data/Scripts/ShipPoints/AllGridsList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ public void Draw()
}
}

public static void ClimbingCostRename(ref string blockDisplayName, ref double climbingCostMultiplier) // Double instead of float.
public static void ClimbingCostRename(ref string blockDisplayName, ref float climbingCostMultiplier) // Double instead of float.
{
if (I._climbingCostFunction == null) return;
var results = I._climbingCostFunction.Invoke(blockDisplayName);
Expand Down
4 changes: 2 additions & 2 deletions TLBGridPoints/Data/Scripts/ShipPoints/BuildingBlockPoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private void UpdateHud(MyHudBlockInfo blockInfo)

string blockDisplayName = blockInfo.BlockName;

double thisClimbingCostMult = 0;
float thisClimbingCostMult = 0;
AllGridsList.ClimbingCostRename(ref blockDisplayName, ref thisClimbingCostMult); // Use double instead of float.

_pointsMessage.Message.Clear();
Expand All @@ -65,7 +65,7 @@ private void UpdateHud(MyHudBlockInfo blockInfo)
_pointsMessage.Message.Append($" +{(blockPoints * thisClimbingCostMult)}bp/b");

// Even though this is here, the tooltip will not be visible
_pointsMessage.Visible = false; // Ensures the HUD is never displayed
//_pointsMessage.Visible = false; // Ensures the HUD is never displayed
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ private void UpdateGlobalStats()
if (!AllGridsList.PointValues.ContainsKey(block.BlockDefinition.SubtypeName))
continue;

double ignored = 0;
float ignored = 0;
AllGridsList.ClimbingCostRename(ref blockDisplayName, ref ignored);
ShipTracker.SpecialBlockRename(ref blockDisplayName, block);
if (!SpecialBlockCounts.ContainsKey(blockDisplayName))
Expand Down Expand Up @@ -251,7 +251,7 @@ private void UpdateWeaponStats()
// Check for WeaponCore weapons
if (AllGridsList.PointValues.TryGetValue(block.BlockDefinition.SubtypeName, out weaponPoints) && WcApi.HasCoreWeapon((MyEntity)block))
{
double thisClimbingCostMult = 0;
float thisClimbingCostMult = 0;
AllGridsList.ClimbingCostRename(ref weaponDisplayName, ref thisClimbingCostMult);
AddWeaponCount(weaponDisplayName);
continue;
Expand Down Expand Up @@ -296,7 +296,7 @@ private void CalculateCost(IMyCubeBlock block)
if (blockPoints == 0) return;

var blockDisplayName = block.DefinitionDisplayNameText;
double climbingCostMultiplier = 0; // Updated name
float climbingCostMultiplier = 0; // Updated name
AllGridsList.ClimbingCostRename(ref blockDisplayName, ref climbingCostMultiplier);

// DEBUG: Check multiplier
Expand Down

0 comments on commit 368653a

Please sign in to comment.