mirror of
https://github.com/darksaid98/Flashback.git
synced 2026-12-03 14:38:50 +00:00
Add glowing override option
This commit is contained in:
1 parent
14bf2e982b
commit
1405193523
4 files changed
+60
-1
No files matched your search
@@ -0,0 +1,20 @@
|
|||||||
|
package com.moulberry.flashback.combo_options;
|
||||||
|
|
||||||
|
public enum GlowingOverride implements ComboOption {
|
||||||
|
|
||||||
|
DEFAULT("Default"),
|
||||||
|
FORCE_GLOW("Force Glow"),
|
||||||
|
FORCE_NO_GLOW("Force No Glow");
|
||||||
|
|
||||||
|
private final String text;
|
||||||
|
|
||||||
|
GlowingOverride(String text) {
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String text() {
|
||||||
|
return this.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import com.mojang.authlib.yggdrasil.ProfileResult;
|
|||||||
import com.moulberry.flashback.FilePlayerSkin;
|
import com.moulberry.flashback.FilePlayerSkin;
|
||||||
import com.moulberry.flashback.Flashback;
|
import com.moulberry.flashback.Flashback;
|
||||||
import com.moulberry.flashback.Utils;
|
import com.moulberry.flashback.Utils;
|
||||||
|
import com.moulberry.flashback.combo_options.GlowingOverride;
|
||||||
import com.moulberry.flashback.editor.ui.ImGuiHelper;
|
import com.moulberry.flashback.editor.ui.ImGuiHelper;
|
||||||
import com.moulberry.flashback.exporting.AsyncFileDialogs;
|
import com.moulberry.flashback.exporting.AsyncFileDialogs;
|
||||||
import com.moulberry.flashback.state.EditorState;
|
import com.moulberry.flashback.state.EditorState;
|
||||||
@@ -82,7 +83,8 @@ public class SelectedEntityPopup {
|
|||||||
editorState.markDirty();
|
editorState.markDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isHiddenDuringExport && entity instanceof Player player) {
|
if (!isHiddenDuringExport) {
|
||||||
|
if (entity instanceof Player player) {
|
||||||
boolean hideNametag = editorState.hideNametags.contains(entity.getUUID());
|
boolean hideNametag = editorState.hideNametags.contains(entity.getUUID());
|
||||||
if (ImGui.checkbox("Render Nametag", !hideNametag)) {
|
if (ImGui.checkbox("Render Nametag", !hideNametag)) {
|
||||||
if (hideNametag) {
|
if (hideNametag) {
|
||||||
@@ -131,6 +133,8 @@ public class SelectedEntityPopup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showGlowingDropdown(entity, editorState);
|
||||||
|
|
||||||
ImGuiHelper.separatorWithText("Change Skin & Cape (UUID)");
|
ImGuiHelper.separatorWithText("Change Skin & Cape (UUID)");
|
||||||
ImGui.setNextItemWidth(320);
|
ImGui.setNextItemWidth(320);
|
||||||
ImGui.inputTextWithHint("##SetSkinInput", "e.g. d0e05de7-6067-454d-beae-c6d19d886191", changeSkinInput);
|
ImGui.inputTextWithHint("##SetSkinInput", "e.g. d0e05de7-6067-454d-beae-c6d19d886191", changeSkinInput);
|
||||||
@@ -166,6 +170,9 @@ public class SelectedEntityPopup {
|
|||||||
changeSkinInput.set("");
|
changeSkinInput.set("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
showGlowingDropdown(entity, editorState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ImGui.sameLine();
|
// ImGui.sameLine();
|
||||||
@@ -186,4 +193,19 @@ public class SelectedEntityPopup {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void showGlowingDropdown(Entity entity, EditorState editorState) {
|
||||||
|
GlowingOverride glowingOverride = GlowingOverride.DEFAULT;
|
||||||
|
if (editorState.glowingOverride.containsKey(entity.getUUID())) {
|
||||||
|
glowingOverride = editorState.glowingOverride.get(entity.getUUID());
|
||||||
|
}
|
||||||
|
GlowingOverride newGlowingOverride = ImGuiHelper.enumCombo("Glowing", glowingOverride);
|
||||||
|
if (newGlowingOverride != glowingOverride) {
|
||||||
|
if (newGlowingOverride == GlowingOverride.DEFAULT) {
|
||||||
|
editorState.glowingOverride.remove(entity.getUUID());
|
||||||
|
} else {
|
||||||
|
editorState.glowingOverride.put(entity.getUUID(), newGlowingOverride);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,7 @@ import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
|
|||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import com.moulberry.flashback.Flashback;
|
import com.moulberry.flashback.Flashback;
|
||||||
import com.moulberry.flashback.FreezeSlowdownFormula;
|
import com.moulberry.flashback.FreezeSlowdownFormula;
|
||||||
|
import com.moulberry.flashback.combo_options.GlowingOverride;
|
||||||
import com.moulberry.flashback.configuration.FlashbackConfig;
|
import com.moulberry.flashback.configuration.FlashbackConfig;
|
||||||
import com.moulberry.flashback.editor.ui.windows.ExportDoneWindow;
|
import com.moulberry.flashback.editor.ui.windows.ExportDoneWindow;
|
||||||
import com.moulberry.flashback.editor.ui.windows.WindowType;
|
import com.moulberry.flashback.editor.ui.windows.WindowType;
|
||||||
@@ -165,6 +166,20 @@ public abstract class MixinMinecraft implements MinecraftExt {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Inject(method = "shouldEntityAppearGlowing", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void shouldEntityAppearGlowing(Entity entity, CallbackInfoReturnable<Boolean> cir) {
|
||||||
|
EditorState editorState = EditorStateManager.getCurrent();
|
||||||
|
if (editorState != null) {
|
||||||
|
GlowingOverride glowingOverride = editorState.glowingOverride.get(entity.getUUID());
|
||||||
|
|
||||||
|
if (glowingOverride == GlowingOverride.FORCE_GLOW) {
|
||||||
|
cir.setReturnValue(true);
|
||||||
|
} else if (glowingOverride == GlowingOverride.FORCE_NO_GLOW) {
|
||||||
|
cir.setReturnValue(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@WrapOperation(method = "runTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/sounds/SoundManager;updateSource(Lnet/minecraft/client/Camera;)V"))
|
@WrapOperation(method = "runTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/sounds/SoundManager;updateSource(Lnet/minecraft/client/Camera;)V"))
|
||||||
public void runTick_updateSource(SoundManager instance, Camera camera, Operation<Void> original) {
|
public void runTick_updateSource(SoundManager instance, Camera camera, Operation<Void> original) {
|
||||||
EditorState editorState = EditorStateManager.getCurrent();
|
EditorState editorState = EditorStateManager.getCurrent();
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.mojang.authlib.GameProfile;
|
|||||||
import com.moulberry.flashback.FilePlayerSkin;
|
import com.moulberry.flashback.FilePlayerSkin;
|
||||||
import com.moulberry.flashback.Flashback;
|
import com.moulberry.flashback.Flashback;
|
||||||
import com.moulberry.flashback.FlashbackGson;
|
import com.moulberry.flashback.FlashbackGson;
|
||||||
|
import com.moulberry.flashback.combo_options.GlowingOverride;
|
||||||
import com.moulberry.flashback.editor.ui.ReplayUI;
|
import com.moulberry.flashback.editor.ui.ReplayUI;
|
||||||
import com.moulberry.flashback.keyframe.Keyframe;
|
import com.moulberry.flashback.keyframe.Keyframe;
|
||||||
import com.moulberry.flashback.keyframe.KeyframeType;
|
import com.moulberry.flashback.keyframe.KeyframeType;
|
||||||
@@ -51,6 +52,7 @@ public class EditorState {
|
|||||||
public Map<UUID, GameProfile> skinOverride = new HashMap<>();
|
public Map<UUID, GameProfile> skinOverride = new HashMap<>();
|
||||||
public Map<UUID, FilePlayerSkin> skinOverrideFromFile = new HashMap<>();
|
public Map<UUID, FilePlayerSkin> skinOverrideFromFile = new HashMap<>();
|
||||||
public Map<UUID, String> nameOverride = new HashMap<>();
|
public Map<UUID, String> nameOverride = new HashMap<>();
|
||||||
|
public Map<UUID, GlowingOverride> glowingOverride = new HashMap<>();
|
||||||
public Set<UUID> hideTeamPrefix = new HashSet<>();
|
public Set<UUID> hideTeamPrefix = new HashSet<>();
|
||||||
public Set<UUID> hideTeamSuffix = new HashSet<>();
|
public Set<UUID> hideTeamSuffix = new HashSet<>();
|
||||||
public Set<String> filteredEntities = new HashSet<>();
|
public Set<String> filteredEntities = new HashSet<>();
|
||||||
|
|||||||
Reference in new issue
Block a user