Jump to content

Recommended Posts

  • Active Member

Hello there,

here is a little improvement for the characterwindow which looks like that: 
234953472a6e009013af1009ac4338f78574db.g

You will be able to switch between tabs with the MouseWheel, so lets get started. First of all you need to put this in your source, after that simply do the following changes to the uicharacter.py: 
 

Spoiler
Look for this:  
    def GetState(self):
        return self.state
Add under it this:
    def OnRunMouseWheel(self, nLen):
        if nLen > 0:
            if self.GetState() == "STATUS":
                self.SetState("SKILL")
            elif self.GetState() == "SKILL":
                self.SetState("EMOTICON")
            elif self.GetState() == "EMOTICON":
                self.SetState("QUEST")
        else:
            if self.GetState() == "SKILL":
                self.SetState("STATUS")
            elif self.GetState() == "EMOTICON":
                self.SetState("SKILL")
            elif self.GetState() == "QUEST":
                self.SetState("EMOTICON")

 

Kind Regards,

Dex

  • Metin2 Dev 1
  • Good 3
  • Love 1

spacer.png

Link to comment
https://metin2.dev/topic/28186-python-onrunmousewheel-characterwindow/
Share on other sites

7 hours ago, Helia01 said:

It is better to do it where it is really necessary. For example, in the bonus viewing panel.

uicharacterdetails.py

search this.:
 

	def OnScroll(self):
		self.RefreshLabel()

add under this:

 

	def OnRunMouseWheel(self, nLen):
		if nLen > 0:
			self.ScrollBar.OnUp()
		else:
			self.ScrollBar.OnDown()

 

  • Good 2

uimessenger.py

search this:
 

	def OnScroll(self):
		scrollLineCount = len(self.showingItemList) - (self.showingPageSize/20)
		startLine = int(scrollLineCount * self.scrollBar.GetPos())

		if startLine != self.startLine:
			self.startLine = startLine
			self.__LocateMember()

add under this:

 

	def OnRunMouseWheel(self, nLen):
		if nLen > 0:
			self.scrollBar.OnUp()
		else:
			self.scrollBar.OnDown()

uiwhisper.py

search this:

 

	def OnScroll(self):
		chat.SetWhisperPosition(self.targetName, self.scrollBar.GetPos())

add under this:

 

	def OnRunMouseWheel(self, nLen):
		if nLen > 0:
			self.scrollBar.OnUp()
		else:
			self.scrollBar.OnDown()

uiselectmusic.py

search this:

 

	def __OnRefresh(self):
		self.__RefreshFileList()

add under this:
 

	def OnRunMouseWheel(self, nLen):
		self.fileListBox.RunMouseWheel(nLen)

 

  • Love 1
  • Active Member

 

21 hours ago, SamuraiHUN said:

uiselectmusic.py

search this:

 

	def __OnRefresh(self):
		self.__RefreshFileList()

add under this:
 

	def OnRunMouseWheel(self, nLen):
		self.fileListBox.RunMouseWheel(nLen)

 

 

it' dont work for me.

I did it like this

This is the hidden content, please

Edited by Helia01
  • Metin2 Dev 30
  • Good 5
  • Love 5
18 hours ago, Helia01 said:

 

 

it' dont work for me.

I did it like this

Hidden Content

 

#in file uiselectmusic.py
#in class FileListDialog(ui.ScriptWindow):
#under self.fileListBox=None
#add this:
self.ScrollBar=None

#in function: def __Load_BindObject(self):
#under self.fileListBox.SetScrollBar(self.GetChild("ScrollBar"))
#add this
self.ScrollBar=self.GetChild("ScrollBar")

#under def __OnRefresh(self):
#add this
	def OnRunMouseWheel(self, nLen):
		if nLen > 0:
			self.ScrollBar.OnUp()
		else:
			self.ScrollBar.OnDown()

 

 

Yeah i forgeted, thank you the anwser, dear @ Helia01

Is any additional code required?

I can only scroll if i have the mouse pointed on the scroll bar (distraught system only)

Whatever modifications i made from this post, didn't work.

Anyone having any suggestion?

Edited by Mohseini
  • Active Member
1 hour ago, Mohseini said:

Is any additional code required?

I can only scroll if i have the mouse pointed on the scroll bar (distraught system only)

Whatever modifications i made from this post, didn't work.

Anyone having any suggestion?

You may have forgotten to do this.

  • Metin2 Dev 1
  • 5 weeks later...
  • Active Member

For special storage - "categories"

Search 

Search
def SetCategoryPage(self, page):
[...]

Add after
	def OnRunMouseWheel(self, nLen):
		if nLen > 0:
			if self.categoryPageIndex < 3: 
				self.SetCategoryPage(self.categoryPageIndex + 1)
		else:
			if self.categoryPageIndex > 0:
				self.SetCategoryPage(self.categoryPageIndex - 1)
              

 " < 3 : " change with how much categories you have. 

Edited by Vaynz

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

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