the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 670 lines 19 kB view raw
1#include "stdafx.h" 2#include "StatsScreen.h" 3#include "StatsCounter.h" 4#include "ItemRenderer.h" 5#include "Button.h" 6#include "Font.h" 7#include "Lighting.h" 8#include "..\Minecraft.World\net.minecraft.locale.h" 9#include "..\Minecraft.World\net.minecraft.stats.h" 10#include "..\Minecraft.World\net.minecraft.world.item.h" 11 12const float StatsScreen::SLOT_TEX_SIZE = 128.0f; 13ItemRenderer *StatsScreen::itemRenderer = NULL; 14 15StatsScreen::StatsScreen(Screen *lastScreen, StatsCounter *stats) 16{ 17 // 4J - added initialisers 18 itemRenderer = new ItemRenderer(); 19 statsList = NULL; 20 itemStatsList = NULL; 21 blockStatsList = NULL; 22 this->lastScreen = lastScreen; 23 this->stats = stats; 24} 25 26void StatsScreen::init() 27{ 28 title = I18n::get(L"gui.stats"); 29 30 statsList = new GeneralStatisticsList(this); 31 statsList->init(&buttons, 1, 1); 32 33 itemStatsList = new ItemStatisticsList(this); 34 itemStatsList->init(&buttons, 1, 1); 35 36 blockStatsList = new BlockStatisticsList(this); 37 blockStatsList->init(&buttons, 1, 1); 38 39 activeList = statsList; 40 41 postInit(); 42} 43 44void StatsScreen::postInit() 45{ 46 Language *language = Language::getInstance(); 47 buttons.push_back(new Button(BUTTON_CANCEL_ID, width / 2 + 4, height - 28, 150, 20, language->getElement(L"gui.done"))); 48 49 Button *blockButton, *itemButton; 50 51 buttons.push_back(new Button(BUTTON_STATS_ID, width / 2 - 154, height - 52, 100, 20, language->getElement(L"stat.generalButton"))); 52 buttons.push_back(blockButton = new Button(BUTTON_BLOCKITEMSTATS_ID, width / 2 - 46, height - 52, 100, 20, language->getElement(L"stat.blocksButton"))); 53 buttons.push_back(itemButton = new Button(BUTTON_ITEMSTATS_ID, width / 2 + 62, height - 52, 100, 20, language->getElement(L"stat.itemsButton"))); 54 55 if (blockStatsList->getNumberOfItems() == 0) 56 { 57 blockButton->active = false; 58 } 59 if (itemStatsList->getNumberOfItems() == 0) 60 { 61 itemButton->active = false; 62 } 63 64} 65 66void StatsScreen::buttonClicked(Button *button) 67{ 68 if (!button->active) return; 69 if (button->id == BUTTON_CANCEL_ID) 70 { 71 minecraft->setScreen(lastScreen); 72 } 73 else if (button->id == BUTTON_STATS_ID) 74 { 75 activeList = statsList; 76 } 77 else if (button->id == BUTTON_ITEMSTATS_ID) 78 { 79 activeList = itemStatsList; 80 } 81 else if (button->id == BUTTON_BLOCKITEMSTATS_ID) 82 { 83 activeList = blockStatsList; 84 } 85 else 86 { 87 activeList->buttonClicked(button); 88 } 89} 90 91void StatsScreen::render(int xm, int ym, float a) 92{ 93 activeList->render(xm, ym, a); 94 95 drawCenteredString(font, title, width / 2, 20, 0xffffff); 96 97 Screen::render(xm, ym, a); 98 99} 100 101 102StatsScreen::GeneralStatisticsList::GeneralStatisticsList(StatsScreen *ss) : ScrolledSelectionList(ss->minecraft, ss->width, ss->height, 32, ss->height - 64, 10) 103{ 104 parent = ss; 105 setRenderSelection(false); 106} 107 108int StatsScreen::GeneralStatisticsList::getNumberOfItems() 109{ 110 return (int)Stats::generalStats->size(); 111} 112 113void StatsScreen::GeneralStatisticsList::selectItem(int item, bool doubleClick) 114{ 115} 116 117bool StatsScreen::GeneralStatisticsList::isSelectedItem(int item) 118{ 119 return false; 120} 121 122int StatsScreen::GeneralStatisticsList::getMaxPosition() 123{ 124 return getNumberOfItems() * 10; 125} 126 127void StatsScreen::GeneralStatisticsList::renderBackground() 128{ 129 parent->renderBackground(); // 4J - was StatsScreen.this.renderBackground(); 130} 131 132void StatsScreen::GeneralStatisticsList::renderItem(int i, int x, int y, int h, Tesselator *t) 133{ 134 Stat *stat = Stats::generalStats->at(i); 135 parent->drawString(parent->font, stat->name, x + 2, y + 1, i % 2 == 0 ? 0xffffff : 0x909090); 136 wstring msg = stat->format(parent->stats->getTotalValue(stat)); 137 parent->drawString(parent->font, msg, x + 2 + 213 - parent->font->width(msg), y + 1, i % 2 == 0 ? 0xffffff : 0x909090); 138} 139 140void StatsScreen::blitSlot(int x, int y, int item) 141{ 142// 4J Unused 143#if 0 144 blitSlotBg(x + SLOT_BG_X, y + SLOT_BG_Y); 145 146 glEnable(GL_RESCALE_NORMAL); 147 148 glPushMatrix(); 149 glRotatef(180, 1, 0, 0); 150 Lighting::turnOn(); 151 glPopMatrix(); 152 153 itemRenderer->renderGuiItem(font, minecraft->textures, item, 0, Item::items[item]->getIcon(0), x + SLOT_FG_X, y + SLOT_FG_Y); 154 Lighting::turnOff(); 155 156 glDisable(GL_RESCALE_NORMAL); 157#endif 158} 159 160void StatsScreen::blitSlotBg(int x, int y) 161{ 162 blitSlotIcon(x, y, 0, 0); 163} 164 165void StatsScreen::blitSlotIcon(int x, int y, int sx, int sy) 166{ 167 // 4J Unused 168#if 0 169 int tex = minecraft->textures->loadTexture(L"/gui/slot.png"); 170 glColor4f(1, 1, 1, 1); 171 minecraft->textures->bind(tex); 172 173 const float us = 1 / SLOT_TEX_SIZE; 174 const float vs = 1 / SLOT_TEX_SIZE; 175 const int w = SLOT_BG_SIZE; 176 const int h = SLOT_BG_SIZE; 177 Tesselator *t = Tesselator::getInstance(); 178 t->begin(); 179 t->vertexUV((float)(x + 0), (float)( y + h), (float)( blitOffset), (float)( (sx + 0) * us), (float)( (sy + h) * vs)); 180 t->vertexUV((float)(x + w), (float)( y + h), (float)( blitOffset), (float)( (sx + w) * us), (float)( (sy + h) * vs)); 181 t->vertexUV((float)(x + w), (float)( y + 0), (float)( blitOffset), (float)( (sx + w) * us), (float)( (sy + 0) * vs)); 182 t->vertexUV((float)(x + 0), (float)( y + 0), (float)( blitOffset), (float)( (sx + 0) * us), (float)( (sy + 0) * vs)); 183 t->end(); 184#endif 185} 186 187// 4J - added parameter so we can access parent 188StatsScreen::StatisticsList::StatisticsList(StatsScreen *ss) : ScrolledSelectionList(ss->minecraft, ss->width, ss->height, 32, ss->height - 64, SLOT_STAT_HEIGHT) 189{ 190 // 4J - added initialisers 191 parent = ss; 192 headerPressed = -1; 193 sortColumn = -1; 194 sortOrder = SORT_NONE; 195 196 setRenderSelection(false); 197 setRenderHeader(true, SLOT_STAT_HEIGHT); 198} 199 200void StatsScreen::StatisticsList::selectItem(int item, bool doubleClick) 201{ 202} 203 204bool StatsScreen::StatisticsList::isSelectedItem(int item) 205{ 206 return false; 207} 208 209void StatsScreen::StatisticsList::renderBackground() 210{ 211 parent->renderBackground(); // 4J - was StatsScreen.this.renderBackground(); 212} 213 214void StatsScreen::StatisticsList::renderHeader(int x, int y, Tesselator *t) 215{ 216 if (!Mouse::isButtonDown(0)) 217 { 218 headerPressed = -1; 219 } 220 221 if (headerPressed == 0) 222 { 223 parent->blitSlotIcon(x + ROW_COL_1 - SLOT_BG_SIZE, y + SLOT_BG_Y, SLOT_BG_SIZE * 0, SLOT_BG_SIZE * 0); 224 } 225 else 226 { 227 parent->blitSlotIcon(x + ROW_COL_1 - SLOT_BG_SIZE, y + SLOT_BG_Y, SLOT_BG_SIZE * 0, SLOT_BG_SIZE * 1); 228 } 229 230 if (headerPressed == 1) 231 { 232 parent->blitSlotIcon(x + ROW_COL_2 - SLOT_BG_SIZE, y + SLOT_BG_Y, SLOT_BG_SIZE * 0, SLOT_BG_SIZE * 0); 233 } 234 else 235 { 236 parent->blitSlotIcon(x + ROW_COL_2 - SLOT_BG_SIZE, y + SLOT_BG_Y, SLOT_BG_SIZE * 0, SLOT_BG_SIZE * 1); 237 } 238 239 if (headerPressed == 2) 240 { 241 parent->blitSlotIcon(x + ROW_COL_3 - SLOT_BG_SIZE, y + SLOT_BG_Y, SLOT_BG_SIZE * 0, SLOT_BG_SIZE * 0); 242 } 243 else 244 { 245 parent->blitSlotIcon(x + ROW_COL_3 - SLOT_BG_SIZE, y + SLOT_BG_Y, SLOT_BG_SIZE * 0, SLOT_BG_SIZE * 1); 246 } 247 248 if (sortColumn != -1) 249 { 250 int offset = ROW_COL_1 - SLOT_BG_SIZE * 2; 251 int image = SLOT_BG_SIZE; 252 253 if (sortColumn == 1) 254 { 255 offset = ROW_COL_2 - SLOT_BG_SIZE * 2; 256 } 257 else if (sortColumn == 2) 258 { 259 offset = ROW_COL_3 - SLOT_BG_SIZE * 2; 260 } 261 262 if (sortOrder == SORT_UP) 263 { 264 image = SLOT_BG_SIZE * 2; 265 } 266 parent->blitSlotIcon(x + offset, y + SLOT_BG_Y, image, SLOT_BG_SIZE * 0); 267 } 268 269} 270 271void StatsScreen::StatisticsList::clickedHeader(int headerMouseX, int headerMouseY) 272{ 273 headerPressed = -1; 274 if (headerMouseX >= (ROW_COL_1 - SLOT_BG_SIZE * 2) && headerMouseX < ROW_COL_1) 275 { 276 headerPressed = 0; 277 } 278 else if (headerMouseX >= (ROW_COL_2 - SLOT_BG_SIZE * 2) && headerMouseX < ROW_COL_2) 279 { 280 headerPressed = 1; 281 } 282 else if (headerMouseX >= (ROW_COL_3 - SLOT_BG_SIZE * 2) && headerMouseX < ROW_COL_3) 283 { 284 headerPressed = 2; 285 } 286 287 if (headerPressed >= 0) 288 { 289 sortByColumn(headerPressed); 290 parent->minecraft->soundEngine->playUI(eSoundType_RANDOM_CLICK, 1, 1); 291 } 292} 293 294int StatsScreen::StatisticsList::getNumberOfItems() 295{ 296 return (int)statItemList.size(); 297} 298 299ItemStat *StatsScreen::StatisticsList::getSlotStat(int slot) 300{ 301 return statItemList.at(slot); 302} 303 304void StatsScreen::StatisticsList::renderStat(ItemStat *stat, int x, int y, bool shaded) 305{ 306 if (stat != NULL) 307 { 308 wstring msg = stat->format(parent->stats->getTotalValue(stat)); 309 parent->drawString(parent->font, msg, x - parent->font->width(msg), y + SLOT_TEXT_OFFSET, shaded ? 0xffffff : 0x909090); 310 } 311 else 312 { 313 wstring msg = L"-"; 314 parent->drawString(parent->font, msg, x - parent->font->width(msg), y + SLOT_TEXT_OFFSET, shaded ? 0xffffff : 0x909090); 315 } 316} 317 318void StatsScreen::StatisticsList::renderDecorations(int mouseX, int mouseY) 319{ 320 if (mouseY < y0 || mouseY > y1 ) 321 { 322 return; 323 } 324 325 int slot = getItemAtPosition(mouseX, mouseY); 326 int rowX = parent->width / 2 - 92 - 16; 327 if (slot >= 0) 328 { 329 if (mouseX < (rowX + SLOT_LEFT_INSERT) || mouseX > (rowX + SLOT_LEFT_INSERT + 20)) 330 { 331 return; 332 } 333 334 ItemStat *stat = getSlotStat(slot); 335 renderMousehoverTooltip(stat, mouseX, mouseY); 336 } 337 else 338 { 339 wstring elementName; 340 if (mouseX >= (rowX + ROW_COL_1 - SLOT_BG_SIZE) && mouseX <= (rowX + ROW_COL_1)) 341 { 342 elementName = getHeaderDescriptionId(0); 343 } 344 else if (mouseX >= (rowX + ROW_COL_2 - SLOT_BG_SIZE) && mouseX <= (rowX + ROW_COL_2)) 345 { 346 elementName = getHeaderDescriptionId(1); 347 } 348 else if (mouseX >= (rowX + ROW_COL_3 - SLOT_BG_SIZE) && mouseX <= (rowX + ROW_COL_3)) 349 { 350 elementName = getHeaderDescriptionId(2); 351 } 352 else 353 { 354 return; 355 } 356 357 elementName = trimString(L"" + Language::getInstance()->getElement(elementName)); 358 359 if (elementName.length() > 0) 360 { 361 int rx = mouseX + 12; 362 int ry = mouseY - 12; 363 int width = parent->font->width(elementName); 364 parent->fillGradient(rx - 3, ry - 3, rx + width + 3, ry + 8 + 3, 0xc0000000, 0xc0000000); 365 366 parent->font->drawShadow(elementName, rx, ry, 0xffffffff); 367 } 368 } 369 370} 371 372void StatsScreen::StatisticsList::renderMousehoverTooltip(ItemStat *stat, int x, int y) 373{ 374 // 4J Stu - Unused 375#if 0 376 if (stat == NULL) 377 { 378 return; 379 } 380 381 Item *item = Item::items[stat->getItemId()]; 382 383 wstring elementName = trimString(L"" + Language::getInstance()->getElementName(item->getDescriptionId())); 384 385 if (elementName.length() > 0) 386 { 387 int rx = x + 12; 388 int ry = y - 12; 389 int width = parent->font->width(elementName); 390 parent->fillGradient(rx - 3, ry - 3, rx + width + 3, ry + 8 + 3, 0xc0000000, 0xc0000000); 391 392 parent->font->drawShadow(elementName, rx, ry, 0xffffffff); 393 } 394#endif 395} 396 397void StatsScreen::StatisticsList::sortByColumn(int column) 398{ 399 if (column != sortColumn) 400 { 401 sortColumn = column; 402 sortOrder = SORT_DOWN; 403 } 404 else if (sortOrder == SORT_DOWN) 405 { 406 sortOrder = SORT_UP; 407 } 408 else 409 { 410 sortColumn = -1; 411 sortOrder = SORT_NONE; 412 } 413 414// Collections.sort(statItemList, itemStatSorter); // 4J - TODO 415} 416 417 418StatsScreen::ItemStatisticsList::ItemStatisticsList(StatsScreen *ss) : StatsScreen::StatisticsList(ss) 419{ 420 //4J Gordon: Removed, not used anyway 421 /*for(vector<ItemStat *>::iterator it = Stats::itemStats->begin(); it != Stats::itemStats->end(); it++ ) 422 { 423 ItemStat *stat = *it; 424 425 bool addToList = false; 426 int id = stat->getItemId(); 427 428 if (parent->stats->getTotalValue(stat) > 0) 429 { 430 addToList = true; 431 } 432 else if (Stats::itemBroke[id] != NULL && parent->stats->getTotalValue(Stats::itemBroke[id]) > 0) 433 { 434 addToList = true; 435 } 436 else if (Stats::itemCrafted[id] != NULL && parent->stats->getTotalValue(Stats::itemCrafted[id]) > 0) 437 { 438 addToList = true; 439 } 440 if (addToList) 441 { 442 statItemList.push_back(stat); 443 } 444 }*/ 445 446 /* 4J - TODO 447 itemStatSorter = new Comparator<ItemStat>() { 448 public int compare(ItemStat o1, ItemStat o2) { 449 int id1 = o1.getItemId(); 450 int id2 = o2.getItemId(); 451 452 Stat stat1 = null; 453 Stat stat2 = null; 454 if (sortColumn == COLUMN_DEPLETED) { 455 stat1 = Stats.itemBroke[id1]; 456 stat2 = Stats.itemBroke[id2]; 457 } else if (sortColumn == COLUMN_CRAFTED) { 458 stat1 = Stats.itemCrafted[id1]; 459 stat2 = Stats.itemCrafted[id2]; 460 } else if (sortColumn == COLUMN_USED) { 461 stat1 = Stats.itemUsed[id1]; 462 stat2 = Stats.itemUsed[id2]; 463 } 464 465 if (stat1 != null || stat2 != null) { 466 if (stat1 == null) { 467 return 1; 468 } else if (stat2 == null) { 469 return -1; 470 } else { 471 int value1 = stats.getValue(stat1); 472 int value2 = stats.getValue(stat2); 473 if (value1 != value2) { 474 return (value1 - value2) * sortOrder; 475 } 476 } 477 } 478 479 return id1 - id2; 480 } 481 }; 482 */ 483} 484 485void StatsScreen::ItemStatisticsList::renderHeader(int x, int y, Tesselator *t) 486{ 487 StatsScreen::StatisticsList::renderHeader(x, y, t); 488 489 if (headerPressed == 0) 490 { 491 parent->blitSlotIcon(x + ROW_COL_1 - SLOT_BG_SIZE + 1, y + SLOT_BG_Y + 1, SLOT_BG_SIZE * 4, SLOT_BG_SIZE * 1); 492 } 493 else 494 { 495 parent->blitSlotIcon(x + ROW_COL_1 - SLOT_BG_SIZE, y + SLOT_BG_Y, SLOT_BG_SIZE * 4, SLOT_BG_SIZE * 1); 496 } 497 if (headerPressed == 1) 498 { 499 parent->blitSlotIcon(x + ROW_COL_2 - SLOT_BG_SIZE + 1, y + SLOT_BG_Y + 1, SLOT_BG_SIZE * 1, SLOT_BG_SIZE * 1); 500 } 501 else 502 { 503 parent->blitSlotIcon(x + ROW_COL_2 - SLOT_BG_SIZE, y + SLOT_BG_Y, SLOT_BG_SIZE * 1, SLOT_BG_SIZE * 1); 504 } 505 if (headerPressed == 2) 506 { 507 parent->blitSlotIcon(x + ROW_COL_3 - SLOT_BG_SIZE + 1, y + SLOT_BG_Y + 1, SLOT_BG_SIZE * 2, SLOT_BG_SIZE * 1); 508 } 509 else 510 { 511 parent->blitSlotIcon(x + ROW_COL_3 - SLOT_BG_SIZE, y + SLOT_BG_Y, SLOT_BG_SIZE * 2, SLOT_BG_SIZE * 1); 512 } 513 514} 515 516void StatsScreen::ItemStatisticsList::renderItem(int i, int x, int y, int h, Tesselator *t) 517{ 518 //4J Gordon: Removed, not used anyway 519 /*ItemStat *stat = getSlotStat(i); 520 int id = stat->getItemId(); 521 522 parent->blitSlot(x + SLOT_LEFT_INSERT, y, id); 523 524 renderStat((ItemStat *) Stats::itemBroke[id], x + ROW_COL_1, y, i % 2 == 0); 525 renderStat((ItemStat *) Stats::itemCrafted[id], x + ROW_COL_2, y, i % 2 == 0); 526 renderStat((ItemStat *) stat, x + ROW_COL_3, y, i % 2 == 0);*/ 527} 528 529wstring StatsScreen::ItemStatisticsList::getHeaderDescriptionId(int column) 530{ 531 if (column == COLUMN_CRAFTED) 532 { 533 return L"stat.crafted"; 534 } 535 else if (column == COLUMN_USED) 536 { 537 return L"stat.used"; 538 } 539 else 540 { 541 return L"stat.depleted"; 542 } 543} 544 545StatsScreen::BlockStatisticsList::BlockStatisticsList(StatsScreen *ss) : StatisticsList(ss) 546{ 547 //4J Gordon: Removed, not used anyway 548 /*for(vector<ItemStat *>::iterator it = Stats::blockStats->begin(); it != Stats::blockStats->end(); it++ ) 549 { 550 ItemStat *stat = *it; 551 552 bool addToList = false; 553 int id = stat->getItemId(); 554 555 if (parent->stats->getTotalValue(stat) > 0) 556 { 557 addToList = true; 558 } 559 else if (Stats::itemUsed[id] != NULL && parent->stats->getTotalValue(Stats::itemUsed[id]) > 0) 560 { 561 addToList = true; 562 } 563 else if (Stats::itemCrafted[id] != NULL && parent->stats->getTotalValue(Stats::itemCrafted[id]) > 0) 564 { 565 addToList = true; 566 } 567 if (addToList) 568 { 569 statItemList.push_back(stat); 570 } 571 }*/ 572 573 /* 4J - TODO 574 itemStatSorter = new Comparator<ItemStat>() { 575 public int compare(ItemStat o1, ItemStat o2) { 576 int id1 = o1.getItemId(); 577 int id2 = o2.getItemId(); 578 579 Stat stat1 = null; 580 Stat stat2 = null; 581 if (sortColumn == COLUMN_MINED) { 582 stat1 = Stats.blockMined[id1]; 583 stat2 = Stats.blockMined[id2]; 584 } else if (sortColumn == COLUMN_CRAFTED) { 585 stat1 = Stats.itemCrafted[id1]; 586 stat2 = Stats.itemCrafted[id2]; 587 } else if (sortColumn == COLUMN_USED) { 588 stat1 = Stats.itemUsed[id1]; 589 stat2 = Stats.itemUsed[id2]; 590 } 591 592 if (stat1 != null || stat2 != null) { 593 if (stat1 == null) { 594 return 1; 595 } else if (stat2 == null) { 596 return -1; 597 } else { 598 int value1 = stats.getValue(stat1); 599 int value2 = stats.getValue(stat2); 600 if (value1 != value2) { 601 return (value1 - value2) * sortOrder; 602 } 603 } 604 } 605 606 return id1 - id2; 607 } 608 }; 609 */ 610} 611 612void StatsScreen::BlockStatisticsList::renderHeader(int x, int y, Tesselator *t) 613{ 614 StatisticsList::renderHeader(x, y, t); 615 616 if (headerPressed == 0) 617 { 618 parent->blitSlotIcon(x + ROW_COL_1 - SLOT_BG_SIZE + 1, y + SLOT_BG_Y + 1, SLOT_BG_SIZE * 1, SLOT_BG_SIZE * 1); 619 } 620 else 621 { 622 parent->blitSlotIcon(x + ROW_COL_1 - SLOT_BG_SIZE, y + SLOT_BG_Y, SLOT_BG_SIZE * 1, SLOT_BG_SIZE * 1); 623 } 624 if (headerPressed == 1) 625 { 626 parent->blitSlotIcon(x + ROW_COL_2 - SLOT_BG_SIZE + 1, y + SLOT_BG_Y + 1, SLOT_BG_SIZE * 2, SLOT_BG_SIZE * 1); 627 } 628 else 629 { 630 parent->blitSlotIcon(x + ROW_COL_2 - SLOT_BG_SIZE, y + SLOT_BG_Y, SLOT_BG_SIZE * 2, SLOT_BG_SIZE * 1); 631 } 632 if (headerPressed == 2) 633 { 634 parent->blitSlotIcon(x + ROW_COL_3 - SLOT_BG_SIZE + 1, y + SLOT_BG_Y + 1, SLOT_BG_SIZE * 3, SLOT_BG_SIZE * 1); 635 } 636 else 637 { 638 parent->blitSlotIcon(x + ROW_COL_3 - SLOT_BG_SIZE, y + SLOT_BG_Y, SLOT_BG_SIZE * 3, SLOT_BG_SIZE * 1); 639 } 640 641} 642 643void StatsScreen::BlockStatisticsList::renderItem(int i, int x, int y, int h, Tesselator *t) 644{ 645 //4J Gordon: Removed, not used anyway 646 /*ItemStat *mineCount = getSlotStat(i); 647 int id = mineCount->getItemId(); 648 649 parent->blitSlot(x + SLOT_LEFT_INSERT, y, id); 650 651 renderStat((ItemStat *) Stats::itemCrafted[id], x + ROW_COL_1, y, i % 2 == 0); 652 renderStat((ItemStat *) Stats::itemUsed[id], x + ROW_COL_2, y, i % 2 == 0); 653 renderStat((ItemStat *) mineCount, x + ROW_COL_3, y, i % 2 == 0);*/ 654} 655 656wstring StatsScreen::BlockStatisticsList::getHeaderDescriptionId(int column) 657{ 658 if (column == COLUMN_CRAFTED) 659 { 660 return L"stat.crafted"; 661 } 662 else if (column == COLUMN_USED) 663 { 664 return L"stat.used"; 665 } 666 else 667 { 668 return L"stat.mined"; 669 } 670}