Jump to content

Config Graphic On / Off


Recommended Posts

  • Bot

M2 Download Center

This is the hidden content, please
( Internal )

Spoiler

282635aEnXaab.png.b7020ed6869c2a2cd89f3d

 

A few days ago I saw a post where someone asked how to hide the effects of the character and if there was a way, it would be better to do it with options to enabled/disabled.

So I was trying to replicate the feature that the official servers implemented in version 18.4

Here I leave you an advance, it is not finished. At the moment only the options for hiding effects of items (such as "EFFECT_AUTO_HPUP", "EFFECT_HAPPINESS_RING_EQUIP", etc.) work.

I know that you can also hide the effects such as skills, emoticons, etc. But I still can not find the way to do it (I could do it from playersettingmodule.py, but in that case it would not be updated in real time, the client.exe would have to be restarted for the changes to be made.) I suppose that somewhere in the client src it will be possible to , but I still can not find it.

But you can also try! So if you like you can do it and share in this thread. :)

Download link: 

This is the hidden content, please

  • Metin2 Dev 101
  • Eyes 2
  • Dislove 2
  • Angry 1
  • Not Good 1
  • Sad 2
  • Smile Tear 1
  • Confused 1
  • Lmao 2
  • Good 23
  • Love 7
  • Love 58

english_banner.gif

Link to comment
Share on other sites

  • Forum Moderator

Good idea, but the python part is a bit too much, 200 lines for 5-6 functions.

2 hours ago, WLsj24 said:
Spoiler


				self.effectLevelButtonList.append(GetObject("effect_level1"))
				self.effectLevelButtonList.append(GetObject("effect_level2"))
				self.effectLevelButtonList.append(GetObject("effect_level3"))
				self.effectLevelButtonList.append(GetObject("effect_level4"))
				self.effectLevelButtonList.append(GetObject("effect_level5"))

				self.privateShopLevelButtonList.append(GetObject("privateShop_level1"))
				self.privateShopLevelButtonList.append(GetObject("privateShop_level2"))
				self.privateShopLevelButtonList.append(GetObject("privateShop_level3"))
				self.privateShopLevelButtonList.append(GetObject("privateShop_level4"))
				self.privateShopLevelButtonList.append(GetObject("privateShop_level5"))

				self.dropItemLevelButtonList.append(GetObject("dropItem_level1"))
				self.dropItemLevelButtonList.append(GetObject("dropItem_level2"))
				self.dropItemLevelButtonList.append(GetObject("dropItem_level3"))
				self.dropItemLevelButtonList.append(GetObject("dropItem_level4"))
				self.dropItemLevelButtonList.append(GetObject("dropItem_level5"))

 

Can be like:

Spoiler

for i in xrange(1, GRAPHIC_LEVEL_MAX_NUM + 1):
	self.effectLevelButtonList.append(GetObject("effect_level%d" % i))
	self.privateShopLevelButtonList.append(GetObject("privateShop_level%d" % i))
	self.dropItemLevelButtonList.append(GetObject("dropItem_level%d" % i))

_____________________________________________________________

