-
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.
- Loading branch information
1 parent
cbebe40
commit bdab685
Showing
5 changed files
with
63 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,30 @@ | ||
/run/ | ||
/out/ | ||
/build/ | ||
/.settings/ | ||
/bin/ | ||
/.gradle/ | ||
/.iml/ | ||
/.ipr/ | ||
/.iws/ | ||
# eclipse | ||
eclipse | ||
bin | ||
*.launch | ||
.settings | ||
.metadata | ||
.classpath | ||
.project | ||
|
||
# idea | ||
out | ||
classes | ||
*.ipr | ||
*.iws | ||
*.iml | ||
.idea | ||
|
||
# gradle | ||
build | ||
.gradle | ||
|
||
#Netbeans | ||
.nb-gradle | ||
.nb-gradle-properties | ||
|
||
# other | ||
run | ||
.DS_Store | ||
Thumbs.db | ||
.env |
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
7 changes: 5 additions & 2 deletions
7
src/main/java/net/minusmc/discordrpcplugin/DiscordRPCPlugin.kt
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
25 changes: 22 additions & 3 deletions
25
src/main/java/net/minusmc/discordrpcplugin/GuiDiscordRPC.kt
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,13 +1,32 @@ | ||
package net.minusmc.discordrpcplugin | ||
|
||
import net.minecraft.client.gui.GuiButton | ||
import net.minecraft.client.gui.GuiScreen | ||
import net.minusmc.minusbounce.ui.client.BoolButton | ||
import net.minusmc.minusbounce.ui.font.Fonts | ||
import net.minusmc.minusbounce.utils.render.RenderUtils | ||
import java.awt.Color | ||
|
||
class GuiKeybindHelper(private val prevGui: GuiScreen) : GuiScreen() { | ||
class GuiDiscordRPC(private val prevGui: GuiScreen) : GuiScreen() { | ||
override fun initGui() { | ||
buttonList.add(GuiButton(1, width / 2 + 40, height / 3, "ON")) | ||
buttonList.add(BoolButton(0, width / 2 + 100, height / 2 - 60, DiscordRPCPlugin.clientRichPresence.showRichPresenceValue)) | ||
} | ||
|
||
override fun drawScreen(mouseX: Int, mouseY: Int, partialTicks: Float) { | ||
Fonts.font40.drawString("Enable", width / 2 - 100, (height / 3 - mc.fontRendererObj.FONT_HEIGHT * 2).toFloat(), 0xffffff, false) | ||
drawBackground(0) | ||
RenderUtils.drawRoundedRect((width / 2 - 200).toFloat(), (height / 2 - 120).toFloat(), (width / 2 + 200).toFloat(), (height / 2 + 120).toFloat(), 4f, Color(249, 246, 238, 120).rgb) | ||
Fonts.font72.drawCenteredString("Discord RPC Settings", width.toFloat() / 2f, (height / 2 - mc.fontRendererObj.FONT_HEIGHT - 90).toFloat(), Color(54, 69, 79).rgb, false) | ||
Fonts.font50.drawString("Enable", (width / 2 - 140).toFloat(), (height / 2 - 56).toFloat(), Color(54, 69, 79).rgb, false) | ||
super.drawScreen(mouseX, mouseY, partialTicks) | ||
} | ||
|
||
override fun actionPerformed(button: GuiButton) { | ||
when (button.id) { | ||
0 -> { | ||
val button = button as BoolButton | ||
button.state = !button.state | ||
DiscordRPCPlugin.clientRichPresence.showRichPresenceValue = !DiscordRPCPlugin.clientRichPresence.showRichPresenceValue | ||
} | ||
} | ||
} | ||
} |