Skip to content

Commit

Permalink
WIP: Improve Instrument and MusicVenueTool overlays.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aeronica committed Mar 12, 2024
1 parent b9214a0 commit 01a96a7
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 38 deletions.
9 changes: 5 additions & 4 deletions src/generated/resources/assets/mxtune/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
"commands.mxtune.music.dump": "Wrote %s records",
"commands.mxtune.music.load": "Read %s records",
"config.mxtune.client.double_click_time_ms": "Double-click time in milliseconds for GUI widgets",
"config.mxtune.client.instrument_overlay_percent": "Instrument Overlay Percent down screen",
"config.mxtune.client.instrument_overlay_position": "Instrument Overlay Position",
"config.mxtune.client.instrument_overlay_x_pos": "Instrument Overlay X-Pos",
"config.mxtune.client.instrument_overlay_y_pct": "Instrument Overlay Y-Pos %",
"config.mxtune.client.mml_Link": "MML Site Link",
"config.mxtune.client.venue_tool_overlay_percent": "Venue Tool Overlay Percent down screen",
"config.mxtune.client.venue_tool_overlay_position": "Venue Tool Overlay Position",
"config.mxtune.client.venue_tool_overlay_x_pos": "Venue Tool Overlay X-Pos",
"config.mxtune.client.venue_tool_overlay_y_pct": "Venue Tool Overlay Y-Pos %",
"config.mxtune.client_only_settings": "Client Only Settings",
"config.mxtune.server.listener_range": "Listener Range",
"config.mxtune.server.sheet_music_expires": "Sheet Music Expires",
"config.mxtune.server.sheet_music_life_in_days": "Sheet Music Life in Days",
Expand Down
69 changes: 39 additions & 30 deletions src/main/java/aeronicamc/mods/mxtune/config/MXTuneConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,46 +35,55 @@ public static class Client
{
public final ConfigValue<Integer> doubleClickTime;
public final ConfigValue<String> site;
public final ConfigValue<IOverlayItem.Position> instrumentOverlayPosition;
public final ConfigValue<Integer> instrumentOverlayPercent;
public final ConfigValue<IOverlayItem.Position> venueToolOverlayPosition;
public final ConfigValue<Integer> venueToolOverlayPercent;
public final ConfigValue<IOverlayItem.Position> instrumentOverlayXPosition;
public final ConfigValue<Integer> instrumentOverlayYPercent;
public final ConfigValue<IOverlayItem.Position> venueToolOverlayXPosition;
public final ConfigValue<Integer> venueToolOverlayYPercent;

public Client(final ForgeConfigSpec.Builder builder)
{
builder.comment("Client Only Settings")
.push("client");
builder.comment("Client Only Settings");

builder.comment("1) GUI widgets Double-click time")
.push("1) GUI widgets Double-click time");
doubleClickTime = builder
.comment("Double-click time in milliseconds for GUI widgets")
.translation("config.mxtune.client.double_click_time_ms")
.defineInRange("doubleClickTime", 500, 10, 5000);
builder.pop();

builder.comment("2) MML Site Link")
.push("2) MML Site Link");
site = builder
.comment("Site Link")
.comment("MML Site Link")
.translation("config.mxtune.client.mml_Link")
.define("site", "https://mabibeats.com/");
builder.pop();

instrumentOverlayPosition = builder
.comment("Instrument Overlay Position")
.translation("config.mxtune.client.instrument_overlay_position")
.defineEnum("instrumentOverlayPosition", IOverlayItem.Position.LEFT);

instrumentOverlayPercent = builder
.comment("Instrument Overlay Percent down screen")
.translation("config.mxtune.client.instrument_overlay_percent")
.defineInRange("instrumentOverlayPercent", 0, 0, 100);

venueToolOverlayPosition = builder
.comment("Venue Tool Overlay Position")
.translation("config.mxtune.client.venue_tool_overlay_position")
.defineEnum("venueToolOverlayPosition", IOverlayItem.Position.CENTER);

venueToolOverlayPercent = builder
.comment("Venue Tool Overlay Percent down screen")
.translation("config.mxtune.client.venue_tool_overlay_percent")
.defineInRange("venueToolOverlayPercent", 70, 0, 100);
builder.comment("3) Instrument Overlay Positions")
.push("3) Instrument Overlay Positions");
instrumentOverlayXPosition = builder
.comment("Instrument Overlay X Position")
.translation("config.mxtune.client.instrument_overlay_x_pos")
.defineEnum("instrumentOverlayXPosition", IOverlayItem.Position.LEFT);

instrumentOverlayYPercent = builder
.comment("Instrument Overlay Y Percent down screen")
.translation("config.mxtune.client.instrument_overlay_y_pct")
.defineInRange("instrumentOverlayYPercent", 0, 0, 100);
builder.pop();

builder.comment("4) Venue Tool Overlay Positions")
.push("4) Venue Tool Overlay Positions");
venueToolOverlayXPosition = builder
.comment("Venue Tool Overlay X Position")
.translation("config.mxtune.client.venue_tool_overlay_x_pos")
.defineEnum("venueToolOverlayXPosition", IOverlayItem.Position.CENTER);

venueToolOverlayYPercent = builder
.comment("Venue Tool Overlay Y Percent down screen")
.translation("config.mxtune.client.venue_tool_overlay_y_pct")
.defineInRange("venueToolOverlayYPercent", 70, 0, 100);
builder.pop();
}
}
Expand Down Expand Up @@ -120,13 +129,13 @@ public Server(final ForgeConfigSpec.Builder builder)

