Jump to content

Render Target Remastered


Recommended Posts

  • Silver
vor 56 Minuten schrieb CxL'Mufuku:

Why the fuck is every1 using it so fucking complicated? - Why do you use the renderTarget-module in the parent class? Just because I did it in the example?!

 


#untested

##ui.py
import renderTarget

class RenderTarget(Window):
	def __init__(self, layer = "UI"):
		Window.__init__(self, layer)
		self.renderIdx = -1

	def __del__(self):
		Window.__del__(self)

	def RegisterWindow(self, layer):
		self.hWnd = wndMgr.RegisterRenderTarget(self, layer)
		
	def SetRenderTarget(self, renderIdx):
		self.renderIdx = renderIdx
		wndMgr.SetRenderTarget(self.hWnd, self.renderIdx)
	
	def SetBackground(self, image):
		if self.renderIdx == -1:
			dbg.TraceError("RenderTarget: You have to set the RenderTarget first!")
			return
		renderTarget.SetBackground(self.renderIdx, image)
	
	def SelectModel(self, index):
		if self.renderIdx == -1:
			dbg.TraceError("RenderTarget: You have to set the RenderTarget first!")
			return
		renderTarget.SelectModel(self.renderIdx, index)
	
	def SetVisibility(self, vis):
		if self.renderIdx == -1:
			dbg.TraceError("RenderTarget: You have to set the RenderTarget first!")
			return
		renderTarget.SetVisibility(self.renderIdx, vis)
	
	def SetHair(self, index):
		if self.renderIdx == -1:
			dbg.TraceError("RenderTarget: You have to set the RenderTarget first!")
			return
		renderTarget.SetHair(self.renderIdx, index)
	
	def SetArmor(self, index):
		if self.renderIdx == -1:
			dbg.TraceError("RenderTarget: You have to set the RenderTarget first!")
			return
		renderTarget.SetArmor(self.renderIdx, index)
	
	def SetWeapon(self, index):
		if self.renderIdx == -1:
			dbg.TraceError("RenderTarget: You have to set the RenderTarget first!")
			return
		renderTarget.SetWeapon(self.renderIdx, index)
	
	def SetAcce(self, index):
		if self.renderIdx == -1:
			dbg.TraceError("RenderTarget: You have to set the RenderTarget first!")
			return
		renderTarget.SetAcce(self.renderIdx, index)

##somewhere in init/load/create
		self.ModelPreview = ui.RenderTarget()
		self.ModelPreview.SetParent(self.ModelPreviewBoard)
		self.ModelPreview.SetSize(190, 210)
		self.ModelPreview.SetPosition(5, 22)
		self.ModelPreview.SetRenderTarget(2) # Der index hat eindeutig zu sein -> sonst kann man nicht 2 rendertargets gleichzeitig sehen, logisch oder?
		self.ModelPreview.SetBackground("d:/ymir work/ui/game/myshop_deco/model_view_bg.sub")
		self.ModelPreview.SetVisibility(True)
		self.ModelPreview.SelectModel(model)
		self.ModelPreview.SetHair(Vnum)
		self.ModelPreview.SetArmor(Vnum)	
		self.ModelPreview.SetWeapon(Vnum)
		self.ModelPreview.SetAcce(Vnum)
		self.ModelPreview.Show()
        
##somewhere in hide/close/whatever:
		self.ModelPreview.SetVisibility(False)
  
##somewhere in some fucking method, who cares?
		self.ModelPreview.SetWeapon(Vnum)
  

 

Why i should define an extra function on RenderTarget class, when ich can use it directly ? e.g. from UiToolTip i call direkt the BInary. So why i should go the extra way over the RenderTarget class ? :D

 

Link to comment
Share on other sites

  • Bronze
vor einer Stunde schrieb V0lvox:

Why i should define an extra function on RenderTarget class, when ich can use it directly ? e.g. from UiToolTip i call direkt the BInary. So why i should go the extra way over the RenderTarget class ? :D

 

Ahh yeah,  lets call every thing directly

id = wndMgr.RegisterTextLine(self, "UI")
wndMgr.SetFontName(id, "Arial:12")
wndMgr.SetText(id, "TEXT TEXT TEXT")
wndMgr.SetSize(id, 10, 100)

 

__________________________________________________________________________________________
Never trade with an alleged "CxL'"-Member on this board. You can see a list of all verified members *here*.

I don't care what they all say
I'ma do this thing my way
Been grinding hard on it all day
We work hard then we all play

Link to comment
Share on other sites

  • Silver
vor 33 Minuten schrieb CxL'Mufuku:

Ahh yeah,  lets call every thing directly


