Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ The vanilla statistics screen is a mess, harder to read and navigate, and lacks
## Dependencies

This mod depends on some other mods that first need to be installed before this mod can be installed. Those dependencies are as follows:
- 🧵 [Fabric API](https://github.com/FabricMC/fabric-api) (Fabric only) - Loads this mod's assets and resources.
- 🖥 [TCDCommons API](https://github.com/TheCSDev/tcdcommons) - Powers the GUI interface of this mod
- 🏗 [Architectury API](https://github.com/architectury/architectury-api) - Allows this mod to run on `Fabric` and `NeoForge`

## Building

Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ maven.group = com.thecsdev

# Mod properties
mod.id = betterstats
mod.version = 5.5.2
mod.version = 5.5.3
mod.name = Better Statistics Screen
mod.description = A Minecraft mod that improves the statistics screen and makes it more useful.
mod.author = TheCSDev
Expand Down Expand Up @@ -48,7 +48,7 @@ fabric.api_version = 0.152.1+26.2
fabric.json.depends.minecraft = ~26.2
fabric.json.depends.fabricloader = >=0.19.3
fabric.json.depends.fabric-api = >=0.152.1
fabric.json.depends.tcdcommons = >=5.5.2
fabric.json.depends.tcdcommons = >=5.5.3

# Neo-Forge properties
neoforge.version = 26.1.0.7-beta
Expand All @@ -57,4 +57,4 @@ neoforge.version = 26.1.0.7-beta
net.toml.loaderVersion = [4,)
neo.toml.dependencies.neoforge = [26.2.0.1-beta,)
neo.toml.dependencies.minecraft = [26.2, 26.3)
neo.toml.dependencies.tcdcommons = [5.5.2,)
neo.toml.dependencies.tcdcommons = [5.5.3,)
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
import com.thecsdev.commonmc.resource.TLanguage;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.ChatFormatting;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -93,7 +95,7 @@ public static final void initConfigGui(@NotNull TPanelElement panel) throws Null
initStringProperty(
panel,
BLanguage.config_common_apiEndpoint(),
TTooltip.of(BLanguage.config_common_apiEndpoint_tooltip()),
BLanguage.config_common_apiEndpoint_tooltip(),
bss_config.getApiEndpoint().toString(),
(_, _, n) -> {
try { bss_config.setApiEndpoint(URI.create(n));}
Expand All @@ -102,13 +104,13 @@ public static final void initConfigGui(@NotNull TPanelElement panel) throws Null
initBooleanProperty(
panel,
BLanguage.config_common_registerCommands(),
TTooltip.of(BLanguage.config_common_registerCommands_tooltip()),
BLanguage.config_common_registerCommands_tooltip(),
bss_config.canRegisterCommands(),
(_, _, n) -> bss_config.setRegisterCommands(n));
initBooleanProperty(
panel,
BLanguage.config_common_experiments(),
TTooltip.of(BLanguage.config_common_experiments_tooltip()),
BLanguage.config_common_experiments_tooltip(),
bss_config.experimentsEnabled(),
(_, _, n) -> bss_config.setExperimentsEnabled(n));

Expand All @@ -117,13 +119,13 @@ public static final void initConfigGui(@NotNull TPanelElement panel) throws Null
initBooleanProperty(
panel,
BLanguage.config_client_guiMobsFollowCursor(),
TTooltip.of(BLanguage.config_client_guiMobsFollowCursor_tooltip()),
BLanguage.config_client_guiMobsFollowCursor_tooltip(),
bss_config.getGuiMobsFollowCursor(),
(_, _, n) -> bss_config.setGuiMobsFollowCursor(n));
initBooleanProperty(
panel,
BLanguage.config_client_allowChatPsa(),
TTooltip.of(BLanguage.config_client_allowChatPsa_tooltip()),
BLanguage.config_client_allowChatPsa_tooltip(),
bss_config.allowsChatPsaMessages(),
(_, _, n) -> bss_config.setAllowChatPsaMessages(n));

Expand All @@ -144,7 +146,7 @@ public static final void initConfigGui(@NotNull TPanelElement panel) throws Null
initBooleanProperty(
panel,
TLanguage.config_client_updateItemGroupsOnJoin(),
TTooltip.of(TLanguage.config_client_updateItemGroupsOnJoin_tooltip()),
TLanguage.config_client_updateItemGroupsOnJoin_tooltip(),
tcd_config.updateItemGroupsOnJoin(),
(_, _, n) -> tcd_config.setUpdateItemGroupsOnJoin(n));

Expand Down Expand Up @@ -204,6 +206,7 @@ private static final void initTableHead(
* Initializes a blank setting slot that has no setting there.
* @param panel The target {@link TPanelElement}.
*/
@ApiStatus.Internal
private static final void initNothingSetting(@NotNull TPanelElement panel)
{
//background color element
Expand All @@ -224,15 +227,27 @@ private static final void initNothingSetting(@NotNull TPanelElement panel)
* Initializes a boolean property setting.
* @param panel The panel where the setting is to be initialized.
* @param name The display name label text.
* @param tooltip The tooltip text.
* @param tooltipText The tooltip text.
* @param value The current value of the setting.
* @param changeListener Use this to apply setting value changes.
*/
@ApiStatus.Internal
private static final void initBooleanProperty(
@NotNull TPanelElement panel,
@NotNull Component name, @Nullable TTooltip tooltip,
@NotNull Component name, @Nullable Component tooltipText,
boolean value, @NotNull IChangeListener<Boolean> changeListener)
{
//preparation
if(tooltipText != null)
tooltipText = Component.literal("")
.append(Component.literal("").append(name).withStyle(ChatFormatting.YELLOW))
.append("\n")
.append(Component.literal("").append(tooltipText).withStyle(ChatFormatting.GRAY));
else
tooltipText = Component.literal("")
.append(Component.literal("").append(name).withStyle(ChatFormatting.YELLOW));
final var tooltip = TTooltip.of(tooltipText);

//background color element
final var el_bg = new TFillColorElement.Flat((panel.size() % 2 == 0) ? 0x33000000 : 0x44000000, 0);
el_bg.hoverableProperty().set(true, BetterStatsConfigScreen.class);
Expand All @@ -258,15 +273,27 @@ private static final void initBooleanProperty(
* Initializes a string property setting.
* @param panel The panel where the setting is to be initialized.
* @param name The display name label text.
* @param tooltip The tooltip text.
* @param tooltipText The tooltip text.
* @param value The current value of the setting.
* @param changeListener Use this to apply setting value changes.
*/
@ApiStatus.Internal
private static final void initStringProperty(
@NotNull TPanelElement panel,
@NotNull Component name, @Nullable TTooltip tooltip,
@NotNull Component name, @Nullable Component tooltipText,
@NotNull String value, @NotNull IChangeListener<String> changeListener)
{
//preparation
if(tooltipText != null)
tooltipText = Component.literal("")
.append(Component.literal("").append(name).withStyle(ChatFormatting.YELLOW))
.append("\n")
.append(Component.literal("").append(tooltipText).withStyle(ChatFormatting.GRAY));
else
tooltipText = Component.literal("")
.append(Component.literal("").append(name).withStyle(ChatFormatting.YELLOW));
final var tooltip = TTooltip.of(tooltipText);

//background color element
final var el_bg = new TFillColorElement.Flat((panel.size() % 2 == 0) ? 0x33000000 : 0x44000000, 0);
el_bg.hoverableProperty().set(true, BetterStatsConfigScreen.class);
Expand Down
Binary file not shown.
Loading
Loading