Jump to content

[Python] OnRunMouseWheel Characterwindow


Recommended Posts

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
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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 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 23
  • Good 3
  • Love 2
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 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
Link to comment
Share on other sites

  • 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
Link to comment
Share on other sites

Announcements



  • Similar Content

  • Similar Content

  • Similar Content

  • Tags

  • Activity

    1. 60

      Inbuild GR2 Animation

    2. 2

      wait() function bug

    3. 0

      Remove Party Role Bonuses

    4. 1

      Fix CBar3D

    5. 1

      set_quest_state not working

    6. 1

      Fix CBar3D

    7. 1

      Game Source Code - where to call void methods to spawn mobs, move mobs and others - in game source side -?

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.