Skip to content

Commit

Permalink
fix config screen being totally broken
Browse files Browse the repository at this point in the history
  • Loading branch information
ix0rai committed Oct 26, 2023
1 parent 9f3923a commit 79c42df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/main/java/io/ix0rai/rainglow/config/CustomModeScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ protected void init() {
}
options.addOptionEntry(colourToggles[i], secondToggle);
}
this.addDrawable(options);
this.addDrawableSelectableElement(options);

// save and clear buttons
this.addDrawable(this.clearOption.createWidget(Position.of(this, this.width / 2 - 155, this.height - 29), 150));
this.addDrawable(this.saveOption.createWidget(Position.of(this, this.width / 2 - 155 + 160, this.height - 29), 150));
this.addDrawableSelectableElement(this.clearOption.createWidget(Position.of(this, this.width / 2 - 155, this.height - 29), 150));
this.addDrawableSelectableElement(this.saveOption.createWidget(Position.of(this, this.width / 2 - 155 + 160, this.height - 29), 150));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ protected void init() {
SpruceOptionListWidget optionList = new SpruceOptionListWidget(Position.of(0, 22), this.width, this.height - (35 + 22));
for (int i = 0; i < RainglowEntity.values().length; i += 2) {
SpruceOption secondToggle = null;
if (i + 1 < RainglowEntity.values().length) {
int l = RainglowEntity.values().length;

if (i + 1 < l) {
secondToggle = this.entityToggles[i + 1];
}

Expand All @@ -127,7 +129,7 @@ protected void init() {

optionList.addOptionEntry(this.modeOption, this.customOption);
optionList.addSingleOptionEntry(this.colourRarityOption);
this.addDrawable(optionList);
this.addDrawableSelectableElement(optionList);

// current colours label and colours to apply label
SpruceLabelWidget currentColoursLabel = createColourListLabel(Rainglow.translatableTextKey("config.current_colours"), Rainglow.CONFIG.getMode(), this.width / 2 - 290, this.height / 4 + 40);
Expand All @@ -136,8 +138,8 @@ protected void init() {
this.addDrawable(this.coloursToApplyLabel);

// reset and save buttons
this.addDrawable(this.resetOption.createWidget(Position.of(this, this.width / 2 - 155, this.height - 29), 150));
this.addDrawable(this.saveOption.createWidget(Position.of(this, this.width / 2 - 155 + 160, this.height - 29), 150));
this.addDrawableSelectableElement(this.resetOption.createWidget(Position.of(this, this.width / 2 - 155, this.height - 29), 150));
this.addDrawableSelectableElement(this.saveOption.createWidget(Position.of(this, this.width / 2 - 155 + 160, this.height - 29), 150));
}

private SpruceLabelWidget createColourListLabel(String translationKey, RainglowMode mode, int x, int y) {
Expand Down

0 comments on commit 79c42df

Please sign in to comment.