MCPcopy Create free account
hub / github.com/5zig/The-5zig-Mod / drawSelectionBox

Method drawSelectionBox

Minecraft-Utils/1.13/src/FileSelector.java:198–234  ·  view source on GitHub ↗
(int x, int y, int mouseX, int mouseY)

Source from the content-addressed store, hash-verified

196 }
197
198 protected void drawSelectionBox(int x, int y, int mouseX, int mouseY) {
199 int rows = (int) Math.ceil((double) files.size() / (double) columnCount);
200 int columns = columnCount;
201 cub tessellator = cub.a();
202 ctf worldRenderer = tessellator.c();
203
204 for (int i = 0; i < rows; ++i) {
205 int ny = y + i * getSlotHeight();
206 int padding = getSlotHeight() - 4;
207 //if (ny > bottom || ny + padding < top) {
208 //this.a(i, var, ny);
209 //}
210 for (int j = 0; j < columnCount; j++) {
211 int nx = x + j * selectionBoxWidth;
212 int nx1 = nx + selectionBoxWidth;
213
214 int id = j + i * columns;
215 if (isSelected(id)) { // isSelected
216 GLUtil.color(1.0F, 1.0F, 1.0F, 1.0F);
217 ctp.z();
218 worldRenderer.a(7, ddk.o);
219 worldRenderer.b((double) nx, (double) (ny + padding + 2), 0.0D).a(0.0D, 1.0D).b(128, 128, 128, 255).d();
220 worldRenderer.b((double) nx1, (double) (ny + padding + 2), 0.0D).a(1.0D, 1.0D).b(128, 128, 128, 255).d();
221 worldRenderer.b((double) nx1, (double) (ny - 2), 0.0D).a(1.0D, 0.0D).b(128, 128, 128, 255).d();
222 worldRenderer.b((double) nx, (double) (ny - 2), 0.0D).a(0.0D, 0.0D).b(128, 128, 128, 255).d();
223 worldRenderer.b((double) (nx + 1), (double) (ny + padding + 1), 0.0D).a(0.0D, 1.0D).b(0, 0, 0, 255).d();
224 worldRenderer.b((double) (nx1 - 1), (double) (ny + padding + 1), 0.0D).a(1.0D, 1.0D).b(0, 0, 0, 255).d();
225 worldRenderer.b((double) (nx1 - 1), (double) (ny - 1), 0.0D).a(1.0D, 0.0D).b(0, 0, 0, 255).d();
226 worldRenderer.b((double) (nx + 1), (double) (ny - 1), 0.0D).a(0.0D, 0.0D).b(0, 0, 0, 255).d();
227 tessellator.b();
228 ctp.y();
229 }
230 drawSlot(id, nx, ny, padding, mouseX, mouseY);
231 }
232 }
233
234 }
235
236 protected void drawSlot(int id, int x, int y, int padding, int mouseX, int mouseY) {
237 File file = getFile(id);

Callers 1

drawMethod · 0.95

Calls 9

getSlotHeightMethod · 0.95
isSelectedMethod · 0.95
colorMethod · 0.95
drawSlotMethod · 0.95
sizeMethod · 0.80
aMethod · 0.45
cMethod · 0.45
dMethod · 0.45
bMethod · 0.45

Tested by

no test coverage detected