public static String getMmlLink() { return CLIENT.site.get(); }

public static IOverlayItem.Position getInstrumentOverlayPosition() { return CLIENT.instrumentOverlayPosition.get(); }
public static IOverlayItem.Position getInstrumentOverlayPosition() { return CLIENT.instrumentOverlayXPosition.get(); }

public static int getInstrumentOverlayPercent() { return CLIENT.instrumentOverlayPercent.get(); }
public static int getInstrumentOverlayPercent() { return CLIENT.instrumentOverlayYPercent.get(); }

public static IOverlayItem.Position getVenueToolOverlayPosition() { return CLIENT.venueToolOverlayPosition.get(); }
public static IOverlayItem.Position getVenueToolOverlayPosition() { return CLIENT.venueToolOverlayXPosition.get(); }

public static int getVenueToolOverlayPercent() { return CLIENT.venueToolOverlayPercent.get(); }
public static int getVenueToolOverlayPercent() { return CLIENT.venueToolOverlayYPercent.get(); }

private static final ForgeConfigSpec serverSpec;
public static final Server SERVER;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,13 @@ private void addCommands()

private void addConfigs()
{
addConfig("client_only_settings", "Client Only Settings");
addConfig("client.double_click_time_ms", "Double-click time in milliseconds for GUI widgets");
addConfig("client.mml_Link", "MML Site Link");
addConfig("client.instrument_overlay_position", "Instrument Overlay Position");
addConfig("client.instrument_overlay_percent", "Instrument Overlay Percent down screen");
addConfig("client.venue_tool_overlay_position", "Venue Tool Overlay Position");
addConfig("client.venue_tool_overlay_percent", "Venue Tool Overlay Percent down screen");
addConfig("client.instrument_overlay_x_pos", "Instrument Overlay X-Pos");
addConfig("client.instrument_overlay_y_pct", "Instrument Overlay Y-Pos %");
addConfig("client.venue_tool_overlay_x_pos", "Venue Tool Overlay X-Pos");
addConfig("client.venue_tool_overlay_y_pct", "Venue Tool Overlay Y-Pos %");
addConfig("server.listener_range", "Listener Range");
addConfig("server.sheet_music_expires", "Sheet Music Expires");
addConfig("server.sheet_music_life_in_days", "Sheet Music Life in Days");
Expand Down

0 comments on commit 01a96a7

Please sign in to comment.