2 hours ago, WLsj24 said:
Spoiler


			self.effectLevelButtonList[0].SAFE_SetEvent(self.__OnClickEffectLevel1Button)
			self.effectLevelButtonList[1].SAFE_SetEvent(self.__OnClickEffectLevel2Button)
			self.effectLevelButtonList[2].SAFE_SetEvent(self.__OnClickEffectLevel3Button)
			self.effectLevelButtonList[3].SAFE_SetEvent(self.__OnClickEffectLevel4Button)
			self.effectLevelButtonList[4].SAFE_SetEvent(self.__OnClickEffectLevel5Button)

			self.privateShopLevelButtonList[0].SAFE_SetEvent(self.__OnClickPrivateShopLevel1Button)
			self.privateShopLevelButtonList[1].SAFE_SetEvent(self.__OnClickPrivateShopLevel2Button)
			self.privateShopLevelButtonList[2].SAFE_SetEvent(self.__OnClickPrivateShopLevel3Button)
			self.privateShopLevelButtonList[3].SAFE_SetEvent(self.__OnClickPrivateShopLevel4Button)
			self.privateShopLevelButtonList[4].SAFE_SetEvent(self.__OnClickPrivateShopLevel5Button)

			self.dropItemLevelButtonList[0].SAFE_SetEvent(self.__OnClickDropItemLevel1Button)
			self.dropItemLevelButtonList[1].SAFE_SetEvent(self.__OnClickDropItemLevel2Button)
			self.dropItemLevelButtonList[2].SAFE_SetEvent(self.__OnClickDropItemLevel3Button)
			self.dropItemLevelButtonList[3].SAFE_SetEvent(self.__OnClickDropItemLevel4Button)
			self.dropItemLevelButtonList[4].SAFE_SetEvent(self.__OnClickDropItemLevel5Button)

			self.petStatusButtonList[0].SAFE_SetEvent(self.__OnClickPetStatusOnButton)
			self.petStatusButtonList[1].SAFE_SetEvent(self.__OnClickPetStatusOffButton)

			self.npcNameStatusButtonList[0].SAFE_SetEvent(self.__OnClickNpcNameStatusOnButton)
			self.npcNameStatusButtonList[1].SAFE_SetEvent(self.__OnClickNpcNameStatusOffButton)

		# Effect
		def __SetEffectLevel(self, index):
			self.__ClickRadioButton(self.effectLevelButtonList, index)
			self.effectLevel=index

		def __OnClickEffectLevel1Button(self):
			self.__SetEffectLevel(0)

		def __OnClickEffectLevel2Button(self):
			self.__SetEffectLevel(1)

		def __OnClickEffectLevel3Button(self):
			self.__SetEffectLevel(2)

		def __OnClickEffectLevel4Button(self):
			self.__SetEffectLevel(3)

		def __OnClickEffectLevel5Button(self):
			self.__SetEffectLevel(4)

		# PrivateShop
		def __SetPrivateShopLevel(self, index):
			self.__ClickRadioButton(self.privateShopLevelButtonList, index)
			self.privateShopLevel=index

		def __OnClickPrivateShopLevel1Button(self):
			self.__SetPrivateShopLevel(0)

		def __OnClickPrivateShopLevel2Button(self):
			self.__SetPrivateShopLevel(1)

		def __OnClickPrivateShopLevel3Button(self):
			self.__SetPrivateShopLevel(2)

		def __OnClickPrivateShopLevel4Button(self):
			self.__SetPrivateShopLevel(3)

		def __OnClickPrivateShopLevel5Button(self):
			self.__SetPrivateShopLevel(4)

		# DropItem
		def __SetDropItemLevel(self, index):
			self.__ClickRadioButton(self.dropItemLevelButtonList, index)
			self.dropItemLevel=index

		def __OnClickDropItemLevel1Button(self):
			self.__SetDropItemLevel(0)

		def __OnClickDropItemLevel2Button(self):
			self.__SetDropItemLevel(1)

		def __OnClickDropItemLevel3Button(self):
			self.__SetDropItemLevel(2)

		def __OnClickDropItemLevel4Button(self):
			self.__SetDropItemLevel(3)

		def __OnClickDropItemLevel5Button(self):
			self.__SetDropItemLevel(4)

		# PetStatus
		def __OnClickPetStatusOnButton(self):
			systemSetting.SetPetStatusFlag(True)
			self.RefreshPetStatus()

		def __OnClickPetStatusOffButton(self):
			systemSetting.SetPetStatusFlag(False)
			self.RefreshPetStatus()

		# NpcNameStatus
		def __OnClickNpcNameStatusOnButton(self):
			systemSetting.SetNpcNameStatusFlag(True)
			self.RefreshNpcNameStatus()

		def __OnClickNpcNameStatusOffButton(self):
			systemSetting.SetNpcNameStatusFlag(False)
			self.RefreshNpcNameStatus()

 

Can be like:

Spoiler

for i in xrange(GRAPHIC_LEVEL_MAX_NUM):
	self.effectLevelButtonList[i].SAFE_SetEvent(self.__OnClickEffectLevelButton, i)
	self.privateShopLevelButtonList[i].SAFE_SetEvent(self.__OnClickPrivateShopLevelButton, i)
	self.dropItemLevelButtonList[i].SAFE_SetEvent(self.__OnClickDropItemLevelButton, i)
	
for i in xrange(2):
	self.petStatusButtonList[i].SAFE_SetEvent(self.__OnClickPetStatusButton, bool(i))
	self.npcNameStatusButtonList[i].SAFE_SetEvent(self.__OnClickNpcNameStatusButton, bool(i))

# Effect
def __OnClickEffectLevelButton(self, index):
	self.__ClickRadioButton(self.effectLevelButtonList, index)
	self.effectLevel=index

