[RELEASE]Marquee style for notice(/n text)

05/29/2015 19:19 STREL#1
This is a modification of the notice metin2 client, notice is(/n and my text here) i modified to show text right to left, if you know python, is possible change invert the script, no more words, have fun.

Only Show 1 notice
And please qualify my english. X/10 :bandit:
Video GIF: [Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]


Same code in pastebin: [Only registered and activated users can see links. Click Here To Register...]
Code:
Code:
##Mr.Toll, Zeler-* Strel

##Espero te sirva de mucho
class TipBoard(ui.Bar):

    SCROLL_WAIT_TIME = 1.0#3.0
    TIP_DURATION = 1.0#5.0
    STEP_HEIGHT = 17

    def __init__(self):
        ui.Bar.__init__(self)
        self.ceh=0
        self.AddFlag("not_pick")
        self.tipList = []
        self.curPos = 0
        self.dstPos = 0
        self.nextScrollTime = 0
        self.lastclock = time.clock()
        self.width = wndMgr.GetScreenWidth()    


        self.SetPosition(0, 70)
        self.SetSize(wndMgr.GetScreenWidth(), 20)
        self.SetColor(grp.GenerateColor(0.0, 1.0, 0.0, 0.1))
        # self.SetWindowHorizontalAlignLeft()

        self.__CreateTextBar()

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

    def __CreateTextBar(self):

        x, y = self.GetGlobalPosition()

        self.textBar = TextBar(wndMgr.GetScreenWidth(), 300)
        self.textBar.SetParent(self)
        self.textBar.SetPosition(wndMgr.GetScreenWidth(), 5)        
        self.textBar.SetClipRect(0, y, wndMgr.GetScreenWidth(), y+18)
        self.textBar.Show()

    def __CleanOldTip(self):
        leaveList = []
        for tip in self.tipList:
            madeTime = tip[0]
            if app.GetTime() - madeTime > self.TIP_DURATION:
                pass
            else:
                leaveList.append(tip)

        self.tipList = leaveList

        if not leaveList:
            self.textBar.ClearBar()
            self.Hide()
            return

        # self.__RefreshBoard()

    # def __RefreshBoard(self):

        # self.textBar.ClearBar()

        # index = 0
        # dt = time.clock() - self.lastclock
        # for tip in self.tipList:
            # text = tip[1]
            
            # self.textBar.TextOut(int(self.textBar.GetGlobalPosition()[1]+dt*200), index*self.STEP_HEIGHT, text)
            # index += 1

    def SetTip(self, text):

        if not app.IsVisibleNotice():
            return

        curTime = app.GetTime()
        self.tipList.append((curTime, text))
        # self.__RefreshBoard()

        self.nextScrollTime = app.GetTime() + 1.0

        if not self.IsShow():
            self.curPos = -self.STEP_HEIGHT
            self.dstPos = -self.STEP_HEIGHT
            self.textBar.SetPosition(wndMgr.GetScreenWidth(),0)
            self.Show()
        return
    def Refresca(self):
        dt = time.clock() - self.lastclock
        ca=int(wndMgr.GetScreenWidth()-dt*15)
        cas=0.0
        if int(ca)==int(cas):
            self.Hide()
            self.__CleanOldTip()
    def OnUpdate(self):        
        if self.ceh==0:
            self.Refresca()
            self.ceh=1
        elif self.ceh==1:
            self.Refresca()
            self.ceh=0
            self.Refresca()
        self.textBar.ClearBar()
    
        index = 0
        dt = time.clock() - self.lastclock
        for tip in self.tipList:
            text = tip[1]
            
            self.textBar.TextOut(int(wndMgr.GetScreenWidth()-dt*20), index*self.STEP_HEIGHT, text)
            index += 1
        if not self.tipList:
            self.Hide()
            return
    
        self.dstPos = 18
        
            

        if self.dstPos > self.curPos:
            self.curPos += 1
            self.textBar.SetPosition(3 , 6)
:mofo:
05/30/2015 01:38 OoKaMi_#2
uichat.py ?
05/30/2015 15:09 Agorin#3
Code:
0530 15:09:25837 :: NameError
0530 15:09:25837 :: : 
0530 15:09:25837 :: global name 'time' is not defined
0530 15:09:25837 ::
05/30/2015 21:56 OoKaMi_#4
Quote:
In uiTip.py die komplette Class ersetzen.
Ok Danke ;)
05/31/2015 13:04 #.TwoFace.##5
Wie kann man das schneller einstellen?
05/31/2015 13:20 marius9612#6
Thanks but It has an error after error occurs only once after not appear

It appears only once
06/01/2015 08:42 fannan10#7
Quote:
Originally Posted by marius9612 View Post
Thanks but It has an error after error occurs only once after not appear

It appears only once
same here :o
06/01/2015 16:08 naosou#8
If i write /n again the notice wont show up.
03/01/2017 10:00 AutozasxD#9
Quote:
Originally Posted by Agorin View Post
Code:
0530 15:09:25837 :: NameError
0530 15:09:25837 :: : 
0530 15:09:25837 :: global name 'time' is not defined
0530 15:09:25837 ::


import time and ready to go

problem is
def SetTip(self, text):

if not app.IsVisibleNotice():
return

curTime = app.GetTime()
self.tipList.append((curTime, text))
#self.__RefreshBoard() change to self.__RefreshBoard()