Skip to content
Draft

Leases! #7043

Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
65db58b
Fixes issue #7004. Gives buttons in the Purchase Unit dialog more con…
savanik May 14, 2025
0f7527e
Implements first part of lease object. Leases work, but implementatio…
savanik May 15, 2025
6e2dbd7
Implements first part of lease object. Leases work, but implementatio…
savanik May 15, 2025
1e7923e
Implements second part of leases, acquisition rolls are now more or l…
savanik May 16, 2025
1532687
Implements third part of leases, acquisition rolls now function appro…
savanik May 16, 2025
7eaf7b9
Implements third part of leases, acquisition rolls now function appro…
savanik May 16, 2025
53eaed5
Quick fix for Lease names in acquisition list.
savanik May 16, 2025
28983d7
Breaking Lease into Lease and LeaseOrder to separate procurement logi…
savanik May 17, 2025
fd02de2
Adding functionality for unleasing units to right-click context menu.
savanik May 17, 2025
4f1d45d
Implements first part of lease object. Leases work, but implementatio…
savanik May 15, 2025
7f3206c
Implements second part of leases, acquisition rolls are now more or l…
savanik May 16, 2025
a3502ca
Implements third part of leases, acquisition rolls now function appro…
savanik May 16, 2025
8b8dbb3
Implements third part of leases, acquisition rolls now function appro…
savanik May 16, 2025
e2bbd4b
Quick fix for Lease names in acquisition list.
savanik May 16, 2025
8594271
Breaking Lease into Lease and LeaseOrder to separate procurement logi…
savanik May 17, 2025
3a8075a
Adding functionality for unleasing units to right-click context menu.
savanik May 17, 2025
b498eb0
Merge remote-tracking branch 'origin/Leases' into Leases
savanik May 17, 2025
b8fefd2
Disambiguating functions.
savanik May 17, 2025
4cb7394
Engineering LeaseOrder to work correctly, cleanly, and with less code.
savanik May 18, 2025
28b2f75
Merge branch 'master' into Leases
HammerGS May 18, 2025
4c17059
Corrected bugs, added documentation, added a unit test.
savanik May 18, 2025
c5fb01d
Merge remote-tracking branch 'origin/Leases' into Leases
savanik May 18, 2025
b83126a
Code cleanup and proper copyrights.
savanik May 18, 2025
52735b3
Removing unwanted file inclusions
savanik May 18, 2025
edeab25
Corrections across many components to correct errors and bugs.
savanik May 19, 2025
a8282dd
Fixing GM Shopping list procure/add functions.
savanik May 19, 2025
c070a91
Lease cleanup and some updates to function names for understandability
savanik May 20, 2025
6ba628d
More descriptive variables names in generateInstanceFromXML
savanik May 20, 2025
3331ad0
More descriptive variables names in generateInstanceFromXML in LeaseO…
savanik May 20, 2025
d4d8286
Merge remote-tracking branch 'upstream/master' into Leases
savanik May 31, 2025
17775db
Update to latest, cleanup of button handling
savanik May 31, 2025
56247dc
Rewrote all unit tests and updated function permissions
savanik May 31, 2025
2d8bf57
Updated LeaseTest with copyright notice
savanik May 31, 2025
dd42c36
Unit tests for more branches, and finance / accountants now handle bi…
savanik Jun 1, 2025
4bf4518
Updates from review, internationalization, leased units don't start m…
savanik Jun 1, 2025
3d23cd2
Magic number update
savanik Jun 1, 2025
edbaf90
Magic number update (#2)
savanik Jun 1, 2025
9f21d2e
Logger update.
savanik Jun 1, 2025
e254644
Updating Lease cost multiplier to divisor for accuracy, updated metho…
savanik Jun 2, 2025
4b5f34e
Merge remote-tracking branch 'upstream/master' into Leases
savanik Jun 3, 2025
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
Binary file removed MekHQ/campaigns/The Learning Ropes.cpnx.gz
Binary file not shown.
39 changes: 39 additions & 0 deletions MekHQ/mmconf/megameklab.properties.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#Client Config Backup
#Sun May 04 22:47:01 CDT 2025
Save_File_9=
techYear=3023
techUnofficialNoYear=false
Save_File_2=/home/crickel/Scripts/mekhq-nightly/mekhq/MekHQ/data/mekfiles/customs/Crab CRB-20 Mk II.mtf
Save_File_1=/home/crickel/Scripts/mekhq-nightly/mekhq/MekHQ/data/mekfiles/customs/Thunderbolt TDR-5S Mk II.mtf
Save_File_4=
Save_File_3=
Save_File_6=
useTROFormat=true
Save_File_5=
rs_scale_units=HEXES
Save_File_8=
mekAutocompact=true
Save_File_7=
rs_color=true
techShowFaction=false
lookAndFeel=com.formdev.flatlaf.FlatDarculaLaf
nag_equipment_ctrlclick=true
nag_import_settings=true
techProgression=true
techUseYear=3023
rs_show_era=true
mekAutosort=true
File_Chooser_Window=3801;421;594;363
rs_show_role=true
StartupGui=SPLASH_SCREEN
rs_scale_factor=1
rs_show_pilot_data=true
rs_show_quirks=true
Last_directory=/home/crickel/Scripts/mekhq-nightly/mekhq/MekHQ/data/mekfiles/customs
Save_File_10=
mekAutofill=true
skipSafetyPrompts=false
techShowExtinct=true
rs_mek_names=IS_CLAN
FullScreen=false
rs_progress_bar=true
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,8 @@ lblPayForRecruitmentBox.tooltip=Pay a two-month salary to new recruits.
# createGeneralOptionsPanel
lblUseLoanLimitsBox.text=Available Loans Based on Unit Reputation \u270E
lblUseLoanLimitsBox.tooltip=Put limits on interest, collateral, and length.
lblTrackLeasesBox.text=Leases Available for Large Craft
lblTrackLeasesBox.tooltip=Allow leases to be obtained for Dropships and Jumpships instead of purchasing outright
lblUsePercentageMaintenanceBox.text=Enable Percentage-Based Maintenance Costs \u270E
lblUsePercentageMaintenanceBox.tooltip=Maintenance costs based upon the value of the unit instead\
\ of the unit type. This makes maintenance costs more impactful.
Expand Down
8 changes: 8 additions & 0 deletions MekHQ/resources/mekhq/resources/Finances.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ TransactionType.FINANCIAL_TERM_END_CARRYOVER.text=Financial Term End Carryover
TransactionType.FINANCIAL_TERM_END_CARRYOVER.toolTipText=Funds carried over from the previous financial term.
TransactionType.FINE.text=Fine
TransactionType.FINE.toolTipText=A financial transaction where the force pays or is paid a fine.
TransactionType.LEASE_PAYMENT.text=Lease Payment
TransactionType.LEASE_PAYMENT.toolTipText=A financial transaction where a lease was being paid for.
TransactionType.LOAN_PAYMENT.text=Loan Payment
TransactionType.LOAN_PAYMENT.toolTipText=A financial transaction where a loan was being paid for.
TransactionType.LOAN_PRINCIPAL.text=Loan Principal
Expand Down Expand Up @@ -83,6 +85,8 @@ TransactionType.UNIT_PURCHASE.text=Unit Purchase(s)
TransactionType.UNIT_PURCHASE.toolTipText=A financial transaction where a unit was or multiple units were purchased.
TransactionType.UNIT_SALE.text=Unit Sale(s)
TransactionType.UNIT_SALE.toolTipText=A financial transaction where a unit was or multiple units were sold.
TransactionType.UNIT_CANCEL_LEASE.text=Cancel Unit Lease
TransactionType.UNIT_CANCEL_LEASE.toolTipText=A financial transaction where a unit's lease was finalized.
TransactionType.BONUS_EXCHANGE.text=Bonus Exchange
TransactionType.BONUS_EXCHANGE.toolTipText=A financial transaction where Bonus Parts were exchanged for money.
TransactionType.WEALTH.text=Reinvestment
Expand All @@ -107,6 +111,10 @@ Loan.title=loan payment to %s
Loan.text=Your account has been debited for %s in loan payment to %s
Loan.insufficient.report=<b>You have insufficient funds to service the debt on loan %s!</b>%s Funds required: %s
Loan.paid.report=You have fully paid off loan %s
# Leases
LeaseCosts.title=Lease payments
LeaseCosts.text=Your account has been debited for %s in lease payments.
LeaseCosts.insufficient.report=<b>You have insufficient funds to service your leases! Funds Required: %s
# File Export
FinanceExport.format=%s financial transactions written to file.
## Unsorted General Finances
Expand Down
13 changes: 13 additions & 0 deletions MekHQ/src/mekhq/campaign/CampaignOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ public static String getTechLevelName(final int techLevel) {
private boolean payForOverhead;
private boolean payForMaintain;
private boolean payForTransport;
private boolean payForLeases;
private boolean sellUnits;
private boolean sellParts;
private boolean payForRecruitment;
Expand Down Expand Up @@ -1068,6 +1069,7 @@ public CampaignOptions() {
payForOverhead = false;
payForMaintain = false;
payForTransport = false;
payForLeases = false;
sellUnits = false;
sellParts = false;
payForRecruitment = false;
Expand Down Expand Up @@ -3305,6 +3307,14 @@ public void setPayForTransport(final boolean payForTransport) {
this.payForTransport = payForTransport;
}

public boolean isTrackLeases() {
return payForLeases;
}

public void setTrackLeases(final boolean payForLeases) {
this.payForLeases = payForLeases;
}

public boolean isSellUnits() {
return sellUnits;
}
Expand Down Expand Up @@ -5305,6 +5315,7 @@ public void writeToXml(final PrintWriter pw, int indent) {
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "payForOverhead", payForOverhead);
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "payForMaintain", payForMaintain);
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "payForTransport", payForTransport);
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "payForLeases", payForLeases);
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "sellUnits", sellUnits);
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "sellParts", sellParts);
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "payForRecruitment", payForRecruitment);
Expand Down Expand Up @@ -6235,6 +6246,8 @@ public static CampaignOptions generateCampaignOptionsFromXml(Node wn, Version ve
retVal.payForMaintain = Boolean.parseBoolean(wn2.getTextContent());
} else if (nodeName.equalsIgnoreCase("payForTransport")) {
retVal.payForTransport = Boolean.parseBoolean(wn2.getTextContent());
} else if (nodeName.equalsIgnoreCase("payForLeases")) {
retVal.payForLeases = Boolean.parseBoolean(wn2.getTextContent());
} else if (nodeName.equalsIgnoreCase("sellUnits")) {
retVal.sellUnits = Boolean.parseBoolean(wn2.getTextContent());
} else if (nodeName.equalsIgnoreCase("sellParts")) {
Expand Down
Loading
Loading