Skip to content

Commit

Permalink
Fix configs not saving
Browse files Browse the repository at this point in the history
Signed-off-by: Octol1ttle <[email protected]>
  • Loading branch information
Octol1ttle committed Feb 28, 2024
1 parent 8dc80d4 commit e1c6def
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
.category(indicators(Text.translatable("config.flightassistant.category.flying"), indicators.flying, IndicatorConfigStorage.createDisabled()))
.category(computers(Text.translatable("config.flightassistant.category.computer_settings"), computers, new ComputerConfig()))

.save(FAConfig::save)

.build().generateScreen(parent);
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public void smoothSetPitch(Float pitch, float delta) {
newPitch = data.pitch + (pitch - data.pitch) * delta;
}

// TODO: wtf? interpolation is missing when opening the inventory
data.player.setPitch(-newPitch);
}

Expand Down
14 changes: 10 additions & 4 deletions src/main/java/ru/octol1ttle/flightassistant/config/FAConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ public static void setup() {
COMPUTER_HANDLER.load();
}

public static HUDConfig hud() {
return HUD_HANDLER.instance();
public static void save() {
HUD_HANDLER.save();
INDICATORS_STORAGE_HANDLER.save();
COMPUTER_HANDLER.save();
}

public static IndicatorConfigStorage getIndicatorConfigStorage() {
return INDICATORS_STORAGE_HANDLER.instance();
public static HUDConfig hud() {
return HUD_HANDLER.instance();
}

public static IndicatorConfigStorage.IndicatorConfig indicator() {
Expand All @@ -74,4 +76,8 @@ public static IndicatorConfigStorage.IndicatorConfig indicator() {
public static ComputerConfig computer() {
return COMPUTER_HANDLER.instance();
}

public static IndicatorConfigStorage getIndicatorConfigStorage() {
return INDICATORS_STORAGE_HANDLER.instance();
}
}

0 comments on commit e1c6def

Please sign in to comment.