|
1 | 1 | package xyz.bluspring.unitytranslate.client.gui |
2 | 2 |
|
3 | | -//? if >= 1.20.6 { |
4 | | -/*import xyz.bluspring.unitytranslate.network.payloads.SetUsedLanguagesPayload |
| 3 | +//? if < 1.21.4 { |
| 4 | +//?} else { |
| 5 | +/*import net.minecraft.util.ARGB |
5 | 6 | *///?} |
6 | 7 | import net.minecraft.client.Minecraft |
7 | 8 | import net.minecraft.client.gui.GuiGraphics |
8 | 9 | import net.minecraft.client.gui.components.Button |
9 | 10 | import net.minecraft.client.gui.screens.Screen |
10 | 11 | import net.minecraft.network.chat.CommonComponents |
11 | 12 | import net.minecraft.network.chat.Component |
12 | | -import net.minecraft.util.FastColor |
13 | 13 | import net.minecraft.util.Mth |
14 | 14 | import org.lwjgl.glfw.GLFW |
15 | 15 | import xyz.bluspring.unitytranslate.UnityTranslate |
16 | 16 | import xyz.bluspring.unitytranslate.client.UnityTranslateClient |
17 | 17 | import xyz.bluspring.unitytranslate.network.UTClientNetworking |
18 | 18 | import java.util.* |
| 19 | +import net.minecraft.util.FastColor.ARGB32 as ARGB |
19 | 20 |
|
20 | 21 | class EditTranscriptBoxesScreen(val boxes: MutableList<TranscriptBox>, val parent: Screen? = null) : Screen(Component.empty()) { |
21 | 22 | val CLOSE_BUTTON = UnityTranslate.id("textures/gui/close.png") |
@@ -105,42 +106,42 @@ class EditTranscriptBoxesScreen(val boxes: MutableList<TranscriptBox>, val paren |
105 | 106 | if (mouseX >= box.x - 1 && mouseY >= box.y - 1 && mouseX <= box.x + box.width + 1 && mouseY <= box.y + box.height + 1) { |
106 | 107 | if (mouseX >= box.x - 1 && mouseX <= box.x + 1) { |
107 | 108 | if (mouseY >= box.y - 1 && mouseY <= box.y + 1) { |
108 | | - guiGraphics.fill(box.x, box.y - 1, box.x + box.width, box.y + 1, FastColor.ARGB32.color(255, 255, 255, 255)) |
| 109 | + guiGraphics.fill(box.x, box.y - 1, box.x + box.width, box.y + 1, ARGB.color(255, 255, 255, 255)) |
109 | 110 | GLFW.glfwSetCursor(this.minecraft!!.window.window, assignCursor(GLFW.GLFW_RESIZE_NWSE_CURSOR)) |
110 | 111 | } else if (mouseY >= box.y + box.height - 1 && mouseY <= box.y + box.height + 1) { |
111 | | - guiGraphics.fill(box.x, box.y + box.height - 1, box.x + box.width, box.y + box.height + 1, FastColor.ARGB32.color(255, 255, 255, 255)) |
| 112 | + guiGraphics.fill(box.x, box.y + box.height - 1, box.x + box.width, box.y + box.height + 1, ARGB.color(255, 255, 255, 255)) |
112 | 113 | GLFW.glfwSetCursor(this.minecraft!!.window.window, assignCursor(GLFW.GLFW_RESIZE_NESW_CURSOR)) |
113 | 114 | } else { |
114 | 115 | GLFW.glfwSetCursor(this.minecraft!!.window.window, assignCursor(GLFW.GLFW_HRESIZE_CURSOR)) |
115 | 116 | } |
116 | 117 |
|
117 | | - guiGraphics.fill(box.x - 1, box.y, box.x + 1, box.y + box.height, FastColor.ARGB32.color(255, 255, 255, 255)) |
| 118 | + guiGraphics.fill(box.x - 1, box.y, box.x + 1, box.y + box.height, ARGB.color(255, 255, 255, 255)) |
118 | 119 | } else if (mouseX >= box.x + box.width - 1 && mouseX <= box.x + box.width + 1) { |
119 | 120 | if (mouseY >= box.y - 1 && mouseY <= box.y + 1) { |
120 | | - guiGraphics.fill(box.x, box.y - 1, box.x + box.width, box.y + 1, FastColor.ARGB32.color(255, 255, 255, 255)) |
| 121 | + guiGraphics.fill(box.x, box.y - 1, box.x + box.width, box.y + 1, ARGB.color(255, 255, 255, 255)) |
121 | 122 | GLFW.glfwSetCursor(this.minecraft!!.window.window, assignCursor(GLFW.GLFW_RESIZE_NESW_CURSOR)) |
122 | 123 | } else if (mouseY >= box.y + box.height - 1 && mouseY <= box.y + box.height + 1) { |
123 | | - guiGraphics.fill(box.x, box.y + box.height - 1, box.x + box.width, box.y + box.height + 1, FastColor.ARGB32.color(255, 255, 255, 255)) |
| 124 | + guiGraphics.fill(box.x, box.y + box.height - 1, box.x + box.width, box.y + box.height + 1, ARGB.color(255, 255, 255, 255)) |
124 | 125 | GLFW.glfwSetCursor(this.minecraft!!.window.window, assignCursor(GLFW.GLFW_RESIZE_NWSE_CURSOR)) |
125 | 126 | } else { |
126 | 127 | GLFW.glfwSetCursor(this.minecraft!!.window.window, assignCursor(GLFW.GLFW_HRESIZE_CURSOR)) |
127 | 128 | } |
128 | 129 |
|
129 | | - guiGraphics.fill(box.x + box.width - 1, box.y, box.x + box.width + 1, box.y + box.height, FastColor.ARGB32.color(255, 255, 255, 255)) |
| 130 | + guiGraphics.fill(box.x + box.width - 1, box.y, box.x + box.width + 1, box.y + box.height, ARGB.color(255, 255, 255, 255)) |
130 | 131 | } else if (mouseY >= box.y - 1 && mouseY <= box.y + 1) { |
131 | | - guiGraphics.fill(box.x, box.y - 1, box.x + box.width, box.y + 1, FastColor.ARGB32.color(255, 255, 255, 255)) |
| 132 | + guiGraphics.fill(box.x, box.y - 1, box.x + box.width, box.y + 1, ARGB.color(255, 255, 255, 255)) |
132 | 133 | GLFW.glfwSetCursor(this.minecraft!!.window.window, assignCursor(GLFW.GLFW_VRESIZE_CURSOR)) |
133 | 134 | } else if (mouseY >= box.y + box.height - 1 && mouseY <= box.y + box.height + 1) { |
134 | | - guiGraphics.fill(box.x, box.y + box.height - 1, box.x + box.width, box.y + box.height + 1, FastColor.ARGB32.color(255, 255, 255, 255)) |
| 135 | + guiGraphics.fill(box.x, box.y + box.height - 1, box.x + box.width, box.y + box.height + 1, ARGB.color(255, 255, 255, 255)) |
135 | 136 | GLFW.glfwSetCursor(this.minecraft!!.window.window, assignCursor(GLFW.GLFW_VRESIZE_CURSOR)) |
136 | 137 | } else { |
137 | | - guiGraphics.renderOutline(box.x, box.y, box.width, box.height, FastColor.ARGB32.color(255, 255, 255, 255)) |
| 138 | + guiGraphics.renderOutline(box.x, box.y, box.width, box.height, ARGB.color(255, 255, 255, 255)) |
138 | 139 |
|
139 | 140 | val offset = 5 |
140 | 141 | if (mouseX >= box.x + offset + 1 && mouseY >= box.y + offset + 1 && mouseX <= box.x + offset + 16 && mouseY <= box.y + offset + 16) { |
141 | 142 | GLFW.glfwSetCursor(this.minecraft!!.window.window, arrowCursor) |
142 | | - guiGraphics.fill(box.x + offset, box.y + offset, box.x + offset + 16, box.y + offset + 16, FastColor.ARGB32.color(95, 255, 0, 0)) |
143 | | - guiGraphics.renderOutline(box.x + offset, box.y + offset, 16, 16, FastColor.ARGB32.color(95, 255, 255, 255)) |
| 143 | + guiGraphics.fill(box.x + offset, box.y + offset, box.x + offset + 16, box.y + offset + 16, ARGB.color(95, 255, 0, 0)) |
| 144 | + guiGraphics.renderOutline(box.x + offset, box.y + offset, 16, 16, ARGB.color(95, 255, 255, 255)) |
144 | 145 | } else { |
145 | 146 | GLFW.glfwSetCursor(this.minecraft!!.window.window, assignCursor(GLFW.GLFW_RESIZE_ALL_CURSOR)) |
146 | 147 | } |
|
0 commit comments