Jump to content
Maintenance ×
×
×
  • Create New...

Expanded Money Taskbar


Recommended Posts

  • Bot

M2 Download Center

This is the hidden content, please
( Internal )

Hello everyone, is my first release and it is something that many people already have, but for those who do not have it, I share it.

Spoiler

285726telechargement.png


Then, let's start.

root/contsinfo.py

Spoiler

# Add this:
ENABLE_EXPANDED_MONEY_TASKBAR = 1

 

root/interfacemodule.py

Spoiler

#Search:
		event.SetInterfaceWindow(self)
#Add before:
		if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
			self.wndExpandedMoneyTaskBar = None

#Search:
	def __MakeTaskBar(self):
		[...]
		if app.ENABLE_ENERGY_SYSTEM:
			wndEnergyBar = uiTaskBar.EnergyBar()
			wndEnergyBar.LoadWindow()
			self.wndEnergyBar = wndEnergyBar
#Add after:
		if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
			self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_EXPAND_MONEY, ui.__mem_func__(self.ToggleExpandedMoneyButton))
			self.wndExpandedMoneyTaskBar = uiTaskBar.ExpandedMoneyTaskBar()
			self.wndExpandedMoneyTaskBar.LoadWindow()
			if self.wndInventory:
				self.wndInventory.SetExpandedMoneyBar(self.wndExpandedMoneyTaskBar)

#Search:
		self.wndChatLog.Destroy()
#Add before:
		if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
			if self.wndExpandedMoneyTaskBar:
				self.wndExpandedMoneyTaskBar.Destroy()

#Search in 	def Close(self)::
		self.questButtonList = []
#Add before:
		if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
			if self.wndExpandedMoneyTaskBar:
				del self.wndExpandedMoneyTaskBar

#Search:
	def ShowAllWindows(self):
		[...]
			self.wndExpandedTaskBar.SetTop()
#Add after:
		if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
			if self.wndExpandedMoneyTaskBar:
				self.wndExpandedMoneyTaskBar.Show()
				self.wndExpandedMoneyTaskBar.SetTop()

#Search:
	def HideAllWindows(self):
		[...]
			self.wndInventory.Hide()
#Add after:
		if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
			if self.wndExpandedMoneyTaskBar:
				self.wndExpandedMoneyTaskBar.Hide()

#Search:
	def ToggleExpandedButton(self):
		[...]
#Add after:
	if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
		def ToggleExpandedMoneyButton(self):
			if False == self.wndExpandedMoneyTaskBar.IsShow():
				self.wndExpandedMoneyTaskBar.Show()
				self.wndExpandedMoneyTaskBar.SetTop()
			else:
				self.wndExpandedMoneyTaskBar.Close()

#Search:
		hideWindows = filter(lambda x:x.IsShow(), hideWindows)
#Add before:
		if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
			if self.wndExpandedMoneyTaskBar:
				hideWindows += self.wndExpandedMoneyTaskBar,

 

root/uiinventory.py:

Spoiler

#Search in "class InventoryWindow(ui.ScriptWindow):":
	def __init__(self):
#Add after:
		if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
			self.wndExpandedMoneyBar = None
			self.wndGem = None

#Search:
	def __del__(self):
		ui.ScriptWindow.__del__(self)
#Add after:
		if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
			self.wndExpandedMoneyBar = None
			self.wndGem = None

#Search:
			self.wndBelt.Show(self.isOpenedBeltWindowWhenClosingInventory)
#Add after:
		if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
			if self.wndExpandedMoneyBar:
				self.wndExpandedMoneyBar.Show()

#Search in "	def Destroy(self):":
		self.equipmentTab = []
#Add after:
		if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
			self.wndExpandedMoneyBar = None

#Search:
		wndMgr.Hide(self.hWnd)
#Add before:
		if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
			if self.wndExpandedMoneyBar:
				self.wndExpandedMoneyBar.Close()

#Search:
	def Close(self):
		self.Hide()
#Add after:
	if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
		def SetExpandedMoneyBar(self, wndBar):
			self.wndExpandedMoneyBar = wndBar
			if self.wndExpandedMoneyBar:
				self.wndMoneySlot = self.wndExpandedMoneyBar.GetMoneySlot()
				self.wndMoney = self.wndExpandedMoneyBar.GetMoney()
				if app.ENABLE_CHEQUE_SYSTEM:
					## 양 관련
					self.wndMoneyIcon = self.wndExpandedMoneyBar.GetMoneyIcon()
					if self.wndMoneyIcon:
						self.wndMoneyIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 0)
						self.wndMoneyIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 0)
					if self.wndMoneySlot:
						self.wndMoneySlot.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog), 0)
					## 2차화폐 관련
					self.wndChequeIcon = self.wndExpandedMoneyBar.GetChequeIcon()
					if self.wndChequeIcon:
						self.wndChequeIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 1)
						self.wndChequeIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 1)
					self.wndChequeSlot = self.wndExpandedMoneyBar.GetChequeSlot() 
					if self.wndChequeSlot:
						self.wndChequeSlot.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog), 1)
					self.wndCheque = self.wndExpandedMoneyBar.GetCheque()
					## 보석 관련
					self.wndGemIcon = self.wndExpandedMoneyBar.GetGemIcon()
					if self.wndGemIcon:
						self.wndGemIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 2)
						self.wndGemIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 2)
					self.wndGem = self.wndExpandedMoneyBar.GetGaya()
					self.toolTip = uiToolTip.ToolTip()
					self.toolTip.ClearToolTip()
				else:
					if self.wndMoneySlot:
						self.wndMoneySlot.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog))

