blacklist chance display for crafted modifiers

This commit is contained in:
radimous 2024-12-05 16:03:43 +01:00
parent e758d2b787
commit 5bfc6c83ba
4 changed files with 19 additions and 6 deletions

View file

@ -1,7 +1,10 @@
package com.radimous.vhatcaniroll;
import iskallia.vault.config.gear.VaultGearTierConfig;
import net.minecraftforge.common.ForgeConfigSpec;
import java.util.List;
public class Config {
public static final ForgeConfigSpec SPEC;
public static final ForgeConfigSpec.BooleanValue VAULT_SCREEN_BUTTON;
@ -12,6 +15,8 @@ public class Config {
public static final ForgeConfigSpec.BooleanValue SHOW_WEIGHT;
public static final ForgeConfigSpec.BooleanValue SHOW_CHANCE;
public static final ForgeConfigSpec.BooleanValue QOL_HUNTERS_CONFLICT_RESOLUTION;
public static final ForgeConfigSpec.ConfigValue<List<VaultGearTierConfig.ModifierAffixTagGroup>>
AFFIX_TAG_GROUP_CHANCE_BLACKLIST;
static {
@ -51,6 +56,11 @@ public class Config {
SHOW_CHANCE = builder
.comment("show chance")
.define("showChance", true);
AFFIX_TAG_GROUP_CHANCE_BLACKLIST = builder
.comment("vhcir won't show chance/weight for affixes in these groups")
.define("affixTagGroupBlacklist", List.of(VaultGearTierConfig.ModifierAffixTagGroup.BASE_ATTRIBUTES, VaultGearTierConfig.ModifierAffixTagGroup.CRAFTED_PREFIX, VaultGearTierConfig.ModifierAffixTagGroup.CRAFTED_SUFFIX));
SPEC = builder.build();
}
}

View file

@ -341,6 +341,6 @@ public class Modifiers {
}
private static boolean shouldShowWeight(ModifierCategory modifierCategory, VaultGearTierConfig.ModifierAffixTagGroup affixTagGroup) {
return modifierCategory == ModifierCategory.NORMAL && affixTagGroup != VaultGearTierConfig.ModifierAffixTagGroup.BASE_ATTRIBUTES;
return modifierCategory == ModifierCategory.NORMAL && !Config.AFFIX_TAG_GROUP_CHANCE_BLACKLIST.get().contains(affixTagGroup);
}
}

View file

@ -2,9 +2,11 @@ package com.radimous.vhatcaniroll.ui;
import com.mojang.blaze3d.platform.InputConstants;
import com.radimous.vhatcaniroll.Config;
import com.radimous.vhatcaniroll.VHatCanIRoll;
import com.radimous.vhatcaniroll.logic.Items;
import com.radimous.vhatcaniroll.logic.ModifierCategory;
import com.simibubi.create.foundation.config.ui.ConfigScreen;
import com.simibubi.create.foundation.config.ui.SubMenuConfigScreen;
import iskallia.vault.client.gui.framework.ScreenRenderers;
import iskallia.vault.client.gui.framework.ScreenTextures;
@ -260,6 +262,7 @@ public class GearModifierScreen extends AbstractElementScreen {
private void createConfigButton(){
this.addElement(new ButtonElement<>(Spatials.positionXY(-3, 3), ScreenTextures.BUTTON_HISTORY_TEXTURES, () -> {
SubMenuConfigScreen screen = new SubMenuConfigScreen(this, "VHat Can I Roll? Configuration", ModConfig.Type.CLIENT, Config.SPEC, Config.SPEC.getValues());
ConfigScreen.modID = VHatCanIRoll.MODID;
Minecraft.getInstance().setScreen(screen);
})).layout((screen, gui, parent, world) -> {

View file

@ -43,7 +43,7 @@ public class HelpContainer extends ContainerElement<HelpContainer> {
var vimArrows = new LabelElement<>(
Spatials.positionXY(410, 72).width(16).height(16),
new TextComponent("h ").withStyle(ChatFormatting.GOLD)
.append(new TextComponent("lvl").withStyle(ChatFormatting.BLUE))
.append(new TextComponent("wheel").withStyle(ChatFormatting.BLUE))
.append(new TextComponent(" l").withStyle(ChatFormatting.GOLD)),
LabelTextStyle.shadow()
);
@ -96,12 +96,12 @@ public class HelpContainer extends ContainerElement<HelpContainer> {
String text = """
Colored triangles
represent groups
of attributes
of attributes.
If 2 attributes are
in the same group,
they can't be
rolled together
rolled together.
""";
var array = text.split("\n");