Jump to content

Windows Auto Hide


Recommended Posts

  • Honorable Member
1 hour ago, Cryptex said:

omg ❤️ what utility for record a cinematic

Omg GIF by WE tv

geforce experience shadowplay

misunderstanding

Edited by Metin2 Dev
Core X - External 2 Internal
  • Lmao 1

 

Link to comment
Share on other sites

  • Management

200.gif

best system of the year

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

  • Bronze
55 minutes ago, Typical said:

Nice, thanks bro!
Unfortunately, I have one problem, hiding only works on the minimap, taskbar is not hiding. Clean sysser, all well added.
Have any ideas?

Yes, I have the same problem..

 

Gif here

 

Solved:

remove this from interfacemodule.py:

self.wndExpandedTaskBar and \

and this:

self.wndExpandedTaskBar.IsShow() or \

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
  • Love 1

spacer.png

Link to comment
Share on other sites

29 minutes ago, SCOOB said:

Yes, I have the same problem..

 

Gif here

 

Solved:

remove this from interfacemodule.py:

self.wndExpandedTaskBar and \

and this:

self.wndExpandedTaskBar.IsShow() or \

 

Unfortunately, the solution does not work for me, the taskbar still does not hide. 😕 

My mistake, however, everything works, thank you my friend.

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

  • Bronze

@ Mali You can update the Github with this Update:

Setting will be written in metin2.cfg and will be saved when re-opening the client:


 

Spoiler

PythonSystem.cpp search:

m_Config.bShowSalesText = true;

Add:

m_Config.bGUIMode = true;

Search:

void CPythonSystem::SetShowSalesTextFlag(int iFlag)
{
m_Config.bShowSalesText = iFlag == 1 ? true : false;
}


Add:

void CPythonSystem::SetGUIMode(int iFlag)
{
m_Config.bGUIMode = iFlag == 1 ? true : false;
}

bool CPythonSystem::IsGUIMode()
{
return m_Config.bGUIMode;
}


Search:

else if (!stricmp(command, "SHOW_MONEY_TEXT"))
m_Config.bShowMoneyText = atoi(value) == 1 ? true : false;

Add:

else if (!stricmp(command, "GUI_MODE_ON"))
m_Config.bGUIMode = atoi(value) == 1 ? true : false;


Search:

if (m_Config.bShowSalesText == 0)
fprintf(fp, "SHOW_SALESTTEXT %d\n", m_Config.bShowSalesText);


Add:

fprintf(fp, "GUI_MODE_ON %d\n", m_Config.bGUIMode);


Open PythonSystem.h and search:

bool bShowMoneyText;

Add:

bool bGUIMode;


Search:

void SetShowSalesTextFlag(int iFlag);

Add:

void SetGUIMode(int iFlag);
bool IsGUIMode();


Open PythonSystemModule.cpp and search:

PyObject * systemSetShadowLevel(PyObject * poSelf, PyObject * poArgs)
{
	int level;

	if (!PyTuple_GetInteger(poArgs, 0, &level))
		return Py_BuildException();

	if (level > 0)
		CPythonSystem::Instance().SetShadowLevel(level);

	return Py_BuildNone();
}

Add:

PyObject* systemSetGUIMode(PyObject* poSelf, PyObject* poArgs)
{
	int iFlag;
	if (!PyTuple_GetInteger(poArgs, 0, &iFlag))
		return Py_BuildException();

	CPythonSystem::Instance().SetGUIMode(iFlag);

	return Py_BuildNone();
}

PyObject* systemIsGUIMode(PyObject* poSelf, PyObject* poArgs)
{
	return Py_BuildValue("i", CPythonSystem::Instance().IsGUIMode());
}

Search:

{ "GetShadowLevel", systemGetShadowLevel, METH_VAARGS },
{ "SetShadowLevel", systemSetShadowLevel, METH_VAARGS },

Add:

{ "SetGUIMode", systemSetGUIMode, METH_VAARGS },
{ "IsGUIMode", systemIsGUIMode, METH_VAARRGS },


