Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix #325

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions ssw/src/main/java/ssw/gui/frmMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -856,11 +856,11 @@ private void FixJJSpinnerModel() {
}

if( CurMech.GetJumpJets().IsImproved() ) {
if( CurMech.GetArmor().IsHardened() && !CurMech.GetJumpJets().IsImproved() ) {
max = CurMech.GetRunningMP() - 1;
} else {
// if( CurMech.GetArmor().IsHardened() && !CurMech.GetJumpJets().IsImproved() ) {
// max = CurMech.GetRunningMP() - 1;
// } else {
max = CurMech.GetRunningMP();
}
// }
} else {
max = CurMech.GetWalkingMP();
}
Expand Down Expand Up @@ -1796,6 +1796,8 @@ private void RecalcArmor() {
}
}
SetPatchworkArmor();
// Included to update run speed if hardened armor is added/removed.
FixWalkMPSpinner();
}

private void SetPatchworkArmor() {
Expand Down Expand Up @@ -2163,7 +2165,12 @@ public void RefreshInfoPane() {
txtInfoTonnage.setText( "Tons: " + CurMech.GetCurrentTons() );
txtInfoFreeTons.setText( "Free Tons: " + ( CurMech.GetTonnage() - CurMech.GetCurrentTons() ) );
}
txtInfoMaxHeat.setText( "Max Heat: " + String.format( "%1$,.1f", CurMech.GetMaxHeat() ) );
// Change to make string format reactive.
if(CurMech.GetMaxHeat() % 2 == 0) {
txtInfoMaxHeat.setText( "Max Heat: " + String.format( "%1$,.0f", CurMech.GetMaxHeat() ) );
} else {
txtInfoMaxHeat.setText( "Max Heat: " + String.format( "%1$,.1f", CurMech.GetMaxHeat() ) );
}
txtInfoHeatDiss.setText( "Heat Dissipation: " + CurMech.GetHeatSinks().TotalDissipation() );
txtInfoFreeCrits.setText( "Free Crits: " + CurMech.GetLoadout().FreeCrits() );
txtInfoUnplaced.setText( "Unplaced Crits: " + CurMech.GetLoadout().UnplacedCrits() );
Expand Down
17 changes: 12 additions & 5 deletions ssw/src/main/java/ssw/gui/frmMainWide.java
Original file line number Diff line number Diff line change
Expand Up @@ -852,11 +852,11 @@ private void FixJJSpinnerModel() {
}

if( CurMech.GetJumpJets().IsImproved() ) {
if( CurMech.GetArmor().IsHardened() && !CurMech.GetJumpJets().IsImproved() ) {
max = CurMech.GetRunningMP() - 1;
} else {
// if( CurMech.GetArmor().IsHardened() && !CurMech.GetJumpJets().IsImproved() ) {
// max = CurMech.GetRunningMP() - 1;
// } else {
max = CurMech.GetRunningMP();
}
// }
} else {
max = CurMech.GetWalkingMP();
}
Expand Down Expand Up @@ -1790,6 +1790,8 @@ private void RecalcArmor() {
}
}
SetPatchworkArmor();
// Included to update run speed if hardened armor is added/removed.
FixWalkMPSpinner();
}