#Search this:
			self.costumeButton = self.GetChild2("CostumeButton")

#Add after:
			if app.ENABLE_CHEQUE_SYSTEM:
				self.wndCheque = self.GetChild("Cheque")
				self.wndChequeSlot = self.GetChild("Cheque_Slot")

				if app.ENABLE_GEM_SYSTEM:
					self.wndMoneyIcon = self.GetChild("Money_Icon")
					self.wndChequeIcon = self.GetChild("Cheque_Icon")
					self.wndMoneyIcon.Hide()
					self.wndMoneySlot.Hide()
					self.wndChequeIcon.Hide()
					self.wndChequeSlot.Hide()

					## ?? ??
					height = self.GetHeight()
					width = self.GetWidth()
					self.SetSize(width, height - 22)
					self.GetChild("board").SetSize(width, height - 22)

				else:
					self.wndMoneyIcon = self.GetChild("Money_Icon")
					self.wndChequeIcon = self.GetChild("Cheque_Icon")
				
					self.wndMoneyIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 0)
					self.wndChequeIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 1)
				
					self.wndMoneyIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 0)
					self.wndChequeIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 1)
				
					self.toolTip = uiToolTip.ToolTip()
					self.toolTip.ClearToolTip()
			else:
				if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
					self.wndMoneyIcon = self.GetChild("Money_Icon")
					self.wndMoneyIcon.Hide()
					self.wndMoneySlot.Hide()

					## lôRE Á¶Rý
					height = self.GetHeight()
					width = self.GetWidth()
					self.SetSize(width, height - 22)
					self.GetChild("board").SetSize(width, height - 22)

				else:
					self.wndMoneyIcon = self.GetChild("Money_Icon")
					self.wndMoneyIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 0)
					self.wndMoneyIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 0)
					self.toolTip = uiToolTip.ToolTip()
					self.toolTip.ClearToolTip()

 

root/uitaskbar.py:

Spoiler

#Search:
#-------------------Giftbox Begin------------------------------
#Add BEFORE:
#-------------------Expanded Money TaskBar Begin--------------------------
if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
	class ExpandedMoneyTaskBar(ui.ScriptWindow):

		def __init__(self):
			ui.Window.__init__(self)

			self.wndMoney = None
			self.wndMoneySlot = None
			self.wndMoneyIcon = None

			if app.ENABLE_CHEQUE_SYSTEM:
				self.wndCheque = None
				self.wndChequeSlot = None
				self.wndChequeIcon = None
			if app.ENABLE_GEM_SYSTEM:
				self.wndGem = None
				self.wndGemSlot = None
				self.wndGemIcon = None

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

		def Destroy(self):
			self.wndMoney = None
			self.wndMoneySlot = None
			self.wndMoneyIcon = None
			if app.ENABLE_CHEQUE_SYSTEM:
				self.wndCheque = None
				self.wndChequeSlot = None
				self.wndChequeIcon = None
			if app.ENABLE_GEM_SYSTEM:
				self.wndGem = None
				self.wndGemSlot = None
				self.wndGemIcon = None

		def LoadWindow(self):
			try:
				pyScrLoader = ui.PythonScriptLoader()
				pyScrLoader.LoadScriptFile(self, "UIScript/ExpandedMoneyTaskbar.py")

				self.wndMoney = self.GetChild("Money")
				self.wndMoneyIcon = self.GetChild("Money_Icon")
				self.wndMoneySlot = self.GetChild("Money_Slot")

				if app.ENABLE_CHEQUE_SYSTEM:
					self.wndCheque = self.GetChild("Cheque")
					self.wndChequeIcon = self.GetChild("Cheque_Icon")
					self.wndChequeSlot = self.GetChild("Cheque_Slot")

				if app.ENABLE_GEM_SYSTEM:
					self.wndGem = self.GetChild("Gem")
					self.wndGemIcon = self.GetChild("Gem_Icon")
					self.wndGemSlot = self.GetChild("Gem_Slot")

			except:
				import exception
				exception.Abort("ExpandedMoneyTaskBar.LoadWindow.LoadObject")

		def GetMoneySlot(self):
				if self.wndMoneySlot:
					return self.wndMoneySlot
				else:
					return None
		def GetMoney(self):
				if self.wndMoney:
					return self.wndMoney
				else:
					return None
		def GetMoneyIcon(self):
				if self.wndMoneyIcon:
					return self.wndMoneyIcon
				else:
					return None

		if app.ENABLE_CHEQUE_SYSTEM:
			def GetCheque(self):
				if self.wndCheque:
					return self.wndCheque
				else:
					return None
			def GetChequeSlot(self):
				if self.wndChequeSlot:
					return self.wndChequeSlot
				else:
					return None
			def GetChequeIcon(self):
				if self.wndChequeIcon:
					return self.wndChequeIcon
				else:
					return None

		if app.ENABLE_GEM_SYSTEM:
			def GetGaya(self):
				if self.wndGem:
					return self.wndGem
				else:
					return None
			def GetGemSlot(self):
				if self.wndGemSlot:
					return self.wndGemSlot
				else:
					return None
			def GetGemIcon(self):
				if self.wndGemIcon:
					return self.wndGemIcon
				else:
					return None