Compile binary and open interfacemodule.py , search for x2:

constInfo.AUTO_HIDE_OPTION == False:

replace both with:

systemSetting.IsGUIMode()


Open uisystemoption.py and search for(in class OptionDialog):

self.__Load()

Add after:

self.RefreshGUIMode()


search for

def __OnClickAutoHideModeOnButton

and

def __OnClickAutoHideModeOffButton

replace these 2 defs with:

		def __OnClickAutoHideModeOnButton(self):
			systemSetting.SetGUIMode(True)
			self.RefreshGUIMode()

		def __OnClickAutoHideModeOffButton(self):
			systemSetting.SetGUIMode(False)
			self.RefreshGUIMode()
			
		def RefreshGUIMode(self):
			if systemSetting.IsGUIMode():
				self.autoHideModeButtonList[0].Down()
				self.autoHideModeButtonList[1].SetUp()
			else:
				self.autoHideModeButtonList[0].SetUp()
				self.autoHideModeButtonList[1].Down()


Search for:

		if app.__BL_WINDOW_AUTO_HIDE__:
			self.autoHideModeButtonList[0].SAFE_SetEvent(self.__OnClickAutoHideModeOnButton)
			self.autoHideModeButtonList[1].SAFE_SetEvent(self.__OnClickAutoHideModeOffButton)
			self.__ClickRadioButton(self.autoHideModeButtonList, 1)

Replace with:

		if app.__BL_WINDOW_AUTO_HIDE__:
			self.autoHideModeButtonList[0].SAFE_SetEvent(self.__OnClickAutoHideModeOnButton)
			self.autoHideModeButtonList[1].SAFE_SetEvent(self.__OnClickAutoHideModeOffButton)



🤩 And done. Now the setting will be saved in Metin2.cfg and it will save after re-opening the client.

Edited by SCOOB
  • Good 1
  • Love 1

spacer.png

Link to comment
Share on other sites

0318 00:46:13652 :: Traceback (most recent call last): 0318 00:46:13652 :: File "game.py", line 1644, in OnUpdate 0318 00:46:13652 :: File "interfaceModule.py", line 2114, in BUILD_OnUpdate 0318 00:46:13652 :: AttributeError 0318 00:46:13652 :: : 0318 00:46:13652 :: 'Interface' object has no attribute 'yConstPosTaskbar' 0318 00:46:13652 ::

Edited by ahmedmohamed
Link to comment
Share on other sites

 

Hi bro 

I am facing the following error does anyone know the solution

 

uiSystemOption.py(line:80) __Load_BindObject
ui.py(line:2704) GetChild

OptionDialog.__Load_BindObject - <type 'exceptions.KeyError'>:'auto_hide_on'

0319 01:11:05335 :: ============================================================================================================
0319 01:11:05335 :: Abort!!!!

 

 

 

try:
            GetObject = self.GetChild
            self.titleBar = GetObject("titlebar")
            self.selectMusicFile = GetObject("bgm_file")
            self.changeMusicButton = GetObject("bgm_button")
            self.ctrlMusicVolume = GetObject("music_volume_controller")
            self.ctrlSoundVolume = GetObject("sound_volume_controller")            
            self.cameraModeButtonList.append(GetObject("camera_short"))
            self.cameraModeButtonList.append(GetObject("camera_long"))
            self.fogModeButtonList.append(GetObject("fog_level0"))
            self.fogModeButtonList.append(GetObject("fog_level1"))
            self.fogModeButtonList.append(GetObject("fog_level2"))
            self.tilingModeButtonList.append(GetObject("tiling_cpu"))
            self.tilingModeButtonList.append(GetObject("tiling_gpu"))
            self.tilingApplyButton=GetObject("tiling_apply")
            #self.ctrlShadowQuality = GetObject("shadow_bar")
            if app.__BL_WINDOW_AUTO_HIDE__:
                self.autoHideModeButtonList.append(GetObject("auto_hide_on"))
                self.autoHideModeButtonList.append(GetObject("auto_hide_off"))
        except:
            import exception
            exception.Abort("OptionDialog.__Load_BindObject")

 

 

 

 

