Jump to content
For maintenance and updates, the community will be offline on 31 December 2022 ×

[Python] OnRunMouseWheel Characterwindow


Dex

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

spacer.png

Link to comment
Share on other sites

  • Bronze
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()

 

Link to comment
Share on other sites

  • Bronze

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)

 

Link to comment
Share on other sites

  • Silver

 

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

  • Bronze
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

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

  • Silver
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.

Link to comment
Share on other sites

  • 5 weeks later...
  • Bronze

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



  • Similar Content

  • Activity

    1. 993

      [40250] Reference Serverfile + Client + Src [15 Available Languages]

    2. 1

      Looking for a good designer

    3. 0

      Cross channel friend request

    4. 2

      Where are those maps/dungeons coming from?

    5. 3

      Press F10 to close the client immediately

    6. 2

      Where are those maps/dungeons coming from?

    7. 2

      Where are those maps/dungeons coming from?

    8. 4

      Visual studio 2022 compiling issue

    9. 1

      Count players function

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