Skip to content

Commit

Permalink
Fixed bug #49
Browse files Browse the repository at this point in the history
  • Loading branch information
LMH01 committed May 2, 2021
1 parent a48f481 commit aead80b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

public class MadGamesTycoon2ModTool {
private static final Logger LOGGER = LoggerFactory.getLogger(MadGamesTycoon2ModTool.class);
public static final String VERSION = "2.0.1";//Version numbers that include "dev" are not checked for updates / tool will notify if update is available
public static final String VERSION = "2.0.2-dev";//Version numbers that include "dev" are not checked for updates / tool will notify if update is available
public static final String CURRENT_RELEASE_VERSION = "2.0.1";//When this version number has been detected as the newest release version the update available message is held back
public static void main(String[] args){
Settings.importSettings();
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/com/github/lmh01/mgt2mt/mod/GameplayFeatureMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,12 @@ public void menuActionAddMod() {
JButton buttonBadGenres = new JButton(I18n.INSTANCE.get("mod.gameplayFeature.addMod.components.button.selectBadGenres"));
buttonBadGenres.setToolTipText(I18n.INSTANCE.get("mod.gameplayFeature.addMod.components.button.selectBadGenres.toolTip"));
buttonBadGenres.addActionListener(actionEvent -> {
badGenreIds[0] = Utils.getSelectedEntries("Select the genre(s) that don't work with your gameplay feature", I18n.INSTANCE.get("mod.gameplayFeature.addMod.components.button.genres.title"), ModManager.genreMod.getAnalyzer().getContentByAlphabet(), ModManager.genreMod.getAnalyzer().getContentByAlphabet(), true);
ArrayList<Integer> goodGenrePositions = Utils.getSelectedEntries("Select the genre(s) that don't work with your gameplay feature", I18n.INSTANCE.get("mod.gameplayFeature.addMod.components.button.genres.title"), ModManager.genreMod.getAnalyzer().getContentByAlphabet(), ModManager.genreMod.getAnalyzer().getContentByAlphabet(), true);
ArrayList<Integer> badGenreIdsOut = new ArrayList<>();
for(Integer integer : goodGenrePositions){
badGenreIdsOut.add(ModManager.genreMod.getAnalyzer().getContentIdByName(ModManager.genreMod.getAnalyzer().getContentByAlphabet()[integer]));
}
badGenreIds[0] = badGenreIdsOut;
if(badGenreIds[0].size() != 0){
boolean mutualEntries = Utils.checkForMutualEntries(badGenreIds[0], goodGenreIds[0]);
if(Settings.disableSafetyFeatures || !mutualEntries){
Expand All @@ -293,7 +298,12 @@ public void menuActionAddMod() {
JButton buttonGoodGenres = new JButton(I18n.INSTANCE.get("mod.gameplayFeature.addMod.components.button.selectGoodGenres"));
buttonGoodGenres.setToolTipText(I18n.INSTANCE.get("mod.gameplayFeature.addMod.components.button.selectGoodGenres.toolTip"));
buttonGoodGenres.addActionListener(actionEvent -> {
goodGenreIds[0] = Utils.getSelectedEntries("Select the genre(s) that work with your gameplay feature", I18n.INSTANCE.get("mod.gameplayFeature.addMod.components.button.genres.title"), ModManager.genreMod.getAnalyzer().getContentByAlphabet(), ModManager.genreMod.getAnalyzer().getContentByAlphabet(), true);
ArrayList<Integer> goodGenrePositions = Utils.getSelectedEntries("Select the genre(s) that work with your gameplay feature", I18n.INSTANCE.get("mod.gameplayFeature.addMod.components.button.genres.title"), ModManager.genreMod.getAnalyzer().getContentByAlphabet(), ModManager.genreMod.getAnalyzer().getContentByAlphabet(), true);
ArrayList<Integer> goodGenreIdsOut = new ArrayList<>();
for(Integer integer : goodGenrePositions){
goodGenreIdsOut.add(ModManager.genreMod.getAnalyzer().getContentIdByName(ModManager.genreMod.getAnalyzer().getContentByAlphabet()[integer]));
}
goodGenreIds[0] = goodGenreIdsOut;
if(goodGenreIds[0].size() != 0){
boolean mutualEntries = Utils.checkForMutualEntries(badGenreIds[0], goodGenreIds[0]);
if(Settings.disableSafetyFeatures || !mutualEntries){
Expand Down

0 comments on commit aead80b

Please sign in to comment.