Link to comment
Share on other sites

  • 1 year later...
  • Premium


Working thanks.

spacer.png

Because someone get errors here is how i have added the system.
First make the Source Client changes from here: https://metin2.dev/topic/28867-windows-auto-hide/?do=findComment&comment=148237&_rid=20400
You can stop at the step

Compile binary and open interfacemodule.py , search for x2:

 

 After that follow this steps:

Spoiler

Inside:
locale/common/locale_interface.txt
Add at the end:

OPTION_AUTO_HIDE	Auto Hide
OPTION_AUTO_HIDE_ON	On
OPTION_AUTO_HIDE_OFF	Off

Remember the tabs between the option and the text example: OPTION_AUTO_HIDE_ON[PRESSTABHERE]On

Inside:
uiscript/systemoptiondialog.py
Add at the end:

import app
if app.__BL_WINDOW_AUTO_HIDE__:
  window["children"][0]["children"] += (
    {
      "name": "auto_hide",
      "type": "text",

      "x": 40 + TEXT_TEMPORARY_X,
      "y": 210 + 2,

      "text": uiScriptLocale.OPTION_AUTO_HIDE,
    },
    {
      "name": "auto_hide_on",
      "type": "radio_button",

      "x": 110,
      "y": 210,

      "text": uiScriptLocale.OPTION_AUTO_HIDE_ON,

      "default_image": ROOT_PATH + "middle_button_01.sub",
      "over_image": ROOT_PATH + "middle_button_02.sub",
      "down_image": ROOT_PATH + "middle_button_03.sub",
    },
    {
      "name": "auto_hide_off",
      "type": "radio_button",

      "x": 110 + 70,
      "y": 210,

      "text": uiScriptLocale.OPTION_AUTO_HIDE_OFF,

      "default_image": ROOT_PATH + "middle_button_01.sub",
      "over_image": ROOT_PATH + "middle_button_02.sub",
      "down_image": ROOT_PATH + "middle_button_03.sub",
    },
  )

Inside:
root/uitaskbar.py
Make the changes like this:

  ...
  def OnChangeCurrentSkill(self, skillSlotNumber):
    self.curSkillButton.SetSkill(skillSlotNumber)
    self.curSkillButton.Show()
    self.curMouseModeButton[self.MOUSE_BUTTON_RIGHT].Hide()
    # Add this
  if app.__BL_WINDOW_AUTO_HIDE__:
    def IsOpenRightLeftMouseButtonWindow(self):
      wndMouseButtonMode = self.mouseModeButtonList[self.MOUSE_BUTTON_LEFT]
      if wndMouseButtonMode and wndMouseButtonMode.IsShow():
        return True

      wndMouseButtonMode = self.mouseModeButtonList[self.MOUSE_BUTTON_RIGHT]
      if wndMouseButtonMode and wndMouseButtonMode.IsShow():
        return True

      if self.mouseImage and self.mouseImage.IsShow():
        return True

      return False
    # End

