Skip to content

Commit

Permalink
Add client config button
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexNijjar committed Jan 18, 2024
1 parent 960dabe commit acd04b6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.20.1 2024-01-17T15:43:20.922995 Languages: en_us
fd9da0afbcb3c630d5c0086af81bb8b2475c033e assets/ad_astra/lang/en_us.json
// 1.20.1 2024-01-17T20:52:57.179114 Languages: en_us
854efde6604b2be8c88597fa5fb336e0bdcbb7ba assets/ad_astra/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@
"block.ad_astra.yellow_industrial_lamp": "Yellow Industrial Lamp",
"config.ad_astra.allowFlagImages": "Allow flag images",
"config.ad_astra.atmosphereLeave": "Atmosphere leave",
"config.ad_astra.clientConfig": "Client Config",
"config.ad_astra.coalGeneratorEnergyGenerationPerTick": "Coal generator energy generation per tick",
"config.ad_astra.deshTierEnergyCapacity": "Desh tier energy capacity",
"config.ad_astra.deshTierFluidCapacity": "Desh tier max fluid capacity",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package earth.terrarium.adastra.client.config;

import com.teamresourceful.resourcefulconfig.client.ConfigScreen;
import com.teamresourceful.resourcefulconfig.common.annotations.Config;
import com.teamresourceful.resourcefulconfig.common.annotations.ConfigEntry;
import com.teamresourceful.resourcefulconfig.common.annotations.InlineCategory;
import com.teamresourceful.resourcefulconfig.common.config.EntryType;
import com.teamresourceful.resourcefulconfig.common.config.ResourcefulConfig;
import earth.terrarium.adastra.AdAstra;
import net.minecraft.client.Minecraft;

@Config("ad_astra-client")
public final class AdAstraConfigClient {
Expand Down Expand Up @@ -80,4 +84,10 @@ public final class AdAstraConfigClient {
translation = "Reduce volume and increase pitch in space"
)
public static boolean spaceMuffler = true;

public static void open() {
ResourcefulConfig config = AdAstra.CONFIGURATOR.getConfig(AdAstraConfigClient.class);
if (config == null) return;
Minecraft.getInstance().setScreen(new ConfigScreen(Minecraft.getInstance().screen, null, config));
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package earth.terrarium.adastra.common.config;

import com.teamresourceful.resourcefulconfig.common.annotations.Comment;
import com.teamresourceful.resourcefulconfig.common.annotations.Config;
import com.teamresourceful.resourcefulconfig.common.annotations.ConfigEntry;
import com.teamresourceful.resourcefulconfig.common.annotations.InlineCategory;
import com.teamresourceful.resourcefulconfig.common.annotations.*;
import com.teamresourceful.resourcefulconfig.common.config.EntryType;
import com.teamresourceful.resourcefulconfig.web.annotations.Gradient;
import com.teamresourceful.resourcefulconfig.web.annotations.Link;
import com.teamresourceful.resourcefulconfig.web.annotations.WebInfo;
import earth.terrarium.adastra.client.config.AdAstraConfigClient;

@Config("ad_astra")
@WebInfo(
Expand All @@ -26,6 +24,10 @@
}
)
public final class AdAstraConfig {
@ConfigButton(text = "Client Config", translation = "config.ad_astra.clientConfig")
public static void clientConfig() {
AdAstraConfigClient.open();
}

@ConfigEntry(
id = "allowFlagImages",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ protected void addTranslations() {
add("tag.item.ad_astra.strophar_caps", "Strophar Caps");
add("tag.item.ad_astra.destroyed_in_space", "Destroyed in Space");

add("config.ad_astra.clientConfig", "Client Config");
add("config.ad_astra.allowFlagImages", "Allow flag images");
add("config.ad_astra.launchFromAnywhere", "Launch from anywhere");
add("config.ad_astra.planetRandomTickSpeed", "Planet random tick speed");
Expand Down

0 comments on commit acd04b6

Please sign in to comment.