# PrivateShop
def __OnClickPrivateShopLevelButton(self, index):
	self.__ClickRadioButton(self.privateShopLevelButtonList, index)
	self.privateShopLevel=index

# DropItem
def __OnClickDropItemLevelButton(self, index):
	self.__ClickRadioButton(self.dropItemLevelButtonList, index)
	self.dropItemLevel=index

# PetStatus
def __OnClickPetStatusButton(self, flag):
	systemSetting.SetPetStatusFlag(flag)
	self.RefreshPetStatus()

# NpcNameStatus
def __OnClickNpcNameStatusButton(self, flag):
	systemSetting.SetNpcNameStatusFlag(flag)
	self.RefreshNpcNameStatus()

 

Btw, for rest you can take a look how they're rended and do something like:

Here you can hide the 'terrain', 'object', 'cloud', 'water', 'tree', and you can disable the effects and more too if you take a look inside of GameLib.

Over 1.5 year ago i extended a bit my release but didn't had enough time to post it, i'll update the repository with the new code when i'll have time to finish it.

That feature allow you to hide specific effects, tree, bulding by property crc or name (not finished) and write them into files like:

graphic_mask/building.txt

general_obj_stone14
ob-b1-005-woodbarrel
landmark_statuestone
B_general_obj_40
general_obj_jar_yellow01

graphic_mask/effect.txt

8182371290
1003918098
volcano_greatsmoke.mse
warpgate01
fall_7
fire_general_obj_charcoal.mse
  • PythonGraphicMask.cpp
Spoiler

/*********************************************************************
* title_name		: Graphic Mask
* date_created		: 2018.04.21
* filename			: PythonGraphicMask.cpp
* author			: VegaS
* version_actual	: Version 1.0
*/

#include "stdafx.h"
#ifdef ENABLE_GRAPHIC_MASK
#include "PythonGraphicMask.h"
#include "PythonSystem.h"
#include "../gamelib/MapOutDoor.h"
#include "../gamelib/MapType.h"

CPythonGraphicMask::CPythonGraphicMask()
{
	Initialize(PROPERTY_TYPE_NONE, "graphic_mask/default.txt");
	Initialize(PROPERTY_TYPE_TREE, "graphic_mask/tree.txt");
	Initialize(PROPERTY_TYPE_BUILDING, "graphic_mask/building.txt");
	Initialize(PROPERTY_TYPE_EFFECT, "graphic_mask/effect.txt");
}

CPythonGraphicMask::~CPythonGraphicMask()
{
	Destroy();
}

void CPythonGraphicMask::Initialize(const BYTE bPropertyType, const char * c_pszFileName)
{
	m_vecMaskObjectCRC[bPropertyType].clear();

	FILE * fp = fopen(c_pszFileName, "r");
	if (!fp)
	{
		Tracef("Can't open file %s.", c_pszFileName);
		return;
	}
	
	Tracef("-------------------- START PARSING --------------------");
	Tracef("Read with successfully %s!", c_pszFileName);

	char line[256];
	while (fgets(line, sizeof(line) - 1, fp))
	{
		const auto dwCRC = strtoul(line, NULL, 0);
		m_vecMaskObjectCRC[bPropertyType].push_back(dwCRC);
	}
	
	TraceError("-------------------- END PARSING --------------------");
}

void CPythonGraphicMask::Destroy()
{
	for (size_t i = 0; i < PROPERTY_TYPE_MAX_NUM; ++i)
		m_vecMaskObjectCRC[i].clear();
}

bool CPythonGraphicMask::IsEnabled(const BYTE bPropertyType) const
{
	if (bPropertyType >= PROPERTY_TYPE_MAX_NUM)
		return false;
	
	switch (bPropertyType)
	{
		case prt::PROPERTY_TYPE_TREE:
			bPropertyType = CMapOutdoor::PART_TREE;
			break;
		case prt::PROPERTY_TYPE_BUILDING:
			bPropertyType = CMapOutdoor::PART_OBJECT;
			break;
			
		case prt::PROPERTY_TYPE_EFFECT:
			bPropertyType = CMapOutdoor::PART_EFFECT;
			break;
	}
	
	const CPythonSystem & rkSystem = CPythonSystem::Instance();
	return rkSystem.GetGraphicMaskPart(bPropertyType);
}

bool CPythonGraphicMask::GetObjectByCRC(const BYTE bPropertyType, const DWORD dwCRC) const
{
	if (bPropertyType >= PROPERTY_TYPE_MAX_NUM)
		return false;

	return std::find(m_vecMaskObjectCRC[bPropertyType].begin(), m_vecMaskObjectCRC[bPropertyType].end(), dwCRC) != m_vecMaskObjectCRC[bPropertyType].end());;
}
#endif

 

  • PythonGraphicMask.h