Inside:
root/interfacemodule.py
Make the changes like this:

	...
		self.wndEnergyBar = None
		import app
		if app.ENABLE_ENERGY_SYSTEM:
			wndEnergyBar = uiTaskBar.EnergyBar()
			wndEnergyBar.LoadWindow()
			self.wndEnergyBar = wndEnergyBar
		# Add this
		if app.__BL_WINDOW_AUTO_HIDE__:
			(xConstPosTaskbar, self.yConstPosTaskbar) = self.wndTaskBar.GetLocalPosition()
			(xConstPosEnergyBar, self.yConstPosEnergyBar) = self.wndEnergyBar.GetLocalPosition()
		# End
	def __MakeParty(self):
		wndParty = uiParty.PartyWindow()
		wndParty.Hide()
		self.wndParty = wndParty
	...
	...	
	def BUILD_CloseWindow(self):
		self.__ShowWindows(self.wndGuildBuilding.wnds)
		self.wndGuildBuilding = None

	def BUILD_OnUpdate(self):
     	# Add this
		if app.__BL_WINDOW_AUTO_HIDE__:
			xMouse, yMouse = wndMgr.GetMousePosition()
			xWidth = wndMgr.GetScreenWidth()
			yHeight = wndMgr.GetScreenHeight()

			if self.wndMiniMap:
				(xCurrentMinimap, yCurrentMinimap) = self.wndMiniMap.GetLocalPosition()
				if (xWidth - 150 <= xMouse <= xWidth and 0 <= yMouse <= 135) or \
						systemSetting.IsGUIMode() == False:
					if xCurrentMinimap > xWidth - self.wndMiniMap.GetWidth():
						self.wndMiniMap.SetPosition(max(xCurrentMinimap - 10, xWidth - self.wndMiniMap.GetWidth()), yCurrentMinimap)
				else:
					if xCurrentMinimap < xWidth:
						self.wndMiniMap.SetPosition(min(xCurrentMinimap + 10, xWidth), yCurrentMinimap)

			if self.wndTaskBar and self.wndTaskBar.IsShow() and \
					self.wndEnergyBar and \
					self.wndChat:
				(xCurrentTaskbar, yCurrentTaskbar) = self.wndTaskBar.GetLocalPosition()
				(xCurrentEnergyBar, yCurrentEnergyBar) = self.wndEnergyBar.GetLocalPosition()
				(xCurrentChat, yCurrentChat) = self.wndChat.GetLocalPosition()

				if yHeight - 90 <= yMouse <= yHeight or \
						self.IsOpenChat() or \
						self.wndTaskBar.IsOpenRightLeftMouseButtonWindow() or \
						systemSetting.IsGUIMode() == False:
					if yCurrentTaskbar > self.yConstPosTaskbar:
						self.wndTaskBar.SetPosition(xCurrentTaskbar, max(yCurrentTaskbar - 5, self.yConstPosTaskbar))
					if yCurrentEnergyBar > self.yConstPosEnergyBar:
						self.wndEnergyBar.SetPosition(xCurrentEnergyBar, max(yCurrentEnergyBar - 5, self.yConstPosEnergyBar))
					if yCurrentChat > yHeight - self.wndChat.EDIT_LINE_HEIGHT - 37:
						self.wndChat.SetPosition(xCurrentChat, max(yCurrentChat - 3, yHeight - self.wndChat.EDIT_LINE_HEIGHT - 37))
						self.wndChat.Refresh()
				else:
					if yCurrentTaskbar < self.yConstPosTaskbar + 65:
						self.wndTaskBar.SetPosition(xCurrentTaskbar, min(yCurrentTaskbar + 5, self.yConstPosTaskbar + 65))
					if yCurrentEnergyBar < self.yConstPosEnergyBar + 65:
						self.wndEnergyBar.SetPosition(xCurrentEnergyBar, min(yCurrentEnergyBar + 5, self.yConstPosEnergyBar + 65))
					if yCurrentChat < yHeight - self.wndChat.EDIT_LINE_HEIGHT:
						self.wndChat.SetPosition(xCurrentChat, min(yCurrentChat + 3, yHeight - self.wndChat.EDIT_LINE_HEIGHT))
						self.wndChat.Refresh()
		# End
		if not self.wndGuildBuilding:
			return

		if self.wndGuildBuilding.IsPositioningMode():
			import background
			x, y, z = background.GetPickingPoint()
			self.wndGuildBuilding.SetBuildingPosition(x, y, z)

	def BUILD_OnMouseLeftButtonDown(self):
		if not self.wndGuildBuilding:
			return
	...

