generated from neoforged/MDK
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Twitch voting and more events
- Loading branch information
Showing
59 changed files
with
1,439 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
src/main/java/dev/katcodes/forgedentropy/client/UIStyles/GTAVUIRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
package dev.katcodes.forgedentropy.client.UIStyles; | ||
|
||
import dev.katcodes.forgedentropy.client.VotingClient; | ||
import net.minecraft.client.gui.GuiGraphics; | ||
import net.minecraft.util.FastColor; | ||
|
||
import static java.lang.Math.floor; | ||
|
||
public class GTAVUIRenderer implements UIRenderer{ | ||
|
||
public final VotingClient votingClient; | ||
//todo: Add voting client to client | ||
public GTAVUIRenderer() { | ||
|
||
public GTAVUIRenderer(VotingClient client) { | ||
this.votingClient=client; | ||
} | ||
|
||
@Override | ||
public void renderTimer(GuiGraphics guiGraphics, int width, double time, double timerDuration) { | ||
|
||
guiGraphics.fill(0,0,width,10,150 << 24); | ||
guiGraphics.fill(0,0, (int) floor(width*(time/timerDuration)),10, FastColor.ARGB32.color(255,70,150,70)); //(this.votingClient != null ? votingClient.getColor(255) : ColorHelper.Argb.getArgb(255,70,150,70))); | ||
guiGraphics.fill(0,0, (int) floor(width*(time/timerDuration)),10, (this.votingClient != null ? votingClient.getColor(255) : FastColor.ARGB32.color(255,70,150,70))); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/dev/katcodes/forgedentropy/client/UIStyles/MinecraftUIRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package dev.katcodes.forgedentropy.client.UIStyles; | ||
|
||
|
||
import dev.katcodes.forgedentropy.mixin.BossBarAccessor; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.GuiGraphics; | ||
import net.minecraft.client.gui.components.BossHealthOverlay; | ||
import net.minecraft.client.gui.components.LerpingBossEvent; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.world.BossEvent; | ||
|
||
import java.util.UUID; | ||
|
||
public class MinecraftUIRenderer implements UIRenderer { | ||
net.minecraft.client.gui.components.LerpingBossEvent bar; | ||
|
||
public MinecraftUIRenderer() { | ||
UUID uuid= UUID.randomUUID(); | ||
this.bar=new LerpingBossEvent(uuid, Component.translatable("entropy.title"),0, BossEvent.BossBarColor.GREEN, BossEvent.BossBarOverlay.NOTCHED_20,false,false,false); | ||
((BossBarAccessor) Minecraft.getInstance().gui.getBossOverlay()).getEvents().put(uuid,bar); | ||
} | ||
@Override | ||
public void renderTimer(GuiGraphics guiGraphics, int width, double time, double timerDuration) { | ||
this.bar.setProgress((float) (time/timerDuration)); | ||
|
||
} | ||
//private final BossB | ||
} |
Oops, something went wrong.