Spoiler

#pragma once
class CPythonGraphicMask : public CSingleton<CPythonGraphicMask>
{
	public:
		CPythonGraphicMask();
		virtual ~CPythonGraphicMask();
	
		void	Initialize(const BYTE bPropertyType, const char * c_pszFileName);
		void	Destroy();
		
		bool	IsEnabled(const BYTE bPropertyType) const;
		bool	GetObjectByCRC(const BYTE bPropertyType, const DWORD dwCRC) const;
		
		enum 
		{
			PROPERTY_TYPE_NONE,
			PROPERTY_TYPE_TREE,
			PROPERTY_TYPE_BUILDING,
			PROPERTY_TYPE_EFFECT,
			PROPERTY_TYPE_MAX_NUM,
		};

	protected:
		std::vector<DWORD> m_vecMaskObjectCRC[PROPERTY_TYPE_MAX_NUM];
};

 

 

 

 

  • Metin2 Dev 8
  • Angry 1
  • Sad 1
  • Good 1
  • Love 13
Link to comment
Share on other sites

  • Bot
Spoiler
1 hour ago, VegaS™ said:

Good idea, but the python part is a bit too much, 200 lines for 5-6 functions.

Can be like:

  Reveal hidden contents



for i in xrange(1, GRAPHIC_LEVEL_MAX_NUM + 1):
	self.effectLevelButtonList.append(GetObject("effect_level%d" % i))
	self.privateShopLevelButtonList.append(GetObject("privateShop_level%d" % i))
	self.dropItemLevelButtonList.append(GetObject("dropItem_level%d" % i))

_____________________________________________________________

Can be like:

  Reveal hidden contents



for i in xrange(GRAPHIC_LEVEL_MAX_NUM):
	self.effectLevelButtonList[i].SAFE_SetEvent(self.__OnClickEffectLevelButton, i)
	self.privateShopLevelButtonList[i].SAFE_SetEvent(self.__OnClickPrivateShopLevelButton, i)
	self.dropItemLevelButtonList[i].SAFE_SetEvent(self.__OnClickDropItemLevelButton, i)
	
for i in xrange(2):
	self.petStatusButtonList[i].SAFE_SetEvent(self.__OnClickPetStatusButton, bool(i))
	self.npcNameStatusButtonList[i].SAFE_SetEvent(self.__OnClickNpcNameStatusButton, bool(i))

# Effect
def __OnClickEffectLevelButton(self, index):
	self.__ClickRadioButton(self.effectLevelButtonList, index)
	self.effectLevel=index

# PrivateShop
def __OnClickPrivateShopLevelButton(self, index):
	self.__ClickRadioButton(self.privateShopLevelButtonList, index)
	self.privateShopLevel=index

# DropItem
def __OnClickDropItemLevelButton(self, index):
	self.__ClickRadioButton(self.dropItemLevelButtonList, index)
	self.dropItemLevel=index

# PetStatus
def __OnClickPetStatusButton(self, flag):
	systemSetting.SetPetStatusFlag(flag)
	self.RefreshPetStatus()

# NpcNameStatus
def __OnClickNpcNameStatusButton(self, flag):
	systemSetting.SetNpcNameStatusFlag(flag)
	self.RefreshNpcNameStatus()

 

Btw, for rest you can take a look how they're rended and do something like:

Here you can hide the 'terrain', 'object', 'cloud', 'water', 'tree', and you can disable the effects and more too if you take a look inside of GameLib.

Over 1.5 year ago i extended a bit my release but didn't had enough time to post it, i'll update the repository with the new code when i'll have time to finish it.

That feature allow you to hide specific effects, tree, bulding by property crc or name (not finished) and write them into files like:

graphic_mask/effect.txt



8182371290
1003918098
  • PythonGraphicMask.cpp
  Reveal hidden contents



/*********************************************************************
* title_name		: Graphic Mask
* date_created		: 2018.04.21
* filename			: PythonGraphicMask.cpp
* author			: VegaS
* version_actual	: Version 1.0
*/

#include "stdafx.h"
#ifdef ENABLE_GRAPHIC_MASK
#include "PythonGraphicMask.h"
#include "PythonSystem.h"
#include "../gamelib/MapOutDoor.h"
#include "../gamelib/MapType.h"

