Commit 0bde2132 authored by mrAppleXZ's avatar mrAppleXZ 💾

IF Tablet entries' connections rework.

parent 52632a33
...@@ -19,7 +19,7 @@ import ru.pearx.purmag.common.infofield.IfEntry; ...@@ -19,7 +19,7 @@ import ru.pearx.purmag.common.infofield.IfEntry;
public class GuiIfTabletSEEntry extends Control public class GuiIfTabletSEEntry extends Control
{ {
public IfEntry entry; public IfEntry entry;
Point[] childs; public Point[] childs;
public GuiIfTabletSEEntry(IfEntry entry) public GuiIfTabletSEEntry(IfEntry entry)
{ {
...@@ -33,7 +33,18 @@ public class GuiIfTabletSEEntry extends Control ...@@ -33,7 +33,18 @@ public class GuiIfTabletSEEntry extends Control
{ {
for (Point p : childs) for (Point p : childs)
{ {
DrawingTools.drawLine(getWidth() / 2, getHeight() / 2, p.getX(), p.getY(), 3, getEntries().getTabletScreen().getTablet().data.getLineColorStart(), getEntries().getTabletScreen().getTablet().data.getLineColorEnd()); int x0 = getWidth() / 2;
int y0 = getHeight() / 2;
int x1 = p.getX();
int y1 = p.getY();
DrawingTools.drawBezier(0.1f, 3, x0, y0, x0, y1, x1, y1, (pts, pt, i) ->
{
int curr = (int)(System.currentTimeMillis() / 50 % pts.length);
int currRange = 1;
boolean b = i >= curr - currRange && i <= curr + currRange;
return b ? getEntries().getTabletScreen().getTablet().data.getLineColorActive() : getEntries().getTabletScreen().getTablet().data.getLineColor();
});
} }
if ((getX() + getWidth()) <= 0 || (getY() + getHeight()) <= 0 || getX() >= getEntries().getWidth() || getY() >= getEntries().getHeight()) if ((getX() + getWidth()) <= 0 || (getY() + getHeight()) <= 0 || getX() >= getEntries().getWidth() || getY() >= getEntries().getHeight())
return; return;
......
...@@ -170,7 +170,7 @@ public class IfRegistry ...@@ -170,7 +170,7 @@ public class IfRegistry
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void setupIfTiersClient() public void setupIfTiersClient()
{ {
registerTierClient(0, new IfTier.TabletData(GuiDrawableRegistry.paperEntry, false, Utils.gRL("textures/gui/if_tablet/0.png"), Colors.WHITE, Colors.BLACK) registerTierClient(0, new IfTier.TabletData(GuiDrawableRegistry.paperEntry, false, Utils.gRL("textures/gui/if_tablet/0.png"), Colors.GREY_100, Colors.GREY_700)
{ {
IGuiDrawable done = GuiDrawableRegistry.paperEntryCompleted; IGuiDrawable done = GuiDrawableRegistry.paperEntryCompleted;
@Override @Override
...@@ -183,8 +183,8 @@ public class IfRegistry ...@@ -183,8 +183,8 @@ public class IfRegistry
return done; return done;
} }
}, Utils.gRL("models/wall_if_tablet/0"), Utils.gRL("if_tablet/0")); }, Utils.gRL("models/wall_if_tablet/0"), Utils.gRL("if_tablet/0"));
registerTierClient(1, new IfTier.TabletData(GuiDrawableRegistry.runes, true, Utils.gRL("textures/gui/if_tablet/1.png"), Colors.LIGHTGREEN_100, Colors.GREEN_900), Utils.gRL("models/wall_if_tablet/1"), Utils.gRL("if_tablet/1")); registerTierClient(1, new IfTier.TabletData(GuiDrawableRegistry.runes, true, Utils.gRL("textures/gui/if_tablet/1.png"), Colors.LIGHTGREEN_200, Colors.GREEN_800), Utils.gRL("models/wall_if_tablet/1"), Utils.gRL("if_tablet/1"));
registerTierClient(2, new IfTier.TabletData(GuiDrawableRegistry.runes, true, Utils.gRL("textures/gui/if_tablet/2.png"), Colors.LIGHTGREEN_100, Colors.GREEN_900), Utils.gRL("models/wall_if_tablet/2"), Utils.gRL("if_tablet/2")); registerTierClient(2, new IfTier.TabletData(GuiDrawableRegistry.runes, true, Utils.gRL("textures/gui/if_tablet/2.png"), Colors.LIGHTGREEN_200, Colors.GREEN_900), Utils.gRL("models/wall_if_tablet/2"), Utils.gRL("if_tablet/2"));
} }
public void setup() public void setup()
......
...@@ -88,16 +88,16 @@ public class IfTier ...@@ -88,16 +88,16 @@ public class IfTier
private IGuiDrawable entryBackground; private IGuiDrawable entryBackground;
private boolean shouldGlow; private boolean shouldGlow;
private ResourceLocation texture; private ResourceLocation texture;
private Color lineColorStart; private Color lineColor;
private Color lineColorEnd; private Color lineColorActive;
public TabletData(IGuiDrawable entryBackground, boolean shouldGlow, ResourceLocation texture, Color lineColorStart, Color lineColorEnd) public TabletData(IGuiDrawable entryBackground, boolean shouldGlow, ResourceLocation texture, Color lineColor, Color lineColorActive)
{ {
this.entryBackground = entryBackground; this.entryBackground = entryBackground;
this.shouldGlow = shouldGlow; this.shouldGlow = shouldGlow;
this.texture = texture; this.texture = texture;
this.lineColorStart = lineColorStart; this.lineColor = lineColor;
this.lineColorEnd = lineColorEnd; this.lineColorActive = lineColorActive;
} }
public IGuiDrawable getEntryBackground(IfEntry entry, int currentSteps) public IGuiDrawable getEntryBackground(IfEntry entry, int currentSteps)
...@@ -130,24 +130,24 @@ public class IfTier ...@@ -130,24 +130,24 @@ public class IfTier
this.texture = texture; this.texture = texture;
} }
public Color getLineColorStart() public Color getLineColor()
{ {
return lineColorStart; return lineColor;
} }
public void setLineColorStart(Color lineColorStart) public void setLineColor(Color lineColor)
{ {
this.lineColorStart = lineColorStart; this.lineColor = lineColor;
} }
public Color getLineColorEnd() public Color getLineColorActive()
{ {
return lineColorEnd; return lineColorActive;
} }
public void setLineColorEnd(Color lineColorEnd) public void setLineColorActive(Color lineColorActive)
{ {
this.lineColorEnd = lineColorEnd; this.lineColorActive = lineColorActive;
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment