mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-25 16:54:30 +00:00
Removed "render ticks" tick type. Instead, animations and frames can define a tick speed measured in milliseconds. Animations/frames using MC tick type will be 50ms (1000ms/20), and render ticks 20ms.
This commit is contained in:
1 parent
de909472b3
commit
799631eece
11 files changed
+97
-95
No files matched your search
@@ -6,12 +6,12 @@ import noppes.npcs.controllers.data.Frame;
|
||||
|
||||
public class SubGuiAnimationFrame extends SubGuiInterface implements ITextfieldListener {
|
||||
private final Frame editingFrame;
|
||||
|
||||
|
||||
public SubGuiAnimationFrame(Frame editingFrame) {
|
||||
this.editingFrame = editingFrame;
|
||||
setBackground("smallbg.png");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
@@ -33,7 +33,7 @@ public class SubGuiAnimationFrame extends SubGuiInterface implements ITextfieldL
|
||||
//
|
||||
//ticks - button
|
||||
this.addLabel(new GuiNpcLabel(13, "animation.tickType", guiLeft + 5, guiTop + 78));
|
||||
this.addButton(new GuiNpcButton(13, guiLeft + 65, guiTop + 72, 75, 20, new String[]{"animation.renderTicks", "animation.mcTicks"}, editingFrame.renderTicks ? 0 : 1));
|
||||
//this.addButton(new GuiNpcButton(13, guiLeft + 65, guiTop + 72, 75, 20, new String[]{"animation.renderTicks", "animation.mcTicks"}, editingFrame.renderTicks ? 0 : 1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,8 +46,6 @@ public class SubGuiAnimationFrame extends SubGuiInterface implements ITextfieldL
|
||||
editingFrame.setCustomized(!editingFrame.isCustomized());
|
||||
} else if (guibutton.id == 12 && editingFrame != null) {
|
||||
editingFrame.smooth = (byte) value;
|
||||
} else if (guibutton.id == 13 && editingFrame != null) {
|
||||
editingFrame.renderTicks = value == 0;
|
||||
}
|
||||
|
||||
initGui();
|
||||
|
||||
@@ -20,7 +20,6 @@ public class SubGuiAnimationOptions extends SubGuiInterface {
|
||||
//
|
||||
//ticks - button
|
||||
this.addLabel(new GuiNpcLabel(10, "animation.tickType", guiLeft + 5, guiTop + 16));
|
||||
this.addButton(new GuiNpcButton(10, guiLeft + 60, guiTop + 10, 75, 20, new String[]{"animation.renderTicks", "animation.mcTicks"}, animation.renderTicks ? 0 : 1));
|
||||
//
|
||||
//whileStanding - button
|
||||
this.addLabel(new GuiNpcLabel(11, "animation.whileStanding", guiLeft + 5, guiTop + 36));
|
||||
@@ -41,7 +40,7 @@ public class SubGuiAnimationOptions extends SubGuiInterface {
|
||||
int value = ((GuiNpcButton)guibutton).getValue();
|
||||
|
||||
if (guibutton.id == 10) {
|
||||
animation.renderTicks = value == 0;
|
||||
|
||||
} else if (guibutton.id == 11) {
|
||||
animation.whileStanding = value == 0;
|
||||
} else if (guibutton.id == 12) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package noppes.npcs.client.gui.global;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.ClientCacheHandler;
|
||||
import noppes.npcs.client.gui.SubGuiAnimationFrame;
|
||||
import noppes.npcs.client.gui.SubGuiAnimationOptions;
|
||||
import noppes.npcs.client.gui.SubGuiColorSelector;
|
||||
@@ -49,7 +50,7 @@ public class GuiNPCEditAnimation extends GuiModelInterface implements ITextfield
|
||||
|
||||
this.animation = animation;
|
||||
AnimationData data = npc.display.animationData;
|
||||
data.animation = animation;
|
||||
data.setAnimation(animation);
|
||||
data.setEnabled(true);
|
||||
|
||||
int bodyPartX = 280;
|
||||
@@ -92,9 +93,9 @@ public class GuiNPCEditAnimation extends GuiModelInterface implements ITextfield
|
||||
|
||||
AnimationData data = npc.display.animationData;
|
||||
if (!playingAnimation) {
|
||||
data.animation = new Animation();
|
||||
data.setAnimation(new Animation());
|
||||
data.animation.smooth = animation.smooth;
|
||||
data.animation.renderTicks = animation.renderTicks;
|
||||
data.animation.tickDuration = 50;
|
||||
data.animation.loop = 0;
|
||||
if (editingFrame != null) {
|
||||
data.animation.frames.add(editingFrame);
|
||||
@@ -107,7 +108,7 @@ public class GuiNPCEditAnimation extends GuiModelInterface implements ITextfield
|
||||
if (!frame.isCustomized()) {
|
||||
frame.speed = animation.speed;
|
||||
frame.smooth = animation.smooth;
|
||||
frame.renderTicks = animation.renderTicks;
|
||||
frame.tickDuration = animation.tickDuration();
|
||||
}
|
||||
for (Map.Entry<EnumAnimationPart,FramePart> entry : frame.frameParts.entrySet()) {
|
||||
FramePart part = entry.getValue();
|
||||
@@ -475,7 +476,7 @@ public class GuiNPCEditAnimation extends GuiModelInterface implements ITextfield
|
||||
}
|
||||
}
|
||||
this.playingAnimation = true;
|
||||
data.animation = animation;
|
||||
data.setAnimation(this.animation);
|
||||
data.animation.paused = false;
|
||||
} else if (guibutton.id == 201) {
|
||||
data.animation.paused = true;
|
||||
@@ -510,12 +511,8 @@ public class GuiNPCEditAnimation extends GuiModelInterface implements ITextfield
|
||||
this.playingAnimation = false;
|
||||
initGui();
|
||||
} else if (data.isActive()) {
|
||||
Frame currentFrame = (Frame) data.animation.currentFrame();
|
||||
long time = mc.theWorld.getTotalWorldTime();
|
||||
if (time != prevTick) {
|
||||
if (currentFrame != null && !currentFrame.renderTicks) {
|
||||
data.animation.increaseTime();
|
||||
}
|
||||
GuiNpcLabel label = this.getLabel(213);
|
||||
if (label != null) {
|
||||
label.label += ".";
|
||||
|
||||
@@ -63,9 +63,9 @@ public class GuiNPCManageAnimations extends GuiModelInterface2 implements IScrol
|
||||
|
||||
AnimationData data = npc.display.animationData;
|
||||
if (!playingAnimation) {
|
||||
data.animation = new Animation();
|
||||
data.setAnimation(new Animation());
|
||||
data.animation.smooth = animation.smooth;
|
||||
data.animation.renderTicks = animation.renderTicks;
|
||||
data.animation.tickDuration = 50;
|
||||
data.animation.loop = 0;
|
||||
|
||||
if (this.animation.frames.size() > 0) {
|
||||
@@ -109,12 +109,8 @@ public class GuiNPCManageAnimations extends GuiModelInterface2 implements IScrol
|
||||
this.playingAnimation = false;
|
||||
initGui();
|
||||
} else if (data.isActive()) {
|
||||
Frame currentFrame = (Frame) data.animation.currentFrame();
|
||||
long time = mc.theWorld.getTotalWorldTime();
|
||||
if (time != prevTick) {
|
||||
if (currentFrame != null && !currentFrame.renderTicks) {
|
||||
data.animation.increaseTime();
|
||||
}
|
||||
GuiNpcLabel label = this.getLabel(94);
|
||||
if (label != null) {
|
||||
label.label += ".";
|
||||
@@ -185,7 +181,7 @@ public class GuiNPCManageAnimations extends GuiModelInterface2 implements IScrol
|
||||
}
|
||||
}
|
||||
this.playingAnimation = true;
|
||||
data.animation = animation;
|
||||
data.setAnimation(this.animation);
|
||||
data.animation.paused = false;
|
||||
} else if (guibutton.id == 92) {
|
||||
data.animation.paused = true;
|
||||
@@ -206,7 +202,7 @@ public class GuiNPCManageAnimations extends GuiModelInterface2 implements IScrol
|
||||
this.animation = new Animation();
|
||||
animation.readFromNBT(compound);
|
||||
setSelected(animation.name);
|
||||
npc.display.animationData.animation = animation;
|
||||
npc.display.animationData.setAnimation(this.animation);
|
||||
this.playingAnimation = false;
|
||||
npc.display.animationData.animation.paused = false;
|
||||
initGui();
|
||||
|
||||
Reference in new issue
Block a user