CPythonGraphicMask::CPythonGraphicMask()
{
	Initialize(PROPERTY_TYPE_NONE, "graphic_mask/default.txt");
	Initialize(PROPERTY_TYPE_TREE, "graphic_mask/tree.txt");
	Initialize(PROPERTY_TYPE_BUILDING, "graphic_mask/building.txt");
	Initialize(PROPERTY_TYPE_EFFECT, "graphic_mask/effect.txt");
}

CPythonGraphicMask::~CPythonGraphicMask()
{
	Destroy();
}

void CPythonGraphicMask::Initialize(const BYTE bPropertyType, const char * c_pszFileName)
{
	m_vecMaskObjectCRC[bPropertyType].clear();

	FILE * fp = fopen(c_pszFileName, "r");
	if (!fp)
	{
		Tracef("Can't open file %s.", c_pszFileName);
		return;
	}
	
	Tracef("-------------------- START PARSING --------------------");
	Tracef("Read with successfully %s!", c_pszFileName);

	char line[256];
	while (fgets(line, sizeof(line) - 1, fp))
	{
		const auto dwCRC = strtoul(line, NULL, 0);
		m_vecMaskObjectCRC[bPropertyType].push_back(dwCRC);
	}
	
	TraceError("-------------------- END PARSING --------------------");
}

void CPythonGraphicMask::Destroy()
{
	for (size_t i = 0; i < PROPERTY_TYPE_MAX_NUM; ++i)
		m_vecMaskObjectCRC[i].clear();
}

bool CPythonGraphicMask::IsEnabled(const BYTE bPropertyType) const
{
	if (bPropertyType >= PROPERTY_TYPE_MAX_NUM)
		return false;
	
	switch (bPropertyType)
	{
		case prt::PROPERTY_TYPE_TREE:
			bPropertyType = CMapOutdoor::PART_TREE;
			break;
		case prt::PROPERTY_TYPE_BUILDING:
			bPropertyType = CMapOutdoor::PART_OBJECT;
			break;
			
		case prt::PROPERTY_TYPE_EFFECT:
			bPropertyType = CMapOutdoor::PART_EFFECT;
			break;
	}
	
	const CPythonSystem & rkSystem = CPythonSystem::Instance();
	return rkSystem.GetGraphicMaskPart(bPropertyType);
}

bool CPythonGraphicMask::GetObjectByCRC(const BYTE bPropertyType, const DWORD dwCRC) const
{
	if (bPropertyType >= PROPERTY_TYPE_MAX_NUM)
		return false;

	return std::find(m_vecMaskObjectCRC[bPropertyType].begin(), m_vecMaskObjectCRC[bPropertyType].end(), dwCRC) != m_vecMaskObjectCRC[bPropertyType].end());;
}
#endif

 

  • PythonGraphicMask.h
  Reveal hidden contents



#pragma once
class CPythonGraphicMask : public CSingleton<CPythonGraphicMask>
{
	public:
		CPythonGraphicMask();
		virtual ~CPythonGraphicMask();
	
		void	Initialize(const BYTE bPropertyType, const char * c_pszFileName);
		void	Destroy();
		
		bool	IsEnabled(const BYTE bPropertyType) const;
		bool	GetObjectByCRC(const BYTE bPropertyType, const DWORD dwCRC) const;
		
		enum 
		{
			PROPERTY_TYPE_NONE,
			PROPERTY_TYPE_TREE,
			PROPERTY_TYPE_BUILDING,
			PROPERTY_TYPE_EFFECT,
			PROPERTY_TYPE_MAX_NUM,
		};

	protected:
		std::vector<DWORD> m_vecMaskObjectCRC[PROPERTY_TYPE_MAX_NUM];
};

 

 

 

 

 

Thanks for contributing this thread, it is very helpful. I think that hiding specifics effect through property src can be a great help for the "hide decoration" features.

  • Metin2 Dev 1
  • Love 1

english_banner.gif

Link to comment
Share on other sites

help 

Spoiler
Spoiler

0512 14:23:53297 :: 
ui.py(line:3196) LoadScriptFile
system.py(line:197) execfile
system.py(line:168) Run
uiscript/systemoptiondialog.py(line:316) <module>

LoadScriptFile!!!!!!!!!!!!!! - <type 'exceptions.TypeError'>:tuple indices must be integers, not str

0512 14:23:53297 :: ============================================================================================================
0512 14:23:53297 :: Abort!!!!