Inside:
root/uisystemoption.py
Make the changes like this:

	...	
	def __init__(self):
		ui.ScriptWindow.__init__(self)
		self.__Initialize()
		self.__Load()
		# Add this
		if app.__BL_WINDOW_AUTO_HIDE__:
			self.RefreshGUIMode()
		# End

	def __del__(self):
		ui.ScriptWindow.__del__(self)
	...
	...
  	def __Initialize(self):
		self.tilingMode = 0
		self.titleBar = 0
		self.changeMusicButton = 0
		self.selectMusicFile = 0
		self.ctrlMusicVolume = 0
		self.ctrlSoundVolume = 0
		self.musicListDlg = 0
		self.tilingApplyButton = 0
		self.cameraModeButtonList = []
		self.fogModeButtonList = []
		self.tilingModeButtonList = []
		self.ctrlShadowQuality = 0
        # Add this
		if app.__BL_WINDOW_AUTO_HIDE__:
			self.autoHideModeButtonList = []
        # End

	def Destroy(self):
		self.ClearDictionary()
    ...
	...
  	def __Load_BindObject(self):
		try:
			GetObject = self.GetChild
			self.titleBar = GetObject("titlebar")
			self.selectMusicFile = GetObject("bgm_file")
			self.changeMusicButton = GetObject("bgm_button")
			self.ctrlMusicVolume = GetObject("music_volume_controller")
			self.ctrlSoundVolume = GetObject("sound_volume_controller")
			self.cameraModeButtonList.append(GetObject("camera_short"))
			self.cameraModeButtonList.append(GetObject("camera_long"))
			self.fogModeButtonList.append(GetObject("fog_level0"))
			self.fogModeButtonList.append(GetObject("fog_level1"))
			self.fogModeButtonList.append(GetObject("fog_level2"))
			self.tilingModeButtonList.append(GetObject("tiling_cpu"))
			self.tilingModeButtonList.append(GetObject("tiling_gpu"))
			self.tilingApplyButton=GetObject("tiling_apply")
			# Add this
			if app.__BL_WINDOW_AUTO_HIDE__:
				self.autoHideModeButtonList.append(GetObject("auto_hide_on"))
				self.autoHideModeButtonList.append(GetObject("auto_hide_off"))
			# End
			#self.ctrlShadowQuality = GetObject("shadow_bar")
		except:
			import exception
			exception.Abort("OptionDialog.__Load_BindObject")

	def __Load(self):
		self.__Load_LoadScript("uiscript/systemoptiondialog.py")
		self.__Load_BindObject()
    ...
		...	
		self.tilingModeButtonList[0].SAFE_SetEvent(self.__OnClickTilingModeCPUButton)
		self.tilingModeButtonList[1].SAFE_SetEvent(self.__OnClickTilingModeGPUButton)
		# Add this
		if app.__BL_WINDOW_AUTO_HIDE__:
			self.autoHideModeButtonList[0].SAFE_SetEvent(self.__OnClickAutoHideModeOnButton)
			self.autoHideModeButtonList[1].SAFE_SetEvent(self.__OnClickAutoHideModeOffButton)
		# End
		self.tilingApplyButton.SAFE_SetEvent(self.__OnClickTilingApplyButton)

		self.__SetCurTilingMode()
        ...
	...
  	def __OnClickTilingModeGPUButton(self):
		self.__NotifyChatLine(localeInfo.SYSTEM_OPTION_GPU_TILING_1)
		self.__NotifyChatLine(localeInfo.SYSTEM_OPTION_GPU_TILING_2)
		self.__NotifyChatLine(localeInfo.SYSTEM_OPTION_GPU_TILING_3)
		self.__SetTilingMode(1)
	# Add this
	if app.__BL_WINDOW_AUTO_HIDE__:
		def __OnClickAutoHideModeOnButton(self):
			systemSetting.SetGUIMode(True)
			self.RefreshGUIMode()

		def __OnClickAutoHideModeOffButton(self):
			systemSetting.SetGUIMode(False)
			self.RefreshGUIMode()

		def RefreshGUIMode(self):
			if systemSetting.IsGUIMode():
				self.autoHideModeButtonList[0].Down()
				self.autoHideModeButtonList[1].SetUp()
			else:
				self.autoHideModeButtonList[0].SetUp()
				self.autoHideModeButtonList[1].Down()
	# End
	def __OnClickTilingApplyButton(self):
		self.__NotifyChatLine(localeInfo.SYSTEM_OPTION_TILING_EXIT)
		if 0==self.tilingMode:
			background.EnableSoftwareTiling(1)
		else:
			background.EnableSoftwareTiling(0)

		net.ExitGame()
	...

 

 

