1+ package com.lambda.client.gui.mc
2+
3+ import net.minecraft.client.gui.GuiButton
4+ import net.minecraft.client.gui.GuiMainMenu
5+ import net.minecraft.client.gui.GuiOptionButton
6+ import net.minecraft.client.gui.GuiScreen
7+ import net.minecraft.client.resources.I18n
8+
9+ class LambdaGuiIncompat : GuiScreen () {
10+
11+ override fun initGui () {
12+ buttonList.clear()
13+ // I used the minecraft "Out of Memory" class as a reference, turns out it has exactly the buttons I need, with internationalization support too
14+ buttonList.add(GuiOptionButton (0 , width / 2 - 155 , height / 4 + 120 , I18n .format(" gui.toTitle" , * arrayOfNulls(0 ))))
15+ buttonList.add(GuiOptionButton (1 , width / 2 - 155 + 160 , height / 4 + 120 , I18n .format(" menu.quit" , * arrayOfNulls(0 ))))
16+ }
17+
18+ override fun actionPerformed (button : GuiButton ) {
19+ if (button.id == 0 ) {
20+ mc.displayGuiScreen(GuiMainMenu ())
21+ } else if (button.id == 1 ) {
22+ mc.shutdown()
23+ }
24+ }
25+
26+ override fun drawScreen (mouseX : Int , mouseY : Int , partialTicks : Float ) {
27+ drawDefaultBackground()
28+ drawCenteredString(fontRenderer, " Found KAMI Blue!" , width / 2 , height / 4 - 60 + 20 , 16777215 )
29+ drawString(fontRenderer, " It appears you are using KAMI Blue alongside Lambda Client." , width / 2 - 140 , height / 4 - 60 + 60 + 0 , 10526880 )
30+ drawString(fontRenderer, " Lambda Client is a continued version of KAMI Blue," , width / 2 - 140 , height / 4 - 60 + 60 + 18 , 10526880 )
31+ drawString(fontRenderer, " and is not compatible as a result." , width / 2 - 140 , height / 4 - 60 + 60 + 27 , 10526880 )
32+ drawString(fontRenderer, " It is not recommended to use both clients" , width / 2 - 140 , height / 4 - 60 + 60 + 45 , 10526880 )
33+ drawString(fontRenderer, " together, since many modules will override each other." , width / 2 - 140 , height / 4 - 60 + 60 + 54 , 10526880 )
34+ drawString(fontRenderer, " You may continue, but it may cause serious issues," , width / 2 - 140 , height / 4 - 60 + 60 + 63 , 10526880 )
35+ drawString(fontRenderer, " and support will not be provided to dual users." , width / 2 - 140 , height / 4 - 60 + 60 + 72 , 10526880 )
36+ super .drawScreen(mouseX, mouseY, partialTicks)
37+ }
38+ }
0 commit comments