##		def SetTop(self):
##			super(ExpandedTaskBar, self).SetTop()
##			for button in self.toggleButtonDict.values():
##				button.SetTop()

		def Show(self):
			self.SetTop()
			ui.ScriptWindow.Show(self)

		def Close(self):
			self.Hide()

		def OnPressEscapeKey(self):
			self.Close()
			return True
#-------------------ExpandedMoneyTaskBar End------------------------------

#Search:
	BUTTON_EXPAND = 4
#Add after:
	if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
		BUTTON_EXPAND_MONEY = 5

#Search:
		toggleButtonDict[TaskBar.BUTTON_SYSTEM]=self.GetChild("SystemButton")
#Add after:
		if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
			toggleButtonDict[TaskBar.BUTTON_EXPAND_MONEY]=self.GetChild("ExpandMoneyButton")

 

locale_xx/locale/xx/ui/taskbar.py

Spoiler

#Search:
		## Button
#Add after:
		## ENABLE_EXPANDED_MONEY_TASKBAR
		{
			"name" : "ExpandMoneyButton",
			"type" : "button",

			"x" : SCREEN_WIDTH - 178+8,
			"y" : 3 + Y_ADD_POSITION,
			"tooltip_text" : uiScriptLocale.TASKBAR_MONEY_EXPAND,

			"default_image" : ROOT + "TaskBar/Ex_gemshop_button_01.tga",
			"over_image" : ROOT + "TaskBar/Ex_gemshop_button_02.tga",
			"down_image" : ROOT + "TaskBar/Ex_gemshop_button_03.tga",
		},
		## ENABLE_EXPANDED_MONEY_TASKBAR

 

locale_xx/locale/xx/locale_interface.txt

Spoiler

TASKBAR_MONEY_EXPAND    Money

uiscript ---> Create a new file with this name
expandedmoneytaskbar.py
and paste this:

Spoiler

import uiScriptLocale
import app

ROOT = "d:/ymir work/ui/game/"

BOARD_ADD_X = 0

if app.ENABLE_CHEQUE_SYSTEM:
	BOARD_ADD_X += 50
if app.ENABLE_GEM_SYSTEM:
	BOARD_ADD_X += 60

BOARD_X = SCREEN_WIDTH - (140 + BOARD_ADD_X)
BOARD_WIDTH = (140 + BOARD_ADD_X)
BOARD_HEIGHT = 40

window = {
	"name" : "ExpandedMoneyTaskbar",
	
	"x" : BOARD_X,
	"y" : SCREEN_HEIGHT - 65,

	"width" : BOARD_WIDTH,
	"height" : BOARD_HEIGHT,

	"style" : ("float",),

	"children" :
	[
		{
			"name" : "ExpanedMoneyTaskBar_Board",
			"type" : "board",

			"x" : 0,
			"y" : 0,

			"width" : BOARD_WIDTH,
			"height" : BOARD_HEIGHT,

			"children" :
			[
				## Print
				{
					"name":"Money_Icon",
					"type":"image",
					
					"x":20 + BOARD_ADD_X,
					"y":10,

					"image":"d:/ymir work/ui/game/windows/money_icon.sub",
				},
				{
					"name":"Money_Slot",
					"type":"button",

					"x":39 + BOARD_ADD_X,
					"y":10,

					#"horizontal_align":"center",

					"default_image" : "d:/ymir work/ui/public/gold_slot.sub",
					"over_image" : "d:/ymir work/ui/public/gold_slot.sub",
					"down_image" : "d:/ymir work/ui/public/gold_slot.sub",

					"children" :
					(
						{
							"name" : "Money",
							"type" : "text",

							"x" : 3,
							"y" : 3,

							"horizontal_align" : "right",
							"text_horizontal_align" : "right",

							"text" : "9,999,999,999",
						},
					),
				},
			],
		},
	],
}

if app.ENABLE_CHEQUE_SYSTEM:
	window["children"][0]["children"] = window["children"][0]["children"] + [
					{
						"name":"Cheque_Icon",
						"type":"image",
						
						"x": BOARD_ADD_X - 27,
						"y": 10,

						"image":"d:/ymir work/ui/game/windows/cheque_icon.sub",
					},					
					{
						"name":"Cheque_Slot",
						"type":"button",

						"x": BOARD_ADD_X - 8,
						"y":10,

						"default_image" : "d:/ymir work/ui/public/cheque_slot.sub",
						"over_image" : "d:/ymir work/ui/public/cheque_slot.sub",
						"down_image" : "d:/ymir work/ui/public/cheque_slot.sub",

						"children" :
						(
							{
								"name" : "Cheque",
								"type" : "text",

								"x" : 3,
								"y" : 3,

								"horizontal_align" : "right",
								"text_horizontal_align" : "right",

								"text" : "99",
							},
						),
					},
					]
if app.ENABLE_GEM_SYSTEM:
	window["children"][0]["children"] = window["children"][0]["children"] + [
					{
						"name":"Gem_Icon",
						"type":"image",
						
						"x":BOARD_ADD_X - 98,
						"y":13,

						"image":"d:/ymir work/ui/gemshop/gemshop_gemicon.sub",
					},					
					{
						"name":"Gem_Slot",
						"type":"image",

						"x": BOARD_ADD_X - 82,
						"y":10,
						
						"image" : "d:/ymir work/ui/public/Parameter_Slot_01.sub",

						"children" :
						(
							{
								"name" : "Gem",
								"type" : "text",

								"x" : 3,
								"y" : 3,

								"horizontal_align" : "right",
								"text_horizontal_align" : "right",

								"text" : "999,999",
							},
						),
					},
					]

 

