Skip to content

Commit 872814a

Browse files
committed
Initial draft for menu bar
1 parent d234586 commit 872814a

File tree

17 files changed

+741
-60
lines changed

17 files changed

+741
-60
lines changed

src/main/java/com/lambda/mixin/CrashReportMixin.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ void injectConstructor(String message, Throwable cause, CallbackInfo ci) {
5454
@WrapMethod(method = "asString(Lnet/minecraft/util/crash/ReportType;Ljava/util/List;)Ljava/lang/String;")
5555
String injectString(ReportType type, List<String> extraInfo, Operation<String> original) {
5656
var list = new ArrayList<>(extraInfo);
57-
58-
list.add("If this issue is related to Lambda, check if other users have experienced this too, or create a new issue at https://github.com/lambda-client/lambda/issues.\n\n");
57+
list.add("If this issue is related to Lambda, check if other users have experienced this too, or create a new issue at " + Lambda.REPO_URL + "/issues.\n\n");
5958

6059
if (MinecraftClient.getInstance() != null) {
6160
list.add("Enabled modules:");

src/main/kotlin/com/lambda/Lambda.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ object Lambda : ClientModInitializer {
5151
const val MOD_ID = "lambda"
5252
const val SYMBOL = "λ"
5353
const val APP_ID = "1221289599427416127"
54+
const val REPO_URL = "https://github.com/lambda-client/lambda"
5455
val VERSION: String = FabricLoader.getInstance()
5556
.getModContainer("lambda").orElseThrow()
5657
.metadata.version.friendlyString

src/main/kotlin/com/lambda/gui/DearImGui.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import com.lambda.module.modules.client.GuiSettings
2626
import com.lambda.util.path
2727
import com.mojang.blaze3d.opengl.GlStateManager
2828
import com.mojang.blaze3d.systems.RenderSystem
29+
import imgui.ImFontConfig
30+
import imgui.ImFontGlyphRangesBuilder
2931
import imgui.ImGui
3032
import imgui.ImGuiIO
3133
import imgui.flag.ImGuiConfigFlags
@@ -54,9 +56,13 @@ object DearImGui : Loadable {
5456
private fun updateScale(scale: Float) {
5557
io.fonts.clear()
5658
val baseFontSize = 13f
57-
io.fonts.addFontFromFileTTF("fonts/FiraSans-Regular.ttf".path, baseFontSize * scale)
59+
val glyphRanges = ImFontGlyphRangesBuilder().apply {
60+
addRanges(io.fonts.glyphRangesDefault)
61+
addRanges(io.fonts.glyphRangesGreek)
62+
addChar('') // U+2934 for external links
63+
}.buildRanges()
64+
io.fonts.addFontFromFileTTF("fonts/FiraSans-Regular.ttf".path, baseFontSize * scale, ImFontConfig(), glyphRanges)
5865
io.fonts.build()
59-
6066
implGl3.createFontsTexture()
6167
}
6268

src/main/kotlin/com/lambda/gui/LambdaScreen.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ import net.minecraft.client.gui.DrawContext
2222
import net.minecraft.client.gui.screen.Screen
2323
import net.minecraft.text.Text
2424

25-
26-
object LambdaScreen : Screen(Text.of("")) {
25+
object LambdaScreen : Screen(Text.of("Lambda")) {
2726
override fun shouldPause() = false
2827
override fun removed() = ClickGui.disable()
2928
override fun render(context: DrawContext?, mouseX: Int, mouseY: Int, deltaTicks: Float) {}

0 commit comments

Comments
 (0)