Skip to content

Commit

Permalink
Fix #8
Browse files Browse the repository at this point in the history
  • Loading branch information
daviscook477 committed Apr 20, 2018
1 parent 4f08f4b commit c354c84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 88 deletions.
14 changes: 10 additions & 4 deletions src/main/java/customclimb/CustomClimb.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;

Expand Down Expand Up @@ -168,6 +169,7 @@ private static Texture makeTexture(String path, float scale) {

private ArrayList<AbstractDailyMod> possibleMods;
private ArrayList<AbstractDailyMod> appliedMods = new ArrayList<>();
private HashMap<AbstractDailyMod, Boolean> reallyPositive = new HashMap<>();
private ArrayList<Hitbox> possibleHB = new ArrayList<>();
private ArrayList<Hitbox> appliedHB = new ArrayList<>();
private int possiblePage = 0;
Expand Down Expand Up @@ -331,7 +333,9 @@ private void setupModLists() {

for (Map.Entry<String, AbstractDailyMod> m :
((Map<String, AbstractDailyMod>) modsField.get(null)).entrySet()) {
possibleMods.add(m.getValue());
AbstractDailyMod mod = m.getValue();
reallyPositive.put(mod, false);
possibleMods.add(mod);
}

Field positiveModsField;
Expand All @@ -340,7 +344,9 @@ private void setupModLists() {

for (Map.Entry<String, AbstractDailyMod> m :
((Map<String, AbstractDailyMod>) positiveModsField.get(null)).entrySet()) {
possibleMods.add(m.getValue());
AbstractDailyMod mod = m.getValue();
reallyPositive.put(mod, true);
possibleMods.add(mod);
}
} catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
logger.error("could not read daily mod pool - leaving empty");
Expand Down Expand Up @@ -448,6 +454,7 @@ public void renderButtons(SpriteBatch sb) {
public void update() {
super.update();
confirmButton.update();
recalcHitboxes();
updateHitboxes();
if (confirmButton.hb.clicked) {
startRun();
Expand Down Expand Up @@ -597,7 +604,6 @@ private void fixPages() {
}
possiblePageLabel.text = buildPossiblePageText();
appliedPageLabel.text = buildAppliedPageText();
recalcHitboxes();
}

private void updateHitboxes() {
Expand Down Expand Up @@ -795,7 +801,7 @@ private void buildDailyMods() {
DailyMods.enabledMods.clear();
DailyMods.enabledMods.addAll(appliedMods);
for (AbstractDailyMod m : appliedMods) {
if (m.positive) {
if (reallyPositive.get(m)) {
DailyMods.cardMods.put(m.modID, true);
} else {
DailyMods.negativeMods.put(m.modID, true);
Expand Down
84 changes: 0 additions & 84 deletions src/main/java/customclimb/modifiers/Charity.java

This file was deleted.

0 comments on commit c354c84

Please sign in to comment.