One extra step:
locale_xx/locale/xx/ui/inventorywindow.py or uiscript/inventorywindow.py or uiscript/inventorywindowex.py

Spoiler

#Search this:
			## Inventory, Equipment Slots
			{
				"name" : "board",
				"type" : "board",
				"style" : ("attach",),

				"x" : 0,
				"y" : 0,

				"width" : 176,
				"height" : 565,

#Change like this:
			## Inventory, Equipment Slots
			{
				"name" : "board",
				"type" : "board",
				"style" : ("attach",),

				"x" : 0,
				"y" : 0,

				"width" : 176,
				"height" : 543,

# changed: height 565 --> 543

 

If you have this error:
InventoryWindow.LoadWindow.BindObject - <type 'exceptions.AttributeError'>:'ImageBox' object has no attribute 'SetEvent'
Then: open root/ui.py:

Spoiler

#Search:
class ImageBox(Window):
	def __init__(self, layer = "UI"):
		Window.__init__(self, layer)

		self.eventDict={}
#Add after:
		if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
			self.eventFunc = {"mouse_click" : None, "mouse_over_in" : None, "mouse_over_out" : None}
			self.eventArgs = {"mouse_click" : None, "mouse_over_in" : None, "mouse_over_out" : None}

#Search:
	def SAFE_SetStringEvent(self, event, func):
		self.eventDict[event]=__mem_func__(func)
#Add after:
	if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
		def SetEvent(self, func, *args) :
			result = self.eventFunc.has_key(args[0])
			if result :
				self.eventFunc[args[0]] = func
				self.eventArgs[args[0]] = args
			else :
				print "[ERROR] ui.py SetEvent, Can`t Find has_key : %s" % args[0]

		def OnMouseLeftButtonUp(self) :
			if self.eventFunc["mouse_click"] :
				apply(self.eventFunc["mouse_click"], self.eventArgs["mouse_click"])

		def OnMouseOverIn(self) :
			if self.eventFunc["mouse_over_in"] :
				apply(self.eventFunc["mouse_over_in"], self.eventArgs["mouse_over_in"])
			else:
				try:
					self.eventDict["MOUSE_OVER_IN"]()
				except KeyError:
					pass

		def OnMouseOverOut(self) :
			if self.eventFunc["mouse_over_out"] :
				apply(self.eventFunc["mouse_over_out"], self.eventArgs["mouse_over_out"])
			else :
				try:
					self.eventDict["MOUSE_OVER_OUT"]()
				except KeyError:
					pass

 

If you do not have ENABLE_CHEQUE_SYSTEM and ENABLE_GEM_SYSTEM in your src client, then delete those parts of the code or open: UserInterface/PythonApplicationModule.cpp:

Spoiler

//Add:
#ifdef ENABLE_CHEQUE_SYSTEM
	PyModule_AddIntConstant(poModule, "ENABLE_CHEQUE_SYSTEM", 1);
#else
	PyModule_AddIntConstant(poModule, "ENABLE_CHEQUE_SYSTEM", 0);
#endif

#ifdef ENABLE_GEM_SYSTEM
	PyModule_AddIntConstant(poModule, "ENABLE_GEM_SYSTEM", 1);
#else
	PyModule_AddIntConstant(poModule, "ENABLE_GEM_SYSTEM", 0);
#endif

 


I recommend putting this as long as you have cheque_system and gem_system (otherwise the interface is a little ugly)

I hope it serves some people, greetings!!
 

  • Metin2 Dev 26
  • Love 27
  • Love 2
  • Good 16
  • Lmao 4
  • Confused 1
  • Not Good 1

english_banner.gif

Link to comment
Share on other sites

  • Premium

Nice release. Thanks.

One thing tho: in the locale/ui/taskbar.py, don't do:

			"x" : SCREEN_WIDTH - 178 + 8,

Instead, just do:

			"x" : SCREEN_WIDTH - 178,

Becase else it bugs out and the button goes a bit inside the characterbutton, each button in the taskbar has to be exactly 34 units away from eachother, characterbutton takes 144.

 

It would also be useful to remove the moneydialog from the inventory if you're using this, I'll post the code when I have more time.

  • Love 2

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Bot
43 minutes ago, Syreldar said:

"x" : SCREEN_WIDTH - 178,

Yes, you're right! I did it with +8 because I moved all the buttons a little more to the right (so they do not overlap when the resolution is 800x600)

43 minutes ago, Syreldar said:

It would also be useful to remove the moneydialog from the inventory if you're using this, I'll post the code when I have more time.

I would not erase the moneydialog since in the uiinventory it is using it (even with the expanded money taskbar) You can look at it in the last step of my uiinventory.py guide

What I forgot was this:
locale_xx/locale/xx/ui/inventorywindow.py or uiscript/inventorywindow.py or uiscript/inventorywindowex.py

Spoiler
#Search this:
			## Inventory, Equipment Slots
			{
				"name" : "board",
				"type" : "board",
				"style" : ("attach",),

				"x" : 0,
				"y" : 0,

				"width" : 176,
				"height" : 565,

#Change like this:
			## Inventory, Equipment Slots
			{
				"name" : "board",
				"type" : "board",
				"style" : ("attach",),

				"x" : 0,
				"y" : 0,

				"width" : 176,
				"height" : 543,

# changed: height 565 --> 543

 

Ty for reply! ^^

english_banner.gif

Link to comment
Share on other sites

  • Premium

Idk, what i did bad, but thanks for release.
 

Spoiler

'InventoryWindow' object has no attribute 'wndExpandedMoneyBar'

#fixed by WLsj24  100% friendly ok, kek xd

  • Love 1


 

Link to comment
Share on other sites

  • Bot

Update for fix this:
Image: click here

root/uiinventory.py:

Spoiler
#Search this:
			self.costumeButton = self.GetChild2("CostumeButton")

#Add after:
			if app.ENABLE_CHEQUE_SYSTEM:
				self.wndCheque = self.GetChild("Cheque")
				self.wndChequeSlot = self.GetChild("Cheque_Slot")

				if app.ENABLE_GEM_SYSTEM:
					self.wndMoneyIcon = self.GetChild("Money_Icon")
					self.wndChequeIcon = self.GetChild("Cheque_Icon")
					self.wndMoneyIcon.Hide()
					self.wndMoneySlot.Hide()
					self.wndChequeIcon.Hide()
					self.wndChequeSlot.Hide()

					## 높이 조절
					height = self.GetHeight()
					width = self.GetWidth()
					self.SetSize(width, height - 22)
					self.GetChild("board").SetSize(width, height - 22)

				else:
					self.wndMoneyIcon = self.GetChild("Money_Icon")
					self.wndChequeIcon = self.GetChild("Cheque_Icon")
				
					self.wndMoneyIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 0)
					self.wndChequeIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 1)
				
					self.wndMoneyIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 0)
					self.wndChequeIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 1)
				
					self.toolTip = uiToolTip.ToolTip()
					self.toolTip.ClearToolTip()
			else:
				if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
					self.wndMoneyIcon = self.GetChild("Money_Icon")
					self.wndMoneyIcon.Hide()
					self.wndMoneySlot.Hide()

					## lôRE Á¶Rý
					height = self.GetHeight()
					width = self.GetWidth()
					self.SetSize(width, height - 22)
					self.GetChild("board").SetSize(width, height - 22)

				else:
					self.wndMoneyIcon = self.GetChild("Money_Icon")
					self.wndMoneyIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 0)
					self.wndMoneyIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 0)
					self.toolTip = uiToolTip.ToolTip()
					self.toolTip.ClearToolTip()

 

 

  • Metin2 Dev 5
  • Love 3
  • Good 1