0512 14:23:53299 :: 
uiSystemOption.py(line:76) __Load_LoadScript
ui.py(line:3213) LoadScriptFile
exception.py(line:36) Abort

System.OptionDialog.__Load_LoadScript - <type 'exceptions.SystemExit'>:

0512 14:23:53299 :: ============================================================================================================
0512 14:23:53299 :: Abort!!!!

 

 

  • Metin2 Dev 1
Link to comment
Share on other sites

  • Bot
45 minutes ago, Thundernatsu said:

help 

  Reveal hidden contents
  Reveal hidden contents

0512 14:23:53297 :: 
ui.py(line:3196) LoadScriptFile
system.py(line:197) execfile
system.py(line:168) Run
uiscript/systemoptiondialog.py(line:316) <module>

LoadScriptFile!!!!!!!!!!!!!! - <type 'exceptions.TypeError'>:tuple indices must be integers, not str

0512 14:23:53297 :: ============================================================================================================
0512 14:23:53297 :: Abort!!!!


0512 14:23:53299 :: 
uiSystemOption.py(line:76) __Load_LoadScript
ui.py(line:3213) LoadScriptFile
exception.py(line:36) Abort

System.OptionDialog.__Load_LoadScript - <type 'exceptions.SystemExit'>:

0512 14:23:53299 :: ============================================================================================================
0512 14:23:53299 :: Abort!!!!

 

 

Upload your systemoptiondialog.py

english_banner.gif

Link to comment
Share on other sites

  • Forum Moderator
1 hour ago, Thundernatsu said:

help 

  Reveal hidden contents
  Reveal hidden contents

0512 14:23:53297 :: 
ui.py(line:3196) LoadScriptFile
system.py(line:197) execfile
system.py(line:168) Run
uiscript/systemoptiondialog.py(line:316) <module>

LoadScriptFile!!!!!!!!!!!!!! - <type 'exceptions.TypeError'>:tuple indices must be integers, not str

0512 14:23:53297 :: ============================================================================================================
0512 14:23:53297 :: Abort!!!!


0512 14:23:53299 :: 
uiSystemOption.py(line:76) __Load_LoadScript
ui.py(line:3213) LoadScriptFile
exception.py(line:36) Abort

System.OptionDialog.__Load_LoadScript - <type 'exceptions.SystemExit'>:

0512 14:23:53299 :: ============================================================================================================
0512 14:23:53299 :: Abort!!!!

 

 

Your children item from dictionary is a tuple, not a list.

#1.1) Replace:
window["children"][0]["children"] = window["children"][0]["children"] + [
#1.2) With:
window["children"][0]["children"] += (
  
#2.1) Replace:
		},]
#2.2) With:
		},)
  • Metin2 Dev 1
  • Love 1
Link to comment
Share on other sites

1 hour ago, VegaS™ said:

Your children item from dictionary is a tuple, not a list.


#1.1) Replace:
window["children"][0]["children"] = window["children"][0]["children"] + [
#1.2) With:
window["children"][0]["children"] += (
  
#2.1) Replace:
		},]
#2.2) With:
		},)

now it shows but it doesn't work it hides nothing

 

Spoiler

0512_170803.thumb.jpg.9614601e6d6c329bcbb2068db38ba6c2.jpg

 

Link to comment
Share on other sites

  • Bot
17 minutes ago, Thundernatsu said:

now it shows but it doesn't work it hides nothing

it is not finished. At the moment only the options for hiding effects of items (such as "EFFECT_AUTO_HPUP", "EFFECT_HAPPINESS_RING_EQUIP", etc.) work.

 

18 minutes ago, Thundernatsu said:
Spoiler

0512_170803.thumb.jpg.9614601e6d6c329bcbb2068db38ba6c2.jpg

 

You must add the .sub files in public and replace (or modify) the public.dds file also so that the small buttons are displayed.

english_banner.gif

Link to comment
Share on other sites

  • 4 weeks later...
  • Bot

@Tunga

Regarding the above buttons that do not work, please read the description that I put to this thread.

And regarding the non-clickable buttons:

Spoiler

		def RefreshPetStatus(self):
			if systemSetting.IsPetStatus():
				self.petStatusButtonList[0].SetUp()
				self.petStatusButtonList[1].Down()
			else:
				self.petStatusButtonList[0].Down()
				self.petStatusButtonList[1].SetUp()

		def RefreshNpcNameStatus(self):
			if systemSetting.IsNpcNameStatus():
				self.npcNameStatusButtonList[0].SetUp()
				self.npcNameStatusButtonList[1].Down()
			else:
				self.npcNameStatusButtonList[0].Down()
				self.npcNameStatusButtonList[1].SetUp()

 

 

  • Love 1

