Merge branch 'main' into upstream-merge
This commit is contained in:
@@ -229,9 +229,47 @@ const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]=
|
||||
L"mob.rabbit.bunnymurder",
|
||||
L"mob.rabbit.hop",
|
||||
|
||||
|
||||
L"item.armor.equip_leather1",
|
||||
L"item.armor.equip_leather2",
|
||||
L"item.armor.equip_leather3",
|
||||
L"item.armor.equip_leather4",
|
||||
L"item.armor.equip_leather5",
|
||||
L"item.armor.equip_leather6",
|
||||
|
||||
L"item.armor.equip_chain1",
|
||||
L"item.armor.equip_chain2",
|
||||
L"item.armor.equip_chain3",
|
||||
L"item.armor.equip_chain4",
|
||||
L"item.armor.equip_chain5",
|
||||
L"item.armor.equip_chain6",
|
||||
|
||||
L"item.armor.equip_iron1",
|
||||
L"item.armor.equip_iron2",
|
||||
L"item.armor.equip_iron3",
|
||||
L"item.armor.equip_iron4",
|
||||
L"item.armor.equip_iron5",
|
||||
L"item.armor.equip_iron6",
|
||||
|
||||
L"item.armor.equip_gold1",
|
||||
L"item.armor.equip_gold2",
|
||||
L"item.armor.equip_gold3",
|
||||
L"item.armor.equip_gold4",
|
||||
L"item.armor.equip_gold5",
|
||||
L"item.armor.equip_gold6",
|
||||
|
||||
L"item.armor.equip_diamond1",
|
||||
L"item.armor.equip_diamond2",
|
||||
L"item.armor.equip_diamond3",
|
||||
L"item.armor.equip_diamond4",
|
||||
L"item.armor.equip_diamond5",
|
||||
L"item.armor.equip_diamond6",
|
||||
|
||||
L"item.armor.equip_generic1",
|
||||
L"item.armor.equip_generic2",
|
||||
L"item.armor.equip_generic3",
|
||||
L"item.armor.equip_generic4",
|
||||
L"item.armor.equip_generic5",
|
||||
L"item.armor.equip_generic6"
|
||||
};
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@@ -5,9 +5,13 @@
|
||||
#include "UI.h"
|
||||
#include "../../../Minecraft.World/net.minecraft.world.inventory.h"
|
||||
#include "../../../Minecraft.World/net.minecraft.world.item.h"
|
||||
#include "../../../Minecraft.World/net.minecraft.world.item.enchantment.h"
|
||||
#include "../../../Minecraft.World/net.minecraft.world.item.crafting.h"
|
||||
#include "../../../Minecraft.World/net.minecraft.world.level.tile.entity.h"
|
||||
#include "../../MultiPlayerLocalPlayer.h"
|
||||
#include "../../ServerPlayer.h"
|
||||
#include "../../MinecraftServer.h"
|
||||
#include "../../PlayerList.h"
|
||||
#include "../../Minecraft.h"
|
||||
#include "../../Options.h"
|
||||
|
||||
@@ -264,6 +268,47 @@ void IUIScene_AbstractContainerMenu::UpdateTooltips()
|
||||
}
|
||||
}
|
||||
|
||||
void IUIScene_AbstractContainerMenu::handleEnchantButton(int slot, int iPad) {
|
||||
UIScene* t = ui.FindScene(eUIScene_EnchantingMenu);
|
||||
MinecraftServer* aMinecraft = MinecraftServer::getInstance();
|
||||
EnchantmentMenu* menu = dynamic_cast<EnchantmentMenu*>(aMinecraft->getPlayers()->players[iPad]->containerMenu);
|
||||
|
||||
if (menu->en == false && menu->cachedEnchantments[slot] != nullptr) {
|
||||
EnchantmentInstance* a = menu->cachedEnchantments[slot]->at(0);
|
||||
if (a != nullptr) {
|
||||
int lapisCost = slot + 1; // slot 0 = 1 lapis, slot 1 = 2, slot 2 = 3
|
||||
|
||||
HtmlString title = HtmlString(
|
||||
wstring(app.GetString(a->enchantment->enchantments[a->enchantment->id]->getDescriptionId())) +
|
||||
L" " +
|
||||
a->enchantment->enchantments[a->enchantment->id]->getLevelString(a->level) +
|
||||
L"...?",
|
||||
eHTMLColor_White
|
||||
);
|
||||
|
||||
bool costEnough = aMinecraft->getPlayers()->players[iPad]->experienceLevel >= menu->costs[slot];
|
||||
bool enough = menu->getLapisCount() >= lapisCost;
|
||||
eMinecraftColour col = enough ? eHTMLColor_7 : eHTMLColor_c;
|
||||
eMinecraftColour colCost = costEnough ? eHTMLColor_7 : eHTMLColor_c;
|
||||
|
||||
std::wstring message = costEnough
|
||||
? std::to_wstring(menu->costs[slot]) + L" Enchantment Levels"
|
||||
: L"Level Requirement: " + std::to_wstring(menu->costs[slot]);
|
||||
|
||||
vector<HtmlString>* lines = new vector<HtmlString>();
|
||||
lines->push_back(title);
|
||||
if (!aMinecraft->getPlayers()->players[iPad]->abilities.instabuild) {
|
||||
lines->push_back(HtmlString(L"")); // title1 blank line
|
||||
if (costEnough) {
|
||||
lines->push_back(HtmlString(std::to_wstring(lapisCost) + L" Lapis Lazuli", col));
|
||||
}
|
||||
lines->push_back(HtmlString(message, colCost));
|
||||
}
|
||||
SetPointerText(lines, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void IUIScene_AbstractContainerMenu::onMouseTick()
|
||||
{
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
@@ -826,6 +871,9 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
|
||||
SetPointerText(nullptr, false);
|
||||
m_lastPointerLabelSlot = nullptr;
|
||||
}
|
||||
if (eSectionUnderPointer == eSectionEnchantButton1) handleEnchantButton(0, iPad);
|
||||
else if (eSectionUnderPointer == eSectionEnchantButton2) handleEnchantButton(1, iPad);
|
||||
else if (eSectionUnderPointer == eSectionEnchantButton3) handleEnchantButton(2, iPad);
|
||||
|
||||
EToolTipItem buttonA, buttonX, buttonY, buttonRT, buttonBack;
|
||||
buttonA = buttonX = buttonY = buttonRT = buttonBack = eToolTipNone;
|
||||
|
||||
@@ -66,6 +66,7 @@ protected:
|
||||
eSectionEnchantUsing,
|
||||
eSectionEnchantInventory,
|
||||
eSectionEnchantSlot,
|
||||
eSectionLapisSlot,
|
||||
eSectionEnchantButton1,
|
||||
eSectionEnchantButton2,
|
||||
eSectionEnchantButton3,
|
||||
@@ -216,6 +217,7 @@ protected:
|
||||
virtual void PlatformInitialize(int iPad, int startIndex) = 0;
|
||||
virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0) = 0;
|
||||
|
||||
void handleEnchantButton(int slot, int iPad);
|
||||
void onMouseTick();
|
||||
bool handleKeyDown(int iPad, int iAction, bool bRepeat);
|
||||
virtual bool handleValidKeyPress(int iUserIndex, int buttonNum, BOOL quickKeyHeld);
|
||||
|
||||
@@ -426,6 +426,10 @@ void IUIScene_CreativeMenu::staticCtor()
|
||||
ITEM_AUX(Item::spawnEgg_Id, 62); // Magma Cube
|
||||
ITEM_AUX(Item::spawnEgg_Id, 65); // Bat
|
||||
ITEM_AUX(Item::spawnEgg_Id, 66); // Witch
|
||||
|
||||
ITEM_AUX(Item::spawnEgg_Id, 67); // Endermite
|
||||
ITEM_AUX(Item::spawnEgg_Id, 68); // Guardian
|
||||
ITEM_AUX(Item::spawnEgg_Id, 4); // Elder Guardian
|
||||
ITEM_AUX(Item::spawnEgg_Id, 90); // Pig
|
||||
ITEM_AUX(Item::spawnEgg_Id, 91); // Sheep
|
||||
ITEM_AUX(Item::spawnEgg_Id, 92); // Cow
|
||||
@@ -435,7 +439,6 @@ void IUIScene_CreativeMenu::staticCtor()
|
||||
ITEM_AUX(Item::spawnEgg_Id, 96); // Mooshroom
|
||||
ITEM_AUX(Item::spawnEgg_Id, 98); // Ozelot
|
||||
ITEM_AUX(Item::spawnEgg_Id, 100); // Horse
|
||||
ITEM_AUX(Item::spawnEgg_Id, 67); // Endermite
|
||||
|
||||
ITEM_AUX(Item::spawnEgg_Id, 100 | ((EntityHorse::TYPE_DONKEY + 1) << 12) ); // Donkey
|
||||
ITEM_AUX(Item::spawnEgg_Id, 100 | ((EntityHorse::TYPE_MULE + 1) << 12)); // Mule
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
#include "../../../Minecraft.World/net.minecraft.world.inventory.h"
|
||||
#include "../../Minecraft.h"
|
||||
#include "../../MultiPlayerLocalPlayer.h"
|
||||
#include "../../PlayerList.h"
|
||||
#include "../../ServerPlayer.h"
|
||||
#include "IUIScene_EnchantingMenu.h"
|
||||
#include <MinecraftServer.h>
|
||||
|
||||
IUIScene_AbstractContainerMenu::ESceneSection IUIScene_EnchantingMenu::GetSectionAndSlotInDirection( IUIScene_AbstractContainerMenu::ESceneSection eSection, ETapState eTapDirection, int *piTargetX, int *piTargetY )
|
||||
{
|
||||
@@ -140,9 +143,10 @@ void IUIScene_EnchantingMenu::handleOtherClicked(int iPad, ESceneSection eSectio
|
||||
break;
|
||||
};
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
if (index >= 0 && m_menu->clickMenuButton(dynamic_pointer_cast<Player>(pMinecraft->localplayers[iPad]), index))
|
||||
MinecraftServer *aMinecraft = MinecraftServer::getInstance();
|
||||
if (index >= 0 && dynamic_cast<EnchantmentMenu*>(aMinecraft->getPlayers()->players[iPad]->containerMenu)->clickMenuButton(dynamic_pointer_cast<Player>(aMinecraft->getPlayers()->players[iPad]), index))
|
||||
{
|
||||
pMinecraft->localgameModes[iPad]->handleInventoryButtonClick(m_menu->containerId, index);
|
||||
pMinecraft->localgameModes[iPad]->handleInventoryButtonClick(dynamic_cast<EnchantmentMenu*>(aMinecraft->getPlayers()->players[iPad]->containerMenu)->containerId, index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,11 +158,14 @@ int IUIScene_EnchantingMenu::getSectionStartOffset(ESceneSection eSection)
|
||||
case eSectionEnchantSlot:
|
||||
offset = 0;
|
||||
break;
|
||||
case eSectionEnchantInventory:
|
||||
case eSectionLapisSlot:
|
||||
offset = 1;
|
||||
break;
|
||||
case eSectionEnchantInventory:
|
||||
offset = 2;
|
||||
break;
|
||||
case eSectionEnchantUsing:
|
||||
offset = 1 + 27;
|
||||
offset = 2 + 27;
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
@@ -174,6 +181,7 @@ bool IUIScene_EnchantingMenu::IsSectionSlotList( ESceneSection eSection )
|
||||
case eSectionEnchantInventory:
|
||||
case eSectionEnchantUsing:
|
||||
case eSectionEnchantSlot:
|
||||
case eSectionLapisSlot:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -26,6 +26,8 @@ bool UIControl_EnchantmentButton::setupControl(UIScene *scene, IggyValuePath *pa
|
||||
|
||||
//Button specific initialisers
|
||||
m_funcChangeState = registerFastName(L"ChangeState");
|
||||
m_CLevel = registerFastName(L"m_iCurrentLevel");
|
||||
m_CLevelU = registerFastName(L"SetEnchantmentLevel");
|
||||
|
||||
return success;
|
||||
}
|
||||
@@ -33,6 +35,18 @@ bool UIControl_EnchantmentButton::setupControl(UIScene *scene, IggyValuePath *pa
|
||||
void UIControl_EnchantmentButton::init(int index)
|
||||
{
|
||||
m_index = index;
|
||||
//IggyValueSetF64RS(getIggyValuePath(), m_CLevel, nullptr, index + 1);
|
||||
}
|
||||
|
||||
void UIControl_EnchantmentButton::setLevel()
|
||||
{
|
||||
IggyValueSetF64RS(getIggyValuePath(), m_CLevel, nullptr, m_index + 1);
|
||||
|
||||
IggyDataValue value[1];
|
||||
value[0].type = IGGY_DATATYPE_number;
|
||||
value[0].number = m_index + 1;
|
||||
IggyDataValue result;
|
||||
IggyResult out = IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_CLevelU, 1, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -176,6 +190,8 @@ void UIControl_EnchantmentButton::updateState()
|
||||
setLabel(L"");
|
||||
}
|
||||
|
||||
IggyValueSetF64RS(getIggyValuePath(), m_CLevel, nullptr, m_BValue);
|
||||
|
||||
if(state != m_lastState)
|
||||
{
|
||||
IggyDataValue result;
|
||||
|
||||
@@ -20,6 +20,8 @@ private:
|
||||
bool m_bHasFocus;
|
||||
|
||||
IggyName m_funcChangeState;
|
||||
IggyName m_CLevel;
|
||||
IggyName m_CLevelU;
|
||||
|
||||
unsigned int m_textColour, m_textFocusColour, m_textDisabledColour;
|
||||
|
||||
@@ -27,6 +29,7 @@ private:
|
||||
{
|
||||
public:
|
||||
static EnchantmentNames instance;
|
||||
|
||||
|
||||
private:
|
||||
Random random;
|
||||
@@ -40,12 +43,13 @@ private:
|
||||
|
||||
public:
|
||||
UIControl_EnchantmentButton();
|
||||
|
||||
int m_BValue = 1;
|
||||
virtual bool setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName);
|
||||
|
||||
virtual void tick();
|
||||
|
||||
void init(int index);
|
||||
void setLevel();
|
||||
virtual void ReInit();
|
||||
void render(IggyCustomDrawCallbackRegion *region);
|
||||
|
||||
|
||||
@@ -10,10 +10,18 @@ UIScene_EnchantingMenu::UIScene_EnchantingMenu(int iPad, void *_initData, UILaye
|
||||
// Setup all the Iggy references we need for this scene
|
||||
initialiseMovie();
|
||||
|
||||
m_enchantButton[0].m_BValue = 1.0f;
|
||||
m_enchantButton[1].m_BValue = 2.0f;
|
||||
m_enchantButton[2].m_BValue = 3.0f;
|
||||
|
||||
m_enchantButton[0].init(0);
|
||||
m_enchantButton[1].init(1);
|
||||
m_enchantButton[2].init(2);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
EnchantingScreenInput *initData = static_cast<EnchantingScreenInput *>(_initData);
|
||||
|
||||
m_labelEnchant.init( initData->name.empty() ? app.GetString(IDS_ENCHANT) : initData->name );
|
||||
@@ -26,15 +34,21 @@ UIScene_EnchantingMenu::UIScene_EnchantingMenu(int iPad, void *_initData, UILaye
|
||||
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Enchanting_Menu, this);
|
||||
}
|
||||
|
||||
EnchantmentMenu *menu = new EnchantmentMenu(initData->inventory, initData->level, initData->x, initData->y, initData->z);
|
||||
menu = new EnchantmentMenu(initData->inventory, initData->level, initData->x, initData->y, initData->z);
|
||||
//menu->iPad = initData->iPad;
|
||||
|
||||
Initialize( initData->iPad, menu, true, EnchantmentMenu::INV_SLOT_START, eSectionEnchantUsing, eSectionEnchantMax );
|
||||
|
||||
m_slotListIngredient.addSlots(EnchantmentMenu::INGREDIENT_SLOT, 1);
|
||||
m_slotListLapis.addSlots(EnchantmentMenu::LAPIS_SLOT, 1);
|
||||
|
||||
app.SetRichPresenceContext(m_iPad,CONTEXT_GAME_STATE_ENCHANTING);
|
||||
|
||||
delete initData;
|
||||
|
||||
m_enchantButton[0].setLevel();
|
||||
m_enchantButton[1].setLevel();
|
||||
m_enchantButton[2].setLevel();
|
||||
}
|
||||
|
||||
wstring UIScene_EnchantingMenu::getMoviePath()
|
||||
@@ -54,6 +68,7 @@ void UIScene_EnchantingMenu::handleReload()
|
||||
Initialize( m_iPad, m_menu, true, EnchantmentMenu::INV_SLOT_START, eSectionEnchantUsing, eSectionEnchantMax );
|
||||
|
||||
m_slotListIngredient.addSlots(EnchantmentMenu::INGREDIENT_SLOT, 1);
|
||||
m_slotListLapis.addSlots(EnchantmentMenu::LAPIS_SLOT, 1);
|
||||
}
|
||||
|
||||
int UIScene_EnchantingMenu::getSectionColumns(ESceneSection eSection)
|
||||
@@ -64,6 +79,9 @@ int UIScene_EnchantingMenu::getSectionColumns(ESceneSection eSection)
|
||||
case eSectionEnchantSlot:
|
||||
cols = 1;
|
||||
break;
|
||||
case eSectionLapisSlot:
|
||||
cols = 1;
|
||||
break;
|
||||
case eSectionEnchantInventory:
|
||||
cols = 9;
|
||||
break;
|
||||
@@ -85,6 +103,9 @@ int UIScene_EnchantingMenu::getSectionRows(ESceneSection eSection)
|
||||
case eSectionEnchantSlot:
|
||||
rows = 1;
|
||||
break;
|
||||
case eSectionLapisSlot:
|
||||
rows = 1;
|
||||
break;
|
||||
case eSectionEnchantInventory:
|
||||
rows = 3;
|
||||
break;
|
||||
@@ -106,6 +127,10 @@ void UIScene_EnchantingMenu::GetPositionOfSection( ESceneSection eSection, UIVec
|
||||
pPosition->x = m_slotListIngredient.getXPos();
|
||||
pPosition->y = m_slotListIngredient.getYPos();
|
||||
break;
|
||||
case eSectionLapisSlot:
|
||||
pPosition->x = m_slotListLapis.getXPos();
|
||||
pPosition->y = m_slotListLapis.getYPos();
|
||||
break;
|
||||
case eSectionEnchantInventory:
|
||||
pPosition->x = m_slotListInventory.getXPos();
|
||||
pPosition->y = m_slotListInventory.getYPos();
|
||||
@@ -141,6 +166,10 @@ void UIScene_EnchantingMenu::GetItemScreenData( ESceneSection eSection, int iIte
|
||||
sectionSize.x = m_slotListIngredient.getWidth();
|
||||
sectionSize.y = m_slotListIngredient.getHeight();
|
||||
break;
|
||||
case eSectionLapisSlot:
|
||||
sectionSize.x = m_slotListLapis.getWidth();
|
||||
sectionSize.y = m_slotListLapis.getHeight();
|
||||
break;
|
||||
case eSectionEnchantInventory:
|
||||
sectionSize.x = m_slotListInventory.getWidth();
|
||||
sectionSize.y = m_slotListInventory.getHeight();
|
||||
@@ -200,6 +229,9 @@ void UIScene_EnchantingMenu::setSectionSelectedSlot(ESceneSection eSection, int
|
||||
case eSectionEnchantSlot:
|
||||
slotList = &m_slotListIngredient;
|
||||
break;
|
||||
case eSectionLapisSlot:
|
||||
slotList = &m_slotListLapis;
|
||||
break;
|
||||
case eSectionEnchantInventory:
|
||||
slotList = &m_slotListInventory;
|
||||
break;
|
||||
@@ -222,6 +254,9 @@ UIControl *UIScene_EnchantingMenu::getSection(ESceneSection eSection)
|
||||
case eSectionEnchantSlot:
|
||||
control = &m_slotListIngredient;
|
||||
break;
|
||||
case eSectionLapisSlot:
|
||||
control = &m_slotListLapis;
|
||||
break;
|
||||
case eSectionEnchantInventory:
|
||||
control = &m_slotListInventory;
|
||||
break;
|
||||
|
||||
@@ -20,8 +20,10 @@ public:
|
||||
|
||||
virtual EUIScene getSceneType() { return eUIScene_EnchantingMenu;}
|
||||
|
||||
EnchantmentMenu* menu;
|
||||
|
||||
protected:
|
||||
UIControl_SlotList m_slotListIngredient;
|
||||
UIControl_SlotList m_slotListIngredient, m_slotListLapis;
|
||||
UIControl_Label m_labelEnchant;
|
||||
UIControl_EnchantmentButton m_enchantButton[3];
|
||||
UIControl_EnchantmentBook m_enchantBook;
|
||||
@@ -29,6 +31,7 @@ protected:
|
||||
UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene_AbstractContainerMenu)
|
||||
UI_BEGIN_MAP_CHILD_ELEMENTS( m_controlMainPanel )
|
||||
UI_MAP_ELEMENT( m_slotListIngredient, "ingredient")
|
||||
UI_MAP_ELEMENT(m_slotListLapis, "lapis")
|
||||
UI_MAP_ELEMENT( m_enchantButton[0], "Button1")
|
||||
UI_MAP_ELEMENT( m_enchantButton[1], "Button2")
|
||||
UI_MAP_ELEMENT( m_enchantButton[2], "Button3")
|
||||
|
||||
@@ -34,6 +34,7 @@ UIScene_MainMenu::UIScene_MainMenu(int iPad, void *initData, UILayer *parentLaye
|
||||
|
||||
|
||||
m_buttons[static_cast<int>(eControl_PlayGame)].init(IDS_PLAY_GAME,eControl_PlayGame);
|
||||
m_buttons[(int)eControl_MiniGames].init(L"Mini Games",eControl_MiniGames);
|
||||
|
||||
#ifdef _XBOX_ONE
|
||||
if(!ProfileManager.IsFullVersion()) m_buttons[(int)eControl_PlayGame].setLabel(IDS_PLAY_TRIAL_GAME);
|
||||
@@ -325,6 +326,24 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId)
|
||||
//CD - Added for audio
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
|
||||
signInReturnedFunc = &UIScene_MainMenu::CreateLoad_SignInReturned;
|
||||
#endif
|
||||
break;
|
||||
case eControl_MiniGames:
|
||||
#ifdef __ORBIS__
|
||||
{
|
||||
m_bIgnorePress=true;
|
||||
|
||||
//CD - Added for audio
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
|
||||
ProfileManager.RefreshChatAndContentRestrictions(RefreshChatAndContentRestrictionsReturned_PlayGame, this);
|
||||
}
|
||||
#else
|
||||
m_eAction=eAction_RunGame;
|
||||
//CD - Added for audio
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
|
||||
signInReturnedFunc = &UIScene_MainMenu::CreateLoad_SignInReturned;
|
||||
#endif
|
||||
break;
|
||||
|
||||
@@ -12,6 +12,7 @@ private:
|
||||
eControl_Achievements,
|
||||
eControl_HelpAndOptions,
|
||||
eControl_UnlockOrDLC,
|
||||
eControl_MiniGames,
|
||||
#ifndef _DURANGO
|
||||
eControl_Exit,
|
||||
#else
|
||||
@@ -38,7 +39,9 @@ private:
|
||||
UI_MAP_ELEMENT( m_buttons[(int)eControl_HelpAndOptions], "Button4")
|
||||
UI_MAP_ELEMENT( m_buttons[(int)eControl_UnlockOrDLC], "Button5")
|
||||
#ifndef _DURANGO
|
||||
UI_MAP_ELEMENT( m_buttons[(int)eControl_MiniGames], "Button7")
|
||||
UI_MAP_ELEMENT( m_buttons[(int)eControl_Exit], "Button6")
|
||||
|
||||
#else
|
||||
UI_MAP_ELEMENT( m_buttons[(int)eControl_XboxHelp], "Button6")
|
||||
#endif
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1016 B |
Binary file not shown.
|
After Width: | Height: | Size: 246 B |
Binary file not shown.
|
After Width: | Height: | Size: 965 B |
@@ -85,6 +85,8 @@
|
||||
|
||||
#include "ArmorStandRenderer.h"
|
||||
#include "EndermiteRenderer.h"
|
||||
#include "GuardianRenderer.h"
|
||||
#include "GuardianModel.h"
|
||||
#include "MobRenderer.h"
|
||||
|
||||
double EntityRenderDispatcher::xOff = 0.0;
|
||||
@@ -128,6 +130,9 @@ EntityRenderDispatcher::EntityRenderDispatcher()
|
||||
renderers[eTYPE_VILLAGER] = new VillagerRenderer();
|
||||
renderers[eTYPE_VILLAGERGOLEM] = new VillagerGolemRenderer();
|
||||
renderers[eTYPE_BAT] = new BatRenderer();
|
||||
renderers[eTYPE_GUARDIAN] = new GuardianRenderer(new GuardianModel(), 0.5f);
|
||||
renderers[eTYPE_ELDER_GUARDIAN] = new GuardianRenderer(new GuardianModel(), 0.5f);
|
||||
|
||||
|
||||
renderers[eTYPE_MOB] = new MobRenderer(new HumanoidModel(), 0.5f);
|
||||
|
||||
|
||||
@@ -407,6 +407,7 @@ void EntityRenderer::registerTerrainTextures(IconRegister *iconRegister)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
ResourceLocation *EntityRenderer::getTextureLocation(shared_ptr<Entity> mob)
|
||||
{
|
||||
return nullptr;
|
||||
|
||||
@@ -75,4 +75,6 @@ public:
|
||||
virtual Model *getNewModel() { return newModel; }
|
||||
virtual Model *getNewModelSlim() { return newModelSlim; }
|
||||
virtual void SetItemFrame(bool bSet) {}
|
||||
virtual bool shouldRender(shared_ptr<Entity> entity, float camX, float camY, float camZ) { return true; }
|
||||
|
||||
};
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
#include "stdafx.h"
|
||||
#include "GuardianModel.h"
|
||||
#include "..\Minecraft.World\Mth.h"
|
||||
#include "ModelPart.h"
|
||||
#include "..\Minecraft.World\Guardian.h"
|
||||
|
||||
|
||||
|
||||
GuardianModel::GuardianModel() : Model()
|
||||
{
|
||||
texWidth = 64;
|
||||
texHeight = 64;
|
||||
|
||||
|
||||
guardianBody = new ModelPart(this);
|
||||
guardianBody->texOffs(0, 0)->addBox(-6.0f, 10.0f, -8.0f, 12, 12, 16);
|
||||
guardianBody->texOffs(0, 28)->addBox(-8.0f, 10.0f, -6.0f, 2, 12, 12);
|
||||
|
||||
|
||||
ModelPart *rightSide = new ModelPart(this);
|
||||
rightSide->texOffs(0, 28)->mirror()->addBox(6.0f, 10.0f, -6.0f, 2, 12, 12);
|
||||
guardianBody->addChild(rightSide);
|
||||
|
||||
guardianBody->texOffs(16, 40)->addBox(-6.0f, 8.0f, -6.0f, 12, 2, 12);
|
||||
guardianBody->texOffs(16, 40)->addBox(-6.0f, 22.0f, -6.0f, 12, 2, 12);
|
||||
|
||||
|
||||
for (int i = 0; i < 12; i++)
|
||||
{
|
||||
guardianSpines[i] = new ModelPart(this, 0, 0);
|
||||
guardianSpines[i]->addBox(-1.0f, -4.5f, -1.0f, 2, 9, 2);
|
||||
guardianBody->addChild(guardianSpines[i]);
|
||||
}
|
||||
|
||||
|
||||
guardianEye = new ModelPart(this, 8, 0);
|
||||
guardianEye->addBox(-1.0f, 15.0f, 0.0f, 2, 2, 1);
|
||||
guardianBody->addChild(guardianEye);
|
||||
|
||||
|
||||
guardianTail[0] = new ModelPart(this, 40, 0);
|
||||
guardianTail[0]->addBox(-2.0f, 14.0f, 7.0f, 4, 4, 8);
|
||||
|
||||
guardianTail[1] = new ModelPart(this, 0, 54);
|
||||
guardianTail[1]->addBox(0.0f, 14.0f, 0.0f, 3, 3, 7);
|
||||
|
||||
guardianTail[2] = new ModelPart(this);
|
||||
guardianTail[2]->texOffs(41, 32)->addBox(0.0f, 14.0f, 0.0f, 2, 2, 6);
|
||||
guardianTail[2]->texOffs(25, 19)->addBox(1.0f, 10.5f, 3.0f, 1, 9, 9);
|
||||
|
||||
guardianBody->addChild(guardianTail[0]);
|
||||
guardianTail[0]->addChild(guardianTail[1]);
|
||||
guardianTail[1]->addChild(guardianTail[2]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void GuardianModel::setupAnim(float time, float r, float bob, float yRot, float xRot,
|
||||
float scale, shared_ptr<Entity> entity,
|
||||
unsigned int uiBitmaskOverrideAnim)
|
||||
{
|
||||
shared_ptr<Guardian> guardian = dynamic_pointer_cast<Guardian>(entity);
|
||||
if (!guardian) return;
|
||||
|
||||
|
||||
float afloat[] = { 1.75f, 0.25f, 0.0f, 0.0f, 0.5f, 0.5f, 0.5f, 0.5f, 1.25f, 0.75f, 0.0f, 0.0f };
|
||||
float afloat1[] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.25f,1.75f, 1.25f, 0.75f, 0.0f, 0.0f, 0.0f, 0.0f };
|
||||
float afloat2[] = { 0.0f, 0.0f, 0.25f,1.75f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.75f,1.25f};
|
||||
float afloat3[] = { 0.0f, 0.0f, 8.0f, -8.0f,-8.0f, 8.0f, 8.0f, -8.0f, 0.0f, 0.0f, 8.0f,-8.0f };
|
||||
float afloat4[] = {-8.0f, -8.0f, -8.0f, -8.0f, 0.0f, 0.0f, 0.0f, 0.0f, 8.0f, 8.0f, 8.0f, 8.0f };
|
||||
float afloat5[] = { 8.0f, -8.0f, 0.0f, 0.0f,-8.0f,-8.0f, 8.0f, 8.0f, 8.0f, -8.0f, 0.0f, 0.0f };
|
||||
|
||||
// Body orientation
|
||||
guardianBody->yRot = yRot / (180.0f / (float)PI);
|
||||
guardianBody->xRot = xRot / (180.0f / (float)PI);
|
||||
|
||||
|
||||
guardianEye->z = -8.25f;
|
||||
|
||||
if (guardian->hasTargetedEntity())
|
||||
{
|
||||
shared_ptr<LivingEntity> target = guardian->getTargetedEntity();
|
||||
if (target)
|
||||
{
|
||||
|
||||
double d0 = (guardian->y + guardian->getEyeHeight())
|
||||
- (target->y + target->getEyeHeight());
|
||||
guardianEye->y = (d0 > 0.0) ? 0.0f : 1.0f;
|
||||
|
||||
|
||||
double dx = target->x - guardian->x;
|
||||
double dz = target->z - guardian->z;
|
||||
float targetYaw = (float)(atan2(dz, dx) * 180.0 / PI) - 90.0f;
|
||||
float diff = Mth::wrapDegrees(targetYaw - guardian->yRot);
|
||||
|
||||
float clamped = diff / 45.0f;
|
||||
if (clamped < -2.0f) clamped = -2.0f;
|
||||
if (clamped > 2.0f) clamped = 2.0f;
|
||||
guardianEye->x = clamped;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
guardianEye->y = 0.0f;
|
||||
guardianEye->x = 0.0f;
|
||||
}
|
||||
|
||||
|
||||
float f1 = (1.0f - guardian->getSpikesAnimation(0.0f)) * 0.55f;
|
||||
|
||||
for (int i = 0; i < 12; ++i)
|
||||
{
|
||||
guardianSpines[i]->xRot = (float)PI * afloat[i];
|
||||
guardianSpines[i]->yRot = (float)PI * afloat1[i];
|
||||
guardianSpines[i]->zRot = (float)PI * afloat2[i];
|
||||
|
||||
float wave = 1.0f + Mth::cos(bob * 1.5f + (float)i) * 0.01f - f1;
|
||||
guardianSpines[i]->x = afloat3[i] * wave;
|
||||
guardianSpines[i]->y = 16.0f + afloat4[i] * wave;
|
||||
guardianSpines[i]->z = afloat5[i] * wave;
|
||||
}
|
||||
|
||||
|
||||
float tailAnim = guardian->getTailAnimation(0.0f);
|
||||
|
||||
guardianTail[0]->yRot = Mth::sin(tailAnim) * (float)PI * 0.05f;
|
||||
|
||||
guardianTail[1]->yRot = Mth::sin(tailAnim) * (float)PI * 0.1f;
|
||||
guardianTail[1]->x = -1.5f;
|
||||
guardianTail[1]->y = 0.5f;
|
||||
guardianTail[1]->z = 14.0f;
|
||||
|
||||
guardianTail[2]->yRot = Mth::sin(tailAnim) * (float)PI * 0.15f;
|
||||
guardianTail[2]->x = 0.5f;
|
||||
guardianTail[2]->y = 0.5f;
|
||||
guardianTail[2]->z = 6.0f;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void GuardianModel::render(shared_ptr<Entity> entity, float time, float r, float bob,
|
||||
float yRot, float xRot, float scale, bool usecompiled)
|
||||
{
|
||||
setupAnim(time, r, bob, yRot, xRot, scale, entity);
|
||||
|
||||
guardianBody->render(scale, usecompiled);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
#include "Model.h"
|
||||
|
||||
class ModelPart;
|
||||
|
||||
class GuardianModel : public Model
|
||||
{
|
||||
public:
|
||||
ModelPart *guardianBody;
|
||||
ModelPart *guardianEye;
|
||||
ModelPart *guardianSpines[12];
|
||||
ModelPart *guardianTail[3];
|
||||
|
||||
GuardianModel();
|
||||
|
||||
|
||||
int getTextureHeight() { return 64; }
|
||||
|
||||
virtual void setupAnim(float time, float r, float bob, float yRot, float xRot,
|
||||
float scale, shared_ptr<Entity> entity,
|
||||
unsigned int uiBitmaskOverrideAnim = 0) override;
|
||||
|
||||
virtual void render(shared_ptr<Entity> entity, float time, float r, float bob,
|
||||
float yRot, float xRot, float scale, bool usecompiled) override;
|
||||
};
|
||||
@@ -0,0 +1,239 @@
|
||||
#include "stdafx.h"
|
||||
#include "GuardianRenderer.h"
|
||||
#include "GuardianModel.h"
|
||||
#include "..\Minecraft.World\Mth.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.animal.h"
|
||||
#include "../Minecraft.World/Guardian.h"
|
||||
#include "..\Minecraft.World\Level.h"
|
||||
#include "Tesselator.h"
|
||||
|
||||
|
||||
|
||||
ResourceLocation GuardianRenderer::GUARDIAN_LOCATION = ResourceLocation(TN_MOB_GUARDIAN);
|
||||
ResourceLocation GuardianRenderer::GUARDIAN_ELDER_LOCATION = ResourceLocation(TN_MOB_GUARDIAN_ELDER);
|
||||
ResourceLocation GuardianRenderer::GUARDIAN_BEAM_LOCATION = ResourceLocation(TN_MOB_GUARDIAN_BEAM);
|
||||
|
||||
GuardianRenderer::GuardianRenderer(Model *model, float shadow)
|
||||
: MobRenderer(model, shadow)
|
||||
{
|
||||
guardianModel = static_cast<GuardianModel *>(model);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
ResourceLocation *GuardianRenderer::getTextureLocation(shared_ptr<Entity> mob)
|
||||
{
|
||||
shared_ptr<Guardian> guardian = dynamic_pointer_cast<Guardian>(mob);
|
||||
if (guardian && guardian->isElder())
|
||||
return &GUARDIAN_ELDER_LOCATION;
|
||||
return &GUARDIAN_LOCATION;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool GuardianRenderer::shouldRender(shared_ptr<Entity> mob, float camX, float camY, float camZ)
|
||||
{
|
||||
if (MobRenderer::shouldRender(mob, camX, camY, camZ))
|
||||
return true;
|
||||
|
||||
shared_ptr<Guardian> guardian = dynamic_pointer_cast<Guardian>(mob);
|
||||
if (!guardian || !guardian->hasTargetedEntity())
|
||||
return false;
|
||||
|
||||
shared_ptr<LivingEntity> target = guardian->getTargetedEntity();
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
double tx, ty, tz, gx, gy, gz;
|
||||
getInterpolatedPos(target, (double)target->bbHeight * 0.5, 1.0f, tx, ty, tz);
|
||||
getInterpolatedPos(guardian, (double)guardian->getEyeHeight(), 1.0f, gx, gy, gz);
|
||||
|
||||
|
||||
auto inRange = [&](double x, double y, double z) {
|
||||
double dx = x - camX, dy = y - camY, dz = z - camZ;
|
||||
return (dx*dx + dy*dy + dz*dz) < (64.0 * 64.0);
|
||||
};
|
||||
|
||||
return inRange(gx, gy, gz) || inRange(tx, ty, tz);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void GuardianRenderer::getInterpolatedPos(shared_ptr<LivingEntity> entity, double yOffset,
|
||||
float partialTicks,
|
||||
double &outX, double &outY, double &outZ)
|
||||
{
|
||||
outX = entity->xo + (entity->x - entity->xo) * (double)partialTicks;
|
||||
outY = yOffset + entity->yo + (entity->y - entity->yo) * (double)partialTicks;
|
||||
outZ = entity->zo + (entity->z - entity->zo) * (double)partialTicks;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void GuardianRenderer::setupRotations(shared_ptr<LivingEntity> _mob, float bob,
|
||||
float bodyRot, float a)
|
||||
{
|
||||
shared_ptr<Guardian> mob = dynamic_pointer_cast<Guardian>(_mob);
|
||||
float bodyXRot = mob->xBodyRotO + (mob->xBodyRot - mob->xBodyRotO) * a;
|
||||
|
||||
|
||||
glTranslatef(0, 1.2f, 0);
|
||||
glRotatef(180.0f - bodyRot, 0, 1, 0);
|
||||
glRotatef(bodyXRot, 1, 0, 0);
|
||||
glTranslatef(0, -1.2f, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void GuardianRenderer::render(shared_ptr<Entity> _mob, double x, double y, double z,
|
||||
float rot, float a)
|
||||
{
|
||||
|
||||
MobRenderer::render(_mob, x, y, z, rot, a);
|
||||
|
||||
shared_ptr<Guardian> mob = dynamic_pointer_cast<Guardian>(_mob);
|
||||
if (!mob || !mob->hasTargetedEntity()) return;
|
||||
|
||||
shared_ptr<Entity> target = mob->level->getEntity(mob->getTargetedEntityId());
|
||||
if (!target) {
|
||||
target = mob->level->getNearestPlayer(mob->x, mob->y, mob->z, 64.0);
|
||||
if (!target || target->entityId != mob->getTargetedEntityId()) return;
|
||||
}
|
||||
|
||||
|
||||
float f = mob->getAttackAnimationScale(a);
|
||||
float time = (float)mob->tickCount + a;
|
||||
float texVOff = -time * 0.2f - floor(-time * 0.1f);
|
||||
float eyeHeight = mob->getEyeHeight();
|
||||
if (mob && mob->isElder())
|
||||
eyeHeight = mob->bbHeight * 0.5f * 2.35f;
|
||||
|
||||
|
||||
double targetX = target->xo + (target->x - target->xo) * a;
|
||||
double targetZ = target->zo + (target->z - target->zo) * a;
|
||||
|
||||
double targetYBase = target->yo + (target->y - target->yo) * a;
|
||||
double targetY = targetYBase - (target->bbHeight * 0.5f);
|
||||
|
||||
|
||||
|
||||
double mobX = mob->xo + (mob->x - mob->xo) * a;
|
||||
double mobY = mob->yo + (mob->y - mob->yo) * a + eyeHeight;
|
||||
double mobZ = mob->zo + (mob->z - mob->zo) * a;
|
||||
|
||||
double dx = targetX - mobX;
|
||||
double dy = targetY - mobY;
|
||||
double dz = targetZ - mobZ;
|
||||
|
||||
double distOrizzontale = sqrt(dx * dx + dz * dz);
|
||||
double distanzaTotale = sqrt(dx * dx + dy * dy + dz * dz);
|
||||
|
||||
|
||||
bindTexture(&GUARDIAN_BEAM_LOCATION);
|
||||
glDisable(GL_LIGHTING);
|
||||
glDisable(GL_CULL_FACE);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glDepthMask(true);
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef((float)x, (float)y + eyeHeight, (float)z);
|
||||
|
||||
|
||||
glRotatef((float)(atan2(dx, dz) * 180.0 / PI), 0, 1, 0);
|
||||
glRotatef((float)(-atan2(dy, distOrizzontale) * 180.0 / PI), 1, 0, 0);
|
||||
|
||||
Tesselator* t = Tesselator::getInstance();
|
||||
|
||||
|
||||
double r1 = 0.2;
|
||||
double r2 = r1 * 1.41;
|
||||
|
||||
double rotBeam = time * 0.05 * (1.0 - 2.5);
|
||||
float f7 = f * f;
|
||||
int red = (int)fmin(255, 64 + (int)(f7 * 240.0f));
|
||||
int green = (int)fmin(255, 32 + (int)(f7 * 192.0f));
|
||||
int blue = (int)fmax(0, fmin(255, 128 - (int)(f7 * 64.0f)));
|
||||
|
||||
double vMin = 0.0 + texVOff;
|
||||
double vMax = distanzaTotale * (0.5 / r1) + texVOff;
|
||||
|
||||
|
||||
double d12 = cos(rotBeam + PI) * r1;
|
||||
double d13 = sin(rotBeam + PI) * r1;
|
||||
double d14 = cos(rotBeam + 0.0) * r1;
|
||||
double d15 = sin(rotBeam + 0.0) * r1;
|
||||
double d16 = cos(rotBeam + (PI / 2.0)) * r1;
|
||||
double d17 = sin(rotBeam + (PI / 2.0)) * r1;
|
||||
double d18 = cos(rotBeam + (PI * 3.0 / 2.0)) * r1;
|
||||
double d19 = sin(rotBeam + (PI * 3.0 / 2.0)) * r1;
|
||||
|
||||
|
||||
t->begin();
|
||||
t->color(red, green, blue, 255);
|
||||
t->vertexUV(d12, d13, distanzaTotale, 0.4999, vMax);
|
||||
t->vertexUV(d12, d13, 0.0, 0.4999, vMin);
|
||||
t->vertexUV(d14, d15, 0.0, 0.0, vMin);
|
||||
t->vertexUV(d14, d15, distanzaTotale, 0.0, vMax);
|
||||
t->vertexUV(d16, d17, distanzaTotale, 0.4999, vMax);
|
||||
t->vertexUV(d16, d17, 0.0, 0.4999, vMin);
|
||||
t->vertexUV(d18, d19, 0.0, 0.0, vMin);
|
||||
t->vertexUV(d18, d19, distanzaTotale, 0.0, vMax);
|
||||
t->end();
|
||||
|
||||
|
||||
glDepthMask(false);
|
||||
double d24 = (mob->tickCount % 2 == 0) ? 0.5 : 0.0;
|
||||
|
||||
t->begin();
|
||||
t->color(red, green, blue, 64);
|
||||
|
||||
double g1 = cos(rotBeam + 2.356) * r2;
|
||||
double g2 = sin(rotBeam + 2.356) * r2;
|
||||
double g3 = cos(rotBeam + 0.785) * r2;
|
||||
double g4 = sin(rotBeam + 0.785) * r2;
|
||||
double g5 = cos(rotBeam + 3.926) * r2;
|
||||
double g6 = sin(rotBeam + 3.926) * r2;
|
||||
double g7 = cos(rotBeam + 5.497) * r2;
|
||||
double g8 = sin(rotBeam + 5.497) * r2;
|
||||
|
||||
t->vertexUV(g1, g2, distanzaTotale, 0.5, d24 + 0.5);
|
||||
t->vertexUV(g1, g2, 0.0, 0.5, d24);
|
||||
t->vertexUV(g3, g4, 0.0, 1.0, d24);
|
||||
t->vertexUV(g3, g4, distanzaTotale, 1.0, d24 + 0.5);
|
||||
t->vertexUV(g7, g8, distanzaTotale, 1.0, d24 + 0.5);
|
||||
t->vertexUV(g7, g8, 0.0, 1.0, d24);
|
||||
t->vertexUV(g5, g6, 0.0, 0.5, d24);
|
||||
t->vertexUV(g5, g6, distanzaTotale, 0.5, d24 + 0.5);
|
||||
t->end();
|
||||
|
||||
glDepthMask(true);
|
||||
glDisable(GL_BLEND);
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
void GuardianRenderer::renderModel(shared_ptr<LivingEntity> mob, float wp, float ws, float bob,
|
||||
float headRotMinusBodyRot, float headRotx, float scale)
|
||||
{
|
||||
shared_ptr<Guardian> guardian = dynamic_pointer_cast<Guardian>(mob);
|
||||
if (guardian && guardian->isElder())
|
||||
{
|
||||
glPushMatrix();
|
||||
|
||||
glTranslatef(0.0f, -2.0f, 0.0f);
|
||||
glScalef(2.35f, 2.35f, 2.35f);
|
||||
LivingEntityRenderer::renderModel(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale);
|
||||
glPopMatrix();
|
||||
}
|
||||
else
|
||||
{
|
||||
LivingEntityRenderer::renderModel(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
#include "MobRenderer.h"
|
||||
|
||||
class GuardianModel;
|
||||
|
||||
class GuardianRenderer : public MobRenderer
|
||||
{
|
||||
private:
|
||||
GuardianModel *guardianModel;
|
||||
|
||||
static ResourceLocation GUARDIAN_LOCATION;
|
||||
static ResourceLocation GUARDIAN_ELDER_LOCATION;
|
||||
static ResourceLocation GUARDIAN_BEAM_LOCATION;
|
||||
|
||||
|
||||
void getInterpolatedPos(shared_ptr<LivingEntity> entity, double yOffset,
|
||||
float partialTicks,
|
||||
double &outX, double &outY, double &outZ);
|
||||
|
||||
public:
|
||||
GuardianRenderer(Model *model, float shadow);
|
||||
|
||||
|
||||
|
||||
|
||||
virtual bool shouldRender(shared_ptr<Entity> mob, float camX, float camY, float camZ) override;
|
||||
|
||||
virtual void render(shared_ptr<Entity> mob, double x, double y, double z,
|
||||
float rot, float a) override;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
virtual void setupRotations(shared_ptr<LivingEntity> mob, float bob,
|
||||
float bodyRot, float a) override;
|
||||
|
||||
|
||||
virtual void renderModel(shared_ptr<LivingEntity> mob, float wp, float ws, float bob,
|
||||
float headRotMinusBodyRot, float headRotx, float scale) override;
|
||||
virtual ResourceLocation *getTextureLocation(shared_ptr<Entity> mob) override;
|
||||
};
|
||||
@@ -2646,6 +2646,28 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
case Item::writtenBook_Id:
|
||||
*piUse = IDS_TOOLTIPS_READ;
|
||||
break;
|
||||
case Item::helmet_leather_Id:
|
||||
case Item::helmet_chain_Id:
|
||||
case Item::helmet_iron_Id:
|
||||
case Item::helmet_gold_Id:
|
||||
case Item::helmet_diamond_Id:
|
||||
case Item::chestplate_leather_Id:
|
||||
case Item::chestplate_chain_Id:
|
||||
case Item::chestplate_iron_Id:
|
||||
case Item::chestplate_gold_Id:
|
||||
case Item::chestplate_diamond_Id:
|
||||
case Item::leggings_leather_Id:
|
||||
case Item::leggings_chain_Id:
|
||||
case Item::leggings_iron_Id:
|
||||
case Item::leggings_gold_Id:
|
||||
case Item::leggings_diamond_Id:
|
||||
case Item::boots_leather_Id:
|
||||
case Item::boots_chain_Id:
|
||||
case Item::boots_iron_Id:
|
||||
case Item::boots_gold_Id:
|
||||
case Item::boots_diamond_Id:
|
||||
*piUse = IDS_TOOLTIPS_EQUIP;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,17 @@ void MobRenderer::render(shared_ptr<Entity> _mob, double x, double y, double z,
|
||||
renderLeash(mob, x, y, z, rot, a);
|
||||
}
|
||||
|
||||
|
||||
bool MobRenderer::shouldRender(shared_ptr<Entity> entity, float camX, float camY, float camZ)
|
||||
{
|
||||
|
||||
double dx = entity->x - camX;
|
||||
double dy = entity->y - camY;
|
||||
double dz = entity->z - camZ;
|
||||
double distSq = dx*dx + dy*dy + dz*dz;
|
||||
return entity->shouldRenderAtSqrDistance(distSq);
|
||||
}
|
||||
|
||||
bool MobRenderer::shouldShowName(shared_ptr<LivingEntity> mob)
|
||||
{
|
||||
return LivingEntityRenderer::shouldShowName(mob) && (mob->shouldShowName() || dynamic_pointer_cast<Mob>(mob)->hasCustomName());
|
||||
|
||||
@@ -14,6 +14,7 @@ class MobRenderer : public LivingEntityRenderer
|
||||
public:
|
||||
MobRenderer(Model *model, float shadow);
|
||||
virtual void render(shared_ptr<Entity> mob, double x, double y, double z, float rot, float a);
|
||||
virtual bool shouldRender(shared_ptr<Entity> entity, float camX, float camY, float camZ) override;
|
||||
|
||||
protected:
|
||||
virtual bool shouldShowName(shared_ptr<LivingEntity> mob);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
Model::Model()
|
||||
{
|
||||
riding = false;
|
||||
young=true;
|
||||
young=false; //andi change
|
||||
texWidth=64;
|
||||
texHeight=32;
|
||||
}
|
||||
|
||||
@@ -386,6 +386,7 @@ bool ServerPlayerGameMode::useItem(shared_ptr<Player> player, Level *level, shar
|
||||
player->inventory->items[player->inventory->selected] = itemInstance;
|
||||
if (isCreative())
|
||||
{
|
||||
//if (!(Item::items[itemInstance->id]->getBaseItemType() == 7 || Item::items[itemInstance->id]->getBaseItemType() == 8 || Item::items[itemInstance->id]->getBaseItemType() == 9 || Item::items[itemInstance->id]->getBaseItemType() == 10))
|
||||
itemInstance->count = oldCount;
|
||||
if (itemInstance->isDamageableItem()) itemInstance->setAuxValue(oldAux);
|
||||
}
|
||||
|
||||
@@ -191,6 +191,9 @@ const wchar_t *Textures::preLoaded[TN_COUNT] =
|
||||
|
||||
|
||||
L"mob/endermite",
|
||||
L"mob/guardian",
|
||||
L"mob/guardian_elder",
|
||||
L"mob/guardian_beam",
|
||||
|
||||
#ifdef _LARGE_WORLDS
|
||||
L"misc/additionalmapicons",
|
||||
|
||||
@@ -177,6 +177,9 @@ typedef enum _TEXTURE_NAME
|
||||
|
||||
|
||||
TN_MOB_ENDERMITE,
|
||||
TN_MOB_GUARDIAN,
|
||||
TN_MOB_GUARDIAN_ELDER,
|
||||
TN_MOB_GUARDIAN_BEAM,
|
||||
|
||||
|
||||
#ifdef _LARGE_WORLDS
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -624,6 +624,8 @@ set(_MINECRAFT_CLIENT_COMMON_NET_MINECRAFT_CLIENT_MODEL
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/ArmorStandModel.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/EndermiteModel.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/EndermiteModel.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/GuardianModel.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/GuardianModel.h"
|
||||
|
||||
)
|
||||
source_group("net/minecraft/client/model" FILES ${_MINECRAFT_CLIENT_COMMON_NET_MINECRAFT_CLIENT_MODEL})
|
||||
@@ -901,6 +903,8 @@ set(_MINECRAFT_CLIENT_COMMON_NET_MINECRAFT_CLIENT_RENDERER_ENTITY
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/RabbitRenderer.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/ArmorStandRenderer.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/EndermiteRenderer.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/GuardianRenderer.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/GuardianRenderer.h"
|
||||
)
|
||||
source_group("net/minecraft/client/renderer/entity" FILES ${_MINECRAFT_CLIENT_COMMON_NET_MINECRAFT_CLIENT_RENDERER_ENTITY})
|
||||
|
||||
|
||||
@@ -389,4 +389,9 @@ void glTexGen(int coord, int mode, FloatBuffer *vec)
|
||||
void glCullFace(int dir)
|
||||
{
|
||||
RenderManager.StateSetFaceCullCW( dir == GL_BACK);
|
||||
}
|
||||
}
|
||||
|
||||
void glTexParameterf(int target, int param, float value)
|
||||
{
|
||||
RenderManager.TextureSetParam(param, (int)value);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ void glFogf(int,float);
|
||||
void glFog(int,FloatBuffer *);
|
||||
void glColorMaterial(int,int);
|
||||
void glMultiTexCoord2f(int, float, float);
|
||||
|
||||
void glTexParameterf(int target, int param, float value);
|
||||
//1.8.2
|
||||
void glClientActiveTexture(int);
|
||||
void glActiveTexture(int);
|
||||
|
||||
Reference in New Issue
Block a user