english_banner.gif

Link to comment
Share on other sites

  • Premium

This tutorial have some syntax problems and missing parts to make it working...

1. Missing part in source for app.ENABLE_GEM_SYSTEM and app.ENABLE_CHEQUE_SYSTEM

2. Try to set expanded money taskbar in constinfo to 0, you'll get this error:

Spoiler

uiInventory.py(line:381) __LoadWindow

InventoryWindow.LoadWindow.BindObject - <type 'exceptions.AttributeError'>:'ImageBox' object has no attribute 'SetEvent'

problem is in:

Spoiler
if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
                    self.wndMoneyIcon = self.GetChild("Money_Icon")
                    self.wndMoneyIcon.Hide()
                    self.wndMoneySlot.Hide()

                    ##
                    height = self.GetHeight()
                    width = self.GetWidth()
                    self.SetSize(width, height - 22)
                    self.GetChild("board").SetSize(width, height - 22)

                else:
                    self.wndMoneyIcon = self.GetChild("Money_Icon")
                    self.wndMoneyIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 0)
                    self.wndMoneyIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 0)
                    self.toolTip = uiToolTip.ToolTip()
                    self.toolTip.ClearToolTip()

 

And for those who don't have gem system and cheque system and want to use this system:

Open expandedmoneytaskbar.py

Change it to:

Spoiler
import uiScriptLocale
import app

ROOT = "d:/ymir work/ui/game/"

BOARD_ADD_X = 0

if app.ENABLE_CHEQUE_SYSTEM:
	BOARD_ADD_X += 50
if app.ENABLE_GEM_SYSTEM:
	BOARD_ADD_X += 60

BOARD_X = SCREEN_WIDTH - (176 + BOARD_ADD_X)
BOARD_WIDTH = (176 + BOARD_ADD_X)
BOARD_HEIGHT = 40

window = {
	"name" : "ExpandedMoneyTaskbar",
	
	"x" : BOARD_X,
	"y" : SCREEN_HEIGHT - 65,

	"width" : BOARD_WIDTH,
	"height" : BOARD_HEIGHT,

	"style" : ("float",),

	"children" :
	[
		{
			"name" : "ExpanedMoneyTaskBar_Board",
			"type" : "board",

			"x" : 0,
			"y" : 0,

			"width" : BOARD_WIDTH,
			"height" : BOARD_HEIGHT,

			"children" :
			[
				## Print
				{
					"name":"Money_Icon",
					"type":"image",
					
					"x":15 + BOARD_ADD_X,
					"y":11,

					"image":"d:/ymir work/ui/game/windows/money_icon.sub",
				},
				{
					"name":"Money_Slot",
					"type":"button",

					"x":36 + BOARD_ADD_X,
					"y":9,

					#"horizontal_align":"center",

					"default_image" : "d:/ymir work/ui/public/parameter_slot_05.sub",
					"over_image" : "d:/ymir work/ui/public/parameter_slot_05.sub",
					"down_image" : "d:/ymir work/ui/public/parameter_slot_05.sub",

					"children" :
					(
						{
							"name" : "Money",
							"type" : "text",

							"x" : 6,
							"y" : 3,

							"horizontal_align" : "right",
							"text_horizontal_align" : "right",

							"text" : "9,999,999,999",
						},
					),
				},
			],
		},
	],
}

