exclude unused GameMode implementations, format Platform/Common/Tutorial

This commit is contained in:
Tropical
2026-03-22 02:11:47 -05:00
parent 3fa28df4da
commit a30330f1d0
64 changed files with 5917 additions and 4813 deletions

View File

@@ -7,124 +7,111 @@
#include "../../Minecraft.Client/Minecraft.h"
#include "../../Minecraft.Client/Player/MultiPlayerLocalPlayer.h"
TutorialHint::TutorialHint(eTutorial_Hint id, Tutorial *tutorial, int descriptionId, eHintType type, bool allowFade /*= true*/)
: m_id( id ), m_tutorial(tutorial), m_descriptionId( descriptionId ), m_type( type ), m_counter( 0 ),
m_lastTile( NULL ), m_hintNeeded( true ), m_allowFade(allowFade)
{
tutorial->addMessage(descriptionId, type != e_Hint_NoIngredients);
TutorialHint::TutorialHint(eTutorial_Hint id, Tutorial* tutorial,
int descriptionId, eHintType type,
bool allowFade /*= true*/)
: m_id(id),
m_tutorial(tutorial),
m_descriptionId(descriptionId),
m_type(type),
m_counter(0),
m_lastTile(NULL),
m_hintNeeded(true),
m_allowFade(allowFade) {
tutorial->addMessage(descriptionId, type != e_Hint_NoIngredients);
}
int TutorialHint::startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile)
{
int returnVal = -1;
switch(m_type)
{
case e_Hint_HoldToMine:
if( tile == m_lastTile && m_hintNeeded )
{
++m_counter;
if(m_counter > TUTORIAL_HINT_MAX_MINE_REPEATS)
{
returnVal = m_descriptionId;
}
}
else
{
m_counter = 0;
}
m_lastTile = tile;
break;
default:
break;
}
int TutorialHint::startDestroyBlock(std::shared_ptr<ItemInstance> item,
Tile* tile) {
int returnVal = -1;
switch (m_type) {
case e_Hint_HoldToMine:
if (tile == m_lastTile && m_hintNeeded) {
++m_counter;
if (m_counter > TUTORIAL_HINT_MAX_MINE_REPEATS) {
returnVal = m_descriptionId;
}
} else {
m_counter = 0;
}
m_lastTile = tile;
break;
default:
break;
}
return returnVal;
return returnVal;
}
int TutorialHint::destroyBlock(Tile *tile)
{
int returnVal = -1;
switch(m_type)
{
case e_Hint_HoldToMine:
if(tile == m_lastTile && m_counter > 0)
{
m_hintNeeded = false;
}
break;
default:
break;
}
int TutorialHint::destroyBlock(Tile* tile) {
int returnVal = -1;
switch (m_type) {
case e_Hint_HoldToMine:
if (tile == m_lastTile && m_counter > 0) {
m_hintNeeded = false;
}
break;
default:
break;
}
return returnVal;
return returnVal;
}
int TutorialHint::attack(std::shared_ptr<ItemInstance> item, std::shared_ptr<Entity> entity)
{
/*
switch(m_type)
{
default:
return -1;
}
*/
return -1;
int TutorialHint::attack(std::shared_ptr<ItemInstance> item,
std::shared_ptr<Entity> entity) {
/*
switch(m_type)
{
default:
return -1;
}
*/
return -1;
}
int TutorialHint::createItemSelected(std::shared_ptr<ItemInstance> item, bool canMake)
{
int returnVal = -1;
switch(m_type)
{
case e_Hint_NoIngredients:
if(!canMake)
returnVal = m_descriptionId;
break;
default:
break;
}
return returnVal;
int TutorialHint::createItemSelected(std::shared_ptr<ItemInstance> item,
bool canMake) {
int returnVal = -1;
switch (m_type) {
case e_Hint_NoIngredients:
if (!canMake) returnVal = m_descriptionId;
break;
default:
break;
}
return returnVal;
}
int TutorialHint::itemDamaged(std::shared_ptr<ItemInstance> item)
{
int returnVal = -1;
switch(m_type)
{
case e_Hint_ToolDamaged:
returnVal = m_descriptionId;
break;
default:
break;
}
return returnVal;
int TutorialHint::itemDamaged(std::shared_ptr<ItemInstance> item) {
int returnVal = -1;
switch (m_type) {
case e_Hint_ToolDamaged:
returnVal = m_descriptionId;
break;
default:
break;
}
return returnVal;
}
bool TutorialHint::onTake( std::shared_ptr<ItemInstance> item )
{
return false;
}
bool TutorialHint::onTake(std::shared_ptr<ItemInstance> item) { return false; }
bool TutorialHint::onLookAt(int id, int iData)
{
return false;
}
bool TutorialHint::onLookAt(int id, int iData) { return false; }
bool TutorialHint::onLookAtEntity(eINSTANCEOF type)
{
return false;
}
bool TutorialHint::onLookAtEntity(eINSTANCEOF type) { return false; }
int TutorialHint::tick()
{
int returnVal = -1;
switch(m_type)
{
case e_Hint_SwimUp:
if( Minecraft::GetInstance()->localplayers[m_tutorial->getPad()]->isUnderLiquid(Material::water) ) returnVal = m_descriptionId;
break;
default:
break;
}
return returnVal;
int TutorialHint::tick() {
int returnVal = -1;
switch (m_type) {
case e_Hint_SwimUp:
if (Minecraft::GetInstance()
->localplayers[m_tutorial->getPad()]
->isUnderLiquid(Material::water))
returnVal = m_descriptionId;
break;
default:
break;
}
return returnVal;
}