english_banner.gif

Link to comment
Share on other sites

On 6/11/2019 at 7:30 PM, WLsj24 said:

@Tunga

Regarding the above buttons that do not work, please read the description that I put to this thread.

And regarding the non-clickable buttons:

  Hide contents


		def RefreshPetStatus(self):
			if systemSetting.IsPetStatus():
				self.petStatusButtonList[0].SetUp()
				self.petStatusButtonList[1].Down()
			else:
				self.petStatusButtonList[0].Down()
				self.petStatusButtonList[1].SetUp()

		def RefreshNpcNameStatus(self):
			if systemSetting.IsNpcNameStatus():
				self.npcNameStatusButtonList[0].SetUp()
				self.npcNameStatusButtonList[1].Down()
			else:
				self.npcNameStatusButtonList[0].Down()
				self.npcNameStatusButtonList[1].SetUp()

 

 

ahh thanks i didnt think to check that.

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 year later...
On 5/12/2019 at 4:47 PM, VegaS™ said:

Your children item from dictionary is a tuple, not a list.


#1.1) Replace:
window["children"][0]["children"] = window["children"][0]["children"] + [
#1.2) With:
window["children"][0]["children"] += (
  
#2.1) Replace:
		},]
#2.2) With:
		},)

 

Discontinued ?
It was a nice idea tbh !

  • Love 1
Link to comment
Share on other sites

  • 3 months later...

 

On 5/11/2019 at 4:07 PM, VegaS™ said:

Good idea, but the python part is a bit too much, 200 lines for 5-6 functions.

Can be like:

  Reveal hidden contents


for i in xrange(1, GRAPHIC_LEVEL_MAX_NUM + 1):
	self.effectLevelButtonList.append(GetObject("effect_level%d" % i))
	self.privateShopLevelButtonList.append(GetObject("privateShop_level%d" % i))
	self.dropItemLevelButtonList.append(GetObject("dropItem_level%d" % i))

_____________________________________________________________

Can be like:

  Reveal hidden contents


for i in xrange(GRAPHIC_LEVEL_MAX_NUM):
	self.effectLevelButtonList[i].SAFE_SetEvent(self.__OnClickEffectLevelButton, i)
	self.privateShopLevelButtonList[i].SAFE_SetEvent(self.__OnClickPrivateShopLevelButton, i)
	self.dropItemLevelButtonList[i].SAFE_SetEvent(self.__OnClickDropItemLevelButton, i)
	
for i in xrange(2):
	self.petStatusButtonList[i].SAFE_SetEvent(self.__OnClickPetStatusButton, bool(i))
	self.npcNameStatusButtonList[i].SAFE_SetEvent(self.__OnClickNpcNameStatusButton, bool(i))

# Effect
def __OnClickEffectLevelButton(self, index):
	self.__ClickRadioButton(self.effectLevelButtonList, index)
	self.effectLevel=index

# PrivateShop
def __OnClickPrivateShopLevelButton(self, index):
	self.__ClickRadioButton(self.privateShopLevelButtonList, index)
	self.privateShopLevel=index

# DropItem
def __OnClickDropItemLevelButton(self, index):
	self.__ClickRadioButton(self.dropItemLevelButtonList, index)
	self.dropItemLevel=index

# PetStatus
def __OnClickPetStatusButton(self, flag):
	systemSetting.SetPetStatusFlag(flag)
	self.RefreshPetStatus()

# NpcNameStatus
def __OnClickNpcNameStatusButton(self, flag):
	systemSetting.SetNpcNameStatusFlag(flag)
	self.RefreshNpcNameStatus()

 

Btw, for rest you can take a look how they're rended and do something like:

Here you can hide the 'terrain', 'object', 'cloud', 'water', 'tree', and you can disable the effects and more too if you take a look inside of GameLib.

Over 1.5 year ago i extended a bit my release but didn't had enough time to post it, i'll update the repository with the new code when i'll have time to finish it.

That feature allow you to hide specific effects, tree, bulding by property crc or name (not finished) and write them into files like:

graphic_mask/building.txt


general_obj_stone14
ob-b1-005-woodbarrel
landmark_statuestone
B_general_obj_40
general_obj_jar_yellow01

graphic_mask/effect.txt