id = wndMgr.RegisterTextLine(self, "UI")
wndMgr.SetFontName(id, "Arial:12")
wndMgr.SetText(id, "TEXT TEXT TEXT")
wndMgr.SetSize(id, 10, 100)

 

Where is this code from ?

vor 22 Minuten schrieb Thundernatsu:

CPythonTextTail::DeleteCharacterTextTail - Find VID[0] Error
CPythonTextTail::DeleteCharacterTextTail - Find VID[0] Error

when I go to the armor hair weapon etc ...

You call SetArmor/ SetWeapon /SetHair with 0 somewhere. Contact me Discord and i will have a look

 

Link to comment
Share on other sites

Hello,

Thanks for share this system,

But i have multiple error,

0816 14:07:34639 :: AttributeError
0816 14:07:34639 :: : 
0816 14:07:34639 :: 'module' object has no attribute 'SetWeapon'
0816 14:07:34639 :: 
0816 14:07:34639 :: AttributeError
0816 14:07:34639 :: : 
0816 14:07:34639 :: 'module' object has no attribute 'SetHair'
0816 14:07:34639 :: 

Can you help me ? thx

Link to comment
Share on other sites

  • Silver
On 8/16/2019 at 10:14 PM, louxor said:

Hello,

Thanks for share this system,

But i have multiple error,


0816 14:07:34639 :: AttributeError
0816 14:07:34639 :: : 
0816 14:07:34639 :: 'module' object has no attribute 'SetWeapon'
0816 14:07:34639 :: 

0816 14:07:34639 :: AttributeError
0816 14:07:34639 :: : 
0816 14:07:34639 :: 'module' object has no attribute 'SetHair'
0816 14:07:34639 :: 

Can you help me ? thx

Add me Discord:

Edited by VegaS™
Link to comment
Share on other sites

  • 2 weeks later...
  • Forum Moderator
On 8/5/2019 at 3:20 PM, CxL'Mufuku said:
Spoiler


#untested

##ui.py
import renderTarget

class RenderTarget(Window):
	def __init__(self, layer = "UI"):
		Window.__init__(self, layer)
		self.renderIdx = -1

	def __del__(self):
		Window.__del__(self)

	def RegisterWindow(self, layer):
		self.hWnd = wndMgr.RegisterRenderTarget(self, layer)
		
	def SetRenderTarget(self, renderIdx):
		self.renderIdx = renderIdx
		wndMgr.SetRenderTarget(self.hWnd, self.renderIdx)
	
	def SetBackground(self, image):
		if self.renderIdx == -1:
			dbg.TraceError("RenderTarget: You have to set the RenderTarget first!")
			return
		renderTarget.SetBackground(self.renderIdx, image)
	
	def SelectModel(self, index):
		if self.renderIdx == -1:
			dbg.TraceError("RenderTarget: You have to set the RenderTarget first!")
			return
		renderTarget.SelectModel(self.renderIdx, index)
	
	def SetVisibility(self, vis):
		if self.renderIdx == -1:
			dbg.TraceError("RenderTarget: You have to set the RenderTarget first!")
			return
		renderTarget.SetVisibility(self.renderIdx, vis)
	
	def SetHair(self, index):
		if self.renderIdx == -1:
			dbg.TraceError("RenderTarget: You have to set the RenderTarget first!")
			return
		renderTarget.SetHair(self.renderIdx, index)
	
	def SetArmor(self, index):
		if self.renderIdx == -1:
			dbg.TraceError("RenderTarget: You have to set the RenderTarget first!")
			return
		renderTarget.SetArmor(self.renderIdx, index)
	
	def SetWeapon(self, index):
		if self.renderIdx == -1:
			dbg.TraceError("RenderTarget: You have to set the RenderTarget first!")
			return
		renderTarget.SetWeapon(self.renderIdx, index)
	
	def SetAcce(self, index):
		if self.renderIdx == -1:
			dbg.TraceError("RenderTarget: You have to set the RenderTarget first!")
			return
		renderTarget.SetAcce(self.renderIdx, index)

##somewhere in init/load/create
		self.ModelPreview = ui.RenderTarget()
		self.ModelPreview.SetParent(self.ModelPreviewBoard)
		self.ModelPreview.SetSize(190, 210)
		self.ModelPreview.SetPosition(5, 22)
		self.ModelPreview.SetRenderTarget(2) # Der index hat eindeutig zu sein -> sonst kann man nicht 2 rendertargets gleichzeitig sehen, logisch oder?
		self.ModelPreview.SetBackground("d:/ymir work/ui/game/myshop_deco/model_view_bg.sub")
		self.ModelPreview.SetVisibility(True)
		self.ModelPreview.SelectModel(model)
		self.ModelPreview.SetHair(Vnum)
		self.ModelPreview.SetArmor(Vnum)	
		self.ModelPreview.SetWeapon(Vnum)
		self.ModelPreview.SetAcce(Vnum)
		self.ModelPreview.Show()
        
