#include "stdafx.h" #include "HtmlString.h" #include "WrittenBook.h" #include "../Minecraft.Client/Minecraft.h" #include "../Minecraft.Client/MultiPlayerLocalPlayer.h" WrittenBookItem::WrittenBookItem(int id) : Item(id) { } bool WrittenBookItem::isFoil(shared_ptr itemInstance) { return true; } const Rarity* WrittenBookItem::getRarity(shared_ptr itemInstance) { return Rarity::common; } shared_ptr WrittenBookItem::use(shared_ptr instance, Level* level, shared_ptr player) { //shared_ptr player1 = Minecraft::GetInstance()->player; //player1->openItemInstanceGui(instance, player1); player->openItemInstanceGui(instance, player); return instance; } bool WrittenBookItem::TestUse(shared_ptr itemInstance, Level* level, shared_ptr player) { return true; } void WrittenBookItem::appendHoverText(shared_ptr itemInstance, shared_ptr player, vector* lines, bool advanced) { if (!itemInstance->hasTag()) { return; } HtmlString stringd = HtmlString(L"By " + (itemInstance->tag->getString(L"author")), eHTMLColor_7, false, false); HtmlString stringf = HtmlString(L"Original", eHTMLColor_7, false, false); lines->push_back(stringd); lines->push_back(stringf); //lines->push_back(wstring(L"tone")); }