(float partialTicks)
| 334 | } |
| 335 | |
| 336 | private void drawOpen(float partialTicks) { |
| 337 | // Draw the pages |
| 338 | mc.renderEngine.bindTexture(LEFT_PAGE); |
| 339 | PAGE_LEFT.drawAt(minX, minY); |
| 340 | |
| 341 | mc.renderEngine.bindTexture(RIGHT_PAGE); |
| 342 | PAGE_RIGHT.drawAt(minX + PAGE_LEFT.width, minY); |
| 343 | |
| 344 | isOverHover = PEN_HIDDEN_AREA.offset(minX, minY).contains(mouse); |
| 345 | |
| 346 | // Now draw the actual contents of the book |
| 347 | String title = currentPage.getTitle(); |
| 348 | if (title != null) { |
| 349 | int x = /* this.minX + */ (width - currentFont.getStringWidth(title)) / 2; |
| 350 | currentFont.drawString(title, x, minY + 12, 0); |
| 351 | } |
| 352 | |
| 353 | tooltipStack = null; |
| 354 | setupFontRenderer(); |
| 355 | for (GuideChapter chapter : chapters) { |
| 356 | chapter.reset(); |
| 357 | } |
| 358 | |
| 359 | currentPage.renderFirstPage(minX + PAGE_LEFT_TEXT.x, minY + PAGE_LEFT_TEXT.y, PAGE_LEFT_TEXT.width, PAGE_LEFT_TEXT.height); |
| 360 | currentPage.renderSecondPage(minX + PAGE_LEFT.width + PAGE_RIGHT_TEXT.x, minY + PAGE_RIGHT_TEXT.y, PAGE_RIGHT_TEXT.width, PAGE_RIGHT_TEXT.height); |
| 361 | |
| 362 | int chapterIndex = 0; |
| 363 | for (GuideChapter chapter : chapters) { |
| 364 | chapter.draw(chapterIndex, partialTicks); |
| 365 | chapterIndex++; |
| 366 | } |
| 367 | |
| 368 | // Draw the back button if there are any pages on the stack |
| 369 | if (!pages.isEmpty()) { |
| 370 | GuiIcon icon = BACK; |
| 371 | IPositionedElement position = BACK_POSITION.offset(minX, minY); |
| 372 | if (position.contains(mouse)) { |
| 373 | icon = BACK_HOVERED; |
| 374 | } |
| 375 | icon.drawAt(position); |
| 376 | } |
| 377 | |
| 378 | // Reset the colour for the pen |
| 379 | GlStateManager.color(1, 1, 1); |
| 380 | |
| 381 | // Draw the pen |
| 382 | if (isEditing) { |
| 383 | mc.renderEngine.bindTexture(ICONS_2); |
| 384 | |
| 385 | if (isOverHover) { |
| 386 | PEN_UP.drawAt(mouse.getX() - PEN_UP.width / 2, mouse.getY() - PEN_UP.height); |
| 387 | } else { |
| 388 | PEN_ANGLED.drawAt(mouse.getX() - 2, mouse.getY() - PEN_ANGLED.height - 2); |
| 389 | } |
| 390 | } else { |
| 391 | int h = (int) (hoverStageLast * (1 - partialTicks) + hoverStageNext * partialTicks); |
| 392 | |
| 393 | // Draw pen |
no test coverage detected