8182371290
1003918098
volcano_greatsmoke.mse
warpgate01
fall_7
fire_general_obj_charcoal.mse
  • PythonGraphicMask.cpp
  Reveal hidden contents


/*********************************************************************
* title_name		: Graphic Mask
* date_created		: 2018.04.21
* filename			: PythonGraphicMask.cpp
* author			: VegaS
* version_actual	: Version 1.0
*/

#include "stdafx.h"
#ifdef ENABLE_GRAPHIC_MASK
#include "PythonGraphicMask.h"
#include "PythonSystem.h"
#include "../gamelib/MapOutDoor.h"
#include "../gamelib/MapType.h"

CPythonGraphicMask::CPythonGraphicMask()
{
	Initialize(PROPERTY_TYPE_NONE, "graphic_mask/default.txt");
	Initialize(PROPERTY_TYPE_TREE, "graphic_mask/tree.txt");
	Initialize(PROPERTY_TYPE_BUILDING, "graphic_mask/building.txt");
	Initialize(PROPERTY_TYPE_EFFECT, "graphic_mask/effect.txt");
}

CPythonGraphicMask::~CPythonGraphicMask()
{
	Destroy();
}

void CPythonGraphicMask::Initialize(const BYTE bPropertyType, const char * c_pszFileName)
{
	m_vecMaskObjectCRC[bPropertyType].clear();

	FILE * fp = fopen(c_pszFileName, "r");
	if (!fp)
	{
		Tracef("Can't open file %s.", c_pszFileName);
		return;
	}
	
	Tracef("-------------------- START PARSING --------------------");
	Tracef("Read with successfully %s!", c_pszFileName);

	char line[256];
	while (fgets(line, sizeof(line) - 1, fp))
	{
		const auto dwCRC = strtoul(line, NULL, 0);
		m_vecMaskObjectCRC[bPropertyType].push_back(dwCRC);
	}
	
	TraceError("-------------------- END PARSING --------------------");
}

void CPythonGraphicMask::Destroy()
{
	for (size_t i = 0; i < PROPERTY_TYPE_MAX_NUM; ++i)
		m_vecMaskObjectCRC[i].clear();
}

bool CPythonGraphicMask::IsEnabled(const BYTE bPropertyType) const
{
	if (bPropertyType >= PROPERTY_TYPE_MAX_NUM)
		return false;
	
	switch (bPropertyType)
	{
		case prt::PROPERTY_TYPE_TREE:
			bPropertyType = CMapOutdoor::PART_TREE;
			break;
		case prt::PROPERTY_TYPE_BUILDING:
			bPropertyType = CMapOutdoor::PART_OBJECT;
			break;
			
		case prt::PROPERTY_TYPE_EFFECT:
			bPropertyType = CMapOutdoor::PART_EFFECT;
			break;
	}
	
	const CPythonSystem & rkSystem = CPythonSystem::Instance();
	return rkSystem.GetGraphicMaskPart(bPropertyType);
}

bool CPythonGraphicMask::GetObjectByCRC(const BYTE bPropertyType, const DWORD dwCRC) const
{
	if (bPropertyType >= PROPERTY_TYPE_MAX_NUM)
		return false;

	return std::find(m_vecMaskObjectCRC[bPropertyType].begin(), m_vecMaskObjectCRC[bPropertyType].end(), dwCRC) != m_vecMaskObjectCRC[bPropertyType].end());;
}
#endif

 

  • PythonGraphicMask.h
  Reveal hidden contents


#pragma once
class CPythonGraphicMask : public CSingleton<CPythonGraphicMask>
{
	public:
		CPythonGraphicMask();
		virtual ~CPythonGraphicMask();
	
		void	Initialize(const BYTE bPropertyType, const char * c_pszFileName);
		void	Destroy();
		
		bool	IsEnabled(const BYTE bPropertyType) const;
		bool	GetObjectByCRC(const BYTE bPropertyType, const DWORD dwCRC) const;
		
		enum 
		{
			PROPERTY_TYPE_NONE,
			PROPERTY_TYPE_TREE,
			PROPERTY_TYPE_BUILDING,
			PROPERTY_TYPE_EFFECT,
			PROPERTY_TYPE_MAX_NUM,
		};

	protected:
		std::vector<DWORD> m_vecMaskObjectCRC[PROPERTY_TYPE_MAX_NUM];
};

 

 

 

 

 

This release have bugs?

  • Metin2 Dev 1
Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...
  • 4 weeks later...

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.