if app.ENABLE_CHEQUE_SYSTEM:
	window["children"][0]["children"] = window["children"][0]["children"] + [
					{
						"name":"Cheque_Icon",
						"type":"image",
						
						"x": BOARD_ADD_X - 27,
						"y": 10,

						"image":"d:/ymir work/ui/game/windows/cheque_icon.sub",
					},					
					{
						"name":"Cheque_Slot",
						"type":"button",

						"x": BOARD_ADD_X - 8,
						"y":10,

						"default_image" : "d:/ymir work/ui/public/cheque_slot.sub",
						"over_image" : "d:/ymir work/ui/public/cheque_slot.sub",
						"down_image" : "d:/ymir work/ui/public/cheque_slot.sub",

						"children" :
						(
							{
								"name" : "Cheque",
								"type" : "text",

								"x" : 3,
								"y" : 3,

								"horizontal_align" : "right",
								"text_horizontal_align" : "right",

								"text" : "99",
							},
						),
					},
					]
if app.ENABLE_GEM_SYSTEM:
	window["children"][0]["children"] = window["children"][0]["children"] + [
					{
						"name":"Gem_Icon",
						"type":"image",
						
						"x":BOARD_ADD_X - 98,
						"y":13,

						"image":"d:/ymir work/ui/gemshop/gemshop_gemicon.sub",
					},					
					{
						"name":"Gem_Slot",
						"type":"image",

						"x": BOARD_ADD_X - 82,
						"y":10,
						
						"image" : "d:/ymir work/ui/public/Parameter_Slot_01.sub",

						"children" :
						(
							{
								"name" : "Gem",
								"type" : "text",

								"x" : 3,
								"y" : 3,

								"horizontal_align" : "right",
								"text_horizontal_align" : "right",

								"text" : "999,999",
							},
						),
					},
					]

 

Enjoy! And hope @WLsj24 will fix mentioned problems and update the tutorial :)

  • Love 1

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Premium
3 hours ago, ReFresh said:

This tutorial have some syntax problems and missing parts to make it working...

1. Missing part in source for app.ENABLE_GEM_SYSTEM and app.ENABLE_CHEQUE_SYSTEM

2. Try to set expanded money taskbar in constinfo to 0, you'll get this error:

  Hide contents

uiInventory.py(line:381) __LoadWindow

InventoryWindow.LoadWindow.BindObject - <type 'exceptions.AttributeError'>:'ImageBox' object has no attribute 'SetEvent' 

problem is in:

  Reveal hidden contents

if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:
                    self.wndMoneyIcon = self.GetChild("Money_Icon")
                    self.wndMoneyIcon.Hide()
                    self.wndMoneySlot.Hide()

                    ##
                    height = self.GetHeight()
                    width = self.GetWidth()
                    self.SetSize(width, height - 22)
                    self.GetChild("board").SetSize(width, height - 22)

                else:
                    self.wndMoneyIcon = self.GetChild("Money_Icon")
                    self.wndMoneyIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 0)
                    self.wndMoneyIcon.SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 0)
                    self.toolTip = uiToolTip.ToolTip()
                    self.toolTip.ClearToolTip()

 

And for those who don't have gem system and cheque system and want to use this system:

Open expandedmoneytaskbar.py

Change it to:

  Reveal hidden contents

import uiScriptLocale
import app

ROOT = "d:/ymir work/ui/game/"

BOARD_ADD_X = 0

if app.ENABLE_CHEQUE_SYSTEM:
	BOARD_ADD_X += 50
if app.ENABLE_GEM_SYSTEM:
	BOARD_ADD_X += 60

BOARD_X = SCREEN_WIDTH - (176 + BOARD_ADD_X)
BOARD_WIDTH = (176 + BOARD_ADD_X)
BOARD_HEIGHT = 40

window = {
	"name" : "ExpandedMoneyTaskbar",
	
	"x" : BOARD_X,
	"y" : SCREEN_HEIGHT - 65,

	"width" : BOARD_WIDTH,
	"height" : BOARD_HEIGHT,

	"style" : ("float",),

	"children" :
	[
		{
			"name" : "ExpanedMoneyTaskBar_Board",
			"type" : "board",

			"x" : 0,
			"y" : 0,

			"width" : BOARD_WIDTH,
			"height" : BOARD_HEIGHT,

			"children" :
			[
				## Print
				{
					"name":"Money_Icon",
					"type":"image",
					
					"x":15 + BOARD_ADD_X,
					"y":11,

					"image":"d:/ymir work/ui/game/windows/money_icon.sub",
				},
				{
					"name":"Money_Slot",
					"type":"button",

					"x":36 + BOARD_ADD_X,
					"y":9,

					#"horizontal_align":"center",

					"default_image" : "d:/ymir work/ui/public/parameter_slot_05.sub",
					"over_image" : "d:/ymir work/ui/public/parameter_slot_05.sub",
					"down_image" : "d:/ymir work/ui/public/parameter_slot_05.sub",

					"children" :
					(
						{
							"name" : "Money",
							"type" : "text",

							"x" : 6,
							"y" : 3,

							"horizontal_align" : "right",
							"text_horizontal_align" : "right",

							"text" : "9,999,999,999",
						},
					),
				},
			],
		},
	],
}