private void SetPatchworkArmor() {
Expand Down Expand Up @@ -2157,7 +2159,12 @@ public void RefreshInfoPane() {
txtInfoTonnage.setText( "Tons: " + CurMech.GetCurrentTons() );
txtInfoFreeTons.setText( "Free Tons: " + ( CurMech.GetTonnage() - CurMech.GetCurrentTons() ) );
}
txtInfoMaxHeat.setText( "Max Heat: " + String.format( "%1$,.1f", CurMech.GetMaxHeat() ) );
// Change to make string format reactive.
if(CurMech.GetMaxHeat() % 2 == 0) {
txtInfoMaxHeat.setText( "Max Heat: " + String.format( "%1$,.0f", CurMech.GetMaxHeat() ) );
} else {
txtInfoMaxHeat.setText( "Max Heat: " + String.format( "%1$,.1f", CurMech.GetMaxHeat() ) );
}
txtInfoHeatDiss.setText( "Heat Dissipation: " + CurMech.GetHeatSinks().TotalDissipation() );
txtInfoFreeCrits.setText( "Free Crits: " + CurMech.GetLoadout().FreeCrits() );
txtInfoUnplaced.setText( "Unplaced Crits: " + CurMech.GetLoadout().UnplacedCrits() );
Expand Down
7 changes: 6 additions & 1 deletion sswlib/src/main/java/Print/PrintMech.java
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,12 @@ private void DrawMechData( Graphics2D graphics ) {
graphics.drawString( String.format( "%1$,d", CurMech.GetCurrentBV() ), p[PrintConsts.BV2].x, p[PrintConsts.BV2].y );
else
graphics.drawString( String.format( "%1$,.0f (Base: %2$,d)", BV, CurMech.GetCurrentBV() ), p[PrintConsts.BV2].x, p[PrintConsts.BV2].y );
graphics.drawString( String.format( "Weapon Heat (%1$,.1f)", CurMech.GetWeaponHeat() ), p[PrintConsts.MAX_HEAT].x-1, p[PrintConsts.MAX_HEAT].y-7 );
// Change to make string format reactive.
if (CurMech.GetWeaponHeat() % 2 == 0) {
graphics.drawString( String.format( "Weapon Heat (%1$,.0f)", CurMech.GetWeaponHeat() ), p[PrintConsts.MAX_HEAT].x-1, p[PrintConsts.MAX_HEAT].y-7 );
} else {
graphics.drawString( String.format( "Weapon Heat (%1$,.1f)", CurMech.GetWeaponHeat() ), p[PrintConsts.MAX_HEAT].x-1, p[PrintConsts.MAX_HEAT].y-7 );
}
graphics.drawString( "Dissipation (" + CurMech.GetHeatSinks().TotalDissipation() + ")", p[PrintConsts.MAX_HEAT].x-1, p[PrintConsts.MAX_HEAT].y+1 );
//graphics.drawString( "Weapon Heat (" + CurMech.GetWeaponHeat(false, false, true, false) + ")", p[PrintConsts.MAX_HEAT].x-1, p[PrintConsts.MAX_HEAT].y );
graphics.setFont( PrintConsts.SmallFont );
Expand Down
14 changes: 11 additions & 3 deletions sswlib/src/main/java/components/Mech.java
Original file line number Diff line number Diff line change
Expand Up @@ -1982,11 +1982,19 @@ public void SetWalkMP( int mp ) throws Exception {
}

public int GetRunningMP() {
return (int) Math.floor( GetWalkingMP() * 1.5 + 0.5 );
if(CurArmor.IsHardened()) {
return (int) Math.floor( GetWalkingMP() * 1.5 - 0.5 );
} else {
return (int) Math.floor( GetWalkingMP() * 1.5 + 0.5 );
}
}

public int GetRunningMP( int MiniMult ) {
return (int) Math.floor( ( GetWalkingMP() * MiniMult ) * 1.5 + 0.5 );
if(CurArmor.IsHardened()) {
return (int) Math.floor( ( GetWalkingMP() * MiniMult ) * 1.5 - 0.5 );
} else {
return (int) Math.floor( ( GetWalkingMP() * MiniMult ) * 1.5 + 0.5 );
}
}

public int GetAdjustedRunningMP( boolean BV, boolean MASCTSM ) {
Expand Down Expand Up @@ -2292,7 +2300,7 @@ public double GetWeaponHeat()
return GetWeaponHeat(Prefs.getBoolean("HeatExcludeOS", false),
Prefs.getBoolean( "HeatExcludeRear", false),
Prefs.getBoolean( "HeatACFullRate", false),
Prefs.getBoolean( "HeatStreaksHalfRate", false),
Prefs.getBoolean( "HeatStreaksHalfRate", false),
Prefs.getBoolean( "HeatExcludeEquips", false));
}

Expand Down
Loading