Skip to content

Commit cf947c9

Browse files
committed
Add deprecation message for Dulkir in config
1 parent 3815fdb commit cf947c9

File tree

5 files changed

+67
-6
lines changed

5 files changed

+67
-6
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
mod_name = OverflowAnimations
22
mod_id = overflowanimations
3-
mod_version = 2.2.4
3+
mod_version = 2.2.5
44
mod_archives_name=OverflowAnimations
55

66
# Gradle Configuration -- DO NOT TOUCH THESE VALUES.

src/main/java/org/polyfrost/overflowanimations/gui/PleaseMigrateDulkirModGui.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import cc.polyfrost.oneconfig.utils.color.ColorUtils;
1111
import cc.polyfrost.oneconfig.utils.gui.GuiUtils;
1212
import cc.polyfrost.oneconfig.utils.gui.OneUIScreen;
13+
import org.polyfrost.overflowanimations.OverflowAnimations;
14+
import org.polyfrost.overflowanimations.config.OldAnimationsSettings;
1315
import org.polyfrost.overflowanimations.hooks.AnimationExportUtils;
1416

1517
public class PleaseMigrateDulkirModGui extends OneUIScreen {
@@ -31,19 +33,31 @@ public class PleaseMigrateDulkirModGui extends OneUIScreen {
3133
2,
3234
ColorPalette.PRIMARY_DESTRUCTIVE
3335
);
36+
private int ticks = 0;
3437

3538
@Override
3639
public void draw(long vg, float partialTicks, InputHandler inputHandler) {
40+
if (ticks < 10) {
41+
ticks++;
42+
if (ticks == 10) {
43+
markAsViewed();
44+
}
45+
}
3746
if (transferButton.getWidth() == -1) {
3847
transferButton.setWidth((int) (NanoVGHelper.INSTANCE.getTextWidth(vg, TRANSFER, 14f, Fonts.MEDIUM) + 40));
39-
transferButton.setClickAction(AnimationExportUtils::transferDulkirConfig);
48+
transferButton.setClickAction(() -> {
49+
markAsViewed();
50+
AnimationExportUtils.transferDulkirConfig();
51+
GuiUtils.displayScreen(null);
52+
});
4053
}
4154
if (cancelButton.getWidth() == -1) {
4255
cancelButton.setWidth((int) (NanoVGHelper.INSTANCE.getTextWidth(vg, CANCEL, 14f, Fonts.MEDIUM) + 40));
4356
cancelButton.setClickAction(() -> {
4457
cancelButton.setText("Confirm");
4558
cancelButton.setWidth((int) (NanoVGHelper.INSTANCE.getTextWidth(vg, "Confirm", 14f, Fonts.MEDIUM) + 40));
4659
cancelButton.setClickAction(() -> {
60+
markAsViewed();
4761
cancelButton.setText(CANCEL);
4862
cancelButton.setWidth((int) (NanoVGHelper.INSTANCE.getTextWidth(vg, CANCEL, 14f, Fonts.MEDIUM) + 40));
4963
GuiUtils.displayScreen(null);
@@ -65,4 +79,10 @@ public void draw(long vg, float partialTicks, InputHandler inputHandler) {
6579
transferButton.draw(vg, x + 300 - transferButton.getWidth(), y + 180, inputHandler);
6680
cancelButton.draw(vg, x + 300 + 10, y + 180, inputHandler);
6781
}
82+
83+
private void markAsViewed() {
84+
OverflowAnimations.doTheFunnyDulkirThing = false;
85+
OldAnimationsSettings.didTheFunnyDulkirThingElectricBoogaloo = true;
86+
OldAnimationsSettings.INSTANCE.save();
87+
}
6888
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package org.polyfrost.overflowanimations.mixin.compat;
2+
3+
import cc.polyfrost.oneconfig.config.Config;
4+
import cc.polyfrost.oneconfig.config.annotations.Exclude;
5+
import cc.polyfrost.oneconfig.config.data.Mod;
6+
import org.spongepowered.asm.mixin.Dynamic;
7+
import org.spongepowered.asm.mixin.Mixin;
8+
import org.spongepowered.asm.mixin.Pseudo;
9+
import org.spongepowered.asm.mixin.Unique;
10+
import org.spongepowered.asm.mixin.injection.At;
11+
import org.spongepowered.asm.mixin.injection.Inject;
12+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
13+
14+
@Pseudo
15+
@Mixin(targets = "dulkirmod.config.DulkirConfig")
16+
public class DulkirConfigMixin extends Config {
17+
18+
@Unique
19+
@Exclude
20+
private static final String overflow$USE_OVERFLOW = "Please use OverflowAnimations' Custom Item Positions instead of Dulkir's, as it is more compatible with old animations and has more features. You can find it in the OneConfig Mods menu. You can use the Dulkir export buttons and import it into OverflowAnimations directly. For more info, please join the Polyfrost Discord server: discord.gg/polyfrost.";
21+
22+
public DulkirConfigMixin(Mod modData, String configFile) {
23+
super(modData, configFile);
24+
}
25+
26+
@Dynamic("DulkirMod")
27+
@Inject(method = "init", at = @At("RETURN"))
28+
private void onInit(CallbackInfo ci) {
29+
addDependency("customAnimations", overflow$USE_OVERFLOW, () -> false);
30+
addDependency("customSize", overflow$USE_OVERFLOW, () -> false);
31+
addDependency("doesScaleSwing", overflow$USE_OVERFLOW, () -> false);
32+
addDependency("customX", overflow$USE_OVERFLOW, () -> false);
33+
addDependency("customY", overflow$USE_OVERFLOW, () -> false);
34+
addDependency("customZ", overflow$USE_OVERFLOW, () -> false);
35+
addDependency("customYaw", overflow$USE_OVERFLOW, () -> false);
36+
addDependency("customPitch", overflow$USE_OVERFLOW, () -> false);
37+
addDependency("customRoll", overflow$USE_OVERFLOW, () -> false);
38+
addDependency("customSpeed", overflow$USE_OVERFLOW, () -> false);
39+
addDependency("ignoreHaste", overflow$USE_OVERFLOW, () -> false);
40+
addDependency("drinkingSelector", overflow$USE_OVERFLOW, () -> false);
41+
}
42+
}

src/main/kotlin/org/polyfrost/overflowanimations/OverflowAnimations.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ object OverflowAnimations {
3535

3636
@JvmField
3737
var isPatcherPresent: Boolean = false
38-
private var doTheFunnyDulkirThing = false
38+
@JvmField
39+
var doTheFunnyDulkirThing = false
3940
@JvmField
4041
var oldDulkirMod: Boolean = false
4142
private var customCrosshair = false
@@ -100,9 +101,6 @@ object OverflowAnimations {
100101

101102
private fun dulkirTrollage() {
102103
GuiUtils.displayScreen(PleaseMigrateDulkirModGui())
103-
doTheFunnyDulkirThing = false
104-
OldAnimationsSettings.didTheFunnyDulkirThingElectricBoogaloo = true
105-
OldAnimationsSettings.INSTANCE.save()
106104
}
107105

108106
}

src/main/resources/mixins.overflowanimations.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"RenderItemMixin",
4040
"RenderSnowballMixin",
4141
"RenderSnowballMixin_CustomPositions",
42+
"compat.DulkirConfigMixin",
4243
"compat.ItemCustomizeManagerMixin",
4344
"interfaces.EntityLivingBaseInvoker",
4445
"interfaces.GuiPlayerTabOverlayInvoker",

0 commit comments

Comments
 (0)