uniques done
This commit is contained in:
parent
6b50b6cb3b
commit
5c161a0f7c
11 changed files with 257 additions and 142 deletions
|
|
@ -22,8 +22,8 @@ public class QOLHuntersCompat {
|
||||||
if (qolConfigButton == null) {
|
if (qolConfigButton == null) {
|
||||||
// use reflection to avoid a million dependencies
|
// use reflection to avoid a million dependencies
|
||||||
try {
|
try {
|
||||||
var cl = Class.forName("io.iridium.qolhunters.config.QOLHuntersClientConfigs");
|
Class<?> cl = Class.forName("io.iridium.qolhunters.config.QOLHuntersClientConfigs");
|
||||||
var qolButton = cl.getField("SHOW_CONFIG_BUTTON").get(null);
|
Object qolButton = cl.getField("SHOW_CONFIG_BUTTON").get(null);
|
||||||
qolConfigButton = (ForgeConfigSpec.BooleanValue) qolButton;
|
qolConfigButton = (ForgeConfigSpec.BooleanValue) qolButton;
|
||||||
} catch (NoSuchFieldException | ClassNotFoundException | IllegalAccessException e) {
|
} catch (NoSuchFieldException | ClassNotFoundException | IllegalAccessException e) {
|
||||||
qolHuntersLoaded = false;
|
qolHuntersLoaded = false;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,14 @@
|
||||||
package com.radimous.vhatcaniroll.logic;
|
package com.radimous.vhatcaniroll.logic;
|
||||||
|
|
||||||
|
import iskallia.vault.gear.VaultGearState;
|
||||||
|
import iskallia.vault.gear.data.VaultGearData;
|
||||||
|
import iskallia.vault.init.ModGearAttributes;
|
||||||
import iskallia.vault.init.ModItems;
|
import iskallia.vault.init.ModItems;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
@ -23,35 +29,36 @@ public class Items {
|
||||||
|
|
||||||
public static List<ItemStack> getVHGearItems() {
|
public static List<ItemStack> getVHGearItems() {
|
||||||
return List.of(
|
return List.of(
|
||||||
new ItemStack(ModItems.SWORD),
|
withTransmog(new ItemStack(ModItems.SWORD), new ResourceLocation("the_vault:gear/sword/sword_0")),
|
||||||
new ItemStack(ModItems.AXE),
|
withTransmog(new ItemStack(ModItems.AXE), new ResourceLocation("the_vault:gear/axe/axe_0")),
|
||||||
new ItemStack(ModItems.HELMET),
|
withTransmog(new ItemStack(ModItems.HELMET), new ResourceLocation("the_vault:gear/armor/gladiator_dark/helmet")),
|
||||||
new ItemStack(ModItems.CHESTPLATE),
|
withTransmog(new ItemStack(ModItems.CHESTPLATE), new ResourceLocation("the_vault:gear/armor/magmatic/chestplate")),
|
||||||
new ItemStack(ModItems.LEGGINGS),
|
withTransmog(new ItemStack(ModItems.LEGGINGS), new ResourceLocation("the_vault:gear/armor/reinforced_platemail_dark/leggings")),
|
||||||
new ItemStack(ModItems.BOOTS),
|
withTransmog(new ItemStack(ModItems.BOOTS), new ResourceLocation("the_vault:gear/armor/gladiator_dark/boots")),
|
||||||
new ItemStack(ModItems.FOCUS),
|
withTransmog(new ItemStack(ModItems.FOCUS), new ResourceLocation("the_vault:gear/focus/tatteredtome")),
|
||||||
new ItemStack(ModItems.SHIELD),
|
withTransmog(new ItemStack(ModItems.SHIELD), new ResourceLocation("the_vault:gear/shield/gold_plated")),
|
||||||
new ItemStack(ModItems.WAND),
|
withTransmog(new ItemStack(ModItems.WAND), new ResourceLocation("the_vault:gear/wand/lunar")),
|
||||||
new ItemStack(ModItems.MAGNET),
|
withTransmog(new ItemStack(ModItems.MAGNET), new ResourceLocation("the_vault:magnets/magnet_1")),
|
||||||
new ItemStack(ModItems.JEWEL)
|
withTransmog(new ItemStack(ModItems.JEWEL), new ResourceLocation("the_vault:gear/jewel/sword_0"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<ItemStack> getWoldGearItems() {
|
public static List<ItemStack> getWoldGearItems() {
|
||||||
List<ItemStack> woldItems = new ArrayList<>();
|
List<ItemStack> woldItems = new ArrayList<>();
|
||||||
List<String> woldItemFields = Arrays.asList(
|
List<Pair<String, String>> woldItemFields = Arrays.asList(
|
||||||
"BATTLESTAFF",
|
Pair.of("BATTLESTAFF", "the_vault:gear/battlestaff/battlestaff_redstone"),
|
||||||
"TRIDENT",
|
Pair.of("TRIDENT", "the_vault:gear/trident/orange"),
|
||||||
"PLUSHIE",
|
Pair.of("PLUSHIE", "the_vault:gear/plushie/hrry"),
|
||||||
"LOOT_SACK",
|
Pair.of("LOOT_SACK", "the_vault:gear/loot_sack/bundle"),
|
||||||
"RANG"
|
Pair.of("RANG", "the_vault:gear/rang/wooden")
|
||||||
);
|
);
|
||||||
try{
|
try{
|
||||||
Class<?> woldItemClass = Class.forName("xyz.iwolfking.woldsvaults.init.ModItems");
|
Class<?> woldItemClass = Class.forName("xyz.iwolfking.woldsvaults.init.ModItems");
|
||||||
for (String woldFieldName : woldItemFields) {
|
for (Pair<String, String> woldFieldTransmogs : woldItemFields) {
|
||||||
try {
|
try {
|
||||||
|
String woldFieldName = woldFieldTransmogs.getLeft();
|
||||||
Item item = (Item) woldItemClass.getField(woldFieldName).get(null);
|
Item item = (Item) woldItemClass.getField(woldFieldName).get(null);
|
||||||
woldItems.add(new ItemStack(item));
|
woldItems.add(withTransmog(new ItemStack(item), new ResourceLocation(woldFieldTransmogs.getRight())));
|
||||||
} catch (IllegalArgumentException | SecurityException | NoSuchFieldException |
|
} catch (IllegalArgumentException | SecurityException | NoSuchFieldException |
|
||||||
IllegalAccessException ignored) {
|
IllegalAccessException ignored) {
|
||||||
// no-op
|
// no-op
|
||||||
|
|
@ -61,6 +68,20 @@ public class Items {
|
||||||
// no-op
|
// no-op
|
||||||
}
|
}
|
||||||
return woldItems;
|
return woldItems;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates copy of the given stack with the transmog applied
|
||||||
|
* @param stack the stack to apply the transmog to
|
||||||
|
* @param transmog the transmog to apply
|
||||||
|
* @return the stack with the transmog applied
|
||||||
|
*/
|
||||||
|
public static ItemStack withTransmog(ItemStack stack, ResourceLocation transmog){
|
||||||
|
ItemStack displayStack = stack.copy();
|
||||||
|
VaultGearData gearData = VaultGearData.read(displayStack);
|
||||||
|
gearData.setState(VaultGearState.IDENTIFIED);
|
||||||
|
gearData.createOrReplaceAttributeValue(ModGearAttributes.GEAR_MODEL, transmog);
|
||||||
|
gearData.write(displayStack);
|
||||||
|
return displayStack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,17 +16,26 @@ import iskallia.vault.gear.attribute.ability.special.FrostNovaVulnerabilityModif
|
||||||
import iskallia.vault.gear.attribute.ability.special.base.SpecialAbilityConfig;
|
import iskallia.vault.gear.attribute.ability.special.base.SpecialAbilityConfig;
|
||||||
import iskallia.vault.gear.attribute.ability.special.base.SpecialAbilityGearAttribute;
|
import iskallia.vault.gear.attribute.ability.special.base.SpecialAbilityGearAttribute;
|
||||||
import iskallia.vault.gear.attribute.ability.special.base.SpecialAbilityModification;
|
import iskallia.vault.gear.attribute.ability.special.base.SpecialAbilityModification;
|
||||||
|
import iskallia.vault.gear.attribute.ability.special.base.template.FloatRangeModification;
|
||||||
|
import iskallia.vault.gear.attribute.ability.special.base.template.IntRangeModification;
|
||||||
|
import iskallia.vault.gear.attribute.ability.special.base.template.config.FloatRangeConfig;
|
||||||
import iskallia.vault.gear.attribute.ability.special.base.template.config.IntRangeConfig;
|
import iskallia.vault.gear.attribute.ability.special.base.template.config.IntRangeConfig;
|
||||||
|
import iskallia.vault.gear.attribute.ability.special.base.template.value.FloatValue;
|
||||||
import iskallia.vault.gear.attribute.ability.special.base.template.value.IntValue;
|
import iskallia.vault.gear.attribute.ability.special.base.template.value.IntValue;
|
||||||
import iskallia.vault.gear.attribute.config.BooleanFlagGenerator;
|
import iskallia.vault.gear.attribute.config.BooleanFlagGenerator;
|
||||||
import iskallia.vault.gear.attribute.config.ConfigurableAttributeGenerator;
|
import iskallia.vault.gear.attribute.config.ConfigurableAttributeGenerator;
|
||||||
import iskallia.vault.gear.attribute.custom.effect.EffectGearAttribute;
|
import iskallia.vault.gear.attribute.custom.effect.EffectGearAttribute;
|
||||||
|
import iskallia.vault.gear.attribute.custom.loot.LootTriggerAttribute;
|
||||||
|
import iskallia.vault.gear.attribute.custom.loot.ManaPerLootAttribute;
|
||||||
import iskallia.vault.gear.reader.VaultGearModifierReader;
|
import iskallia.vault.gear.reader.VaultGearModifierReader;
|
||||||
import iskallia.vault.init.ModConfigs;
|
import iskallia.vault.init.ModConfigs;
|
||||||
|
import iskallia.vault.skill.ability.component.AbilityLabelFormatters;
|
||||||
|
import iskallia.vault.skill.base.Skill;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.network.chat.MutableComponent;
|
import net.minecraft.network.chat.MutableComponent;
|
||||||
import net.minecraft.network.chat.Style;
|
import net.minecraft.network.chat.Style;
|
||||||
|
import net.minecraft.network.chat.TextColor;
|
||||||
import net.minecraft.network.chat.TextComponent;
|
import net.minecraft.network.chat.TextComponent;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraftforge.fml.LogicalSide;
|
import net.minecraftforge.fml.LogicalSide;
|
||||||
|
|
@ -37,7 +46,9 @@ import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
@ -50,6 +61,7 @@ public class Modifiers {
|
||||||
ChatFormatting.LIGHT_PURPLE, ChatFormatting.AQUA, ChatFormatting.WHITE};
|
ChatFormatting.LIGHT_PURPLE, ChatFormatting.AQUA, ChatFormatting.WHITE};
|
||||||
|
|
||||||
private static final Pattern CLOUD_PATTERN = Pattern.compile("^(?<effect>.*?) ?(?<lvl>I|II|III|IV|V|VI|VII|VIII|IX|X)? (?<suffix>Cloud.*)$");
|
private static final Pattern CLOUD_PATTERN = Pattern.compile("^(?<effect>.*?) ?(?<lvl>I|II|III|IV|V|VI|VII|VIII|IX|X)? (?<suffix>Cloud.*)$");
|
||||||
|
private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("0.##");
|
||||||
|
|
||||||
public static List<Component> getModifierList(int lvl, VaultGearTierConfig cfg, ModifierCategory modifierCategory) {
|
public static List<Component> getModifierList(int lvl, VaultGearTierConfig cfg, ModifierCategory modifierCategory) {
|
||||||
Map<VaultGearTierConfig.ModifierAffixTagGroup, VaultGearTierConfig.AttributeGroup> modifierGroup = ((VaultGearTierConfigAccessor) cfg).getModifierGroup();
|
Map<VaultGearTierConfig.ModifierAffixTagGroup, VaultGearTierConfig.AttributeGroup> modifierGroup = ((VaultGearTierConfigAccessor) cfg).getModifierGroup();
|
||||||
|
|
@ -155,8 +167,8 @@ public class Modifiers {
|
||||||
// more than 7 groups is a bit crazy, but just in case
|
// more than 7 groups is a bit crazy, but just in case
|
||||||
boolean useNums = groupedModifiers.size() > COLORS.length;
|
boolean useNums = groupedModifiers.size() > COLORS.length;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (var modGr: groupedModifiers.values()) {
|
for (List<Component> modGr: groupedModifiers.values()) {
|
||||||
for (var mod: modGr) {
|
for (Component mod: modGr) {
|
||||||
MutableComponent full = new TextComponent(useNums ? i + " " : "► ").withStyle(COLORS[i % COLORS.length]);
|
MutableComponent full = new TextComponent(useNums ? i + " " : "► ").withStyle(COLORS[i % COLORS.length]);
|
||||||
full.append(mod);
|
full.append(mod);
|
||||||
componentList.add(full);
|
componentList.add(full);
|
||||||
|
|
@ -222,8 +234,8 @@ public class Modifiers {
|
||||||
return getNormalModifierTiers(lvl, modifierTierGroup);
|
return getNormalModifierTiers(lvl, modifierTierGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
var res = new ArrayList<VaultGearTierConfig.ModifierTier<?>>();
|
ArrayList<VaultGearTierConfig.ModifierTier<?>> res = new ArrayList<>();
|
||||||
var highest = modifierTierGroup.getHighestForLevel(lvl);
|
VaultGearTierConfig.ModifierTier<?> highest = modifierTierGroup.getHighestForLevel(lvl);
|
||||||
if (highest == null) {
|
if (highest == null) {
|
||||||
return res; // empty
|
return res; // empty
|
||||||
}
|
}
|
||||||
|
|
@ -231,7 +243,7 @@ public class Modifiers {
|
||||||
return res; // empty
|
return res; // empty
|
||||||
}
|
}
|
||||||
int index = Math.min(highest.getModifierTier() + modifierCategory.getTierIncrease(), modifierTierGroup.size() - 1);
|
int index = Math.min(highest.getModifierTier() + modifierCategory.getTierIncrease(), modifierTierGroup.size() - 1);
|
||||||
var legendTier = modifierTierGroup.get(index);
|
VaultGearTierConfig.ModifierTier<?> legendTier = modifierTierGroup.get(index);
|
||||||
if (legendTier == null || legendTier.getWeight() == 0){
|
if (legendTier == null || legendTier.getWeight() == 0){
|
||||||
return res; // empty
|
return res; // empty
|
||||||
}
|
}
|
||||||
|
|
@ -274,7 +286,7 @@ public class Modifiers {
|
||||||
}
|
}
|
||||||
String atrName = atrRegName.toString();
|
String atrName = atrRegName.toString();
|
||||||
|
|
||||||
var minConfigDisplay = atrGenerator.getConfigDisplay(atr.getReader(), minConfig);
|
MutableComponent minConfigDisplay = atrGenerator.getConfigDisplay(atr.getReader(), minConfig);
|
||||||
|
|
||||||
if (minConfig instanceof SpecialAbilityGearAttribute.SpecialAbilityTierConfig<?,?,?> minConfigSpecial) {
|
if (minConfig instanceof SpecialAbilityGearAttribute.SpecialAbilityTierConfig<?,?,?> minConfigSpecial) {
|
||||||
return getSpecialAbilityAttributeComponent(modifierTiers, minConfigSpecial);
|
return getSpecialAbilityAttributeComponent(modifierTiers, minConfigSpecial);
|
||||||
|
|
@ -300,6 +312,9 @@ public class Modifiers {
|
||||||
if (minConfig instanceof AbilityAreaOfEffectPercentAttribute.Config minConfigA) {
|
if (minConfig instanceof AbilityAreaOfEffectPercentAttribute.Config minConfigA) {
|
||||||
return getAbilityAoePercentageComponent(atr, minConfigA, minConfigA);
|
return getAbilityAoePercentageComponent(atr, minConfigA, minConfigA);
|
||||||
}
|
}
|
||||||
|
if (minConfig instanceof ManaPerLootAttribute.Config maxManaPerLootConfig) {
|
||||||
|
return getManaPerLootComponent(maxManaPerLootConfig, maxManaPerLootConfig);
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
return new TextComponent("ERR - NULL DISPLAY " + atrName);
|
return new TextComponent("ERR - NULL DISPLAY " + atrName);
|
||||||
|
|
@ -309,30 +324,55 @@ public class Modifiers {
|
||||||
private static @NotNull MutableComponent getSpecialAbilityAttributeComponent(
|
private static @NotNull MutableComponent getSpecialAbilityAttributeComponent(
|
||||||
ArrayList<VaultGearTierConfig.ModifierTier<?>> modifierTiers,
|
ArrayList<VaultGearTierConfig.ModifierTier<?>> modifierTiers,
|
||||||
SpecialAbilityGearAttribute.SpecialAbilityTierConfig<?, ?, ?> minConfigSpecial) {
|
SpecialAbilityGearAttribute.SpecialAbilityTierConfig<?, ?, ?> minConfigSpecial) {
|
||||||
var modification = minConfigSpecial.getModification();
|
SpecialAbilityModification<? extends SpecialAbilityConfig<?>, ?> modification = minConfigSpecial.getModification();
|
||||||
if (modification instanceof FrostNovaVulnerabilityModification frostNovaVulnerabilityModification) {
|
if (modification instanceof IntRangeModification intRangeModification){
|
||||||
var minToMaxComponent = new TextComponent("<TODO>");
|
var minValue = intRangeModification.getMinimumValue(getIntTiers(modifierTiers));
|
||||||
return (new TextComponent("Frost Nova also applies Level ").append(minToMaxComponent)
|
var maxValue = intRangeModification.getMaximumValue(getIntTiers(modifierTiers));
|
||||||
.append(" Vulnerability"));
|
String minValueDisplay = minValue.map(x -> String.valueOf(x.getValue().getValue())).orElse("NULL");
|
||||||
|
String maxValueDisplay = maxValue.map(x -> String.valueOf(x.getValue().getValue())).orElse("NULL");
|
||||||
|
MutableComponent minToMaxComponent = new TextComponent(minValueDisplay + "-" + maxValueDisplay).withStyle(ChatFormatting.UNDERLINE).withStyle(Style.EMPTY.withColor(TextColor.fromRgb(6082075)));
|
||||||
|
if (intRangeModification instanceof FrostNovaVulnerabilityModification) {
|
||||||
|
return (new TextComponent("Frost Nova also applies Level ").append(minToMaxComponent).append(" Vulnerability")).withStyle(Style.EMPTY.withColor(TextColor.fromRgb(14076214)));
|
||||||
|
}
|
||||||
|
if (intRangeModification instanceof EntropyPoisonModification) {
|
||||||
|
return new TextComponent("Entropic Bind also applies Poison ").withStyle(Style.EMPTY.withColor(TextColor.fromRgb(14076214))).append(minToMaxComponent);
|
||||||
|
}
|
||||||
|
if (intRangeModification.getKey().toString().equals("the_vault:glacial_blast_hypothermia")){
|
||||||
|
return (new TextComponent("Glacial Blast is ").append(minToMaxComponent).append("X more likely to shatter")).withStyle(Style.EMPTY.withColor(TextColor.fromRgb(14076214)));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (modification instanceof EntropyPoisonModification entropyPoisonModification) {
|
if (modification instanceof FloatRangeModification floatRangeModification) {
|
||||||
var tiers = (List<SpecialAbilityGearAttribute.SpecialAbilityTierConfig<SpecialAbilityModification<IntRangeConfig, IntValue>, IntRangeConfig, IntValue>>) modifierTiers.stream().map(x -> x.getModifierConfiguration()).toList();
|
var minValue = floatRangeModification.getMinimumValue(getFloatTiers(modifierTiers));
|
||||||
var minValue = entropyPoisonModification.getMinimumValue(tiers);
|
var maxValue = floatRangeModification.getMaximumValue(getFloatTiers(modifierTiers));
|
||||||
var minValueDisplay = new TextComponent(minValue.map(x -> String.valueOf(x.getValue().getValue())).orElse("NULL"));
|
float minValueDisplay = minValue.map(x -> x.getValue().getValue()).orElse(0f);
|
||||||
var maxValue = entropyPoisonModification.getMaximumValue(tiers);
|
float maxValueDisplay = maxValue.map(x -> x.getValue().getValue()).orElse(0f);
|
||||||
var maxValueDisplay = new TextComponent(maxValue.map(x -> String.valueOf(x.getValue().getValue())).orElse("NULL"));
|
|
||||||
MutableComponent cmp = new TextComponent("Entropic Bind also applies Poison ");
|
MutableComponent minToMaxComponent = new TextComponent(DECIMAL_FORMAT.format(minValueDisplay*100) + "%-" + DECIMAL_FORMAT.format(maxValueDisplay*100)+"%").withStyle(ChatFormatting.UNDERLINE).withStyle(Style.EMPTY.withColor(TextColor.fromRgb(6082075)));
|
||||||
var range = new TextComponent(minValueDisplay.getString() + "-" + maxValueDisplay.getString());
|
if (floatRangeModification.getKey().toString().equals("the_vault:fireball_special_modification")){
|
||||||
cmp.append(range);
|
return (new TextComponent("Fireball has ").append(minToMaxComponent).append(" chance to fire twice")).withStyle(Style.EMPTY.withColor(TextColor.fromRgb(14076214)));
|
||||||
return cmp;
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
var abilityKey = minConfigSpecial.getAbilityKey();
|
|
||||||
|
|
||||||
|
String abilityKey = minConfigSpecial.getAbilityKey();
|
||||||
return ModConfigs.ABILITIES.getAbilityById(abilityKey).filter(skill -> skill.getName() != null).map(skill -> {
|
return ModConfigs.ABILITIES.getAbilityById(abilityKey).filter(skill -> skill.getName() != null).map(skill -> {
|
||||||
String name = skill.getName();
|
String name = skill.getName();
|
||||||
return new TextComponent("Special " + name + " modification");
|
return new TextComponent("Special " + name + " modification");
|
||||||
}).orElseGet(() -> (TextComponent) new TextComponent(abilityKey).withStyle(Style.EMPTY.withColor(14076214)));
|
}).orElseGet(() -> (TextComponent) new TextComponent(abilityKey).withStyle(Style.EMPTY.withColor(14076214)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
private static List<SpecialAbilityGearAttribute.SpecialAbilityTierConfig<SpecialAbilityModification<IntRangeConfig, IntValue>, IntRangeConfig, IntValue>> getIntTiers(List<VaultGearTierConfig.ModifierTier<?>> modifierTiers) {
|
||||||
|
return modifierTiers.stream().map(x -> (SpecialAbilityGearAttribute.SpecialAbilityTierConfig<SpecialAbilityModification<IntRangeConfig, IntValue>, IntRangeConfig, IntValue>) x.getModifierConfiguration()).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
private static List<SpecialAbilityGearAttribute.SpecialAbilityTierConfig<SpecialAbilityModification<FloatRangeConfig, FloatValue>, FloatRangeConfig, FloatValue>> getFloatTiers(List<VaultGearTierConfig.ModifierTier<?>> modifierTiers) {
|
||||||
|
return modifierTiers.stream().map(x -> (SpecialAbilityGearAttribute.SpecialAbilityTierConfig<SpecialAbilityModification<FloatRangeConfig, FloatValue>, FloatRangeConfig, FloatValue>) x.getModifierConfiguration()).toList();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method handles combining multiple configs into a single component
|
* This method handles combining multiple configs into a single component
|
||||||
* VH doesn't have method for this, so we need to do it manually
|
* VH doesn't have method for this, so we need to do it manually
|
||||||
|
|
@ -342,8 +382,8 @@ public class Modifiers {
|
||||||
private static <T, C> MutableComponent rangeComponent(String atrName, VaultGearAttribute<T> atr,
|
private static <T, C> MutableComponent rangeComponent(String atrName, VaultGearAttribute<T> atr,
|
||||||
ConfigurableAttributeGenerator<T, C> atrGenerator, C minConfig, C maxConfig) {
|
ConfigurableAttributeGenerator<T, C> atrGenerator, C minConfig, C maxConfig) {
|
||||||
MutableComponent res = atrGenerator.getConfigRangeDisplay(atr.getReader(), minConfig, maxConfig);
|
MutableComponent res = atrGenerator.getConfigRangeDisplay(atr.getReader(), minConfig, maxConfig);
|
||||||
var minConfigDisplay = atrGenerator.getConfigDisplay(atr.getReader(), minConfig);
|
MutableComponent minConfigDisplay = atrGenerator.getConfigDisplay(atr.getReader(), minConfig);
|
||||||
var maxConfigDisplay = atrGenerator.getConfigDisplay(atr.getReader(), maxConfig);
|
MutableComponent maxConfigDisplay = atrGenerator.getConfigDisplay(atr.getReader(), maxConfig);
|
||||||
|
|
||||||
|
|
||||||
if (res != null && minConfig instanceof AbilityLevelAttribute.Config minConfigAbility) {
|
if (res != null && minConfig instanceof AbilityLevelAttribute.Config minConfigAbility) {
|
||||||
|
|
@ -354,8 +394,8 @@ public class Modifiers {
|
||||||
// res -> "30% - 50%"
|
// res -> "30% - 50%"
|
||||||
// single -> "30% Poison Avoidance"
|
// single -> "30% Poison Avoidance"
|
||||||
// minRange -> "30%"
|
// minRange -> "30%"
|
||||||
var single = minConfigDisplay.withStyle(atr.getReader().getColoredTextStyle());
|
MutableComponent single = minConfigDisplay.withStyle(atr.getReader().getColoredTextStyle());
|
||||||
var minRange = atrGenerator.getConfigRangeDisplay(atr.getReader(), minConfig, minConfig);
|
MutableComponent minRange = atrGenerator.getConfigRangeDisplay(atr.getReader(), minConfig, minConfig);
|
||||||
if (minRange != null && res != null) {
|
if (minRange != null && res != null) {
|
||||||
res.append(single.getString().replace(minRange.getString(), ""));
|
res.append(single.getString().replace(minRange.getString(), ""));
|
||||||
// res -> "30% - 50% Poison Avoidance"
|
// res -> "30% - 50% Poison Avoidance"
|
||||||
|
|
@ -372,11 +412,15 @@ public class Modifiers {
|
||||||
if (minConfig instanceof EffectGearAttribute.Config minEffectConfig
|
if (minConfig instanceof EffectGearAttribute.Config minEffectConfig
|
||||||
&& maxConfig instanceof EffectGearAttribute.Config
|
&& maxConfig instanceof EffectGearAttribute.Config
|
||||||
&& maxConfigDisplay != null) {
|
&& maxConfigDisplay != null) {
|
||||||
var effectStr = ((EffectConfigAccessor)minEffectConfig).getAmplifier() + "-" +
|
String effectStr = ((EffectConfigAccessor)minEffectConfig).getAmplifier() + "-" +
|
||||||
maxConfigDisplay.getString();
|
maxConfigDisplay.getString();
|
||||||
return new TextComponent(effectStr).withStyle(atr.getReader().getColoredTextStyle());
|
return new TextComponent(effectStr).withStyle(atr.getReader().getColoredTextStyle());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (minConfig instanceof ManaPerLootAttribute.Config minManaPerLootConfig && maxConfig instanceof ManaPerLootAttribute.Config maxManaPerLootConfig) {
|
||||||
|
return getManaPerLootComponent(minManaPerLootConfig, maxManaPerLootConfig);
|
||||||
|
}
|
||||||
|
|
||||||
if (atrName.equals("the_vault:effect_cloud")){
|
if (atrName.equals("the_vault:effect_cloud")){
|
||||||
return new TextComponent("Special ability modification");
|
return new TextComponent("Special ability modification");
|
||||||
}
|
}
|
||||||
|
|
@ -387,6 +431,18 @@ public class Modifiers {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static @NotNull MutableComponent getManaPerLootComponent(ManaPerLootAttribute.Config minManaPerLootConfig,
|
||||||
|
ManaPerLootAttribute.Config maxManaPerLootConfig) {
|
||||||
|
int minGenerated = minManaPerLootConfig.getManaGenerated().getMin();
|
||||||
|
int maxGenerated = maxManaPerLootConfig.getManaGenerated().getMax();
|
||||||
|
float minGenChance = minManaPerLootConfig.getManaGenerationChance().getMin();
|
||||||
|
float maxGenChance = maxManaPerLootConfig.getManaGenerationChance().getMax();
|
||||||
|
var minToMax = new TextComponent(DECIMAL_FORMAT.format(minGenChance*100) + "%-" + DECIMAL_FORMAT.format(maxGenChance*100) + "%").withStyle(Style.EMPTY.withColor(20479));
|
||||||
|
var generated = new TextComponent(minGenerated + "-" + maxGenerated).withStyle(Style.EMPTY.withColor(20479));
|
||||||
|
var loot = new TextComponent(maxManaPerLootConfig.getDisplayName()).withStyle(Style.EMPTY.withColor(20479));
|
||||||
|
return new TextComponent("").withStyle(Style.EMPTY.withColor(65535)).append(minToMax).append(new TextComponent(" chance to generate ")).append(generated).append(" Mana per ").append(loot).append(" looted");
|
||||||
|
}
|
||||||
|
|
||||||
private static <T> @NotNull MutableComponent getAbilityAoePercentageComponent(VaultGearAttribute<T> atr,
|
private static <T> @NotNull MutableComponent getAbilityAoePercentageComponent(VaultGearAttribute<T> atr,
|
||||||
AbilityAreaOfEffectPercentAttribute.Config minConfigA,
|
AbilityAreaOfEffectPercentAttribute.Config minConfigA,
|
||||||
AbilityAreaOfEffectPercentAttribute.Config maxConfigA) {
|
AbilityAreaOfEffectPercentAttribute.Config maxConfigA) {
|
||||||
|
|
@ -423,22 +479,22 @@ public class Modifiers {
|
||||||
// <Effect> [<LVL>] Cloud [when Hit]
|
// <Effect> [<LVL>] Cloud [when Hit]
|
||||||
// Poison Cloud
|
// Poison Cloud
|
||||||
// Poison III Cloud
|
// Poison III Cloud
|
||||||
var minString = minConfigDisplay.getString();
|
String minString = minConfigDisplay.getString();
|
||||||
var maxString = maxConfigDisplay.getString();
|
String maxString = maxConfigDisplay.getString();
|
||||||
|
|
||||||
var minLvl = getCloudLvl(minString);
|
String minLvl = getCloudLvl(minString);
|
||||||
var maxLvl = getCloudLvl(maxString);
|
String maxLvl = getCloudLvl(maxString);
|
||||||
|
|
||||||
if (minLvl.equals(maxLvl)) {
|
if (minLvl.equals(maxLvl)) {
|
||||||
return minConfigDisplay.withStyle(atr.getReader().getColoredTextStyle());
|
return minConfigDisplay.withStyle(atr.getReader().getColoredTextStyle());
|
||||||
}
|
}
|
||||||
|
|
||||||
var cloudRange = makeCloudLvlRange(minString, minLvl, maxLvl);
|
String cloudRange = makeCloudLvlRange(minString, minLvl, maxLvl);
|
||||||
return new TextComponent(cloudRange).withStyle(atr.getReader().getColoredTextStyle());
|
return new TextComponent(cloudRange).withStyle(atr.getReader().getColoredTextStyle());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getCloudLvl(String displayString){
|
private static String getCloudLvl(String displayString){
|
||||||
var matcher = CLOUD_PATTERN.matcher(displayString);
|
Matcher matcher = CLOUD_PATTERN.matcher(displayString);
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
if (matcher.group("lvl") != null) {
|
if (matcher.group("lvl") != null) {
|
||||||
return matcher.group("lvl");
|
return matcher.group("lvl");
|
||||||
|
|
@ -449,7 +505,7 @@ public class Modifiers {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String makeCloudLvlRange(String displayString, String minLvl, String maxLvl){
|
private static String makeCloudLvlRange(String displayString, String minLvl, String maxLvl){
|
||||||
var matcher = CLOUD_PATTERN.matcher(displayString);
|
Matcher matcher = CLOUD_PATTERN.matcher(displayString);
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
return matcher.group("effect") + " " + minLvl + "-" + maxLvl + " " + matcher.group("suffix");
|
return matcher.group("effect") + " " + minLvl + "-" + maxLvl + " " + matcher.group("suffix");
|
||||||
}
|
}
|
||||||
|
|
@ -459,15 +515,15 @@ public class Modifiers {
|
||||||
private static MutableComponent abilityLvlComponent(MutableComponent prev, VaultGearAttribute<?> atr,
|
private static MutableComponent abilityLvlComponent(MutableComponent prev, VaultGearAttribute<?> atr,
|
||||||
AbilityLevelAttribute.Config minConfig) {
|
AbilityLevelAttribute.Config minConfig) {
|
||||||
|
|
||||||
var abComp = new TextComponent("+").withStyle(atr.getReader().getColoredTextStyle());
|
MutableComponent abComp = new TextComponent("+").withStyle(atr.getReader().getColoredTextStyle());
|
||||||
var optSkill = ModConfigs.ABILITIES.getAbilityById(minConfig.getAbilityKey());
|
Optional<Skill> optSkill = ModConfigs.ABILITIES.getAbilityById(minConfig.getAbilityKey());
|
||||||
if (optSkill.isEmpty()) {
|
if (optSkill.isEmpty()) {
|
||||||
return prev.append(" added ability levels").withStyle(atr.getReader().getColoredTextStyle());
|
return prev.append(" added ability levels").withStyle(atr.getReader().getColoredTextStyle());
|
||||||
}
|
}
|
||||||
var abName = optSkill.get().getName();
|
String abName = optSkill.get().getName();
|
||||||
var parts = prev.getString().split("-");
|
String[] parts = prev.getString().split("-");
|
||||||
|
|
||||||
var res = new TextComponent("").withStyle(prev.getStyle());
|
MutableComponent res = new TextComponent("").withStyle(prev.getStyle());
|
||||||
if (parts.length == 2) {
|
if (parts.length == 2) {
|
||||||
if (parts[0].equals(parts[1])) {
|
if (parts[0].equals(parts[1])) {
|
||||||
res.append(parts[0]);
|
res.append(parts[0]);
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import net.minecraft.network.chat.MutableComponent;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||||
|
|
||||||
@Mixin(AbilityFloatValueAttribute.Reader.class)
|
@Mixin(value = AbilityFloatValueAttribute.Reader.class, remap = false)
|
||||||
public interface AbilityFloatValueAttributeReaderInvoker {
|
public interface AbilityFloatValueAttributeReaderInvoker {
|
||||||
@Invoker
|
@Invoker
|
||||||
MutableComponent invokeFormatAbilityName(String abilityKey);
|
MutableComponent invokeFormatAbilityName(String abilityKey);
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ public class StatisticsElementContainerScreenMixin extends AbstractSkillTabEleme
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
// add chestplate icon to it
|
// add chestplate icon to it
|
||||||
var chestplateStack = new ItemStack(ModItems.CHESTPLATE);
|
ItemStack chestplateStack = new ItemStack(ModItems.CHESTPLATE);
|
||||||
this.addElement(
|
this.addElement(
|
||||||
new FakeItemSlotElement<>(Spatials.positionXY(-3, 3), () -> chestplateStack, () -> false, ScreenTextures.EMPTY, ScreenTextures.EMPTY
|
new FakeItemSlotElement<>(Spatials.positionXY(-3, 3), () -> chestplateStack, () -> false, ScreenTextures.EMPTY, ScreenTextures.EMPTY
|
||||||
).layout(
|
).layout(
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,12 @@ import iskallia.vault.client.gui.framework.spatial.spi.ISpatial;
|
||||||
import iskallia.vault.client.gui.framework.text.LabelTextStyle;
|
import iskallia.vault.client.gui.framework.text.LabelTextStyle;
|
||||||
import iskallia.vault.config.gear.VaultGearWorkbenchConfig;
|
import iskallia.vault.config.gear.VaultGearWorkbenchConfig;
|
||||||
import iskallia.vault.gear.VaultGearState;
|
import iskallia.vault.gear.VaultGearState;
|
||||||
|
import iskallia.vault.gear.attribute.VaultGearModifier;
|
||||||
import iskallia.vault.gear.data.VaultGearData;
|
import iskallia.vault.gear.data.VaultGearData;
|
||||||
import iskallia.vault.init.ModGearAttributes;
|
import iskallia.vault.init.ModGearAttributes;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.player.LocalPlayer;
|
||||||
import net.minecraft.network.chat.MutableComponent;
|
import net.minecraft.network.chat.MutableComponent;
|
||||||
import net.minecraft.network.chat.Style;
|
import net.minecraft.network.chat.Style;
|
||||||
import net.minecraft.network.chat.TextColor;
|
import net.minecraft.network.chat.TextColor;
|
||||||
|
|
@ -32,6 +34,8 @@ import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
|
@ -49,12 +53,12 @@ public class CraftedModifiersListContainer extends VerticalScrollClipContainer<C
|
||||||
int labelX = 9;
|
int labelX = 9;
|
||||||
int labelY = 0;
|
int labelY = 0;
|
||||||
|
|
||||||
var player = Minecraft.getInstance().player;
|
LocalPlayer player = Minecraft.getInstance().player;
|
||||||
if (player == null) {
|
if (player == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var stackCopy = gearPiece.copy();
|
ItemStack stackCopy = gearPiece.copy();
|
||||||
VaultGearData gearData = VaultGearData.read(stackCopy);
|
VaultGearData gearData = VaultGearData.read(stackCopy);
|
||||||
gearData.setItemLevel(lvl);
|
gearData.setItemLevel(lvl);
|
||||||
gearData.setState(VaultGearState.IDENTIFIED);
|
gearData.setState(VaultGearState.IDENTIFIED);
|
||||||
|
|
@ -63,8 +67,7 @@ public class CraftedModifiersListContainer extends VerticalScrollClipContainer<C
|
||||||
gearData.write(stackCopy);
|
gearData.write(stackCopy);
|
||||||
|
|
||||||
|
|
||||||
|
List<VaultGearWorkbenchConfig.CraftableModifierConfig> crMods = VaultGearWorkbenchConfig.getConfig(gearPiece.getItem())
|
||||||
var crMods = VaultGearWorkbenchConfig.getConfig(gearPiece.getItem())
|
|
||||||
.map(VaultGearWorkbenchConfig::getAllCraftableModifiers).orElse(null);
|
.map(VaultGearWorkbenchConfig::getAllCraftableModifiers).orElse(null);
|
||||||
if (crMods == null) {
|
if (crMods == null) {
|
||||||
cookieDialog();
|
cookieDialog();
|
||||||
|
|
@ -76,11 +79,11 @@ public class CraftedModifiersListContainer extends VerticalScrollClipContainer<C
|
||||||
|
|
||||||
// is unlocked?
|
// is unlocked?
|
||||||
MutableComponent fullCmp = new TextComponent("");
|
MutableComponent fullCmp = new TextComponent("");
|
||||||
var mm = mod.createModifier().orElse(null);
|
VaultGearModifier<?> mm = mod.createModifier().orElse(null);
|
||||||
if (mm == null) {
|
if (mm == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var oCfgDisplay = mm.getConfigDisplay(gearPiece);
|
Optional<MutableComponent> oCfgDisplay = mm.getConfigDisplay(gearPiece);
|
||||||
oCfgDisplay.ifPresent(fullCmp::append);
|
oCfgDisplay.ifPresent(fullCmp::append);
|
||||||
MutableComponent restriction = new TextComponent("");
|
MutableComponent restriction = new TextComponent("");
|
||||||
int minLevel = mod.getMinLevel();
|
int minLevel = mod.getMinLevel();
|
||||||
|
|
@ -123,7 +126,6 @@ public class CraftedModifiersListContainer extends VerticalScrollClipContainer<C
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getScroll() {
|
public float getScroll() {
|
||||||
|
|
@ -199,15 +201,15 @@ public class CraftedModifiersListContainer extends VerticalScrollClipContainer<C
|
||||||
if (this.valueSupplier.get() == 0) {
|
if (this.valueSupplier.get() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var ll = RenderSystem.getModelViewStack();
|
PoseStack viewStack = RenderSystem.getModelViewStack();
|
||||||
ll.pushPose();
|
viewStack.pushPose();
|
||||||
float scale = 2f;
|
float scale = 2f;
|
||||||
ll.scale(scale, scale, scale);
|
viewStack.scale(scale, scale, scale);
|
||||||
ll.translate(-getWorldSpatial().x() * (1 - 1/scale), -getWorldSpatial().y() * (1 - 1/scale), 0);
|
viewStack.translate(-getWorldSpatial().x() * (1 - 1/scale), -getWorldSpatial().y() * (1 - 1/scale), 0);
|
||||||
RenderSystem.applyModelViewMatrix();
|
RenderSystem.applyModelViewMatrix();
|
||||||
|
|
||||||
super.render(renderer, poseStack, mouseX, mouseY, partialTick);
|
super.render(renderer, poseStack, mouseX, mouseY, partialTick);
|
||||||
ll.popPose();
|
viewStack.popPose();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -228,7 +230,7 @@ public class CraftedModifiersListContainer extends VerticalScrollClipContainer<C
|
||||||
} else if (msDiff < 300) {
|
} else if (msDiff < 300) {
|
||||||
scale *= 1 + (300 - msDiff) * 0.001f;
|
scale *= 1 + (300 - msDiff) * 0.001f;
|
||||||
}
|
}
|
||||||
var viewStack = RenderSystem.getModelViewStack();
|
PoseStack viewStack = RenderSystem.getModelViewStack();
|
||||||
viewStack.pushPose();
|
viewStack.pushPose();
|
||||||
viewStack.translate(- (scale - originalScale) * originalScale, - (scale - originalScale) * originalScale, 0);
|
viewStack.translate(- (scale - originalScale) * originalScale, - (scale - originalScale) * originalScale, 0);
|
||||||
viewStack.scale(scale, scale, 1);
|
viewStack.scale(scale, scale, 1);
|
||||||
|
|
|
||||||
|
|
@ -42,12 +42,16 @@ import java.util.List;
|
||||||
public class GearModifierScreen extends AbstractElementScreen {
|
public class GearModifierScreen extends AbstractElementScreen {
|
||||||
//TODO: remove magic numbers
|
//TODO: remove magic numbers
|
||||||
private InnerGearScreen innerScreen;
|
private InnerGearScreen innerScreen;
|
||||||
|
private NineSliceButtonElement<?> minusButton;
|
||||||
|
private NineSliceButtonElement<?> plusButton;
|
||||||
|
private LabelElement<?> minusLabel;
|
||||||
|
private LabelElement<?> plusLabel;
|
||||||
private final ScrollableLvlInputElement lvlInput;
|
private final ScrollableLvlInputElement lvlInput;
|
||||||
private ModifierCategory modifierCategory = ModifierCategory.NORMAL;
|
private ModifierCategory modifierCategory = ModifierCategory.NORMAL;
|
||||||
private LabelElement<?> modifierCategoryLabel;
|
private LabelElement<?> modifierCategoryLabel;
|
||||||
private NineSliceButtonElement<?> modifierCategoryButton;
|
private NineSliceButtonElement<?> modifierCategoryButton;
|
||||||
private HelpContainer helpContainer;
|
private final HelpContainer helpContainer;
|
||||||
private LabelElement<?> windowNameLabel;
|
private final LabelElement<?> windowNameLabel;
|
||||||
|
|
||||||
private int currIndex = 0;
|
private int currIndex = 0;
|
||||||
private final List<TabElement<?>> tabs = new ArrayList<>();
|
private final List<TabElement<?>> tabs = new ArrayList<>();
|
||||||
|
|
@ -111,7 +115,7 @@ public class GearModifierScreen extends AbstractElementScreen {
|
||||||
* @param keepScroll whether to keep the current scroll position
|
* @param keepScroll whether to keep the current scroll position
|
||||||
*/
|
*/
|
||||||
private void updateModifierList(boolean keepScroll) {
|
private void updateModifierList(boolean keepScroll) {
|
||||||
var oldScroll = this.innerScreen.getScroll();
|
float oldScroll = this.innerScreen.getScroll();
|
||||||
this.removeElement(this.innerScreen);
|
this.removeElement(this.innerScreen);
|
||||||
ISpatial modListSpatial = Spatials.positionXY(7, 50).size(this.getGuiSpatial().width() - 14, this.getGuiSpatial().height() - 57);
|
ISpatial modListSpatial = Spatials.positionXY(7, 50).size(this.getGuiSpatial().width() - 14, this.getGuiSpatial().height() - 57);
|
||||||
this.innerScreen = this.innerScreen.create(modListSpatial, lvlInput.getValue(), modifierCategory, getCurrGear());
|
this.innerScreen = this.innerScreen.create(modListSpatial, lvlInput.getValue(), modifierCategory, getCurrGear());
|
||||||
|
|
@ -134,9 +138,8 @@ public class GearModifierScreen extends AbstractElementScreen {
|
||||||
updateModifierCategoryButtonLabel();
|
updateModifierCategoryButtonLabel();
|
||||||
ISpatial modListSpatial = Spatials.positionXY(7, 50).size(this.getGuiSpatial().width() - 14, this.getGuiSpatial().height() - 57);
|
ISpatial modListSpatial = Spatials.positionXY(7, 50).size(this.getGuiSpatial().width() - 14, this.getGuiSpatial().height() - 57);
|
||||||
this.innerScreen = new TransmogListContainer(modListSpatial, getCurrGear()).layout(this.translateWorldSpatial());
|
this.innerScreen = new TransmogListContainer(modListSpatial, getCurrGear()).layout(this.translateWorldSpatial());
|
||||||
this.modifierCategoryButton.setDisabled(true);
|
this.disableCategoryButtons();
|
||||||
this.modifierCategoryButton.setVisible(false);
|
this.disableLvlButtons();
|
||||||
this.modifierCategoryLabel.setVisible(false);
|
|
||||||
this.windowNameLabel.set(new TranslatableComponent("vhatcaniroll.screen.title.transmogs").withStyle(ChatFormatting.BLACK));
|
this.windowNameLabel.set(new TranslatableComponent("vhatcaniroll.screen.title.transmogs").withStyle(ChatFormatting.BLACK));
|
||||||
this.addElement(this.innerScreen);
|
this.addElement(this.innerScreen);
|
||||||
ScreenLayout.requestLayout();
|
ScreenLayout.requestLayout();
|
||||||
|
|
@ -146,9 +149,8 @@ public class GearModifierScreen extends AbstractElementScreen {
|
||||||
this.removeElement(this.innerScreen);
|
this.removeElement(this.innerScreen);
|
||||||
ISpatial modListSpatial = Spatials.positionXY(7, 50).size(this.getGuiSpatial().width() - 14, this.getGuiSpatial().height() - 57);
|
ISpatial modListSpatial = Spatials.positionXY(7, 50).size(this.getGuiSpatial().width() - 14, this.getGuiSpatial().height() - 57);
|
||||||
this.innerScreen = new ModifierListContainer(modListSpatial, lvlInput.getValue(), modifierCategory, getCurrGear()).layout(this.translateWorldSpatial());
|
this.innerScreen = new ModifierListContainer(modListSpatial, lvlInput.getValue(), modifierCategory, getCurrGear()).layout(this.translateWorldSpatial());
|
||||||
this.modifierCategoryButton.setDisabled(false);
|
this.enableCategoryButtons();
|
||||||
this.modifierCategoryButton.setVisible(true);
|
this.enableLvlButtons();
|
||||||
this.modifierCategoryLabel.setVisible(true);
|
|
||||||
this.windowNameLabel.set(new TranslatableComponent("vhatcaniroll.screen.title.random").withStyle(ChatFormatting.BLACK));
|
this.windowNameLabel.set(new TranslatableComponent("vhatcaniroll.screen.title.random").withStyle(ChatFormatting.BLACK));
|
||||||
this.addElement(this.innerScreen);
|
this.addElement(this.innerScreen);
|
||||||
ScreenLayout.requestLayout();
|
ScreenLayout.requestLayout();
|
||||||
|
|
@ -160,9 +162,8 @@ public class GearModifierScreen extends AbstractElementScreen {
|
||||||
updateModifierCategoryButtonLabel();
|
updateModifierCategoryButtonLabel();
|
||||||
ISpatial modListSpatial = Spatials.positionXY(7, 50).size(this.getGuiSpatial().width() - 14, this.getGuiSpatial().height() - 57);
|
ISpatial modListSpatial = Spatials.positionXY(7, 50).size(this.getGuiSpatial().width() - 14, this.getGuiSpatial().height() - 57);
|
||||||
this.innerScreen = new CraftedModifiersListContainer(modListSpatial, lvlInput.getValue(), modifierCategory, getCurrGear()).layout(this.translateWorldSpatial());
|
this.innerScreen = new CraftedModifiersListContainer(modListSpatial, lvlInput.getValue(), modifierCategory, getCurrGear()).layout(this.translateWorldSpatial());
|
||||||
this.modifierCategoryButton.setDisabled(true);
|
this.enableLvlButtons();
|
||||||
this.modifierCategoryButton.setVisible(false);
|
this.disableCategoryButtons();
|
||||||
this.modifierCategoryLabel.setVisible(false);
|
|
||||||
this.windowNameLabel.set(new TranslatableComponent("vhatcaniroll.screen.title.crafted").withStyle(ChatFormatting.BLACK));
|
this.windowNameLabel.set(new TranslatableComponent("vhatcaniroll.screen.title.crafted").withStyle(ChatFormatting.BLACK));
|
||||||
this.addElement(this.innerScreen);
|
this.addElement(this.innerScreen);
|
||||||
ScreenLayout.requestLayout();
|
ScreenLayout.requestLayout();
|
||||||
|
|
@ -174,14 +175,43 @@ public class GearModifierScreen extends AbstractElementScreen {
|
||||||
updateModifierCategoryButtonLabel();
|
updateModifierCategoryButtonLabel();
|
||||||
ISpatial modListSpatial = Spatials.positionXY(7, 50).size(this.getGuiSpatial().width() - 14, this.getGuiSpatial().height() - 57);
|
ISpatial modListSpatial = Spatials.positionXY(7, 50).size(this.getGuiSpatial().width() - 14, this.getGuiSpatial().height() - 57);
|
||||||
this.innerScreen = new UniqueGearListContainer(modListSpatial, lvlInput.getValue(), modifierCategory, getCurrGear()).layout(this.translateWorldSpatial());
|
this.innerScreen = new UniqueGearListContainer(modListSpatial, lvlInput.getValue(), modifierCategory, getCurrGear()).layout(this.translateWorldSpatial());
|
||||||
this.modifierCategoryButton.setDisabled(true);
|
this.enableLvlButtons();
|
||||||
this.modifierCategoryButton.setVisible(false);
|
this.disableCategoryButtons();
|
||||||
this.modifierCategoryLabel.setVisible(false);
|
|
||||||
this.windowNameLabel.set(new TranslatableComponent("vhatcaniroll.screen.title.unique").withStyle(ChatFormatting.BLACK));
|
this.windowNameLabel.set(new TranslatableComponent("vhatcaniroll.screen.title.unique").withStyle(ChatFormatting.BLACK));
|
||||||
this.addElement(this.innerScreen);
|
this.addElement(this.innerScreen);
|
||||||
ScreenLayout.requestLayout();
|
ScreenLayout.requestLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void enableCategoryButtons(){
|
||||||
|
this.modifierCategoryLabel.setVisible(true);
|
||||||
|
this.modifierCategoryButton.setVisible(true);
|
||||||
|
this.modifierCategoryButton.setDisabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void disableCategoryButtons(){
|
||||||
|
this.modifierCategoryLabel.setVisible(false);
|
||||||
|
this.modifierCategoryButton.setVisible(false);
|
||||||
|
this.modifierCategoryButton.setDisabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void enableLvlButtons(){
|
||||||
|
this.lvlInput.setVisible(true);
|
||||||
|
this.minusButton.setVisible(true);
|
||||||
|
this.minusLabel.setVisible(true);
|
||||||
|
this.plusButton.setVisible(true);
|
||||||
|
this.plusLabel.setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void disableLvlButtons(){
|
||||||
|
this.lvlInput.setVisible(false);
|
||||||
|
this.minusButton.setVisible(false);
|
||||||
|
this.minusLabel.setVisible(false);
|
||||||
|
this.plusButton.setVisible(false);
|
||||||
|
this.plusLabel.setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
// pulled from QuestOverviewElementScreen
|
// pulled from QuestOverviewElementScreen
|
||||||
private ILayoutStrategy translateWorldSpatial() {
|
private ILayoutStrategy translateWorldSpatial() {
|
||||||
return (screen, gui, parent, world) -> world.translateXY(this.getGuiSpatial());
|
return (screen, gui, parent, world) -> world.translateXY(this.getGuiSpatial());
|
||||||
|
|
@ -272,7 +302,6 @@ public class GearModifierScreen extends AbstractElementScreen {
|
||||||
Minecraft.getInstance().font)
|
Minecraft.getInstance().font)
|
||||||
.layout(this.translateWorldSpatial())
|
.layout(this.translateWorldSpatial())
|
||||||
);
|
);
|
||||||
|
|
||||||
inputElement.onTextChanged(s -> updateModifierList(true));
|
inputElement.onTextChanged(s -> updateModifierList(true));
|
||||||
return inputElement;
|
return inputElement;
|
||||||
}
|
}
|
||||||
|
|
@ -292,10 +321,10 @@ public class GearModifierScreen extends AbstractElementScreen {
|
||||||
NineSliceButtonElement<?> btnPlus =
|
NineSliceButtonElement<?> btnPlus =
|
||||||
new NineSliceButtonElement<>(Spatials.positionXY(this.getGuiSpatial().width() - 25 - 13, 35).size(15, 14),
|
new NineSliceButtonElement<>(Spatials.positionXY(this.getGuiSpatial().width() - 25 - 13, 35).size(15, 14),
|
||||||
ScreenTextures.BUTTON_EMPTY_TEXTURES, lvlInput::increment).layout(this.translateWorldSpatial());
|
ScreenTextures.BUTTON_EMPTY_TEXTURES, lvlInput::increment).layout(this.translateWorldSpatial());
|
||||||
this.addElement(btnMinus);
|
this.minusButton = this.addElement(btnMinus);
|
||||||
this.addElement(minusLabel);
|
this.minusLabel = this.addElement(minusLabel);
|
||||||
this.addElement(plusLabel);
|
this.plusLabel = this.addElement(plusLabel);
|
||||||
this.addElement(btnPlus);
|
this.plusButton = this.addElement(btnPlus);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void nextModifierCategory() {
|
private void nextModifierCategory() {
|
||||||
|
|
@ -365,9 +394,9 @@ public class GearModifierScreen extends AbstractElementScreen {
|
||||||
if (!(this.innerScreen instanceof ModifierListContainer))
|
if (!(this.innerScreen instanceof ModifierListContainer))
|
||||||
switchToModifiers();
|
switchToModifiers();
|
||||||
})).layout((screen, gui, parent, world) -> {
|
})).layout((screen, gui, parent, world) -> {
|
||||||
world.width(21).height(21).translateX(gui.left() - 18).translateY(this.getGuiSpatial().bottom() - 120);
|
world.width(21).height(21).translateX(gui.left() - 18 - 22).translateY(this.getGuiSpatial().bottom() - 118);
|
||||||
}).tooltip(
|
}).tooltip(
|
||||||
Tooltips.single(TooltipDirection.LEFT, () -> new TextComponent("Random Modifiers"))
|
Tooltips.single(TooltipDirection.LEFT, () -> new TranslatableComponent("vhatcaniroll.screen.title.random"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -376,9 +405,9 @@ public class GearModifierScreen extends AbstractElementScreen {
|
||||||
if (!(this.innerScreen instanceof TransmogListContainer))
|
if (!(this.innerScreen instanceof TransmogListContainer))
|
||||||
switchToTransmog();
|
switchToTransmog();
|
||||||
})).layout((screen, gui, parent, world) -> {
|
})).layout((screen, gui, parent, world) -> {
|
||||||
world.width(21).height(21).translateX(gui.left() - 18).translateY(this.getGuiSpatial().bottom() - 72);
|
world.width(21).height(21).translateX(gui.left() - 18).translateY(this.getGuiSpatial().bottom() - 96);
|
||||||
}).tooltip(
|
}).tooltip(
|
||||||
Tooltips.single(TooltipDirection.LEFT, () -> new TextComponent("Transmogs"))
|
Tooltips.single(TooltipDirection.LEFT, () -> new TranslatableComponent("vhatcaniroll.screen.title.transmogs"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -387,9 +416,9 @@ public class GearModifierScreen extends AbstractElementScreen {
|
||||||
if (!(this.innerScreen instanceof CraftedModifiersListContainer))
|
if (!(this.innerScreen instanceof CraftedModifiersListContainer))
|
||||||
switchToCrafted();
|
switchToCrafted();
|
||||||
})).layout((screen, gui, parent, world) -> {
|
})).layout((screen, gui, parent, world) -> {
|
||||||
world.width(21).height(21).translateX(gui.left() - 18).translateY(this.getGuiSpatial().bottom() - 96);
|
world.width(21).height(21).translateX(gui.left() - 18 - 22).translateY(this.getGuiSpatial().bottom() - 96);
|
||||||
}).tooltip(
|
}).tooltip(
|
||||||
Tooltips.single(TooltipDirection.LEFT, () -> new TextComponent("Crafted Modifiers"))
|
Tooltips.single(TooltipDirection.LEFT, () -> new TranslatableComponent("vhatcaniroll.screen.title.crafted"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -398,9 +427,9 @@ public class GearModifierScreen extends AbstractElementScreen {
|
||||||
if (!(this.innerScreen instanceof UniqueGearListContainer))
|
if (!(this.innerScreen instanceof UniqueGearListContainer))
|
||||||
switchToUnique();
|
switchToUnique();
|
||||||
})).layout((screen, gui, parent, world) -> {
|
})).layout((screen, gui, parent, world) -> {
|
||||||
world.width(21).height(21).translateX(gui.left() - 36).translateY(this.getGuiSpatial().bottom() - 96);
|
world.width(21).height(21).translateX(gui.left() - 18).translateY(this.getGuiSpatial().bottom() - 118);
|
||||||
}).tooltip(
|
}).tooltip(
|
||||||
Tooltips.single(TooltipDirection.LEFT, () -> new TextComponent("Unique Modifiers"))
|
Tooltips.single(TooltipDirection.LEFT, () -> new TranslatableComponent("vhatcaniroll.screen.title.unique"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,21 +15,21 @@ public class HelpContainer extends ContainerElement<HelpContainer> {
|
||||||
super(spatial);
|
super(spatial);
|
||||||
this.setVisible(false); // Hide by default
|
this.setVisible(false); // Hide by default
|
||||||
|
|
||||||
var tabLabel = new LabelElement<>(
|
LabelElement<?> tabLabel = new LabelElement<>(
|
||||||
Spatials.positionXY(336, 16).width(16).height(16),
|
Spatials.positionXY(336, 16).width(16).height(16),
|
||||||
new TextComponent("TAB").withStyle(ChatFormatting.GOLD),
|
new TextComponent("TAB").withStyle(ChatFormatting.GOLD),
|
||||||
LabelTextStyle.shadow()
|
LabelTextStyle.shadow()
|
||||||
).layout(this.translateWorldSpatial());
|
).layout(this.translateWorldSpatial());
|
||||||
this.addElement(tabLabel);
|
this.addElement(tabLabel);
|
||||||
|
|
||||||
var shiftTabLabel = new LabelElement<>(
|
LabelElement<?> shiftTabLabel = new LabelElement<>(
|
||||||
Spatials.positionXY(-60, 16).width(16).height(16),
|
Spatials.positionXY(-60, 16).width(16).height(16),
|
||||||
new TextComponent("SHIFT + TAB").withStyle(ChatFormatting.GOLD),
|
new TextComponent("SHIFT + TAB").withStyle(ChatFormatting.GOLD),
|
||||||
LabelTextStyle.shadow()
|
LabelTextStyle.shadow()
|
||||||
).layout(this.translateWorldSpatial());
|
).layout(this.translateWorldSpatial());
|
||||||
this.addElement(shiftTabLabel);
|
this.addElement(shiftTabLabel);
|
||||||
|
|
||||||
var arrows = new LabelElement<>(
|
LabelElement<?> arrows = new LabelElement<>(
|
||||||
Spatials.positionXY(260, 54).width(16).height(16),
|
Spatials.positionXY(260, 54).width(16).height(16),
|
||||||
new TextComponent("← ").withStyle(ChatFormatting.GOLD)
|
new TextComponent("← ").withStyle(ChatFormatting.GOLD)
|
||||||
.append(new TextComponent("scroll").withStyle(ChatFormatting.BLUE))
|
.append(new TextComponent("scroll").withStyle(ChatFormatting.BLUE))
|
||||||
|
|
@ -38,7 +38,7 @@ public class HelpContainer extends ContainerElement<HelpContainer> {
|
||||||
).layout(this.translateWorldSpatial());
|
).layout(this.translateWorldSpatial());
|
||||||
this.addElement(arrows);
|
this.addElement(arrows);
|
||||||
|
|
||||||
var vimArrows = new LabelElement<>(
|
LabelElement<?> vimArrows = new LabelElement<>(
|
||||||
Spatials.positionXY(262, 64).width(16).height(16),
|
Spatials.positionXY(262, 64).width(16).height(16),
|
||||||
new TextComponent("h ").withStyle(ChatFormatting.GOLD)
|
new TextComponent("h ").withStyle(ChatFormatting.GOLD)
|
||||||
.append(new TextComponent("wheel").withStyle(ChatFormatting.BLUE))
|
.append(new TextComponent("wheel").withStyle(ChatFormatting.BLUE))
|
||||||
|
|
@ -47,42 +47,42 @@ public class HelpContainer extends ContainerElement<HelpContainer> {
|
||||||
).layout(this.translateWorldSpatial());
|
).layout(this.translateWorldSpatial());
|
||||||
this.addElement(vimArrows);
|
this.addElement(vimArrows);
|
||||||
|
|
||||||
var ctrlLabel = new LabelElement<>(
|
LabelElement<?> ctrlLabel = new LabelElement<>(
|
||||||
Spatials.positionXY(340, 38).width(16).height(16),
|
Spatials.positionXY(365, 38).width(16).height(16),
|
||||||
new TextComponent("CTRL").withStyle(ChatFormatting.GOLD),
|
new TextComponent("CTRL").withStyle(ChatFormatting.GOLD),
|
||||||
LabelTextStyle.shadow()
|
LabelTextStyle.shadow()
|
||||||
).layout(this.translateWorldSpatial());
|
).layout(this.translateWorldSpatial());
|
||||||
this.addElement(ctrlLabel);
|
this.addElement(ctrlLabel);
|
||||||
|
|
||||||
var categoryLabelNormal = new LabelElement<>(
|
LabelElement<?> categoryLabelNormal = new LabelElement<>(
|
||||||
Spatials.positionXY(350, 52).width(16).height(16),
|
Spatials.positionXY(375, 52).width(16).height(16),
|
||||||
new TextComponent(ModifierCategory.NORMAL.name()).withStyle(ModifierCategory.NORMAL.getStyle()),
|
new TextComponent(ModifierCategory.NORMAL.name()).withStyle(ModifierCategory.NORMAL.getStyle()),
|
||||||
LabelTextStyle.shadow()
|
LabelTextStyle.shadow()
|
||||||
).layout(this.translateWorldSpatial());
|
).layout(this.translateWorldSpatial());
|
||||||
this.addElement(categoryLabelNormal);
|
this.addElement(categoryLabelNormal);
|
||||||
|
|
||||||
var categoryLabelGreater = new LabelElement<>(
|
LabelElement<?> categoryLabelGreater = new LabelElement<>(
|
||||||
Spatials.positionXY(350, 62).width(16).height(16),
|
Spatials.positionXY(375, 62).width(16).height(16),
|
||||||
new TextComponent(ModifierCategory.GREATER.name()).withStyle(ModifierCategory.GREATER.getStyle()),
|
new TextComponent(ModifierCategory.GREATER.name()).withStyle(ModifierCategory.GREATER.getStyle()),
|
||||||
LabelTextStyle.shadow()
|
LabelTextStyle.shadow()
|
||||||
).layout(this.translateWorldSpatial());
|
).layout(this.translateWorldSpatial());
|
||||||
this.addElement(categoryLabelGreater);
|
this.addElement(categoryLabelGreater);
|
||||||
|
|
||||||
var categoryLabelLegendary = new LabelElement<>(
|
LabelElement<?> categoryLabelLegendary = new LabelElement<>(
|
||||||
Spatials.positionXY(350, 72).width(16).height(16),
|
Spatials.positionXY(375, 72).width(16).height(16),
|
||||||
new TextComponent(ModifierCategory.LEGENDARY.name()).withStyle(ModifierCategory.LEGENDARY.getStyle()),
|
new TextComponent(ModifierCategory.LEGENDARY.name()).withStyle(ModifierCategory.LEGENDARY.getStyle()),
|
||||||
LabelTextStyle.shadow()
|
LabelTextStyle.shadow()
|
||||||
).layout(this.translateWorldSpatial());
|
).layout(this.translateWorldSpatial());
|
||||||
this.addElement(categoryLabelLegendary);
|
this.addElement(categoryLabelLegendary);
|
||||||
|
|
||||||
var upLabel = new LabelElement<>(
|
LabelElement<?> upLabel = new LabelElement<>(
|
||||||
Spatials.positionXY(340, 150).width(16).height(16),
|
Spatials.positionXY(340, 190).width(16).height(16),
|
||||||
new TextComponent("↑ k").withStyle(ChatFormatting.GOLD),
|
new TextComponent("↑ k").withStyle(ChatFormatting.GOLD),
|
||||||
LabelTextStyle.shadow()
|
LabelTextStyle.shadow()
|
||||||
).layout(this.translateWorldSpatial());
|
).layout(this.translateWorldSpatial());
|
||||||
this.addElement(upLabel);
|
this.addElement(upLabel);
|
||||||
var downLabel = new LabelElement<>(
|
LabelElement<?> downLabel = new LabelElement<>(
|
||||||
Spatials.positionXY(340, 164).width(16).height(16),
|
Spatials.positionXY(340, 204).width(16).height(16),
|
||||||
new TextComponent("↓ j").withStyle(ChatFormatting.GOLD),
|
new TextComponent("↓ j").withStyle(ChatFormatting.GOLD),
|
||||||
LabelTextStyle.shadow()
|
LabelTextStyle.shadow()
|
||||||
).layout(this.translateWorldSpatial());
|
).layout(this.translateWorldSpatial());
|
||||||
|
|
@ -100,10 +100,10 @@ public class HelpContainer extends ContainerElement<HelpContainer> {
|
||||||
rolled together.
|
rolled together.
|
||||||
""";
|
""";
|
||||||
|
|
||||||
var array = text.split("\n");
|
String[] array = text.split("\n");
|
||||||
int labelY = 120;
|
int labelY = 120;
|
||||||
for (String s : array) {
|
for (String s : array) {
|
||||||
var textLabel = new LabelElement<>(
|
LabelElement<?> textLabel = new LabelElement<>(
|
||||||
Spatials.positionXY(-100, labelY).width(20).height(15),
|
Spatials.positionXY(-100, labelY).width(20).height(15),
|
||||||
new TextComponent(s).withStyle(ChatFormatting.GOLD), LabelTextStyle.shadow()
|
new TextComponent(s).withStyle(ChatFormatting.GOLD), LabelTextStyle.shadow()
|
||||||
).layout(this.translateWorldSpatial());
|
).layout(this.translateWorldSpatial());
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import iskallia.vault.client.gui.framework.spatial.spi.ISpatial;
|
||||||
import iskallia.vault.client.gui.framework.text.LabelTextStyle;
|
import iskallia.vault.client.gui.framework.text.LabelTextStyle;
|
||||||
import iskallia.vault.config.gear.VaultGearTierConfig;
|
import iskallia.vault.config.gear.VaultGearTierConfig;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.network.chat.TextComponent;
|
import net.minecraft.network.chat.TextComponent;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
|
||||||
|
|
@ -35,7 +36,7 @@ public class ModifierListContainer extends VerticalScrollClipContainer<ModifierL
|
||||||
Optional<VaultGearTierConfig> optCfg = VaultGearTierConfig.getConfig(gearPiece);
|
Optional<VaultGearTierConfig> optCfg = VaultGearTierConfig.getConfig(gearPiece);
|
||||||
if (optCfg.isPresent()) {
|
if (optCfg.isPresent()) {
|
||||||
VaultGearTierConfig cfg = optCfg.get();
|
VaultGearTierConfig cfg = optCfg.get();
|
||||||
for (var modifier : Modifiers.getModifierList(lvl, cfg, modifierCategory)) {
|
for (Component modifier : Modifiers.getModifierList(lvl, cfg, modifierCategory)) {
|
||||||
LabelElement<?> labelelement = new LabelElement<>(
|
LabelElement<?> labelelement = new LabelElement<>(
|
||||||
Spatials.positionXY(labelX, labelY).width(this.innerWidth() - labelX).height(15), modifier, LabelTextStyle.defaultStyle()
|
Spatials.positionXY(labelX, labelY).width(this.innerWidth() - labelX).height(15), modifier, LabelTextStyle.defaultStyle()
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,15 @@ import iskallia.vault.init.ModGearAttributes;
|
||||||
import iskallia.vault.util.SideOnlyFixer;
|
import iskallia.vault.util.SideOnlyFixer;
|
||||||
import iskallia.vault.util.function.ObservableSupplier;
|
import iskallia.vault.util.function.ObservableSupplier;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.player.LocalPlayer;
|
||||||
import net.minecraft.network.chat.Style;
|
import net.minecraft.network.chat.Style;
|
||||||
import net.minecraft.network.chat.TextComponent;
|
import net.minecraft.network.chat.TextComponent;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import static iskallia.vault.client.gui.framework.ScreenTextures.BUTTON_EMPTY;
|
import static iskallia.vault.client.gui.framework.ScreenTextures.BUTTON_EMPTY;
|
||||||
import static iskallia.vault.client.gui.framework.ScreenTextures.BUTTON_EMPTY_DISABLED;
|
import static iskallia.vault.client.gui.framework.ScreenTextures.BUTTON_EMPTY_DISABLED;
|
||||||
|
|
||||||
|
|
@ -36,16 +41,16 @@ public class TransmogListContainer extends VerticalScrollClipContainer<TransmogL
|
||||||
int labelX = 9;
|
int labelX = 9;
|
||||||
int labelY = 0;
|
int labelY = 0;
|
||||||
|
|
||||||
var player = Minecraft.getInstance().player;
|
LocalPlayer player = Minecraft.getInstance().player;
|
||||||
if (player == null) {
|
if (player == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var discoveredModelIds = ClientDiscoveredEntriesData.Models.getDiscoveredModels();
|
Set<ResourceLocation> discoveredModelIds = ClientDiscoveredEntriesData.Models.getDiscoveredModels();
|
||||||
var discoveredModelObserverIds = ClientDiscoveredEntriesData.Models.getObserverModels();
|
ObservableSupplier<Set<ResourceLocation>> discoveredModelObserverIds = ClientDiscoveredEntriesData.Models.getObserverModels();
|
||||||
var model = new DiscoveredModelSelectElement.DiscoveredModelSelectorModel(
|
DiscoveredModelSelectElement.DiscoveredModelSelectorModel model = new DiscoveredModelSelectElement.DiscoveredModelSelectorModel(
|
||||||
ObservableSupplier.of(() -> gearPiece, SideOnlyFixer::stackEqualExact), discoveredModelObserverIds, x -> {});
|
ObservableSupplier.of(() -> gearPiece, SideOnlyFixer::stackEqualExact), discoveredModelObserverIds, x -> {});
|
||||||
var mEntries = model.getEntries();
|
List<DiscoveredModelSelectElement.TransmogModelEntry> mEntries = model.getEntries();
|
||||||
for (var x : mEntries) {
|
for (DiscoveredModelSelectElement.TransmogModelEntry x : mEntries) {
|
||||||
ItemStack displayStack = new ItemStack(gearPiece.getItem());
|
ItemStack displayStack = new ItemStack(gearPiece.getItem());
|
||||||
VaultGearData gearData = VaultGearData.read(displayStack);
|
VaultGearData gearData = VaultGearData.read(displayStack);
|
||||||
gearData.setState(VaultGearState.IDENTIFIED);
|
gearData.setState(VaultGearState.IDENTIFIED);
|
||||||
|
|
@ -62,7 +67,7 @@ public class TransmogListContainer extends VerticalScrollClipContainer<TransmogL
|
||||||
|
|
||||||
NineSliceButtonElement<?> btn = new NineSliceButtonElement<>(Spatials.positionXY(0, labelY ).width(innerWidth()).height(18),
|
NineSliceButtonElement<?> btn = new NineSliceButtonElement<>(Spatials.positionXY(0, labelY ).width(innerWidth()).height(18),
|
||||||
new NineSliceButtonElement.NineSliceButtonTextures(BUTTON_EMPTY, BUTTON_EMPTY, BUTTON_EMPTY, BUTTON_EMPTY_DISABLED), () -> {});
|
new NineSliceButtonElement.NineSliceButtonTextures(BUTTON_EMPTY, BUTTON_EMPTY, BUTTON_EMPTY, BUTTON_EMPTY_DISABLED), () -> {});
|
||||||
var canTransmog = TransmogTableBlock.canTransmogModel(player, discoveredModelIds, x.getModelId());
|
boolean canTransmog = TransmogTableBlock.canTransmogModel(player, discoveredModelIds, x.getModelId());
|
||||||
btn.setDisabled(!canTransmog);
|
btn.setDisabled(!canTransmog);
|
||||||
this.addElement(btn);
|
this.addElement(btn);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import iskallia.vault.gear.data.VaultGearData;
|
||||||
import iskallia.vault.init.ModConfigs;
|
import iskallia.vault.init.ModConfigs;
|
||||||
import iskallia.vault.init.ModGearAttributes;
|
import iskallia.vault.init.ModGearAttributes;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.network.chat.TextComponent;
|
import net.minecraft.network.chat.TextComponent;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
|
@ -36,22 +37,21 @@ public class UniqueGearListContainer extends VerticalScrollClipContainer<UniqueG
|
||||||
int labelY = 9;
|
int labelY = 9;
|
||||||
|
|
||||||
Map<ResourceLocation, UniqueGearConfig.Entry> uniqueRegistry = ((UniqueGearConfigAccessor) ModConfigs.UNIQUE_GEAR).getRegistry();
|
Map<ResourceLocation, UniqueGearConfig.Entry> uniqueRegistry = ((UniqueGearConfigAccessor) ModConfigs.UNIQUE_GEAR).getRegistry();
|
||||||
var regName = gearPiece.getItem().getRegistryName();
|
ResourceLocation regName = gearPiece.getItem().getRegistryName();
|
||||||
if (regName == null) {
|
if (regName == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var regPath = regName.getPath();
|
String regPath = regName.getPath();
|
||||||
|
|
||||||
var goodEntries = uniqueRegistry.entrySet().stream().filter(entry -> entry.getValue().getModel() != null && entry.getValue().getModel().toString().contains(regPath)).toList();
|
var goodEntries = uniqueRegistry.entrySet().stream().filter(entry -> entry.getValue().getModel() != null && entry.getValue().getModel().toString().contains(regPath)).toList();
|
||||||
List<Map.Entry<ResourceLocation, UniqueGearConfig.Entry>> badEntries = uniqueRegistry.entrySet().stream().filter(entry -> entry.getValue().getModel() == null || !entry.getValue().getModel().toString().contains(regPath)).toList();
|
|
||||||
|
|
||||||
|
|
||||||
var uniqueConfig1 = (VaultGearTierConfigAccessor) ModConfigs.VAULT_GEAR_CONFIG.get(VaultGearTierConfig.UNIQUE_ITEM);
|
VaultGearTierConfigAccessor uniqueConfig1 = (VaultGearTierConfigAccessor) ModConfigs.VAULT_GEAR_CONFIG.get(VaultGearTierConfig.UNIQUE_ITEM);
|
||||||
if (uniqueConfig1 == null) {
|
if (uniqueConfig1 == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (var entry : goodEntries) {
|
for (Map.Entry<ResourceLocation, UniqueGearConfig.Entry> entry : goodEntries) {
|
||||||
var value = entry.getValue();
|
UniqueGearConfig.Entry value = entry.getValue();
|
||||||
String name = value.getName();
|
String name = value.getName();
|
||||||
if (name == null) {
|
if (name == null) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -83,8 +83,8 @@ public class UniqueGearListContainer extends VerticalScrollClipContainer<UniqueG
|
||||||
this.addElement(new FakeItemSlotElement<>(Spatials.positionXY(labelX - 4, iconHeight).width(16).height(16), () -> displayStack, () -> false, ScreenTextures.EMPTY, ScreenTextures.EMPTY));
|
this.addElement(new FakeItemSlotElement<>(Spatials.positionXY(labelX - 4, iconHeight).width(16).height(16), () -> displayStack, () -> false, ScreenTextures.EMPTY, ScreenTextures.EMPTY));
|
||||||
|
|
||||||
|
|
||||||
var mlist = Modifiers.getUniqueModifierList(lvl, modifierCategory, modifierIdentifiers);
|
List<Component> mlist = Modifiers.getUniqueModifierList(lvl, modifierCategory, modifierIdentifiers);
|
||||||
for (var mc : mlist) {
|
for (Component mc : mlist) {
|
||||||
LabelElement<?> mcl = new LabelElement<>(
|
LabelElement<?> mcl = new LabelElement<>(
|
||||||
Spatials.positionXY(labelX, labelY).width(this.innerWidth() - labelX).height(15),
|
Spatials.positionXY(labelX, labelY).width(this.innerWidth() - labelX).height(15),
|
||||||
mc, LabelTextStyle.defaultStyle());
|
mc, LabelTextStyle.defaultStyle());
|
||||||
|
|
@ -97,23 +97,24 @@ public class UniqueGearListContainer extends VerticalScrollClipContainer<UniqueG
|
||||||
labelY += 10;
|
labelY += 10;
|
||||||
}
|
}
|
||||||
if (Config.DEBUG_UNIQUE_GEAR.get()) {
|
if (Config.DEBUG_UNIQUE_GEAR.get()) {
|
||||||
|
var badEntries = uniqueRegistry.entrySet().stream().filter(entry -> entry.getValue().getModel() == null || !entry.getValue().getModel().toString().contains(regPath)).toList();
|
||||||
this.addElement(new LabelElement<>(
|
this.addElement(new LabelElement<>(
|
||||||
Spatials.positionXY(labelX, labelY).width(this.innerWidth() - labelX).height(15),
|
Spatials.positionXY(labelX, labelY).width(this.innerWidth() - labelX).height(15),
|
||||||
new TextComponent("[DEBUG] BAD ENTRIES:").withStyle(ChatFormatting.RED), LabelTextStyle.defaultStyle()));
|
new TextComponent("[DEBUG] BAD ENTRIES:").withStyle(ChatFormatting.RED), LabelTextStyle.defaultStyle()));
|
||||||
labelY += 10;
|
labelY += 10;
|
||||||
for (var entry : badEntries) {
|
for (Map.Entry<ResourceLocation, UniqueGearConfig.Entry> entry : badEntries) {
|
||||||
this.addElement(new LabelElement<>(
|
this.addElement(new LabelElement<>(
|
||||||
Spatials.positionXY(labelX, labelY).width(this.innerWidth() - labelX).height(15),
|
Spatials.positionXY(labelX, labelY).width(this.innerWidth() - labelX).height(15),
|
||||||
new TextComponent("ID: " + entry.getKey().toString()).withStyle(ChatFormatting.RED),
|
new TextComponent("ID: " + entry.getKey().toString()).withStyle(ChatFormatting.RED),
|
||||||
LabelTextStyle.defaultStyle()));
|
LabelTextStyle.defaultStyle()));
|
||||||
labelY += 10;
|
labelY += 10;
|
||||||
var vv = entry.getValue();
|
UniqueGearConfig.Entry value = entry.getValue();
|
||||||
if (vv == null) {
|
if (value == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
this.addElement(new LabelElement<>(
|
this.addElement(new LabelElement<>(
|
||||||
Spatials.positionXY(labelX, labelY).width(this.innerWidth() - labelX).height(15),
|
Spatials.positionXY(labelX, labelY).width(this.innerWidth() - labelX).height(15),
|
||||||
new TextComponent("Model: " + vv.getModel()).withStyle(ChatFormatting.RED),
|
new TextComponent("Model: " + value.getModel()).withStyle(ChatFormatting.RED),
|
||||||
LabelTextStyle.defaultStyle()));
|
LabelTextStyle.defaultStyle()));
|
||||||
labelY += 16;
|
labelY += 16;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue