Servus,
hiermit stelle ich euch folgendes "System" zur Verfügung:
Bitte melden Sie sich an, um dieses Bild zu sehen.
Clientsource:
Code
- NetworkActorManager.cpp:
- #ifdef ENABLE_TELEPORT_MINIMAP_GM
- void CNetworkActorManager::__RemoveDynamicActors()
- {
- //copy it
- std::vector<DWORD> dwCharacterVIDList;
- CPythonCharacterManager& rkChrMgr = CPythonCharacterManager::Instance();
- for (CPythonCharacterManager::CharacterIterator i = rkChrMgr.CharacterInstanceBegin(); i != rkChrMgr.CharacterInstanceEnd(); ++i)
- {
- dwCharacterVIDList.push_back((*i)->GetVirtualID());
- }
- for (int i = 0; i < dwCharacterVIDList.size(); ++i)
- {
- CInstanceBase* pkInstEach = rkChrMgr.GetInstancePtr(dwCharacterVIDList[i]);
- if (!pkInstEach)
- continue;
- CActorInstance* rkActorEach = pkInstEach->GetGraphicThingInstancePtr();
- if (rkActorEach->IsPC() || rkActorEach->IsNPC() || rkActorEach->IsEnemy() || rkActorEach->IsStone())
- {
- rkChrMgr.DeleteInstance(dwCharacterVIDList[i]);
- auto it = m_kNetActorDict.find(dwCharacterVIDList[i]);
- if (it != m_kNetActorDict.end())
- {
- m_kNetActorDict.erase(it);
- }
- }
- }
- rkChrMgr.DestroyDeadInstanceList();
- }
- #else
- void CNetworkActorManager::__RemoveDynamicActors()
- {
- //copy it
- std::vector<DWORD> dwCharacterVIDList;
- CPythonCharacterManager& rkChrMgr=CPythonCharacterManager::Instance();
- for(CPythonCharacterManager::CharacterIterator i = rkChrMgr.CharacterInstanceBegin(); i!=rkChrMgr.CharacterInstanceEnd(); ++i)
- {
- dwCharacterVIDList.push_back( (*i)->GetVirtualID() );
- }
- for( int i = 0; i < dwCharacterVIDList.size(); ++i )
- {
- CInstanceBase* pkInstEach = rkChrMgr.GetInstancePtr( dwCharacterVIDList[i] );
- if( !pkInstEach )
- continue;
- CActorInstance* rkActorEach=pkInstEach->GetGraphicThingInstancePtr();
- if( rkActorEach->IsPC() || rkActorEach->IsNPC() || rkActorEach->IsEnemy() )
- {
- rkChrMgr.DeleteInstance(dwCharacterVIDList[i]);
- std::map<DWORD, SNetworkActorData>::iterator it =m_kNetActorDict.find(dwCharacterVIDList[i]);
- if (it != m_kNetActorDict.end())
- {
- m_kNetActorDict.erase(it);
- }
- }
- }
- rkChrMgr.DestroyDeadInstanceList();
- }
- #endif
Code
- PythonMiniMap.cpp:
- bool CPythonMiniMap::GetAtlasInfo(float fScreenX, float fScreenY, std::string & rReturnString, float * pReturnPosX, float * pReturnPosY, DWORD * pdwTextColor, DWORD * pdwGuildID)
- {
- float fRealX = (fScreenX - m_fAtlasScreenX) * (m_fAtlasMaxX / m_fAtlasImageSizeX);
- float fRealY = (fScreenY - m_fAtlasScreenY) * (m_fAtlasMaxY / m_fAtlasImageSizeY);
- #ifdef ENABLE_TELEPORT_MINIMAP_GM
- *pReturnPosX = fRealX;
- *pReturnPosY = fRealY;
- #endif
Python:
Code
- uiminimap.py:
- if app.ENABLE_TELEPORT_MINIMAP_GM:
- import chr
- Suche nach:
- miniMap.RegisterAtlasWindow(self)
- Füge darunter:
- if app.ENABLE_TELEPORT_MINIMAP_GM:
- self.board.SetMouseLeftButtonDownEvent(ui.__mem_func__(self.OnMouseLeftButtonUpEvent))
- Suche nach:
- def SetCenterPositionAdjust(self, x, y):
- Füge darunter:
- if app.ENABLE_TELEPORT_MINIMAP_GM:
- def OnMouseLeftButtonUpEvent(self):
- (mouseX, mouseY) = wndMgr.GetMousePosition()
- (bFind, sName, iPosX, iPosY, dwTextColor, dwGuildID) = miniMap.GetAtlasInfo(mouseX, mouseY)
- if chr.IsGameMaster(player.GetMainCharacterIndex()):
- net.SendChatPacket("/go %s %s" % (str(iPosX), str(iPosY)))
Liebe Grüße
CHXelo