Em có một code, em đã khai báo 3 cái ở *.h
- DrawMiniMapWindow
- MiniMapCheck
- CombinedChecks
Nhưng khi build nó báo lỗi undefined reference
Ở Các chỗ này
ePLAYER_POINT, eLORENCIA_MAP, eDUNGEON_MAP, eDEVIAS_MAP, eNORIA_MAP, eLOSTTOWER_MAP, eSTADIUM_MAP, eATLANS_MAP, eTarkan_MAP, eAida_MAP,eBarraks_MAP
Làm sao khai báo nó ở file *.h
vậy ạ cảm ơn các anh?
File *.cpp
void Interface::Load()
{
this->BindObject(eMINI_MAP_BG, 0x7882, 138, 265, -1, -1);
this->BindObject(ePLAYER_POINT, 0x7883, 3, 3, -1, -1);
// ----
this->BindObject(eNULL_MAP, 0x7884, 128, 128, -1, -1);
// ----
this->BindObject(eLORENCIA_MAP, 0x7885, 128, 128, -1, -1);
// ----
this->BindObject(eDUNGEON_MAP, 0x7886, 128, 128, -1, -1);
// ----
this->BindObject(eDEVIAS_MAP, 0x7887, 128, 128, -1, -1);
// ----
this->BindObject(eNORIA_MAP, 0x7888, 128, 128, -1, -1);
// ----
this->BindObject(eLOSTTOWER_MAP, 0x7889, 128, 128, -1, -1);
// ----
// Reserved 0x788A for EXILE
// ----
this->BindObject(eSTADIUM_MAP, 0x788B, 128, 128, -1, -1);
// ----
this->BindObject(eATLANS_MAP, 0x788C, 128, 128, -1, -1);
}
void Interface::Work()
{
gInterface.DrawMiniMapWindow();
}
void Interface::LoadImages()
{
pLoadImage("Custom\\Interface\\MiniMapUI.tga", 0x7882, 0x2601, 0x2900, 1, 0);
// ----
pLoadImage("Custom\\Maps\\PlayerPoint.jpg", 0x7883, 0x2600, 0x2900, 1, 0);
// ----
pLoadImage("Custom\\Maps\\MiniMapNull.tga", 0x7884, 0x2601, 0x2900, 1, 0);
// --
pLoadImage("Custom\\Maps\\MiniMap0.tga", 0x7885, 0x2601, 0x2900, 1, 0);
// --
pLoadImage("Custom\\Maps\\MiniMap1.tga", 0x7886, 0x2601, 0x2900, 1, 0);
// --
pLoadImage("Custom\\Maps\\MiniMap2.tga", 0x7887, 0x2601, 0x2900, 1, 0);
// ----
pLoadImage("Custom\\Maps\\MiniMap3.tga", 0x7888, 0x2601, 0x2900, 1, 0);
// ----
pLoadImage("Custom\\Maps\\MiniMap4.tga", 0x7889, 0x2601, 0x2900, 1, 0);
// ----
// Exile Map 0x788A
// ----
pLoadImage("Custom\\Maps\\MiniMap6.tga", 0x788B, 0x2601, 0x2900, 1, 0);
// ----
pLoadImage("Custom\\Maps\\MiniMap7.tga", 0x788C, 0x2601, 0x2900, 1, 0);
}
bool Interface::MiniMapCheck()
{
if(this->CheckWindow(Inventory) ||
this->CheckWindow(CashShop) ||
this->CheckWindow(ChaosBox) ||
this->CheckWindow(Character) ||
this->CheckWindow(CommandWindow) ||
this->CheckWindow(ExpandInventory) ||
this->CheckWindow(ExpandWarehouse) ||
this->CheckWindow(FullMap) ||
this->CheckWindow(GensInfo) ||
this->CheckWindow(Guild) ||
this->CheckWindow(NPC_Dialog) ||
this->CheckWindow(NPC_Julia) ||
this->CheckWindow(NPC_Titus) ||
this->CheckWindow(OtherStore) ||
this->CheckWindow(Party) ||
this->CheckWindow(PetInfo) ||
this->CheckWindow(Shop) ||
this->CheckWindow(SkillTree) ||
this->CheckWindow(Store) ||
this->CheckWindow(Trade) ||
this->CheckWindow(Warehouse) )
return true;
return false;
}
bool Interface::CombinedChecks()
{
if( (this->CheckWindow(Inventory)
&& this->CheckWindow(ExpandInventory)
&& this->CheckWindow(Store)) ||
(this->CheckWindow(Inventory)
&& this->CheckWindow(Warehouse)
&& this->CheckWindow(ExpandWarehouse)) ||
(this->CheckWindow(Inventory)
&& this->CheckWindow(Character)
&& this->CheckWindow(Store)) )
return true;
return false;
}
void Interface::DrawMiniMapWindow()
{
float MainWidth = 138.0;
float MainHeight = 265.0;
float StartY = 264.0;
float StartX = 512.0;
// ----
if( this->MiniMapCheck() || this->CombinedChecks() )
{
return;
}
// ----
switch(gObjUser.m_MapNumber)
{
case 0: //Lorencia
{
this->DrawGUI(eLORENCIA_MAP, StartX, StartY + 30);
}
break;
// --
case 1: //Dungeon
{
this->DrawGUI(eDUNGEON_MAP, StartX, StartY + 30);
}
break;
// --
case 2: //Devias
{
this->DrawGUI(eDEVIAS_MAP, StartX, StartY + 30);
}
break;
// --
case 3: //Noria
{
this->DrawGUI(eNORIA_MAP, StartX, StartY + 30);
}
break;
// --
case 4: //LostTower
{
this->DrawGUI(eLOSTTOWER_MAP, StartX, StartY + 30);
}
break;
// --
case 5: //Exile (disabled)
{
return;
}
break;
// --
case 6: //Stadium
{
this->DrawGUI(eSTADIUM_MAP, StartX, StartY + 30);
}
break;
// --
case 7: //Atlans
{
this->DrawGUI(eATLANS_MAP, StartX, StartY + 30);
}
break;
// --
default: //Default
{
this->DrawGUI(eNULL_MAP, StartX, StartY + 30);
}
break;
}
// ----
this->DrawGUI(eMINI_MAP_BG, StartX, StartY);
this->DrawGUI(ePLAYER_POINT, (float)(StartX - 1 + gObjUser.lpViewPlayer->MapPosX / 2), (float)(294 - 1 + ( 255 - gObjUser.lpViewPlayer->MapPosY ) / 2) );
}