if app.ENABLE_CHEQUE_SYSTEM:
	window["children"][0]["children"] = window["children"][0]["children"] + [
					{
						"name":"Cheque_Icon",
						"type":"image",
						
						"x": BOARD_ADD_X - 27,
						"y": 10,

						"image":"d:/ymir work/ui/game/windows/cheque_icon.sub",
					},					
					{
						"name":"Cheque_Slot",
						"type":"button",

						"x": BOARD_ADD_X - 8,
						"y":10,

						"default_image" : "d:/ymir work/ui/public/cheque_slot.sub",
						"over_image" : "d:/ymir work/ui/public/cheque_slot.sub",
						"down_image" : "d:/ymir work/ui/public/cheque_slot.sub",

						"children" :
						(
							{
								"name" : "Cheque",
								"type" : "text",

								"x" : 3,
								"y" : 3,

								"horizontal_align" : "right",
								"text_horizontal_align" : "right",

								"text" : "99",
							},
						),
					},
					]
if app.ENABLE_GEM_SYSTEM:
	window["children"][0]["children"] = window["children"][0]["children"] + [
					{
						"name":"Gem_Icon",
						"type":"image",
						
						"x":BOARD_ADD_X - 98,
						"y":13,

						"image":"d:/ymir work/ui/gemshop/gemshop_gemicon.sub",
					},					
					{
						"name":"Gem_Slot",
						"type":"image",

						"x": BOARD_ADD_X - 82,
						"y":10,
						
						"image" : "d:/ymir work/ui/public/Parameter_Slot_01.sub",

						"children" :
						(
							{
								"name" : "Gem",
								"type" : "text",

								"x" : 3,
								"y" : 3,

								"horizontal_align" : "right",
								"text_horizontal_align" : "right",

								"text" : "999,999",
							},
						),
					},
					]

 

Enjoy! And hope @WLsj24 will fix mentioned problems and update the tutorial :)

class ImageBox(Window):
	def __init__(self, layer = "UI"):
		Window.__init__(self, layer)

		self.eventDict={}
		self.eventFunc = {"mouse_click" : None, "mouse_over_in" : None, "mouse_over_out" : None}
		self.eventArgs = {"mouse_click" : None, "mouse_over_in" : None, "mouse_over_out" : None}

	def __del__(self):
		Window.__del__(self)
		self.eventFunc = None
		self.eventArgs = None

	def RegisterWindow(self, layer):
		self.hWnd = wndMgr.RegisterImageBox(self, layer)

	def LoadImage(self, imageName):
		self.name=imageName
		wndMgr.LoadImage(self.hWnd, imageName)

		if len(self.eventDict)!=0:
			print "LOAD IMAGE", self, self.eventDict

	def SetAlpha(self, alpha):
		wndMgr.SetDiffuseColor(self.hWnd, 1.0, 1.0, 1.0, alpha)

	def GetWidth(self):
		return wndMgr.GetWidth(self.hWnd)

	def GetHeight(self):
		return wndMgr.GetHeight(self.hWnd)

	def OnMouseOverIn(self):
		try:
			self.eventDict["MOUSE_OVER_IN"]()
		except KeyError:
			pass

	def OnMouseOverOut(self):
		try:
			self.eventDict["MOUSE_OVER_OUT"]()
		except KeyError:
			pass

	def SAFE_SetStringEvent(self, event, func):
		self.eventDict[event]=__mem_func__(func)

	def SetEvent(self, func, *args) :
		result = self.eventFunc.has_key(args[0])		
		if result :
			self.eventFunc[args[0]] = func
			self.eventArgs[args[0]] = args
		else :
			print "[ERROR] ui.py SetEvent, Can`t Find has_key : %s" % args[0]

	def OnMouseLeftButtonUp(self) :
		if self.eventFunc["mouse_click"] :
			apply(self.eventFunc["mouse_click"], self.eventArgs["mouse_click"])

	def OnMouseOverIn(self) :
		if self.eventFunc["mouse_over_in"] :
			apply(self.eventFunc["mouse_over_in"], self.eventArgs["mouse_over_in"])
		else:
			try:
				self.eventDict["MOUSE_OVER_IN"]()
			except KeyError:
				pass

	def OnMouseOverOut(self) :
		if self.eventFunc["mouse_over_out"] :
			apply(self.eventFunc["mouse_over_out"], self.eventArgs["mouse_over_out"])
		else :
			try:
				self.eventDict["MOUSE_OVER_OUT"]()
			except KeyError:
				pass

 

  • Love 1


 

Link to comment
Share on other sites

  • Bot
4 hours ago, ReFresh said:

problem is in:

Sorry, I forgot to include that since I had it for the NEW_SELECT_CHARACTER, here it is:
root/ui.py

Spoiler
#Search:
class ImageBox(Window):
	def __init__(self, layer = "UI"):
		Window.__init__(self, layer)

		self.eventDict={}
#Add after:
		if app.NEW_SELECT_CHARACTER:
			self.eventFunc = {"mouse_click" : None, "mouse_over_in" : None, "mouse_over_out" : None}
			self.eventArgs = {"mouse_click" : None, "mouse_over_in" : None, "mouse_over_out" : None}

#Search:
	def SAFE_SetStringEvent(self, event, func):
		self.eventDict[event]=__mem_func__(func)
