43
43
import mekhq .campaign .Campaign ;
44
44
import mekhq .campaign .CampaignOptions ;
45
45
import mekhq .campaign .RandomSkillPreferences ;
46
- import mekhq .campaign .personnel .skills .SkillType ;
47
46
import mekhq .campaign .personnel .enums .PersonnelRole ;
48
47
import mekhq .campaign .personnel .enums .Phenotype ;
49
48
import mekhq .campaign .personnel .skills .SkillType ;
@@ -114,6 +113,7 @@ public class AdvancementTab {
114
113
115
114
//start Skill Randomization Tab
116
115
private JCheckBox chkExtraRandomness ;
116
+ private JCheckBox chkRandomizeTraits ;
117
117
118
118
private JPanel pnlPhenotype ;
119
119
private JLabel [] phenotypeLabels ;
@@ -520,6 +520,7 @@ private JPanel createAdministratorsPanel() {
520
520
*/
521
521
private void initializeSkillRandomizationTab () {
522
522
chkExtraRandomness = new JCheckBox ();
523
+ chkRandomizeTraits = new JCheckBox ();
523
524
524
525
pnlPhenotype = new JPanel ();
525
526
phenotypeLabels = new JLabel [] {}; // This will be initialized properly later
@@ -604,6 +605,7 @@ public JPanel skillRandomizationTab() {
604
605
605
606
// Contents
606
607
chkExtraRandomness = new CampaignOptionsCheckBox ("ExtraRandomness" );
608
+ chkRandomizeTraits = new CampaignOptionsCheckBox ("RandomizeTraits" );
607
609
608
610
pnlPhenotype = createPhenotypePanel ();
609
611
pnlRandomAbilities = createAbilityPanel ();
@@ -621,6 +623,9 @@ public JPanel skillRandomizationTab() {
621
623
layout .gridwidth = 1 ;
622
624
panel .add (chkExtraRandomness , layout );
623
625
626
+ layout .gridy ++;
627
+ panel .add (chkRandomizeTraits , layout );
628
+
624
629
layout .gridx = 0 ;
625
630
layout .gridy ++;
626
631
panel .add (pnlPhenotype , layout );
@@ -1100,7 +1105,7 @@ public void loadValuesFromCampaignOptions() {
1100
1105
* {@code null}, values are loaded from the current skill preferences.
1101
1106
*/
1102
1107
public void loadValuesFromCampaignOptions (@ Nullable CampaignOptions presetCampaignOptions ,
1103
- @ Nullable RandomSkillPreferences presetRandomSkillPreferences ) {
1108
+ @ Nullable RandomSkillPreferences presetRandomSkillPreferences ) {
1104
1109
CampaignOptions options = presetCampaignOptions ;
1105
1110
if (presetCampaignOptions == null ) {
1106
1111
options = this .campaignOptions ;
@@ -1132,6 +1137,7 @@ public void loadValuesFromCampaignOptions(@Nullable CampaignOptions presetCampai
1132
1137
1133
1138
//start Skill Randomization Tab
1134
1139
chkExtraRandomness .setSelected (skillPreferences .randomizeSkill ());
1140
+ chkRandomizeTraits .setSelected (skillPreferences .isRandomizeTraits ());
1135
1141
final int [] phenotypeProbabilities = options .getPhenotypeProbabilities ();
1136
1142
for (int i = 0 ; i < phenotypeSpinners .length ; i ++) {
1137
1143
phenotypeSpinners [i ].setValue (phenotypeProbabilities [i ]);
@@ -1184,7 +1190,7 @@ public void loadValuesFromCampaignOptions(@Nullable CampaignOptions presetCampai
1184
1190
* {@code null}, values are applied to the current skill preferences.
1185
1191
*/
1186
1192
public void applyCampaignOptionsToCampaign (@ Nullable CampaignOptions presetCampaignOptions ,
1187
- @ Nullable RandomSkillPreferences presetRandomSkillPreferences ) {
1193
+ @ Nullable RandomSkillPreferences presetRandomSkillPreferences ) {
1188
1194
CampaignOptions options = presetCampaignOptions ;
1189
1195
if (presetCampaignOptions == null ) {
1190
1196
options = this .campaignOptions ;
@@ -1216,6 +1222,7 @@ public void applyCampaignOptionsToCampaign(@Nullable CampaignOptions presetCampa
1216
1222
1217
1223
//start Skill Randomization Tab
1218
1224
skillPreferences .setRandomizeSkill (chkExtraRandomness .isSelected ());
1225
+ skillPreferences .setRandomizeTraits (chkRandomizeTraits .isSelected ());
1219
1226
for (int i = 0 ; i < phenotypeSpinners .length ; i ++) {
1220
1227
options .setPhenotypeProbability (i , (int ) phenotypeSpinners [i ].getValue ());
1221
1228
}
0 commit comments