Skip to content

Commit

Permalink
Add configurable vault screen texture
Browse files Browse the repository at this point in the history
closes #19
  • Loading branch information
triphora committed Jul 2, 2021
1 parent 1073272 commit a99d5a9
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ yarn_mappings=1
loader_version=0.11.6
fabric_version=0.36.0+1.17
# Mod Properties
mod_version=2.1.1-SNAPSHOT
mod_version=2.1.1
maven_group=dev.frydae
archives_base_name=empire-minecraft-utilities
# Dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.mojang.blaze3d.systems.RenderSystem;
import dev.frydae.emcutils.EmpireMinecraftUtilities;
import dev.frydae.emcutils.accessors.ScreenAccessor;
import dev.frydae.emcutils.utils.Config;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.client.gui.screen.ingame.ScreenHandlerProvider;
Expand All @@ -25,7 +26,7 @@
import org.apache.commons.lang3.math.NumberUtils;

public class VaultScreen extends HandledScreen<VaultScreenHandler> implements ScreenHandlerProvider<VaultScreenHandler> {
private static final Identifier TEXTURE = new Identifier(EmpireMinecraftUtilities.MODID, "textures/gui/container/generic_63.png");
private static final Identifier TEXTURE = new Identifier(EmpireMinecraftUtilities.MODID, Config.returnVaultScreenOption());
private final int rows;
private final int vaultPage;
private final int[] slotOffsets = {8, 26, 44, 62, 80, 98, 116, 134, 152};
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/dev/frydae/emcutils/utils/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@

@SuppressWarnings("unused")
public class Config extends MidnightConfig {
@Getter @Entry public static boolean darkVaultScreen = false;
@Getter @Entry public static boolean tabListShowAllServers = true;
@Getter @Entry public static TabListSortType tabListSortType = TabListSortType.SERVER_ASCENDING;
@Getter @Entry public static TabListCurrentServerPlacement tabListCurrentServerPlacement = TabListCurrentServerPlacement.TOP;
@Entry public static boolean chatAlertsOn = true;
@Getter @Entry(min=-15,max=30) public static int chatAlertPitch = 0;
@Getter @Entry public static ChatAlertSound chatAlertSound = ChatAlertSound.LEVEL_UP;

public enum VaultScreenOptions {LIGHT_SCREEN, DARK_SCREEN}

public static String returnVaultScreenOption() {
if (darkVaultScreen) return "textures/gui/container/generic_63_dark.png";
else return "textures/gui/container/generic_63.png";

This comment has been minimized.

Copy link
@MrFrydae

MrFrydae Jul 2, 2021

Collaborator

You should put curly brackets on this if/else statement

}

@AllArgsConstructor
public enum TabListSortType {
NAME_ASCENDING() {
Expand Down Expand Up @@ -64,4 +72,5 @@ public enum ChatAlertSound {
this.soundEvent = soundEvent;
}
}
// public static String LIGHT_SCREEN = "textures/gui/container/generic_63.png";

This comment has been minimized.

Copy link
@MrFrydae

MrFrydae Jul 2, 2021

Collaborator

You can get rid of this if you want

}
1 change: 1 addition & 0 deletions src/main/resources/assets/emcutils/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"emcutils.midnightconfig.title": "Empire Minecraft Utilities",
"emcutils.midnightconfig.darkVaultScreen": "Dark vault screen (requires restart)",
"emcutils.midnightconfig.tabListShowAllServers": "Show all servers in the Player Tab List",
"emcutils.midnightconfig.tabListSortType": "How to sort players",
"emcutils.midnightconfig.enum.TabListSortType.NAME_ASCENDING": "Players A to Z",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a99d5a9

Please sign in to comment.