Big Progress for Dynamic Bars
This commit is contained in:
@@ -11,7 +11,7 @@ I then remembered when one of my friends (BearCat865) suggested making a Dungeon
|
|||||||
# Roadmap
|
# Roadmap
|
||||||
_Currently in super beta so don't expect something working for a while._
|
_Currently in super beta so don't expect something working for a while._
|
||||||
- Right shift menu to enable and disable mods (90%)
|
- Right shift menu to enable and disable mods (90%)
|
||||||
- Health & Food bars replaced with dynamic bar similar to EXP bar (0%)
|
- Health & Food bars replaced with dynamic bar similar to EXP bar (40%)
|
||||||
- Custom GUIs (0%)
|
- Custom GUIs (0%)
|
||||||
- Built-in guide (CANCELED) **This feature is being worked on in a different mod called "Mythicfy", so it will not be added to this one. We recommend you download that mod.**
|
- Built-in guide (CANCELED) **This feature is being worked on in a different mod called "Mythicfy", so it will not be added to this one. We recommend you download that mod.**
|
||||||
- Auto-Welcome (20%) **WARNING: This feature may prove to be annoying, in which case we will remove it.**
|
- Auto-Welcome (20%) **WARNING: This feature may prove to be annoying, in which case we will remove it.**
|
||||||
|
|||||||
@@ -6,10 +6,8 @@ import net.fabricmc.api.ClientModInitializer
|
|||||||
|
|
||||||
object SciFyClient : ClientModInitializer {
|
object SciFyClient : ClientModInitializer {
|
||||||
override fun onInitializeClient() {
|
override fun onInitializeClient() {
|
||||||
// Runs the Hotkey().hotkeys() function which contains all keybindings.
|
|
||||||
Hotkey().hotkeys()
|
|
||||||
|
|
||||||
// Run the modules
|
// Run the modules
|
||||||
|
Hotkey().hotkeys()
|
||||||
AutoWelcome().autoWelcome()
|
AutoWelcome().autoWelcome()
|
||||||
FishingNotif().fishingNotif()
|
FishingNotif().fishingNotif()
|
||||||
Bars().bars()
|
Bars().bars()
|
||||||
|
|||||||
@@ -1,14 +1,35 @@
|
|||||||
package chickenmanfy.scify.modules
|
package chickenmanfy.scify.modules
|
||||||
|
|
||||||
var barsToggle: Boolean = false
|
import com.mojang.blaze3d.systems.RenderSystem
|
||||||
|
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback
|
||||||
|
import net.minecraft.client.gui.DrawContext
|
||||||
|
import net.minecraft.client.render.*
|
||||||
|
import net.minecraft.util.Identifier
|
||||||
|
|
||||||
|
var barsToggle: Boolean = true
|
||||||
class Bars {
|
class Bars {
|
||||||
fun toggleBars() {
|
fun toggleBars() {
|
||||||
barsToggle = !barsToggle
|
barsToggle = !barsToggle
|
||||||
}
|
}
|
||||||
|
|
||||||
fun bars() {
|
fun bars() {
|
||||||
if (barsToggle) {
|
HudRenderCallback.EVENT.register(HudRenderCallback { drawContext: DrawContext?, tickDelta: Float ->
|
||||||
return
|
val tessellator: Tessellator = Tessellator.getInstance()
|
||||||
}
|
val buffer: BufferBuilder = tessellator.buffer
|
||||||
|
val positionMatrix = drawContext?.matrices?.peek()?.positionMatrix
|
||||||
|
if (barsToggle) {
|
||||||
|
buffer.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR_TEXTURE)
|
||||||
|
buffer.vertex(positionMatrix, 20F, 20F, 0F).color(1f, 1f, 1f, 1f).texture(0f, 0f).next()
|
||||||
|
buffer.vertex(positionMatrix, 20F, 60F, 0F).color(1f, 1f, 1f, 1f).texture(0f, 1f).next()
|
||||||
|
buffer.vertex(positionMatrix, 60F, 60F, 0F).color(1f, 1f, 1f, 1f).texture(1f, 1f).next()
|
||||||
|
buffer.vertex(positionMatrix, 60F, 20F, 0F).color(1f, 1f, 1f, 1f).texture(1f, 0f).next()
|
||||||
|
|
||||||
|
RenderSystem.setShader { GameRenderer.getPositionColorTexProgram() }
|
||||||
|
RenderSystem.setShaderTexture(0, Identifier("scify", "scify.png"))
|
||||||
|
RenderSystem.setShaderColor(1f, 1f, 1f, 1f)
|
||||||
|
|
||||||
|
tessellator.draw()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user