Jump to content

Recommended Posts

  • Premium

Hello from 2025,

If someone wants to add this to TMP4 files you may need to do this in order to make the system working for players and the tooltip :

 

UI.py:

Spoiler
#find 
def GetGlobalPosition(self)

#add after the function:
if app.ENABLE_VIEW_ELEMENT:
		def GetLeft(self):
			x, y = self.GetLocalPosition()
			return x

		def GetGlobalLeft(self):
			x, y = self.GetGlobalPosition()
			return x

		def GetTop(self):
			x, y = self.GetLocalPosition()
			return y

		def GetGlobalTop(self):
			x, y = self.GetGlobalPosition()
			return y

		def GetRight(self):
			return self.GetLeft() + self.GetWidth()

		def GetBottom(self):
			return self.GetTop() + self.GetHeight()

 

 

Game.py:

Spoiler
#search def SetHPTargetBoard(self, vid, hpPercentage, bElement):

#Add before ( or after function):
	def ShowTargetElementEnchant(self, vid, bElement):
			if vid != self.targetBoard.GetTargetVID():
				self.targetBoard.Close()
			self.targetBoard.SetElementImage(bElement)

 

 

Client Source:

 

PythonNetworkStreamPhaseGame.cpp:

Spoiler
//Search : 
if (pInstTarget->IsPC() || pInstTarget->IsBuilding())
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "CloseTargetBoardIfDifferent", Py_BuildValue("(i)", TargetPacket.dwVID));

			else if (pInstPlayer->CanViewTargetHP(*pInstTarget))
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetHPTargetBoard", Py_BuildValue("(ii)", TargetPacket.dwVID, TargetPacket.bHPPercent));

//Replace with :
#ifdef ELEMENT_TARGET
			if (pInstTarget->IsPC() && pInstTarget != pInstPlayer) //if the "&& pInstTarget != pInstPlayer" is not there : element will show on yourself
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "ShowTargetElementEnchant", Py_BuildValue("(ii)", TargetPacket.dwVID, TargetPacket.bElement));
			else if (pInstTarget->IsBuilding() || pInstTarget == pInstPlayer) // "pInstTarget == pInstPlayer": show Unride while mounting
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "CloseTargetBoardIfDifferent", Py_BuildValue("(i)", TargetPacket.dwVID));
			else if (pInstPlayer->CanViewTargetHP(*pInstTarget))
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetHPTargetBoard", Py_BuildValue("(iii)", TargetPacket.dwVID, TargetPacket.bHPPercent, TargetPacket.bElement));
#else
			if (pInstTarget->IsPC() || pInstTarget->IsBuilding())
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "CloseTargetBoardIfDifferent", Py_BuildValue("(i)", TargetPacket.dwVID));

			else if (pInstPlayer->CanViewTargetHP(*pInstTarget))
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetHPTargetBoard", Py_BuildValue("(ii)", TargetPacket.dwVID, TargetPacket.bHPPercent));
#endif

 

 

credit Xpengers for players element image idea here : 

 

I know it's an old system but if someone needs it.

Best regards Ariver.

Edited by ARiver
Maccros and function name changed to match the topic.

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.