Skip to content

Commit 615e10f

Browse files
committed
Adjusted some values and fixed some small issues
Removed KurintoSans-Rg.ttf for now to reduce file size Fixed blur working for guis.
1 parent fbfa96e commit 615e10f

17 files changed

Lines changed: 83 additions & 13 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Project Mithras
1+
# Mithras
22

3-
Project Mithras is a 1.20.1 Minecraft Fabric mod for Hypixel Skyblock.
3+
Mithras is a 1.20.1 Minecraft Fabric mod for Hypixel Skyblock.
44

55
This mod is designed to be in compliance with the
66
[Hypixel Server Rules](https://support.hypixel.net/hc/en-us/articles/6472550754962-Allowed-Modifications).

src/main/java/floppacoding/mithras/mixin/gui/ScreenMixin.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import floppacoding.mithras.utils.ScreenMixinDuck;
88
import net.minecraft.client.gui.AbstractParentElement;
99
import net.minecraft.client.gui.DrawContext;
10+
import net.minecraft.client.gui.Drawable;
1011
import net.minecraft.client.gui.screen.Screen;
1112
import org.spongepowered.asm.mixin.*;
1213
import org.spongepowered.asm.mixin.injection.At;
@@ -28,6 +29,7 @@
2829
*/
2930
@Mixin(Screen.class)
3031
public abstract class ScreenMixin extends AbstractParentElement implements ScreenMixinDuck {
32+
@Shadow @Final private List<Drawable> drawables;
3133
@Unique private final ArrayList<GuiElement> elements = new ArrayList<>();
3234
@Unique private float elementScale = (float) mc.getWindow().getScaleFactor();
3335
@Unique private boolean isVanillaGui = true;
@@ -58,6 +60,11 @@ public void mithras_setIsVanillaGui(boolean state) {
5860
isVanillaGui = state;
5961
}
6062

63+
@Override
64+
public List<Drawable> mithras_getDrawables() {
65+
return this.drawables;
66+
}
67+
6168
@Inject(method = "init()V", at = @At("TAIL"))
6269
private void onInit(CallbackInfo ci) {
6370
// TODO any initialization / resizing goes here

src/main/java/floppacoding/mithras/utils/ScreenMixinDuck.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package floppacoding.mithras.utils;
22

33
import floppacoding.mithras.ui.core.elements.GuiElement;
4+
import net.minecraft.client.gui.Drawable;
45

56
import java.util.List;
67

@@ -14,4 +15,6 @@ public interface ScreenMixinDuck {
1415

1516
// TODO replace with IsMidFrame and other stuff??? Probably a good idea!
1617
void mithras_setIsVanillaGui(boolean state);
18+
19+
List<Drawable> mithras_getDrawables();
1720
}

src/main/kotlin/floppacoding/aurora/core/Aurora.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ object Aurora: Renderer2D, FontRender2D by AuroraFontRenderer {
3737
var useMSAA = true
3838
private set
3939
private var scissorBox: BoundingBox? = null
40+
private var pausedScissorBox: BoundingBox? = null
4041

4142
override fun setMaxDeviation(deviation: Float) {
4243
requiredPrecision = abs(1/deviation)
@@ -481,6 +482,16 @@ object Aurora: Renderer2D, FontRender2D by AuroraFontRenderer {
481482
scissorBox = null
482483
}
483484

485+
override fun pauseScissor() {
486+
pausedScissorBox = scissorBox
487+
scissorBox = null
488+
}
489+
490+
override fun resumeScissor() {
491+
scissorBox = pausedScissorBox
492+
pausedScissorBox = null
493+
}
494+
484495
/**
485496
* Interpolates texture coordinates for the given [position] inside the rectangle defined by its origin [r0] with
486497
* the given [dimensions]. [uv0] is assumed to be the texture coordiante at [r0] and [uv1] the texture coordinate at

src/main/kotlin/floppacoding/aurora/core/Renderer2D.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,18 @@ interface Renderer2D : FontRender2D {
425425
*/
426426
fun endScissor()
427427

428+
/**
429+
* Disables scissoring.
430+
* Stores the scissor state internally to be resumed with [resumeScissor].
431+
*/
432+
fun pauseScissor()
433+
434+
/**
435+
* Resumes the previously paused scissor state.
436+
* @see pauseScissor
437+
*/
438+
fun resumeScissor()
439+
428440
/**
429441
* Begins drawing custom geometry.
430442
*/

src/main/kotlin/floppacoding/mithras/Mithras.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ object Mithras : ModInitializer {
3636
@JvmStatic
3737
val logger: Logger = LoggerFactory.getLogger("mithras")
3838
const val MOD_ID = "mithras"
39-
const val MOD_NAME = "Project Mithras"
39+
const val MOD_NAME = "Mithras"
4040
const val MOD_VERSION = "0.0.1"
41-
const val CHAT_PREFIX = "§6§lProject §r§eMithras §6§l»§r"
41+
const val CHAT_PREFIX = "§r§eMithras §6§l»§r"
4242
const val SHORT_PREFIX = "§6§lF§r§eC §6§l»§r"
4343
const val RESOURCE_DOMAIN = "mithras"
4444
const val CONFIG_DOMAIN = "mithras"
@@ -83,7 +83,7 @@ object Mithras : ModInitializer {
8383
// This code runs as soon as Minecraft is in a mod-load-ready state.
8484
// However, some things (like resources) may still be uninitialized.
8585
// Proceed with mild caution.
86-
logger.info("Initializing Project Mithras")
86+
logger.info("Initializing Mithras")
8787

8888
// Important for orbit, I don't yet know why
8989
EVENT_BUS.registerLambdaFactory("floppacoding.mithras") { lookupInMethod, klass ->

src/main/kotlin/floppacoding/mithras/commands/impl/MainCommand.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ object MainCommand : Command() {
7979
newValue.toDoubleOrNull()?.let { setting.doubleValue = it }
8080
}
8181
is BooleanSetting -> {
82-
newValue.toBooleanStrictOrNull()?.let { setting.value = it }
82+
if (newValue == "toggle") {
83+
setting.value = !setting.value
84+
}else {
85+
newValue.toBooleanStrictOrNull()?.let { setting.value = it }
86+
}
8387
}
8488
is ColorSetting -> {
8589
when(newValue) {

src/main/kotlin/floppacoding/mithras/module/impl/dungeon/DungeonMap.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ object DungeonMap : Module(
3636
val mapBackground = ColorSetting("Background", Color(0, 0, 0, 100),true, visibility = Visibility.ADVANCED_ONLY, description = "Background Color for the map.")
3737
val mapBorder = ColorSetting("Border", Color(0, 0, 0, 255),true, visibility = Visibility.ADVANCED_ONLY, description = "Border Color for the map.")
3838
val chromaBorder = BooleanSetting("Chroma Border", true, visibility = Visibility.ADVANCED_ONLY, description = "Will add a chroma effect to your map border. The chroma can be configured in the ClickGui Module.")
39-
val mapBorderWidth = NumberSetting("Border Width",3.0f,0.0f,10.0f,0.1f, visibility = Visibility.ADVANCED_ONLY, description = "Map border width.")
39+
val mapBorderWidth = NumberSetting("Border Width",0.9f,0.0f,10.0f,0.1f, visibility = Visibility.ADVANCED_ONLY, description = "Map border width.")
4040

4141

4242

src/main/kotlin/floppacoding/mithras/module/impl/keybinds/KeyBind.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import floppacoding.mithras.utils.ChatUtils
1212
class KeyBind(name: String) : Module(name, category = Category.KEY_BIND){
1313

1414
val bindName = StringSetting("Name", this.name, description = "The name of this Key Bind that will be shown on the toggle button in the GUI.")
15-
private val message = StringSetting("Message","",50, description = "Message to be sent. For commands start the message with \"/\".")
15+
private val message = StringSetting("Message","",100, description = "Message to be sent. For commands start the message with \"/\".")
1616
private val removeButton = ActionSetting("Remove Key Bind", visibility = Visibility.ADVANCED_ONLY, description = "Removes the Key Bind."){
1717
ModuleManager.removeKeyBind(this@KeyBind)
1818
}

src/main/kotlin/floppacoding/mithras/module/impl/render/MainSettings.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package floppacoding.mithras.module.impl.render
22

3+
import floppacoding.aurora.core.shader.Shader
34
import floppacoding.mithras.Mithras
45
import floppacoding.mithras.Mithras.mc
56
import floppacoding.mithras.module.AlwaysActive
@@ -9,7 +10,6 @@ import floppacoding.mithras.module.settings.Setting.Companion.onSet
910
import floppacoding.mithras.module.settings.Setting.Companion.withInputTransform
1011
import floppacoding.mithras.module.settings.Visibility
1112
import floppacoding.mithras.module.settings.impl.*
12-
import floppacoding.aurora.core.shader.Shader
1313
import org.lwjgl.glfw.GLFW
1414
import java.awt.Color
1515

@@ -36,15 +36,19 @@ object MainSettings: Module(
3636
val blur: BooleanSetting = +BooleanSetting("Blur", false, description = "Toggles the background blur for the gui.")
3737
val color = +ColorSetting("Color", Color(255,200,0), false, description = "Color theme in the gui.")
3838
val colorSettingMode = +SelectorSetting("Color Mode", ColorMode.HSB, description = "Mode for all color settings in the gui. Changes the way colors are put in.")
39-
val clientName: StringSetting = +StringSetting("Name", "Project Mithras", description = "Name that will be rendered in the gui.")
39+
val clientName: StringSetting = +StringSetting("Name", "Mithras", description = "Name that will be rendered in the gui.")
4040
val prefixStyle = +SelectorSetting("Prefix Style", PrefixStyle.LONG, description = "Chat prefix selection for mod messages.")
41-
val customPrefix = +StringSetting("Custom Prefix", "§0§l[§4§Project Mithras§0§l]§r", 40, description = "You can set a custom chat prefix that will be used when Custom is selected in the Prefix Style dropdown.")
41+
val customPrefix = +StringSetting("Custom Prefix", "§0§l[§4§Mithras§0§l]§r", 40, description = "You can set a custom chat prefix that will be used when Custom is selected in the Prefix Style dropdown.")
42+
@Suppress("unused") // These never need to be referenced as they update everything on their own.
4243
val chromaSize by NumberSetting("Chroma Size", 0.5f, 0.0f, 1.0f, 0.01f, description = "Determines how rapidly the chroma pattern changes spatially.")
4344
.onSet { size -> Shader.setChromaSize(size) }
45+
@Suppress("unused")
4446
val chromaSpeed by NumberSetting("Chroma Speed", 0.5f, 0.0f, 1.0f, 0.01f, description = "Determines how fast the chroma changes with time.")
4547
.onSet { speed -> Shader.setChromaSpeed(speed) }
48+
@Suppress("unused")
4649
val chromaAngle by NumberSetting("Chroma Angle", 45.0f, 0.0f, 360.0f, 1.0f, description = "Determines the direction in which the chroma changes on your screen.")
4750
.onSet { angle -> Shader.setChromaAngle(angle) }
51+
@Suppress("unused")
4852
val showUsageInfo = +BooleanSetting("Usage Info", true, visibility = Visibility.ADVANCED_ONLY, description = "Show info on how to use the GUI.")
4953
val apiKey = +StringSetting("API Key", "", length = 100, visibility = Visibility.HIDDEN).withInputTransform { apiKey: String ->
5054
Mithras.apiHttpClient.updateAPIKey(apiKey)

0 commit comments

Comments
 (0)