#Add after:
	if app.NEW_SELECT_CHARACTER:
		def SetEvent(self, func, *args) :
			result = self.eventFunc.has_key(args[0])
			if result :
				self.eventFunc[args[0]] = func
				self.eventArgs[args[0]] = args
			else :
				print "[ERROR] ui.py SetEvent, Can`t Find has_key : %s" % args[0]

		def OnMouseLeftButtonUp(self) :
			if self.eventFunc["mouse_click"] :
				apply(self.eventFunc["mouse_click"], self.eventArgs["mouse_click"])

		def OnMouseOverIn(self) :
			if self.eventFunc["mouse_over_in"] :
				apply(self.eventFunc["mouse_over_in"], self.eventArgs["mouse_over_in"])
			else:
				try:
					self.eventDict["MOUSE_OVER_IN"]()
				except KeyError:
					pass

		def OnMouseOverOut(self) :
			if self.eventFunc["mouse_over_out"] :
				apply(self.eventFunc["mouse_over_out"], self.eventArgs["mouse_over_out"])
			else :
				try:
					self.eventDict["MOUSE_OVER_OUT"]()
				except KeyError:
					pass

Or you can copy the class of @T4UMP

If you do not have "NEW_SELECT_CHARACTER", you can change it to if constInfo.ENABLE_EXPANDED_MONEY_TASKBAR:

 

4 hours ago, ReFresh said:

1. Missing part in source for app.ENABLE_GEM_SYSTEM and app.ENABLE_CHEQUE_SYSTEM

On the other hand, the tutorial was only to have that interface for the money, not for the systems of cheque_system and gem_system, that's why I put "I recommend putting this as long as you have check_system and gem_system (otherwise the interface is a little ugly)"

If you do not have these systems you can remove that part of the code or in pythonapplicationmodule:

Spoiler
#ifdef ENABLE_CHEQUE_SYSTEM
	PyModule_AddIntConstant(poModule, "ENABLE_CHEQUE_SYSTEM", 1);
#else
	PyModule_AddIntConstant(poModule, "ENABLE_CHEQUE_SYSTEM", 0);
#endif

#ifdef ENABLE_GEM_SYSTEM
	PyModule_AddIntConstant(poModule, "ENABLE_GEM_SYSTEM", 1);
#else
	PyModule_AddIntConstant(poModule, "ENABLE_GEM_SYSTEM", 0);
#endif

 

Although in the same way I will release the cheque_system in a few days. And the gem_system you can buy it from @felipeard1

english_banner.gif

Link to comment
Share on other sites

  • Premium

@WLsj24 It looks ugly only if it's shown as part of inventory, so you can see it only when inventory is opened. It will looks better if it's not part of inventory, keep it opened everytime or hide and show it by another KEY. It will be more useful because then you can see the actual amount of yang, gem etc. everytime without need to have inventory opened.

  • Confused 1

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Premium

It works perfectly and exactly like the official for me.

  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Bot
21 minutes ago, ReFresh said:

@WLsj24 It looks ugly only if it's shown as part of inventory, so you can see it only when inventory is opened. It will looks better if it's not part of inventory, keep it opened everytime or hide and show it by another KEY. It will be more useful because then you can see the actual amount of yang, gem etc. everytime without need to have inventory opened.

You can see whether the inventory is opened or closed. If you want to see only the money interface and not the inventory, then click on the "Money" button and not the "Inventory" button.

english_banner.gif

Link to comment
Share on other sites

  • Premium

@WLsj24 the expanded money taskbar is still hiding when I press (I) or use close inventory button. I think better way is make it like opened everytime or make some key shortcut to hide it.

Or make both things - better solution at all.

Btw. I got another error when I have set in a constInfo 0 to expanded taskbar:

Spoiler
uiInventory.py(line:381) __LoadWindow

InventoryWindow.LoadWindow.BindObject - <type 'exceptions.AttributeError'>:'InventoryWindow' object has no attribute 'EventProgress'

 

I don't have new character select.

Btw. now I don't have gem system or cheque system, but in the future I'll use it. Now I'm trying to make a thing that I wrote above.

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Bot
25 minutes ago, ReFresh said:

@WLsj24 the expanded money taskbar is still hiding when I press (I) or use close inventory button. I think better way is make it like opened everytime or make some key shortcut to hide it.

You can do it that way if you like. I did it the way it works on official servers.

25 minutes ago, ReFresh said:

Btw. I got another error when I have set in a constInfo 0 to expanded taskbar:

You must add the feature that is used in NEW_CHARACTER_SELECT in ui.py

2 hours ago, Syriza said:

You dont need a Tutorial for this shit 

@Syriza 

Spoiler

whoa-just-take-it-easy-man-diylol-com-26

 

english_banner.gif

Link to comment
Share on other sites

  • 2 weeks later...
Dnia 9.04.2019 o 03:19, T4UMP napisał:

Idk, what i did bad, but thanks for release.
 

  Odkryj ukrytą treść

'InventoryWindow' object has no attribute 'wndExpandedMoneyBar'

#fixed by WLsj24  100% friendly ok, kek xd

How you fix it? 

Link to comment
Share on other sites

  • Bot
13 minutes ago, krokodysek said:

Any help me with this problem

 

 

  Hide contents

image.thumb.png.d98125ee74d86cd7182876bdc6d34ac8.png

 

 

 

  Hide contents

image.thumb.png.960faba6f3daaa23b3a6da9b2fd20075.png

 

Check if there is a character with "?", Sometimes when copying from here and paste in notepad ++ it gives that problem.

english_banner.gif

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


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.