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

Method drawSelectionBox

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

Source from the content-addressed store, hash-verified

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