##somewhere in hide/close/whatever:
		self.ModelPreview.SetVisibility(False)
  
##somewhere in some fucking method, who cares?
		self.ModelPreview.SetWeapon(Vnum)
  

 

On 8/5/2019 at 4:18 PM, V0lvox said:

Why i should define an extra function on RenderTarget class, when ich can use it directly ? e.g. from UiToolTip i call direkt the BInary. So why i should go the extra way over the RenderTarget class ? :D

You're right, but if you really want to use something like this, you should do a customizable class, like:

This is the hidden content, please

  • Metin2 Dev 57
  • Dislove 1
  • Not Good 1
  • Think 1
  • Confused 1
  • Good 12
  • Love 59
Link to comment
Share on other sites

1 hour ago, filipw1 said:

Make sure you did PythonApplication.h part 

Yes I did both of these:

 

//1.1 Search:
#include "MovieMan.h"
//1.2 add after:
#include "../eterLib/CRenderTarget.h"
#include "../eterLib/CRenderTargetManager.h"


//2.1 Search:
		CPythonSystem				m_pySystem;

//2.2 Add after:
		CRenderTargetManager		m_kRenderTargetManager;

 

Link to comment
Share on other sites

  • Premium
14 minut temu, Cripplez napisał:

Yes I did both of these:

 


//1.1 Search:
#include "MovieMan.h"
//1.2 add after:
#include "../eterLib/CRenderTarget.h"
#include "../eterLib/CRenderTargetManager.h"


//2.1 Search:
		CPythonSystem				m_pySystem;

//2.2 Add after:
		CRenderTargetManager		m_kRenderTargetManager;

 

OK. Then you didn't add new files to project 

Link to comment
Share on other sites

  • Premium
37 minut temu, Cripplez napisał:

Yes i added the new files, I copy/pasted the files in the right folder, do I have to do something else too other than add them in the folder?

Yes, in Visual Studio right click on User Interface solution, then Add, Existing file and select those new files 

Link to comment
Share on other sites

How can i make this system to show ONLY if i press a key (CTRL or ALT), because if it is always active it is kinda annoying ?

And I have a small problem too, if I am a male Ninja or female Warrior for example in the preview of a Sword I see a Male Ninja or a Female Warrior with the Sword, but if want to see a Bow, Dagger or Armors it will show me a Female Ninja or Male Warrior, how can i fix this? Maybe the problem is here?

Spoiler

 


	def __ItemGetRace(self):
		race = 0

		if item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN) and item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA) and item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN):
			race = 9
		elif item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR) and item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA) and item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN):
			race = 1
		elif item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR) and item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN) and item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN):
			race = 2
		elif item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR) and item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN) and item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA):
			race = 3

		sex = chr.RaceToSex(player.GetRace())
		MALE = 1
		FEMALE = 0

		if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and sex == MALE:
			race = player.GetRace() + 4

		if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and sex == FEMALE:
			race = player.GetRace()

		if race == 0:
			race = player.GetRace()

		if race == 9:
			race = 0

		return race	

****************************************

	def CanViewRendering(self):
		race = player.GetRace()
		job = chr.RaceToJob(race)
		if not self.ANTI_FLAG_DICT.has_key(job):
			return False

		if item.IsAntiFlag(self.ANTI_FLAG_DICT[job]):
			return False

		sex = chr.RaceToSex(race)
		
		MALE = 1
		FEMALE = 0

		if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and sex == MALE:
			return False

		if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and sex == FEMALE:
			return False

		return True

	def CanViewRenderingSex(self):
		race = player.GetRace()
		sex = chr.RaceToSex(race)
		
		MALE = 1
		FEMALE = 0

		if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and sex == MALE:
			return False

		if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and sex == FEMALE:
			return False

		return True

 

Link to comment
Share on other sites

 

Quote

NextUpdate will include Hair :D

https://metin2.download/picture/bFm48CE3T4YF2k5I36YO6n1I9UMJUR6O/.gif

UiToolTip-Fix_2.0.txt

UiToolTip-Fix_3.0.txt

2.0 -> Rüstung Costüme/Waffen

3.0 -> Hair bug Fix + On/Off Render Target on Gameoptions

 

 

such a problem occurred when I made these arrangements. also the background is black? @V0lvox

fAlNeab.jpg

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

Announcements



×
  • 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.