Edited by DemOnJR
  • Metin2 Dev 1
  • Love 1

plague.png.1f5de75b42146262dcd655a5a8078

Link to comment
Share on other sites

Good afternoon...

I'm trying to use your system, and I'm getting an error, I was wondering if you could help me...

the error is as follows:

0720 13:39:23819 :: 
uiSystemOption.py(line:80) __Load_BindObject
ui.py(line:3121) GetChild

OptionDialog.__Load_BindObject - <type 'exceptions.KeyError'>:'auto_hide_on'

0720 13:39:23819 :: ============================================================================================================
0720 13:39:23819 :: Abort!!!!


0720 13:39:23819 :: filename=exception.py, name=Abort
0720 13:39:23819 :: filename=uiSystemOption.py, name=__Load_BindObject
0720 13:39:23819 :: filename=uiSystemOption.py, name=__Load
0720 13:39:23819 :: filename=uiSystemOption.py, name=__init__
0720 13:39:23819 :: filename=uiSystem.py, name=__ClickSystemOptionButton
0720 13:39:23819 :: filename=ui.py, name=__call__
0720 13:39:23819 :: filename=ui.py, name=__call__
0720 13:39:23819 :: filename=ui.py, name=CallEvent
0720 13:39:23819 :: filename=prototype.py, name=RunApp
0720 13:39:23819 :: filename=prototype.py, name=<module>
0720 13:39:23819 :: filename=system.py, name=execfile
0720 13:39:23819 :: filename=system.py, name=RunMainScript
0720 13:39:23819 :: filename=system.py, name=<module>
0720 13:39:23819 :: filename=<string>, name=<module>

Link to comment
Share on other sites

1 hour ago, Marcos17 said:

Good afternoon...

I'm trying to use your system, and I'm getting an error, I was wondering if you could help me...

the error is as follows:

0720 13:39:23819 :: 
uiSystemOption.py(line:80) __Load_BindObject
ui.py(line:3121) GetChild

OptionDialog.__Load_BindObject - <type 'exceptions.KeyError'>:'auto_hide_on'

0720 13:39:23819 :: ============================================================================================================
0720 13:39:23819 :: Abort!!!!


0720 13:39:23819 :: filename=exception.py, name=Abort
0720 13:39:23819 :: filename=uiSystemOption.py, name=__Load_BindObject
0720 13:39:23819 :: filename=uiSystemOption.py, name=__Load
0720 13:39:23819 :: filename=uiSystemOption.py, name=__init__
0720 13:39:23819 :: filename=uiSystem.py, name=__ClickSystemOptionButton
0720 13:39:23819 :: filename=ui.py, name=__call__
0720 13:39:23819 :: filename=ui.py, name=__call__
0720 13:39:23819 :: filename=ui.py, name=CallEvent
0720 13:39:23819 :: filename=prototype.py, name=RunApp
0720 13:39:23819 :: filename=prototype.py, name=<module>
0720 13:39:23819 :: filename=system.py, name=execfile
0720 13:39:23819 :: filename=system.py, name=RunMainScript
0720 13:39:23819 :: filename=system.py, name=<module>
0720 13:39:23819 :: filename=<string>, name=<module>

Solved, thanks bro @ DemOnJR

  • Good 1
  • Love 1
Link to comment
Share on other sites

  • 4 months 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.