Jump to content

Search the Community

Showing results for tags 'python'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Forum board
    • M2Zone.tech
  • Create private server
    • Problems and Questions
    • Looking for...
    • Cooperation
    • Tutorials / Video
    • C++ / Python / Server
    • Sources / Serverfiles / Clients
    • Quests
    • Graphics
    • Programs
  • Marketplace
    • Sell
    • Buy
  • Hydepark
    • About all
    • Introduce yourself
    • Media
    • My Creativity
  • Others
    • Archives
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Sex


Country


Facebook


Discord


Telegram


Gadu-Gadu

Found 32 results

  1. Siema, bo niektórym nie chce się robić konta na freakgamers, bo trzeba posty zrobić to cyk macie tutaj osobny Yang Chat od nich: Z góry mówie jeszcze nie dodawałem, jak będę miał czas to zmienie screeny na swoje jak dodam Pobierz: [Hidden Content] Link do oryginalnego tematu: [Hidden Content]
  2. ⬇ Następne Poradniki w Spoilerze ⬇ Okno z Bonami: [Pobierz] Bonus Switcher i Szybka Zmiana Ekwipunku: [Pobierz] Kosz i Mapa Teleportacji: [Pobierz] AntyExp i Magazyn: [Pobierz] Zapis Teleportacji i Usuwanie Polimorfi: [Pobierz] Sklep z Marmurami i Tobół: [Pobierz] Wikipedia Dropu i Automatyczne Dopalacze: [Pobierz] Sortowanie Ekwipunku i Otwieracz Przedmiotów: [Pobierz] Ikony do Panelu Bocznego: [Pobierz] Aby dodać panel boczny wchodzimy do ..\locale\pl\ui: Szukamy i edytujemy plik inventorywindow.py: Szukamy w nim: "children" : ( Pod dodajemy: Następnie szukamy: ## Inventory, Equipment Slots { "name" : "board", "type" : "board", "style" : ("attach",), "x" : 0, Zamieniamy na: ## Inventory, Equipment Slots { "name" : "board", "type" : "board", "style" : ("attach",), "x" : 37, Następnie szukamy: "x" : SCREEN_WIDTH - 176, "y" : SCREEN_HEIGHT - 37 - 565, "style" : ("movable", "float",), "width" : 176, "height" : 565, Zamieniamy na: "x" : SCREEN_WIDTH - 210, "y" : SCREEN_HEIGHT - 600, "style" : ("movable", "float",), "width" : 263, "height" : 566,
  3. Witam i łapcie Może komuś się przyda Wchodzimy do ui.py ##Dodaj przed class ScrollBar(Window): class ThinBoardGold(Window): CORNER_WIDTH = 16 CORNER_HEIGHT = 16 LINE_WIDTH = 16 LINE_HEIGHT = 16 BOARD_COLOR = grp.GenerateColor(0.0, 0.0, 0.0, 0.51) LT = 0 LB = 1 RT = 2 RB = 3 L = 0 R = 1 T = 2 B = 3 def __init__(self, layer = "UI"): Window.__init__(self, layer) CornerFileNames = [ "d:/ymir work/ui/pattern/thinboardgold/ThinBoard_Corner_"+dir+"_gold.tga" for dir in ["LeftTop","LeftBottom","RightTop","RightBottom"] ] LineFileNames = [ "d:/ymir work/ui/pattern/thinboardgold/ThinBoard_Line_"+dir+"_gold.tga" for dir in ["Left","Right","Top","Bottom"] ] self.Corners = [] for fileName in CornerFileNames: Corner = ExpandedImageBox() Corner.AddFlag("attach") Corner.AddFlag("not_pick") Corner.LoadImage(fileName) Corner.SetParent(self) Corner.SetPosition(0, 0) Corner.Show() self.Corners.append(Corner) self.Lines = [] for fileName in LineFileNames: Line = ExpandedImageBox() Line.AddFlag("attach") Line.AddFlag("not_pick") Line.LoadImage(fileName) Line.SetParent(self) Line.SetPosition(0, 0) Line.Show() self.Lines.append(Line) self.Base = ExpandedImageBox() self.Base.AddFlag("not_pick") self.Base.LoadImage("d:/ymir work/ui/pattern/thinboardgold/ThinBoard_bg_gold.tga") self.Base.SetParent(self) self.Base.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT) self.Base.Show() self.Lines[self.L].SetPosition(0, self.CORNER_HEIGHT) self.Lines[self.T].SetPosition(self.CORNER_WIDTH, 0) def __del__(self): Window.__del__(self) def SetSize(self, width, height): width = max(self.CORNER_WIDTH*2, width) height = max(self.CORNER_HEIGHT*2, height) Window.SetSize(self, width, height) self.Corners[self.LB].SetPosition(0, height - self.CORNER_HEIGHT) self.Corners[self.RT].SetPosition(width - self.CORNER_WIDTH, 0) self.Corners[self.RB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT) self.Lines[self.R].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT) self.Lines[self.B].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT) verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.LINE_HEIGHT) / self.LINE_HEIGHT horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.LINE_WIDTH) / self.LINE_WIDTH self.Lines[self.L].SetRenderingRect(0, 0, 0, verticalShowingPercentage) self.Lines[self.R].SetRenderingRect(0, 0, 0, verticalShowingPercentage) self.Lines[self.T].SetRenderingRect(0, 0, horizontalShowingPercentage, 0) self.Lines[self.B].SetRenderingRect(0, 0, horizontalShowingPercentage, 0) if self.Base: self.Base.SetRenderingRect(0, 0, horizontalShowingPercentage, verticalShowingPercentage) def ShowInternal(self): self.Base.Show() for wnd in self.Lines: wnd.Show() for wnd in self.Corners: wnd.Show() def HideInternal(self): self.Base.Hide() for wnd in self.Lines: wnd.Hide() for wnd in self.Corners: wnd.Hide() class ThinBoardCircle(Window): CORNER_WIDTH = 16 CORNER_HEIGHT = 16 LINE_WIDTH = 16 LINE_HEIGHT = 16 BOARD_COLOR = grp.GenerateColor(0.0, 0.0, 0.0, 0.51) LT = 0 LB = 1 RT = 2 RB = 3 L = 0 R = 1 T = 2 B = 3 def __init__(self, layer = "UI"): Window.__init__(self, layer) CornerFileNames = [ "d:/ymir work/ui/pattern/thinboardcircle/ThinBoard_Corner_"+dir+"_circle.tga" for dir in ["LeftTop","LeftBottom","RightTop","RightBottom"] ] LineFileNames = [ "d:/ymir work/ui/pattern/thinboardcircle/ThinBoard_Line_"+dir+"_circle.tga" for dir in ["Left","Right","Top","Bottom"] ] self.Corners = [] for fileName in CornerFileNames: Corner = ExpandedImageBox() Corner.AddFlag("attach") Corner.AddFlag("not_pick") Corner.LoadImage(fileName) Corner.SetParent(self) Corner.SetPosition(0, 0) Corner.Show() self.Corners.append(Corner) self.Lines = [] for fileName in LineFileNames: Line = ExpandedImageBox() Line.AddFlag("attach") Line.AddFlag("not_pick") Line.LoadImage(fileName) Line.SetParent(self) Line.SetPosition(0, 0) Line.Show() self.Lines.append(Line) Base = Bar() Base.SetParent(self) Base.AddFlag("attach") Base.AddFlag("not_pick") Base.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT) Base.SetColor(self.BOARD_COLOR) Base.Show() self.Base = Base self.Lines[self.L].SetPosition(0, self.CORNER_HEIGHT) self.Lines[self.T].SetPosition(self.CORNER_WIDTH, 0) def __del__(self): Window.__del__(self) def SetSize(self, width, height): width = max(self.CORNER_WIDTH*2, width) height = max(self.CORNER_HEIGHT*2, height) Window.SetSize(self, width, height) self.Corners[self.LB].SetPosition(0, height - self.CORNER_HEIGHT) self.Corners[self.RT].SetPosition(width - self.CORNER_WIDTH, 0) self.Corners[self.RB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT) self.Lines[self.R].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT) self.Lines[self.B].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT) verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.LINE_HEIGHT) / self.LINE_HEIGHT horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.LINE_WIDTH) / self.LINE_WIDTH self.Lines[self.L].SetRenderingRect(0, 0, 0, verticalShowingPercentage) self.Lines[self.R].SetRenderingRect(0, 0, 0, verticalShowingPercentage) self.Lines[self.T].SetRenderingRect(0, 0, horizontalShowingPercentage, 0) self.Lines[self.B].SetRenderingRect(0, 0, horizontalShowingPercentage, 0) self.Base.SetSize(width - self.CORNER_WIDTH*2, height - self.CORNER_HEIGHT*2) def ShowInternal(self): self.Base.Show() for wnd in self.Lines: wnd.Show() for wnd in self.Corners: wnd.Show() def HideInternal(self): self.Base.Hide() for wnd in self.Lines: wnd.Hide() for wnd in self.Corners: wnd.Hide() #Dodaj pod elif Type == "thinboard": elif Type == "thinboard_gold": parent.Children[Index] = ThinBoardGold() parent.Children[Index].SetParent(parent) self.LoadElementThinBoardGold(parent.Children[Index], ElementValue, parent) elif Type == "thinboard_circle": parent.Children[Index] = ThinBoardCircle() parent.Children[Index].SetParent(parent) self.LoadElementThinBoardCircle(parent.Children[Index], ElementValue, parent) #Dodaj pod def LoadElementThinBoard(self, window, value, parentWindow): if FALSE == self.CheckKeyList(value["name"], value, self.BOARD_KEY_LIST): return FALSE window.SetSize(int(value["width"]), int(value["height"])) self.LoadDefaultData(window, value, parentWindow) return TRUE ## ThinBoardGold def LoadElementThinBoardGold(self, window, value, parentWindow): if FALSE == self.CheckKeyList(value["name"], value, self.BOARD_KEY_LIST): return FALSE window.SetSize(int(value["width"]), int(value["height"])) self.LoadDefaultData(window, value, parentWindow) return TRUE ## ThinBoardCircle def LoadElementThinBoardCircle(self, window, value, parentWindow): Pobierz jeszcze to ui.rar i wrzuć do ETC i koniec teraz spakuj root i ETC Skan: [Hidden Content] Od razu mówię działa.
  4. Witam. Dziś pokażę wam jak edytować pasek życia na taki jak poniżej. [Hidden Content] 1.1. W pliku "ui.py" szukamy: class Board(Window) 1.2. Pod tą całą funkcją dodajemy: class DynamicGauge(Gauge): dynamicGaugePerc = None newGaugePerc = 0 def __init__(self): Gauge.__init__(self) def __del__(self): Gauge.__del__(self) def MakeGauge (self, width, color1, color2): Gauge.MakeGauge(self, width, color2) imgGauge2 = ExpandedImageBox() imgGauge2.SetParent(self) imgGauge2.LoadImage("d:/ymir work/ui/pattern/gauge_" + color1 + ".tga") imgGauge2.Show() imgGauge2.SetRenderingRect(0.0, 0.0, 0.0, 0.0) imgGauge2.SetPosition (self.GAUGE_TEMPORARY_PLACE, 0) self.imgGauge2 = imgGauge2 def SetPercentage(self, curValue, maxValue): # PERCENTAGE_MAX_VALUE_ZERO_DIVISION_ERROR if maxValue> 0.0: percentage = min(1.0, float(curValue)/float(maxValue)) else: percentage = 0.0 # END_OF_PERCENTAGE_MAX_VALUE_ZERO_DIVISION_ERROR gaugeSize = -1.0 + float(self.width - self.GAUGE_TEMPORARY_PLACE*2) * percentage/ self.GAUGE_WIDTH if self.dynamicGaugePerc == None: self.imgGauge.SetRenderingRect(0.0, 0.0, (-1.0 + float(self.width - self.GAUGE_TEMPORARY_PLACE*2) * percentage/ self.GAUGE_WIDTH), 0.0) self.dynamicGaugePerc = percentage elif self.dynamicGaugePerc + 0.2 < self.newGaugePerc: self.imgGauge.SetRenderingRect(0.0, 0.0, (-1.0 + float(self.width - self.GAUGE_TEMPORARY_PLACE*2) * self.newGaugePerc/ self .GAUGE_WIDTH), 0.0) self.dynamicGaugePerc = self.newGaugePerc self.newGaugePerc = percentage self.imgGauge2.SetRenderingRect(0.0, 0.0, gaugeSize, 0.0) if percentage == 0: self.imgGauge.Hide() else: self.imgGauge.Show() def OnUpdate(self): if self.dynamicGaugePerc > self.newGaugePerc: self.dynamicGaugePerc = self.dynamicGaugePerc -0.005 self.imgGauge.SetRenderingRect (0.0, 0.0, (-1.0 + float(self.width - self.GAUGE_TEMPORARY_PLACE*2) * self.dynamicGaugePerc/ self.GAUGE_WIDTH), 0.0) elif self.dynamicGaugePerc < self.newGaugePerc: self.dynamicGaugePerc = self.newGaugePerc self.imgGauge.SetRenderingRect (0.0, 0.0, (-1.0 + float(self.width - self.GAUGE_TEMPORARY_PLACE*2) * self.dynamicGaugePerc/ self .GAUGE_WIDTH), 0.0) 2.1. W pliku "uitarget.py" szukamy: hpGauge.MakeGauge(130, "red") 2.2. Zmieniamy na: hpGauge.MakeGauge(130, "red", "blue") 2.3. Dalej w tym samym pliku szukamy: ui.Gauge 2.4. Zmieniamy na: ui.DynamicGauge Teraz wystarczy spakować root i cieszyć się urozmaiconym target hp.
  5. Cześć, jak przerobić ten kod żeby zamiast takiego zwykłego okna było okno jako grafika? Chciałbym żeby tłem była grafika do której sam ustawię ścieżkę. Kod wygląda tak: uiachievement.py: [Hidden Content] okienka: [Hidden Content] Z góry dzięki za pomoc.
  6. Witam Dziś przedstawię Wam jak wyłączyć ten pasek Wchodzimy do pliku root/uiinventory.py który znajduję się w kliencie gry. Szukamy poniższych linijek kodu i komentujemy tym znakiem # każdą linijkę kodu lub kasujemy: 1 ) self.wndBelt = None if app.ENABLE_NEW_EQUIPMENT_SYSTEM: self.wndBelt = BeltInventoryWindow(self) 2 ) if self.wndBelt: self.wndBelt.Destroy() self.wndBelt = None 3 ) if self.wndBelt: self.isOpenedBeltWindowWhenClosingInventory = self.wndBelt.IsOpeningInventory() # ŔÎşĄĹ丮 âŔĚ ´ÝČú ¶§ ş§Ć® ŔÎşĄĹ丮µµ ż­·Á ŔÖľú´Â°ˇ? print "Is Opening Belt Inven?? ", self.isOpenedBeltWindowWhenClosingInventory self.wndBelt.Close() 4 ) if self.wndBelt: self.wndBelt.RefreshSlot() 5 ) def OnMoveWindow(self, x, y): # print "Inventory Global Pos : ", self.GetGlobalPosition() if self.wndBelt: # print "Belt Global Pos : ", self.wndBelt.GetGlobalPosition() self.wndBelt.AdjustPositionAndSize() 6 ) wndBelt = None 7 ) if self.wndBelt: self.wndBelt.Show(self.isOpenedBeltWindowWhenClosingInventory) 8 ) 9 ) isOpenedBeltWindowWhenClosingInventory = 0 # ŔÎşĄĹ丮 ´ÝŔ» ¶§ ş§Ć® ŔÎşĄĹ丮°ˇ ż­·ÁŔÖľú´ÂÁö ż©şÎ-_-; ł×ŔĚąÖ ¤¸¤µ 10 ) self.isOpenedBeltWindowWhenClosingInventory = 0 # ŔÎşĄĹ丮 ´ÝŔ» ¶§ ş§Ć® ŔÎşĄĹ丮°ˇ ż­·ÁŔÖľú´ÂÁö ż©şÎ-_-; ł×ŔĚąÖ ¤¸¤µ Pakujemy klienta gry. Pozdrawiam * To tylko przedsmak tego co dla Was przygotowałem proszę daj + by zmotywować mnie do dalszego działania.
  7. Takie małe urozmaicenie dodające +10 do zajebistości. Download: [Hidden Content] PS: Zostawiam linka do innego rozwiązania: [Hidden Content]
  8. W niektórych clientach problem polegał na tym, że nie było można używać strzałek przy wyborze postaci po prostu nic się nie działo. Tutaj kod jak to poprawić. Wchodzimy do root -> networkModule.py Linijka 154 u mnie. Szukamy: if self.curPhaseWindow: self.curtain.FadeIn() zmieniamy na: if self.curPhaseWindow: self.curtain.FadeIn() self.curPhaseWindow.SetFocus() Pakujemy root, podmieniamy i mamy naprawione:)
  9. Witam podaję wam plik do lepszego wyglądu ładowania gry Przed: Po: Pobieranie: [Hidden Content]
  10. Myślę, że obraz wszystko wyjaśnia i nie trzeba nikomu tego tłumaczyć ;) 01: Otwieramy intrologin.py (root), szukamy tego: import uiScriptLocale - I zmieniamy na: import uiScriptLocale import os - Szukamy tego: def Suffle(src): - I zmieniamy na: def LoadAccount(file1, Setting): lines = open(file1).readlines() for line in lines: if line.startswith(Setting): return line.split('=')[1].replace('\n', '') def SaveAccount(file1, Setting, Value): sReader = open(file1,'r') sLines = file.readlines(sReader) sWriter = open(file1,'w') for Line in sLines: if Line.startswith(Setting + '='): Line = Setting + '=' + Value + '\n' sWriter.write(Line) sWriter.close() sReader.close() AccountName = None def Suffle(src): - Szukamy tego: self.loginExitButton = GetObject("LoginExitButton") - I zmieniamy na: self.loginExitButton = GetObject("LoginExitButton") self.SaveLoginButton = ui.ToggleButton() self.SaveLoginButton.SetParent(self.idEditLine) self.SaveLoginButton.SetPosition(103, 1) self.SaveLoginButton.SetUpVisual("locale/pl/ui/login/accunlocked_01.sub") self.SaveLoginButton.SetOverVisual("locale/pl/ui/login/accunlocked_02.sub") self.SaveLoginButton.SetDownVisual("locale/pl/ui/login/acclocked_01.sub") self.SaveLoginButton.SetText("") self.SaveLoginButton.Show() self.SaveLoginButton.SetToggleUpEvent(lambda a = "delete_acc": self.NewSaveAccountButton(a)) self.SaveLoginButton.SetToggleDownEvent(lambda a = "save_acc": self.NewSaveAccountButton(a)) self.SavePwdButton = ui.ToggleButton() self.SavePwdButton.SetParent(self.pwdEditLine) self.SavePwdButton.SetPosition(103, 1) self.SavePwdButton.SetUpVisual("locale/pl/ui/login/accunlocked_01.sub") self.SavePwdButton.SetOverVisual("locale/pl/ui/login/accunlocked_02.sub") self.SavePwdButton.SetDownVisual("locale/pl/ui/login/acclocked_01.sub") self.SavePwdButton.SetText("") self.SavePwdButton.Show() self.SavePwdButton.SetToggleUpEvent(lambda a = "delete_pwd": self.NewSaveAccountButton(a)) self.SavePwdButton.SetToggleDownEvent(lambda a = "save_pwd": self.NewSaveAccountButton(a)) - Szukamy tego: def __OnSelectRegionGroup(self): - I zmieniamy na: account_file = "ACCstored.dll" if os.path.exists(account_file): if LoadAccount(account_file, 'login')!="": self.idEditLine.SetText(LoadAccount(account_file, 'login')) self.SaveLoginButton.Down() else: self.SaveLoginButton.SetUp() if LoadAccount(account_file, 'pwd')!="": self.pwdEditLine.SetText(LoadAccount(account_file, 'pwd')) self.SavePwdButton.Down() else: self.SavePwdButton.SetUp() def __OnSelectRegionGroup(self): - Szukamy tego: self.stream.popupWindow.Open(localeInfo.LOGIN_FAILURE_SAMELOGIN, 0, localeInfo.UI_OK) - I zmieniamy na: self.stream.popupWindow.Open(localeInfo.LOGIN_FAILURE_SAMELOGIN, 0, localeInfo.UI_OK) def NewSaveAccountButton(self, arg): id = self.idEditLine.GetText() pwd = self.pwdEditLine.GetText() if not os.path.exists('ACCstored.dll'): ch = open('ACCstored.dll', 'w') ch.write("login=" + id + "\n") ch.write("pwd=" + pwd + "\n") ch.close() if arg=="save_acc": SaveAccount('ACCstored.dll', 'login', id) elif arg=="delete_acc": SaveAccount('ACCstored.dll', 'login', '') elif arg=="save_pwd": SaveAccount('ACCstored.dll', 'pwd', pwd) elif arg=="delete_pwd": SaveAccount('ACCstored.dll', 'pwd', '') 02: Pobieramy kłódeczkę, pakujemy ją do roota i to wszystko: [Hidden Content]
  11. Ostatnio potrzebowałem panelu gracza, lecz nigdzie na internecie nie było nic co mógłbym wykorzystać. Pythona bardzo nie rozumiem ale zdecydowałem się napisać własne GUI takiego Panelu Gracza. Nie jest to szczyt metinowskiej architektury lecz proste otwieralne GUI, które można wykorzystać do wielu rzeczy. Dziś pokaże wam jak samemu je skonfigurować, jak podpiąć je pod klawisz oraz button a także jak dodać do panelu własny przycisk z funkcją. Zaczynajmy! USTAWIENIE PANELU POD PRZYCISK USTAWIENIE PANELU POD BUTTON DODAWANIE NOWEGO BUTTONU Oczywiście, możemy dodać ten przycisk pod button oraz pod przycisk, jeśli jednak chcecie tylko pod przycisk to robimy wszystko z 1 spojlera oraz wszystko wyłączając edycje plików taskbar.py z 2 spojlera. Dobra, to na tyle z dodawania panelu. Teraz dorzucamy plik uiPanel.py do /root/ oraz do /uiscript/ wrzucamy panel.py Paczka : Poradnik 1 - Panel Gracza Skan paczki Całość prezentuje się w ten sposób : Button : Panel gracza : W paczce, która wam udostępniłem jest dodany tylko 1 button, reszte dodajemy analogicznie jak poprzednie i dopisujemy w pliku uiPanel.py funkcje, co button ma robić. Bardzo mile widziane byłyby podziekowania, nie chcę blokować tematu - ale nie ukrywam, motywuje to do dalszej pracy.
  12. Ostatnio ktoś pytał o animowane tło logowania. Ten poradnik pokaże jeden ze sposobów na uzyskanie takiego efektu. Powiem jeszcze tylko, że nie jest to najlepszy sposób na animowane tło i można w internecie doszukać się ciekawszych rozwiązań, ale ten sposób też jest warty uwagi. Dzięki niemu możemy zrobić dość ciekawe logo, a nie tylko tło, co według mnie jest już lepszym zastosowaniem. Poradnik podzielę na dwie części, abyście mogli przetestować to co was bardziej interesuje. Download: [Hidden Content] ANIMOWANE TŁO LOGOWANIA 01: Wrzucamy zawartość pobranej paczki do klienta gry (root/locale/pl/ui). 02: Otwieramy loginwindow.py (root/locale/pl/ui) i szukamy tego: { "name" : "bg2", "type" : "expanded_image", "x" : 0, "y" : 0, "x_scale" : float(SCREEN_WIDTH) / 1024.0, "y_scale" : float(SCREEN_HEIGHT) / 768.0, "image" : "locale/pl/ui/login.sub", }, I pod spodem dodajemy to: # ANIMOWANY BACKGROUND LOGIN { "name" : "AnimationBackgroundLogin", "type" : "ani_image", "x" : -448, "y" : 0, "width" : 1024.0, "height" : 768.0, "horizontal_align" : "center", "delay" : 3, "images" : ( "locale/pl/ui/animationbackground/log 01.jpg", "locale/pl/ui/animationbackground/log 02.jpg", "locale/pl/ui/animationbackground/log 03.jpg", "locale/pl/ui/animationbackground/log 04.jpg", "locale/pl/ui/animationbackground/log 05.jpg", "locale/pl/ui/animationbackground/log 06.jpg", "locale/pl/ui/animationbackground/log 07.jpg", "locale/pl/ui/animationbackground/log 08.jpg", "locale/pl/ui/animationbackground/log 09.jpg", "locale/pl/ui/animationbackground/log 10.jpg", "locale/pl/ui/animationbackground/log 11.jpg", "locale/pl/ui/animationbackground/log 12.jpg", "locale/pl/ui/animationbackground/log 13.jpg", "locale/pl/ui/animationbackground/log 14.jpg", "locale/pl/ui/animationbackground/log 15.jpg", "locale/pl/ui/animationbackground/log 16.jpg", "locale/pl/ui/animationbackground/log 17.jpg", "locale/pl/ui/animationbackground/log 18.jpg", "locale/pl/ui/animationbackground/log 19.jpg", "locale/pl/ui/animationbackground/log 20.jpg", "locale/pl/ui/animationbackground/log 21.jpg", "locale/pl/ui/animationbackground/log 22.jpg", "locale/pl/ui/animationbackground/log 23.jpg", "locale/pl/ui/animationbackground/log 24.jpg", "locale/pl/ui/animationbackground/log 25.jpg", "locale/pl/ui/animationbackground/log 26.jpg", "locale/pl/ui/animationbackground/log 27.jpg", "locale/pl/ui/animationbackground/log 28.jpg", "locale/pl/ui/animationbackground/log 29.jpg", "locale/pl/ui/animationbackground/log 30.jpg", "locale/pl/ui/animationbackground/log 31.jpg", "locale/pl/ui/animationbackground/log 32.jpg", "locale/pl/ui/animationbackground/log 33.jpg", "locale/pl/ui/animationbackground/log 34.jpg", "locale/pl/ui/animationbackground/log 35.jpg", "locale/pl/ui/animationbackground/log 36.jpg", "locale/pl/ui/animationbackground/log 37.jpg", "locale/pl/ui/animationbackground/log 38.jpg", "locale/pl/ui/animationbackground/log 39.jpg", "locale/pl/ui/animationbackground/log 40.jpg", "locale/pl/ui/animationbackground/log 41.jpg", "locale/pl/ui/animationbackground/log 42.jpg", "locale/pl/ui/animationbackground/log 43.jpg", "locale/pl/ui/animationbackground/log 44.jpg", "locale/pl/ui/animationbackground/log 45.jpg", "locale/pl/ui/animationbackground/log 46.jpg", "locale/pl/ui/animationbackground/log 47.jpg", "locale/pl/ui/animationbackground/log 48.jpg", "locale/pl/ui/animationbackground/log 49.jpg", "locale/pl/ui/animationbackground/log 50.jpg", ) }, ANIMOWANE LOGO 01: Otwieramy loginwindow.py (root/locale/pl/ui) i teraz, jeśli dodałeś animowane tło logowania to kod z tej części dodaj pod tamtym, a jeśli nie to szukamy tego: { "name" : "bg2", "type" : "expanded_image", "x" : 0, "y" : 0, "x_scale" : float(SCREEN_WIDTH) / 1024.0, "y_scale" : float(SCREEN_HEIGHT) / 768.0, "image" : "locale/pl/ui/login.sub", }, I pod spodem dodajemy to: # ANIMOWANE LOGO { "name" : "AnimationLogo", "type" : "ani_image", "x" : 0, "y" : 74, "width" : 390, "height" : 100, "horizontal_align" : "center", "delay" : 3, "images" : ( "locale/pl/ui/animationlogo/0.jpg", "locale/pl/ui/animationlogo/1.jpg", "locale/pl/ui/animationlogo/2.jpg", "locale/pl/ui/animationlogo/3.jpg", "locale/pl/ui/animationlogo/4.jpg", "locale/pl/ui/animationlogo/5.jpg", "locale/pl/ui/animationlogo/6.jpg", "locale/pl/ui/animationlogo/7.jpg", "locale/pl/ui/animationlogo/8.jpg", "locale/pl/ui/animationlogo/9.jpg", "locale/pl/ui/animationlogo/10.jpg", "locale/pl/ui/animationlogo/11.jpg", "locale/pl/ui/animationlogo/12.jpg", "locale/pl/ui/animationlogo/13.jpg", ) }, I to wszystko. Pamiętajcie tylko, że tło i logo (w szczególności logo) są obrazami przykładowymi PS: Kombinowałem, żeby obrazy skalowały się do rozdzielczości okna gry, ale nic mi nie wychodziło. Jakby ktoś się na tym znał to może napisać, jak to zrobić.
  13. Cześć, Pokażę Wam jak podświetlić + dodać informację o posiadanej ilości danego ulepszacza. Otwórz uiRefine.py w root i znajdź: textLine = ui.TextLine() Zamień całość na: textLine = ui.TextLine() textLine.SetParent(thinBoard) textLine.SetFontName(localeInfo.UI_DEF_FONT) have_count = player.GetItemCountByVnum(vnum) if have_count < count: textLine.SetFontColor(1.0, 0.0, 0.0) else: textLine.SetFontColor(0.0, 1.0, 0.0) textLine.SetText("%s x %02d / %02d" % (item.GetItemName(), count, have_count)) textLine.SetOutline() textLine.SetFeather(False) textLine.SetWindowVerticalAlignCenter() textLine.SetVerticalAlignCenter()
  14. Cześć Python: [align=center] [Hidden Content] [Hidden Content] [/align] Quest [align=center] [Hidden Content] [Hidden Content] [/align]
  15. Siemanko W tym poście udostępniam wam mapkę teleportacji Download: [Hidden Content]
  16. dobry

    Pasek HP

    W ui.py szukaj class Board (Window) Zamień całość na class DynamicGauge (Gauge): dynamicGaugePerc = None newGaugePerc = 0 def __init__ ( self ): Gauge. __init__ ( self ) def __del__ ( self ): Gauge. __del__ ( self ) def MakeGauge ( self , width, color1, color2): Gauge.MakeGauge ( self , width, color2) imgGauge2 = ExpandedImageBox () imgGauge2.SetParent ( self ) imgGauge2.LoadImage ( "d: / ymir work / ui / pattern / gauge_" + color1 + ".tga" ) imgGauge2.Show () imgGauge2.SetRenderingRect ( 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 ) imgGauge2.SetPosition ( self .GAUGE_TEMPORARY_PLACE, 0 ) self .imgGauge2 = imgGauge2 def SetPercentage ( self , curValue, maxValue): # PERCENTAGE_MAX_VALUE_ZERO_DIVISION_ERROR if maxValue > 0 . 0 : percentage = min ( 1 . 0 , float (curValue) / float (maxValue)) else : percentage = 0 . 0 # END_OF_PERCENTAGE_MAX_VALUE_ZERO_DIVISION_ERROR gaugeSize = - 1 . 0 + float ( self .width - self .GAUGE_TEMPORARY_PLACE * 2 ) * percentage / self .GAUGE_WIDTH if self .dynamicGaugePerc = = None : self .imgGauge.SetRenderingRect ( 0 . 0 , 0 . 0 , ( - 1 . 0 + float ( self .width - self .GAUGE_TEMPORARY_PLACE * 2 ) * percentage / self .GAUGE_WIDTH), 0 . 0 ) self .dynamicGaugePerc = percentage elif self .dynamicGaugePerc + 0 . 2 < self .newGaugePerc: self .imgGauge.SetRenderingRect ( 0 . 0 , 0 . 0 , ( - 1 . 0 + float ( self .width - self .GAUGE_TEMPORARY_PLACE * 2 ) * self .newGaugePerc / self .GAUGE_WIDTH), 0 . 0 ) self .dynamicGaugePerc = self .newGaugePerc self .newGaugePerc = percentage self .imgGauge2.SetRenderingRect ( 0 . 0 , 0 . 0 , gaugeSize, 0 . 0 ) if percentage = = 0 : self .imgGauge.Hide () else : self .imgGauge.Show () def OnUpdate ( self ): if self .dynamicGaugePerc > self .newGaugePerc: self .dynamicGaugePerc = self .dynamicGaugePerc - 0 . 005 self .imgGauge.SetRenderingRect ( 0 . 0 , 0 . 0 , ( - 1 . 0 + float ( self .width - self .GAUGE_TEMPORARY_PLACE * 2 ) * self .dynamicGaugePerc / self .GAUGE_WIDTH), 0 . 0 ) elif self .dynamicGaugePerc < self .newGaugePerc: self .dynamicGaugePerc = self .newGaugePerc self .imgGauge.SetRenderingRect ( 0 . 0 , 0 . 0 , ( - 1 . 0 + float ( self .width - self .GAUGE_TEMPORARY_PLACE * 2 ) * self .dynamicGaugePerc / self .GAUGE_WIDTH), 0 . 0 ) W uitarget.py szukaj hpGauge.MakeGauge ( 130 , "red" ) Zamień na hpGauge.MakeGauge ( 130 , "red" , "blue" ) Szukaj ui.Gauge Zamień na ui.DynamicGauge Źródło turkmmo
  17. Jako że linki wygasły, idt, itp. no to łapcie uiminimap.py 1. Na początku dopisujemy import time 2. szukamy i dodajemy: #szukamy self.serverInfo = self.GetChild("ServerInfo") #dodajemy self.dateInfo = self.GetChild("DateInfo") self.timeInfo = self.GetChild("TimeInfo") 3. szukamy i dodajemy: #szukamy if constInfo.MINIMAP_POSITIONINFO_ENABLE==0: #dodajemy if constInfo.MINIMAP_DATETIME_ENABLE==0: self.dateInfo.Hide() self.timeInfo.Hide() 4.szukamy i dodajemy: #szukamy self.positionInfo.SetText("%.0f, %.0f" % (x/100, y/100)) #Jeśli nie mamy tego kodu, szukamy def OnUpdate(self): i tam wklejamy poniższy kod #dodajemy self.dateInfo.SetText(time.strftime("%Y-%m-%d")) self.timeInfo.SetText(time.strftime("%H:%M:%S")) uiscript/minimap.py nad ## ObserverCount dodajemy ## Date { "name" : "DateInfo", "type" : "text", "text_horizontal_align" : "center", "outline" : 1, "color" : 0xff2877d6, "x" : 70, "y" : 175, "text" : "", }, ## Time { "name" : "TimeInfo", "type" : "text", "text_horizontal_align" : "center", "outline" : 1, "color" : 0xddffffff, "x" : 70, "y" : 190, "text" : "", }, constInfo.py MINIMAP_POSITIONINFO_ENABLE = 0 #zmieniamy na MINIMAP_POSITIONINFO_ENABLE = 1 MINIMAP_DATETIME_ENABLE = 1
  18. Wyciągniete z któryś tam plików siela, ja jedynie edytowałem Gui. Nie pomagam przy implementacji na serwer. [Hidden Content] questlib.lua
  19. Siemka, posiedziałem trochę i edytowałem Switch bota Mijago co zrobiłem to naprawiłem propozycje które działają teraz na całe EQ a nie tylko bronie co wam zostało do zrobienia to tylko edytować sobie bonusy na dany item te bony które są wpisane są byle jakie i wartości tak samo dodawanie nowych propozycji musi wyglądać tak pamiętajcie o TABACH "EXP":[ [1,3000], [29,15], [30,15], [31,15], [34,15], ], import shop import player import item import ui import net import locale import chat import grp import wndMgr import mouseModule from uitooltip import ItemToolTip # Switchbot by Mijago poprawa kodowania by xNukox WEAR_NAMES = ItemToolTip.WEAR_NAMES AFFECT_DICT = ItemToolTip.AFFECT_DICT ### Tutaj podajemy applytype np 1 to HP BONI_AVAIL = [1,2,3,4,5,6,7,9,10,12,13,14,15,16,17,18,19,20,21,22,23,27,28,29,30,31,32,33,34,37,39,41,43,44,45,48,53,71,72] # Tutaj podajemy applytype 6-7 bonu BONI_RARE_AVAIL = [1,2] # Tutaj ustawiamy ID zmianek SWITCH_VNUM = 71084 SWITCH_RARE_VNUM = 71084 # Tu ustawiamy minimalny i maksymalny czas // nie wiem do czego to ale prawdopodobnie czas zmiany bonusów MIN_SWITCH_DELAY = 35 MAX_SWITCH_DELAY_APPEND = 120 # Max 10!! MAX_NUM = 7 #Tutaj ustawiamy propozycję bonusów na dany ITEM proposals = { 1: { # 1 = Weapon "PVP (BODY)":[ [5,15], [6,15], [15,10], [9,30], [17,15], ], "PVP (MENTAL)":[ [5,15], [6,15], [15,10], [9,30], [17,15], ], "PVP (DAGGER)":[ [5,15], [6,15], [15,10], [9,30], [17,15], ], "PVP (ARCHER)":[ [5,15], [6,15], [15,10], [9,30], [17,15], ], "PVP (BM)":[ [4,15], [6,15], [15,10], [9,30], [17,15], ], "PVP (WP)":[ [4,15], [5,15], [15,10], [9,30], [17,15], ], "PVP (SMOK)":[ [4,15], [5,15], [15,10], [9,30], [17,15], ], "PVP (HEALER)":[ [4,15], [6,15], [15,10], [9,30], [17,15], ], "PvM": [ [72,60], [19,20], [20,20], [21,20], [22,20], ], }, 2: [ # Armor { #BODY, "PVP":[ [1,3000], [29,15], [30,15], [31,15], [34,15], ], "EXP":[ [1,3000], [29,15], [30,15], [31,15], [34,15], ], }, { #HEAD, "PVP":[ [17,15], [37,15], [10,30], [7,8], [12,10], ], "EXP":[ [1,3000], [29,15], [30,15], [31,15], [34,15], ], }, { #SHIELD, "PVP(WOJ/NINJA)":[ [5,15], [6,15], [17,15], [48,100], [39,10], ], "PVP(SURA/SZAMAN)":[ [4,15], [6,15], [17,15], [48,100], [39,10], ], "EXP (SURA/SZAMAN)":[ [4,15], [19,20], [20,20], [21,20], [48,100], ], "EXP (WOJOWNIK)":[ [5,15], [19,20], [20,20], [21,20], [48,100], ], "EXP (NINJA)":[ [6,15], [19,20], [20,20], [21,20], [48,100], ], }, { #NECK, "PVP":[ [1,3000], [17,15], [23,10], [37,15], [15,10], ], }, { #FOOTS, "PVP":[ [1,3000], [29,15], [30,15], [31,15], [34,15], ], }, { #WRIST, "PVP":[ [1,3000], [29,15], [30,15], [31,15], [34,15], ], "EXP":[ [1,3000], [29,15], [30,15], [31,15], [34,15], ], }, { #EAR, "PVP":[ [17,15], [29,15], [30,15], [31,15], [34,15], ], }, ], } COLOR_BG = grp.GenerateColor(0.0, 0.0, 0.0, 0.5) COLOR_INACTIVE = grp.GenerateColor(1.0, 0.0, 0.0, 0.2) COLOR_ACTIVE = grp.GenerateColor(1.0, 0.6, 0.1, 0.2) COLOR_FINISHED = grp.GenerateColor(0.0, 1.0, 0.0, 0.2) COLOR_INACTIVE_RARE = grp.GenerateColor(1.0, 0.2, 0.0, 0.2) COLOR_ACTIVE_RARE = grp.GenerateColor(1.0, 0.7, 0.2, 0.2) COLOR_HIGHLIGHT_RARE = grp.GenerateColor(1.0, 0.2, 0.2, 0.05) COLOR_PIN_HINT = grp.GenerateColor(0.0, 0.5, 1.0, 0.3) COLOR_CHECKBOX_NOT_SELECTED = grp.GenerateColor(1.0, 0.3, 0.0, 0.1) COLOR_CHECKBOX_SELECTED = grp.GenerateColor(0.3, 1.0, 1.0, 0.3) DISTANCE_BOTTOM = 36 class Bar(ui.Bar): def __init__(self,layer = "UI"): ui.Bar.__init__(self,layer) def SetColor(self,color): wndMgr.SetColor(self.hWnd, color) self.color = color class BonusSelector(ui.Bar): def Activate(self): self.sub_parent.resetSwitch() self.Status_new.SetColor(COLOR_ACTIVE) self.sub_parent.StatusBar.SetColor(COLOR_ACTIVE) self.sub_parent.StatusText.SetText("Aktywny") self.Starter.SetText("Zmiana ("+str(self.index+1)+") Zatrzymaj") self.sub_parent.boni_active = 1 def Deactivate(self): self.sub_parent.resetSwitch() self.Status_new.SetColor(COLOR_INACTIVE) self.sub_parent.StatusBar.SetColor(COLOR_INACTIVE) self.sub_parent.StatusText.SetText("Aktywny") self.Starter.SetText("Zmiana ("+str(self.index+1)+") Start") self.sub_parent.boni_active = 0 if self.sub_parent.parentWindow.parentWindow.gameWindow != None: self.sub_parent.blockBar.swib_normal.SetColor(COLOR_INACTIVE) pass def Activate_rare(self): self.sub_parent.resetSwitch_rare() self.sub_parent.StatusBar_rare.SetColor(COLOR_ACTIVE_RARE) self.sub_parent.StatusText_rare.SetText("6/7 Aktywny") self.Starter_rare_boni.SetText("6/7 Zatrzymaj") self.sub_parent.boni_rare_active = 1 if self.parentWindow.parentWindow.gameWindow != None: self.sub_parent.blockBar.swib_rare.SetColor(COLOR_ACTIVE_RARE) pass def Deactivate_rare(self): self.sub_parent.resetSwitch_rare() self.sub_parent.StatusBar_rare.SetColor(COLOR_INACTIVE_RARE) self.sub_parent.StatusText_rare.SetText("6/7 Aktywny") self.Starter_rare_boni.SetText("6/7 Start") self.Starter_rare_boni.SetUp() self.sub_parent.boni_rare_active = 0 if self.sub_parent.parentWindow.parentWindow.gameWindow != None: self.sub_parent.blockBar.swib_rare.SetColor(COLOR_INACTIVE_RARE) pass def Finish(self): self.Status_new.SetColor(COLOR_FINISHED) self.sub_parent.StatusBar.SetColor(COLOR_FINISHED) self.sub_parent.StatusText.SetText("Zakończono") self.Starter.SetText("Zmiana ("+str(self.index+1)+") Kontynuuj") self.sub_parent.boni_active = 0 if self.sub_parent.parentWindow.parentWindow.gameWindow != None: self.sub_parent.blockBar.swib_normal.SetColor(COLOR_FINISHED) pass def Finish_rare(self): self.sub_parent.StatusBar_rare.SetColor(COLOR_FINISHED) self.sub_parent.StatusText_rare.SetText("6/7 Zakończono") self.Starter_rare_boni.SetText("6/7 Kontynuuj") self.sub_parent.boni_rare_active = 0 if self.sub_parent.parentWindow.parentWindow.gameWindow != None: self.sub_parent.blockBar.swib_rare.SetColor(COLOR_FINISHED) pass def Block(self): self.BlockBar.Show() self.BlockBar.sub.Show() self.Starter.Hide() pass def Unblock(self): self.BlockBar.sub.Hide() self.BlockBar.Hide() self.Starter.Show() pass def enable_rare_boni(self): for i in range(0,4): self.boni[6][i].Show() self.boni[7][i].Show() self.Starter.SetPosition(0,140+45) self.bg_rare_boni.Show() self.bg_rare_boni_but.Show() self.Starter_rare_boni.Show() self.sub_parent.StatusBar_rare.Show() if self.sub_parent.parentWindow.parentWindow.gameWindow != None: self.sub_parent.blockBar.Enable_rare(1) def disable_rare_boni(self): for i in range(0,4): self.boni[6][i].Hide() self.boni[7][i].Hide() self.Starter.SetPosition(0,140) self.bg_rare_boni.Hide() self.bg_rare_boni_but.Hide() self.Starter_rare_boni.Hide() self.sub_parent.StatusBar_rare.Hide() self.Deactivate_rare() if self.sub_parent.parentWindow.parentWindow.gameWindow != None: self.sub_parent.blockBar.Enable_rare(0) def __init__(self,sub_parent): ui.Bar.__init__(self, "UI") self.sub_parent = sub_parent self.index = sub_parent.index self.SetColor(COLOR_BG) self.SetSize(500,225+10) self.boni = {} self.Status_new = ui.Bar() self.Status_new.SetParent(self) self.Status_new.SetColor(COLOR_INACTIVE) self.Status_new.SetSize(500,5) self.Status_new.Show() self.bg_rare_boni = ui.Bar() self.bg_rare_boni.SetColor(COLOR_HIGHLIGHT_RARE) self.bg_rare_boni.SetParent(self) self.bg_rare_boni.SetPosition(0,132) self.bg_rare_boni.SetSize(500,51) self.bg_rare_boni.Hide() self.bg_rare_boni_but = ui.Bar() self.bg_rare_boni_but.SetColor(COLOR_HIGHLIGHT_RARE) self.bg_rare_boni_but.SetParent(self) self.bg_rare_boni_but.SetPosition(400,133+50) self.bg_rare_boni_but.SetSize(100,25) self.bg_rare_boni_but.Hide() self.EnableRareBoni = CheckBox("6/7 Wstaw") self.EnableRareBoni.SetParent(self) self.EnableRareBoni.SetPosition(10,185) self.EnableRareBoni.eventUp = self.disable_rare_boni self.EnableRareBoni.eventDown = self.enable_rare_boni self.EnableRareBoni.Show() self.Starter = ui.ToggleButton() self.Starter.SetWindowHorizontalAlignCenter() self.Starter.SetParent(self) self.Starter.SetUpVisual("d:/ymir work/ui/public/XLarge_Button_01.sub") self.Starter.SetOverVisual("d:/ymir work/ui/public/XLarge_button_02.sub") self.Starter.SetDownVisual("d:/ymir work/ui/public/XLarge_button_03.sub") self.Starter.SetPosition(0,140) self.Starter.SetText("Zmieniacz włączony") self.Starter.SetToggleDownEvent(self.Activate) self.Starter.SetToggleUpEvent(self.Deactivate) self.Starter.Show() self.Starter_rare_boni = ui.ToggleButton() self.Starter_rare_boni.SetWindowHorizontalAlignCenter() self.Starter_rare_boni.SetParent(self) self.Starter_rare_boni.SetUpVisual("d:/ymir work/ui/public/Large_Button_01.sub") self.Starter_rare_boni.SetOverVisual("d:/ymir work/ui/public/Large_button_02.sub") self.Starter_rare_boni.SetDownVisual("d:/ymir work/ui/public/Large_button_03.sub") self.Starter_rare_boni.SetPosition(200,140+45) self.Starter_rare_boni.SetText("6/7 Start") self.Starter_rare_boni.SetToggleDownEvent(self.Activate_rare) self.Starter_rare_boni.SetToggleUpEvent(self.Deactivate_rare) self.Starter_rare_boni.Hide() for i in range(7,5,-1): vas = i self.boni[vas] = {} self.boni[vas][0] = ui.TextLine() self.boni[vas][0].SetParent(self) self.boni[vas][0].SetText("Bonus "+str(vas)) self.boni[vas][0].SetPosition(15,10+25*(vas-1)) self.boni[vas][0].Hide() self.boni[vas][1] = DropDown(self,"- Brak -") self.boni[vas][1].SetPosition(70,10+25*(vas-1)) for x in AFFECT_DICT: if x in BONI_RARE_AVAIL: self.boni[vas][1].AppendItem(str(AFFECT_DICT[x](0)),x) self.boni[vas][1].SetSize(330,20) self.boni[vas][1].Hide() self.boni[vas][2] = ui.Bar("UI") self.boni[vas][2].SetParent(self) self.boni[vas][2].SetPosition(410,10+25*(vas-1)) self.boni[vas][2].SetColor(0xC0000000) self.boni[vas][2].SetSize(80,20) self.boni[vas][2].Hide() self.boni[vas][3] = Edit2("0",14) self.boni[vas][3].SetParent(self.boni[vas][2]) self.boni[vas][3].SetNumberMode() self.boni[vas][3].SetSize(80,20) self.boni[vas][3].SetPosition(4,3) self.boni[vas][3].Hide() for i in range(0,5): vas = 5-i self.boni[vas] = {} self.boni[vas][0] = ui.TextLine() self.boni[vas][0].SetParent(self) self.boni[vas][0].SetText("Bonus "+str(vas)) self.boni[vas][0].SetPosition(15,10+25*(vas-1)) self.boni[vas][0].Show() self.boni[vas][1] = DropDown(self,"- Brak -") self.boni[vas][1].SetPosition(70,10+25*(vas-1)) for x in AFFECT_DICT: if x in BONI_AVAIL: self.boni[vas][1].AppendItem(str(AFFECT_DICT[x](0)),x) self.boni[vas][1].SetSize(330,20) self.boni[vas][1].Show() self.boni[vas][2] = ui.Bar("UI") self.boni[vas][2].SetParent(self) self.boni[vas][2].SetPosition(410,10+25*(vas-1)) self.boni[vas][2].SetColor(0xC0000000) self.boni[vas][2].SetSize(80,20) self.boni[vas][2].Show() self.boni[vas][3] = Edit2("0",14) self.boni[vas][3].SetParent(self.boni[vas][2]) self.boni[vas][3].SetNumberMode() self.boni[vas][3].SetSize(80,20) self.boni[vas][3].SetPosition(4,3) self.boni[vas][3].Show() self.but_propose = DropDown(self,'Propozycje',0) self.but_propose.SetParent(self) self.but_propose.SetPosition(380,210) self.but_propose.OnChange=self.change_boni self.but_propose.Show() self.BlockBar = ui.Bar() self.BlockBar.SetParent(self) self.BlockBar.SetColor(COLOR_INACTIVE) self.BlockBar.SetPosition(0,5) self.BlockBar.SetSize(500,170-5+35+2) self.BlockBar.Hide() self.BlockBar.sub = ui.Bar() self.BlockBar.sub.SetParent(self) self.BlockBar.sub.SetColor(COLOR_INACTIVE) self.BlockBar.sub.SetPosition(500-122,5+170-5+35+2) self.BlockBar.sub.SetSize(122,30) self.BlockBar.sub.Hide() self.BlockText = ui.TextLine() self.BlockText.SetParent(self.BlockBar) self.BlockText.SetWindowHorizontalAlignCenter() self.BlockText.SetHorizontalAlignCenter() self.BlockText.SetPosition(0,140) self.BlockText.SetText("Tego itemu nie można zmieniać.") self.BlockText.Show() self.prepare_propose() def change_boni(self): use = self.but_propose.DropList.GetSelectedItem().value bon = 1 item.SelectItem(self.sub_parent.vnum) for x in use: ok = 1 for i in xrange(item.ITEM_APPLY_MAX_NUM): (affectType, affectValue) = item.GetAffect(i) if affectType == x[0]: ok = 0 if ok == 0: continue y = self.boni[bon][1] y.SelectByAffectId(x[0]) self.boni[bon][1].act.SetText(y.DropList.GetSelectedItem().textBox.GetText()) self.boni[bon][3].SetText(str(x[1])) bon+=1 for x in range(bon,6): y = self.boni[x][1].DropList y.SelectIndex(0) self.boni[x][1].act.SetText(y.GetSelectedItem().textBox.GetText()) self.boni[x][3].SetText("0") def prepare_propose(self): self.but_propose.DropList.RemoveAllItems() self.but_propose.maxh = 95 self.but_propose.c = 0 self.but_propose.AppendItem("Pusto",[]) item.SelectItem(self.sub_parent.vnum) type = item.GetItemType() use = proposals[type] if type == 2: use = use[item.GetItemSubType()] for prop in use: self.but_propose.AppendItem(prop,use[prop]) class ItemTabBar(ui.Window): class BlockBar(ui.Window): size_res = 32 multi = 1 def SetSize(self,i=1): self.multi = i ui.Window.SetSize(self,self.size_res,self.size_res*i) if self.rare_enabled == 1: self.swib_normal.SetSize(self.size_res,self.size_res*i/3*2) pos1 = int(1.0*self.size_res*i/3.0*2.0) self.swib_normal.SetSize(self.size_res,pos1) self.swib_rare.SetSize(self.size_res,self.size_res*i-pos1) self.swib_rare.SetPosition(0,pos1) self.swib_rare.Show() else: self.swib_normal.SetSize(self.size_res,self.size_res*i) self.swib_rare.Hide() def Enable_rare(self,o = 1): self.rare_enabled = o self.SetSize(self.multi) def __init__(self): ui.Window.__init__(self) self.rare_enabled = 0 self.swib_normal = ui.Bar() self.swib_normal.SetParent(self) self.swib_normal.SetSize(self.size_res,self.size_res*self.multi) self.swib_normal.SetColor(COLOR_INACTIVE) self.swib_normal.SetPosition(0,0) self.swib_normal.Show() self.swib_rare = ui.Bar() self.swib_rare.SetParent(self) self.swib_rare.SetSize(self.size_res,self.size_res) self.swib_rare.SetColor(COLOR_INACTIVE_RARE) self.swib_rare.SetPosition(0,0) self.swib_rare.Hide() self.SetSize(1) class ItemTab(ui.Bar): height_selected = 36*3+8 height_unselected = 36*3+5 def Destroy(self): self.parentWindow.parentWindow.enable_rebuy.SetParent(self.parentWindow.parentWindow) self.parentWindow.parentWindow.but_speed.SetParent(self.parentWindow.parentWindow) self.parentWindow.parentWindow.help_show_rare.SetParent(self.parentWindow.parentWindow) self.parentWindow.parentWindow.help_rebuy.SetParent(self.parentWindow.parentWindow) self.parentWindow.parentWindow.help_duration.SetParent(self.parentWindow.parentWindow) self.parentWindow.parentWindow.enable_rebuy.Hide() self.parentWindow.parentWindow.but_speed.Hide() self.bonusSelector.Hide() self.bonusSelector.__del__() self.Hide() self.__del__() def DeleteMe(self): self.parentWindow.DeleteTab(self.tabnum) def __init__(self,parent,tabnum,index = 0,vnum = 0): ## Init ItemTab ui.Bar.__init__(self) self.SetColor(COLOR_BG) self.SetSize(self.width,self.height_unselected) self.index = index self.tabnum = tabnum self.vnum = vnum self.count = 0 self.count_rare = 0 self.parentWindow = parent self.SetParent(parent) if self.parentWindow.parentWindow.gameWindow != None: self.blockBar = ItemTabBar.BlockBar() self.blockBar.SetParent(self.parentWindow.parentWindow.gameWindow.interface.wndInventory.wndItem) ipi = self.parentWindow.parentWindow.gameWindow.interface.wndInventory.inventoryPageIndex self.blockBar.Show() ip2 = self.index - ipi*45 self.blockBar.SetPosition(((ip2-int(ip2/5)*5)*self.blockBar.size_res),int(ip2/5)*self.blockBar.size_res) self.ItemIcon = ui.ImageBox() self.ItemIcon.SetParent(self) self.ItemIcon.AddFlag("not_pick") self.ItemIcon.SetWindowHorizontalAlignCenter() self.ItemIcon.SetWindowVerticalAlignCenter() self.ItemIcon.Show() self.SlotName = ui.TextLine() self.SlotName.SetParent(self) self.SlotName.SetWindowHorizontalAlignCenter() self.SlotName.SetHorizontalAlignCenter() self.SlotName.SetPosition(0,5) self.SlotName.SetText("Slot %d" % (self.index+1)) self.SlotName.AddFlag("not_pick") self.SlotName.Show() self.StatusBar = Bar() # Special Bar self.StatusBar.SetParent(self) self.StatusBar.SetWindowVerticalAlignBottom() self.StatusBar.SetSize(self.width,20) self.StatusBar.SetPosition(0,20) self.StatusBar.SetColor(COLOR_INACTIVE) self.StatusBar.AddFlag("not_pick") self.StatusBar.Show() self.StatusText = ui.TextLine() self.StatusText.SetParent(self.StatusBar) # self.StatusText.SetParent(self) self.StatusText.SetWindowHorizontalAlignCenter() self.StatusText.SetWindowVerticalAlignCenter() self.StatusText.SetHorizontalAlignCenter() self.StatusText.SetVerticalAlignCenter() self.StatusText.SetPosition(0,0) self.StatusText.SetText("Aktywny") self.StatusText.Show() self.StatusBar_rare = Bar() # Special Bar self.StatusBar_rare.SetParent(self) self.StatusBar_rare.SetWindowVerticalAlignBottom() self.StatusBar_rare.SetSize(self.width,20) self.StatusBar_rare.SetPosition(0,40) self.StatusBar_rare.SetColor(COLOR_INACTIVE_RARE) self.StatusBar_rare.AddFlag("not_pick") self.StatusBar_rare.Hide() self.StatusText_rare = ui.TextLine() self.StatusText_rare.SetParent(self.StatusBar_rare) self.StatusText_rare.SetWindowHorizontalAlignCenter() self.StatusText_rare.SetWindowVerticalAlignCenter() self.StatusText_rare.SetHorizontalAlignCenter() self.StatusText_rare.SetVerticalAlignCenter() self.StatusText_rare.SetPosition(0,0) self.StatusText_rare.SetText("6/7 Aktywny") self.StatusText_rare.Show() self.CloseBut = ui.Button() self.CloseBut.SetParent(self) self.CloseBut.SetUpVisual("d:/ymir work/ui/public/close_button_01.sub") self.CloseBut.SetOverVisual("d:/ymir work/ui/public/close_button_02.sub") self.CloseBut.SetDownVisual("d:/ymir work/ui/public/close_button_03.sub") self.CloseBut.SetToolTipText("Minimalizacja", 0, -23) self.CloseBut.SetEvent(self.DeleteMe) self.CloseBut.SetPosition(0,0) self.CloseBut.Show() self.OnMouseLeftButtonDown = lambda: self.Select() self.boni_active = 0 self.boni_rare_active = 0 self.bonusSelector = BonusSelector(self) self.bonusSelector.SetParentProxy(self.parentWindow.parentWindow) self.bonusSelector.SetPosition(10,35+36*3+4*2) self.bonusSelector.Hide() self.vnum = 0 self.SetIndex(index) self.resetSwitch() self.resetSwitch_rare() def IsActive(self): return self.boni_active == 1 def IsActive_rare(self): return self.boni_rare_active == 1 def SetParentProxy(self,parent): ui.Bar.SetParentProxy(self,parent) def Select(self): for a in self.parentWindow.tabList: self.parentWindow.tabList[a].UnSelect() self.parentWindow.tabList[a].bonusSelector.Hide() self.bonusSelector.Show() self.SetSize(self.width,self.height_selected) self.Update() self.parentWindow.parentWindow.enable_rebuy.SetParent(self.bonusSelector) self.parentWindow.parentWindow.enable_rebuy.SetPosition(10,200+10) self.parentWindow.parentWindow.enable_rebuy.Show() self.parentWindow.parentWindow.but_speed.SetParent(self.bonusSelector) self.parentWindow.parentWindow.but_speed.SetPosition(0,205+10) self.parentWindow.parentWindow.but_speed.Show() self.parentWindow.parentWindow.help_show_rare.SetParent(self.bonusSelector) self.parentWindow.parentWindow.help_rebuy.SetParent(self.bonusSelector) self.parentWindow.parentWindow.help_duration.SetParent(self.bonusSelector) def UnSelect(self): self.SetSize(self.width,self.height_unselected) self.Update() def Update(self): self.StatusBar.SetPosition(0,20) self.SetPosition((self.width+self.dist)*self.tabnum,0) self.SlotName.SetText("Slot %d" % (self.index+1)) def resetSwitch(self): self.values = [0,0,0,0,0] def resetSwitch_rare(self): self.values_rare = [0,0] # last_switch = -1 rebuyed = 0 def nachkauf(self): if self.parentWindow.parentWindow.buyed != 0: return else: self.parentWindow.parentWindow.buyed = 1 if self.parentWindow.parentWindow.enable_rebuy.checked == 1: for i in range(0,shop.SHOP_SLOT_COUNT): me = shop.GetItemID(i) if me == SWITCH_VNUM: if shop.GetItemPrice(i) > player.GetMoney(): self.bonusSelector.Deactivate() return else: net.SendShopBuyPacket(i) self.rebuyed = 1 return rebuyed_rare = 0 def nachkauf_rare(self): if self.parentWindow.parentWindow.buyed_rare != 0: return else: self.parentWindow.parentWindow.buyed_rare = 1 if self.parentWindow.parentWindow.enable_rebuy.checked == 1: for i in range(0,shop.SHOP_SLOT_COUNT): me = shop.GetItemID(i) if me == SWITCH_RARE_VNUM: if shop.GetItemPrice(i) > player.GetMoney(): self.bonusSelector.Deactivate_rare() return else: net.SendShopBuyPacket(i) self.rebuyed_rare = 1 return def Switch_rare(self): lc = 0 for i in range(0,90*2): if player.GetItemIndex(i) == SWITCH_RARE_VNUM: lc+=player.GetItemCount(i) if lc == 0 and self.parentWindow.parentWindow.enable_rebuy.checked == 0: chat.AppendChat(2,"Slot %d: 6/7 Bonowanie przerwane. - Brak itemow do bonowania & dokup zmianki!" % (self.index+1)) self.bonusSelector.Deactivate_rare() return if lc < 15: self.nachkauf_rare() if lc == 0: self.bonusSelector.Deactivate_rare() chat.AppendChat(2,"Slot %d: 6/7 Bonowanie przerwane -> Brak itemów!" % (self.index+1)) return for i in range(0,90*2): if player.GetItemIndex(i) == SWITCH_RARE_VNUM: net.SendItemUseToItemPacket(i,self.index) return def Switch(self): lc = 0 for i in range(0,90*2): if player.GetItemIndex(i) == SWITCH_VNUM: lc+=player.GetItemCount(i) if lc == 0 and self.parentWindow.parentWindow.enable_rebuy.checked == 0: self.bonusSelector.Deactivate() return if lc < 15: self.nachkauf() if lc == 0: self.bonusSelector.Deactivate() return for i in range(0,90*2): if player.GetItemIndex(i) == SWITCH_VNUM: net.SendItemUseToItemPacket(i,self.index) return def checkSwitch(self): ok = 0 for i in range(0,5): if player.GetItemAttribute(self.index, i) != self.values[i]: ok = 1 self.prob = self.GetProb() self.StatusText.SetText("Aktywny (%d%%)" %self.prob) if ok == 1 or self.prob >= 90: if self.prob >= 90: chat.AppendChat(1,"Slot %d: Bonowanie zakończone!" % (self.index+1)) self.bonusSelector.Finish() return self.values = [player.GetItemAttribute(self.index, i) for i in range(0,5)] self.Switch() elif self.rebuyed > 0: self.rebuyed = 0 self.Switch() elif ok == 0 and self.count < 5: self.count+=1 elif ok == 0 and self.count >= 5: self.count = 0 self.Switch() pass def checkSwitch_rare(self): ok = 0 for i in range(0,2): if player.GetItemAttribute(self.index, i+6) != self.values_rare[i]: ok = 1 self.prob_rare = self.GetProb_rare() self.StatusText_rare.SetText("Aktywny (%d%%)" %self.prob_rare) if ok == 1 or self.prob_rare >= 90: if self.prob_rare >= 90: self.bonusSelector.Finish_rare() chat.AppendChat(1,"Slot %d: 6/7 Bonowanie zakończone!" % (self.index+1)) return self.values_rare = [player.GetItemAttribute(self.index, i) for i in range(5,7)] self.Switch_rare() elif self.rebuyed_rare > 0: self.rebuyed_rare = 0 self.Switch_rare() elif ok == 0 and self.count_rare < 5: self.count_rare+=1 elif ok == 0 and self.count_rare >= 5: self.count_rare = 0 self.Switch_rare() pass def UpdateItem(self): # try: vnum = player.GetItemIndex(self.index) if vnum == 0 and self.vnum != 0: self.resetSwitch() self.resetSwitch_rare() self.vnum = 0 self.bonusSelector.Deactivate() self.bonusSelector.Block() self.bonusSelector.prepare_propose() self.ItemIcon.Hide() if self.parentWindow.parentWindow.gameWindow != None: self.blockBar.SetSize(1) return elif vnum != self.vnum: self.resetSwitch() self.resetSwitch_rare() self.vnum = vnum self.bonusSelector.Deactivate() self.bonusSelector.prepare_propose() item.SelectItem(self.vnum) if self.parentWindow.parentWindow.gameWindow != None: (w,h) = item.GetItemSize() self.blockBar.SetSize(h) if item.GetItemType() != 1 and item.GetItemType() != 2: self.bonusSelector.Block() else: self.bonusSelector.Unblock() self.ItemIcon.Show() self.ItemIcon.LoadImage(item.GetIconImageFileName()) return if self.IsActive(): self.checkSwitch() if self.IsActive_rare(): self.checkSwitch_rare() def SetIndex(self,index): self.index = index self.bonusSelector.index = index self.bonusSelector.Starter.SetText("Zmieniacz ("+str(index+1)+") Start") self.Update() self.UpdateItem() def GetProb_rare(self): values = [player.GetItemAttribute(self.index, i+6) for i in range(0,2)] val2 = {} for i in range(0,2): try: affectString = AFFECT_DICT[values[i][0]](values[i][1]) val2[values[i][0]] = values[i][1] self.bonusSelector.ibi[i+6].SetText(affectString) except: pass prob = 0 max = 0 yp = self.GenList_rare() for x in yp: if yp[x] in val2 and val2[yp[x]] >= int(self.bonusSelector.boni[x+5][3].GetText()): prob = prob+1 max = max+1 if max > 0: prozent = 100/max*prob else: prozent = 100 return prozent pass def GetProb(self): values = [player.GetItemAttribute(self.index, i) for i in range(0,5)] val2 = {} for i in range(0,5): try: affectString = AFFECT_DICT[values[i][0]](values[i][1]) val2[values[i][0]] = values[i][1] self.bonusSelector.ibi[i].SetText(affectString) except: pass prob = 0 max = 0 yp = self.GenList() for x in yp: if yp[x] in val2 and val2[yp[x]] >= int(self.bonusSelector.boni[x][3].GetText()): prob = prob+1 max = max+1 if max > 0: prozent = 100/max*prob else: prozent = 100 return prozent def GenList(self): ret = {} for i in range(0,5): if self.bonusSelector.boni[5-i][1].selected.value != 0: ret[5-i] = self.bonusSelector.boni[5-i][1].selected.value return ret def GenList_rare(self): ret = {} for i in range(0,2): if self.bonusSelector.boni[6+i][1].selected.value != 0: ret[i+1] = self.bonusSelector.boni[6+i][1].selected.value return ret def __init__(self,parent): ui.Window.__init__(self) self.SetSize(500,36*3+4*2) self.tabCount = 0 self.tabList = {} self.parentWindow = parent self.SetParent(parent) self.plusBar = ui.Bar() self.plusBar.SetParent(self) self.plusBar.SetSize(90,30) self.plusBar.SetWindowVerticalAlignCenter() self.plusBar.SetColor(COLOR_BG) self.plusBar.OnMouseLeftButtonUp = lambda: self.AddTab_pre() self.OnMouseLeftButtonUp = lambda: self.AddTab_pre() self.plusBar.SetPosition(30,0) self.plusBar.Show() self.AddText = ui.TextLine() self.AddText.SetParent(self.plusBar) self.AddText.SetText("Daj tu item!") self.AddText.SetWindowVerticalAlignCenter() self.AddText.SetWindowHorizontalAlignCenter() self.AddText.SetVerticalAlignCenter() self.AddText.SetHorizontalAlignCenter() self.AddText.SetPosition(0,0) self.AddText.Show() dist = [ [500, 0 ], #1 [240, 10 ], [160, 10 ], [117, 10.5], # [ 80, 25 ], #5 [ 92, 10 ], #5 [ 75, 10 ], #6 [ 64, 9 ], #7 [ 56, 7.5], #8 [ 50, 6.5], #9 [ 45, 5.5], #10 ][MAX_NUM-1] self.ItemTab.width = dist[0] self.ItemTab.dist = dist[1] def DeleteTab(self,id): if self.parentWindow.gameWindow != None: self.tabList[id].blockBar.Hide() self.tabList[id].blockBar.Destroy() self.tabList[id].Destroy() self.tabCount = self.tabCount -1 if self.tabCount > id and id < 5: for i in xrange(id,self.tabCount): self.tabList[i] = self.tabList[i+1] self.tabList[i].tabnum = i self.tabList[i].SetPosition((self.tabList[i].width+self.tabList[i].dist)*i,0) del self.tabList[self.tabCount] else: del self.tabList[id] if self.tabCount > 0: self.tabList[0].Select() if (self.ItemTab.width+self.ItemTab.dist)*self.tabCount < 20: self.parentWindow.SetSize(520,387-210) self.parentWindow.but_speed.Hide() self.plusBar.SetPosition(20,0) else: (x,y) = self.tabList[self.tabCount-1].GetLocalPosition() self.plusBar.SetPosition(x+self.ItemTab.width+self.ItemTab.dist,0) self.plusBar.Show() def AddTab_pre(self): if mouseModule.mouseController.isAttached(): attachedSlotType = mouseModule.mouseController.GetAttachedType() attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() attachedSlotVnum = mouseModule.mouseController.GetAttachedItemIndex() item.SelectItem(attachedSlotVnum) if item.GetItemType() != 1 and item.GetItemType() != 2: mouseModule.mouseController.DeattachObject() chat.AppendChat(2,"Tego itemu nie można zmieniać!.") return for a in self.tabList: if self.tabList[a].index == attachedSlotPos: mouseModule.mouseController.DeattachObject() chat.AppendChat(2,"Ten slot został już wstawiony!") return if player.SLOT_TYPE_INVENTORY == attachedSlotType: self.AddTab(attachedSlotPos,attachedSlotVnum) chat.AppendChat(2,"Dodano item!") mouseModule.mouseController.DeattachObject() def AddTab(self,id,vnum = 0): if self.tabCount < MAX_NUM: self.tabList[self.tabCount] = self.ItemTab(self,self.tabCount,id,vnum) self.tabList[self.tabCount].Select() self.tabList[self.tabCount].Show() self.tabCount+= 1 if (self.ItemTab.width+self.ItemTab.dist)*self.tabCount < 20: self.plusBar.SetPosition(20,0) else: (x,y) = self.tabList[self.tabCount-1].GetLocalPosition() self.plusBar.SetPosition(x+self.ItemTab.width+self.ItemTab.dist,0) if self.tabCount == MAX_NUM: self.plusBar.Hide() self.parentWindow.SetSize(520,387+10) self.parentWindow.but_speed.Show() # return 0 class Bot(ui.BoardWithTitleBar): class PinGroup(ui.Bar): def OnUpdate(self): (x,y) = self.GetGlobalPosition() max_x = wndMgr.GetScreenWidth()-self.GetWidth() max_y = wndMgr.GetScreenHeight()-self.GetHeight()-DISTANCE_BOTTOM if not x == self.pos_x or not y == self.pos_y: old_dir = self.dir if self.pos_x == 0 and not self.pos_y == 0 and not self.pos_y == max_y and old_dir != 1: self.parse_dir(1) elif self.pos_x == max_x and not self.pos_y == 0 and not self.pos_y == max_y and old_dir != 2: self.parse_dir(2) elif self.pos_y == max_y and not self.pos_x == 0 and not self.pos_x == max_x and old_dir != 4: self.parse_dir(4) elif self.pos_y == 0 and not self.pos_x == 0 and not self.pos_x == max_x and old_dir != 3: self.parse_dir(3) max_x = wndMgr.GetScreenWidth()-self.GetWidth() max_y = wndMgr.GetScreenHeight()-self.GetHeight()-DISTANCE_BOTTOM if self.pos_x == 0 and not self.pos_y == 0 and not self.pos_y == max_y: x = 0 elif self.pos_x == max_x and not self.pos_y == 0 and not self.pos_y == max_y: x = max_x elif self.pos_y == 0 and not self.pos_x == 0 and not self.pos_x == max_x: y = 0 elif self.pos_y == max_y and not self.pos_x == 0 and not self.pos_x == max_x: y = max_y if x > 0 and x < max_x and y > 0 and y < max_y: if y < int(max_y/2): y = 0 else: y = max_y if x < int(max_x/2): x = 0 else: x = max_x x = min(max(0,x),wndMgr.GetScreenWidth()-self.GetWidth()) y = min(max(0,y),wndMgr.GetScreenHeight()-self.GetHeight()-DISTANCE_BOTTOM) self.SetPosition(x,y) self.pos_x = x self.pos_y = y self.parent.OnUpdate() for c in self.txtlist: c.SetColor(c.item.StatusBar.color) c.txt2.SetText("Status: %s" % c.item.StatusText.GetText()) try: c.listWin2.SetColor(c.item.StatusBar_rare.color) c.txt3.SetText("Status: %s" % c.item.StatusText_rare.GetText()) except: pass def ShowMainWindow(self): (x,y) = self.parent.GetGlobalPosition() x = min(max(32,x),wndMgr.GetScreenWidth()-self.parent.GetWidth()-32) y = min(max(32,y),wndMgr.GetScreenHeight()-self.parent.GetHeight()-DISTANCE_BOTTOM-32) self.parent.SetPosition(x,y) self.parent.Show() self.__del__() def parse_dir(self,dir): self.dir = dir w,h = 100,50 for listWin in self.txtlist: itm = listWin.item listWin.AddFlag("not_pick") if dir >= 3: listWin.SetPosition(w,4) listWin.SetSize(90,h-8) w+=92 if itm.bonusSelector.EnableRareBoni.checked == 1: w+=15 listWin.SetSize(105,4+12+12) listWin.listWin2.SetSize(105,14) listWin.listWin2.Show() listWin.txt3.Show() else: listWin.SetPosition(0,h) listWin.SetSize(w,4+12+12+2) if itm.bonusSelector.EnableRareBoni.checked == 1: listWin.SetSize(w,4+12+12) listWin.listWin2.SetSize(w,14) listWin.listWin2.Show() listWin.txt3.Show() h+=12 pass h+=4+12+12+4 self.SetSize(w,h) def __init__(self,parent,dir = 1): self.parent = parent self.dir = dir ui.Bar.__init__(self) self.SetColor(COLOR_BG) w,h = 100,50 self.AddFlag("float") self.AddFlag("movable") self.maximise_but = ui.Button() self.maximise_but.SetParent(self) self.maximise_but.SetPosition(4,4) self.maximise_but.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub") self.maximise_but.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub") self.maximise_but.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub") self.maximise_but.SetText("Pokaż okno!") self.maximise_but.SetEvent(self.ShowMainWindow) self.maximise_but.Show() self.stop_but = ui.Button() self.stop_but.SetParent(self) self.stop_but.SetPosition(4,24) self.stop_but.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub") self.stop_but.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub") self.stop_but.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub") self.stop_but.SetText("Wyłącz wszystko!") self.stop_but.SetEvent(self.parent.deactivate_all) self.stop_but.Show() self.txtlist = [] for a in self.parent.itemTabBar.tabList: itm = self.parent.itemTabBar.tabList[a] listWin = ui.Bar() listWin.item = itm self.txtlist.append(listWin) listWin.SetColor(itm.StatusBar.color) listWin.SetParent(self) listWin.AddFlag("not_pick") listWin.Show() listWin.txt1 = ui.TextLine() listWin.txt1.SetParent(listWin) listWin.txt1.SetText("Slot %d:" %(itm.index+1)) listWin.txt1.Show() listWin.txt1.SetPosition(4,2) listWin.txt2 = ui.TextLine() listWin.txt2.SetParent(listWin) listWin.txt2.SetText("Status: %s" % itm.StatusText.GetText()) listWin.txt2.SetPosition(4,2+12) listWin.txt2.Show() listWin.listWin2 = ui.Bar() listWin.listWin2.AddFlag("not_pick") listWin.listWin2.SetColor(itm.StatusBar_rare.color) listWin.listWin2.SetParent(listWin) listWin.listWin2.SetPosition(0,4+12+12) listWin.listWin2.SetSize(w,12+2) listWin.listWin2.Hide() listWin.txt3 = ui.TextLine() listWin.txt3.SetParent(listWin.listWin2) listWin.txt3.SetText("Status: %s" % itm.StatusText_rare.GetText()) listWin.txt3.SetPosition(4,0) listWin.txt3.Hide() if dir >= 3: listWin.SetPosition(w,4) listWin.SetSize(90,h-8) w+=92 if itm.bonusSelector.EnableRareBoni.checked == 1: w+=15 listWin.SetSize(105,4+12+12) listWin.listWin2.SetSize(105,14) listWin.listWin2.Show() listWin.txt3.Show() else: listWin.SetPosition(0,h) listWin.SetSize(w,4+12+12+2) if itm.bonusSelector.EnableRareBoni.checked == 1: listWin.SetSize(w,4+12+12) listWin.listWin2.Show() listWin.txt3.Show() h+=12 pass h+=4+12+12+4 self.SetSize(w,h) (x,y) = self.parent.GetGlobalPosition() x = min(max(0,x),wndMgr.GetScreenWidth()-self.GetWidth()) y = min(max(0,y),wndMgr.GetScreenHeight()-self.GetHeight()-DISTANCE_BOTTOM) if dir == 1: self.SetPosition(0,y) elif dir == 2: self.SetPosition(wndMgr.GetScreenWidth()-self.GetWidth(),y) elif dir == 3: self.SetPosition(x,0) else: self.SetPosition(x,wndMgr.GetScreenHeight()-(DISTANCE_BOTTOM+h)) (self.pos_x,self.pos_y) = self.GetGlobalPosition() self.parse_dir(dir) pinhint = 0 def ShowPinHint(self,type): self.pinhint = type if type == 0: self.PinHint.Hide() return (x,y) = self.GetGlobalPosition() if type == 1: # Left self.PinHint.SetWindowHorizontalAlignLeft() self.PinHint.SetWindowVerticalAlignCenter() self.PinHint.SetSize(max(min(30,30-x),3),wndMgr.GetScreenHeight()) self.PinHint.SetPosition(0,0) elif type == 2: # Right self.PinHint.SetWindowHorizontalAlignRight() self.PinHint.SetWindowVerticalAlignCenter() self.PinHint.SetSize(30,wndMgr.GetScreenHeight()) self.PinHint.SetPosition(max(min(30,30-(wndMgr.GetScreenWidth()-(x+self.GetWidth()))),3),0) elif type == 3: # Top self.PinHint.SetWindowHorizontalAlignCenter() self.PinHint.SetWindowVerticalAlignTop() self.PinHint.SetSize(wndMgr.GetScreenWidth(),max(min(30,30-y),3)) self.PinHint.SetPosition(0,0) elif type == 4: # Top self.PinHint.SetWindowHorizontalAlignCenter() self.PinHint.SetWindowVerticalAlignBottom() self.PinHint.SetSize(wndMgr.GetScreenWidth(),30) self.PinHint.SetPosition(0,36+max(min(30,30-(wndMgr.GetScreenHeight()-36-(y+self.GetHeight()))),3)) self.PinHint.Show() # else: def __init__(self): ui.BoardWithTitleBar.__init__(self) self.gameWindow = None self.SetTitleName("Switchbot by xNukox") self.AddFlag("float") self.AddFlag("movable") self.SetPosition(30,30) self.SetSize(520,387-210) self.PinHint = ui.Bar() self.PinHint.SetColor(COLOR_PIN_HINT) self.PinHint.Show() self.OnMouseLeftButtonDown = self.drag_start self.OnMouseLeftButtonUp = self.drag_end self.titleBar.MinimizeBut = ui.Button() self.titleBar.MinimizeBut.SetParent(self.titleBar) self.titleBar.MinimizeBut.SetUpVisual("d:/ymir work/ui/public/minimize_button_01.sub") self.titleBar.MinimizeBut.SetOverVisual("d:/ymir work/ui/public/minimize_button_02.sub") self.titleBar.MinimizeBut.SetDownVisual("d:/ymir work/ui/public/minimize_button_03.sub") self.titleBar.MinimizeBut.SetToolTipText("Zminimalizuj", 0, -23) self.titleBar.MinimizeBut.SetPosition(520 - self.titleBar.btnClose.GetWidth()-3- 32 - 3, 3) self.titleBar.MinimizeBut.SetEvent(lambda: self.PinShow(1)) self.titleBar.MinimizeBut.Show() self.titleBar.HelpBut = ui.ToggleButton() self.titleBar.HelpBut.SetParent(self.titleBar) self.titleBar.HelpBut.SetUpVisual("d:/ymir work/ui/public/small_button_01.sub") self.titleBar.HelpBut.SetOverVisual("d:/ymir work/ui/public/small_button_02.sub") self.titleBar.HelpBut.SetDownVisual("d:/ymir work/ui/public/small_button_03.sub") self.titleBar.HelpBut.SetToolTipText("Szczegółowa pomoc!", 0, -23) self.titleBar.HelpBut.SetText("Pomoc") self.titleBar.HelpBut.SetPosition(3, 0) self.titleBar.HelpBut.SetToggleDownEvent(lambda: self.ToggleHelp(1)) self.titleBar.HelpBut.SetToggleUpEvent(lambda: self.ToggleHelp(0)) self.titleBar.HelpBut.Show() self.but_deactivate_all = ui.Button() self.but_deactivate_all.SetParent(self.titleBar) self.but_deactivate_all.SetPosition(3+5+self.titleBar.HelpBut.GetWidth(), 0) self.but_deactivate_all.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub") self.but_deactivate_all.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub") self.but_deactivate_all.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub") self.but_deactivate_all.SetText("Zatrzymaj wszystkie") self.but_deactivate_all.SetEvent(self.deactivate_all) self.but_deactivate_all.Show() self.titleBar.but_deactivate_all = ui.Button() self.titleBar.but_deactivate_all.SetParent(self.titleBar) self.titleBar.but_deactivate_all.SetPosition(3+5+self.titleBar.HelpBut.GetWidth()+5+self.but_deactivate_all.GetWidth(), 0) self.titleBar.but_deactivate_all.SetUpVisual("d:/ymir work/ui/public/small_button_01.sub") self.titleBar.but_deactivate_all.SetOverVisual("d:/ymir work/ui/public/small_button_02.sub") self.titleBar.but_deactivate_all.SetDownVisual("d:/ymir work/ui/public/small_button_03.sub") self.titleBar.but_deactivate_all.SetText("Info") self.titleBar.but_deactivate_all.SetEvent(self.about) self.titleBar.but_deactivate_all.Show() self.titleName.SetPosition(60, 4) self.enable_rebuy = CheckBox("Aktywuj kupowanie zmianek") self.enable_rebuy.Toggle() self.enable_rebuy.Hide() self.but_speed = ui.SliderBar() self.but_speed.SetParent(self) self.but_speed.SetWindowHorizontalAlignCenter() self.but_speed.SetPosition(0,360) self.but_speed.SetSliderPos(0.0) self.but_speed.Hide() self.itemTabBar = ItemTabBar(self) self.itemTabBar.SetPosition(10,35) self.itemTabBar.Show() self.buyed = 0 self.buyed_rare = 0 self.SetCloseEvent(self._Hide) self.Hide = self._Hide self.help_add_item = HelpBar(0.8,'Upuśc tu item aby go dodać') self.help_add_item.SetParent(self) self.help_add_item.SetPosition(60,50) self.help_minimize = HelpBar(0.8,'Przeciągnij bota do krawędzi lub boku, aby go pomniejszyć!',1) self.help_minimize.SetParent(self.titleBar) self.help_minimize.SetWindowHorizontalAlignCenter() self.help_minimize.SetPosition(100,-30) self.help_show_rare = HelpBar(0.85,'Wyświetlanie 6/7 bon.') self.help_show_rare.SetParent(self) self.help_rebuy = HelpBar(0.5,'Jeśli bot kupi więcej?') self.help_rebuy.SetParent(self) self.help_stop_all = HelpBar(0.8,'Zatrzymaj wszystko!',1) self.help_stop_all.SetParent(self.titleBar) self.help_stop_all.SetPosition(3+5+self.titleBar.HelpBut.GetWidth()*1.2,-30) self.help_duration = HelpBar(0.8,'Spowolnienie bota.',1) self.help_duration.SetParent(self) def ToggleHelp(self,val): self.help_on = val def Show(self): ui.BoardWithTitleBar.Show(self) self.bot_shown = 1 def _Hide(self): ui.BoardWithTitleBar.Hide(self) self.bot_shown = 0 def deactivate_all(self): for a in self.itemTabBar.tabList: self.itemTabBar.tabList[a].bonusSelector.Starter.SetUp() self.itemTabBar.tabList[a].bonusSelector.Starter.OnToggleUp() self.itemTabBar.tabList[a].bonusSelector.Starter_rare_boni.SetUp() self.itemTabBar.tabList[a].bonusSelector.Starter_rare_boni.OnToggleUp() pass drag = 0 def drag_start(self): self.drag = 1 def drag_end(self): self.drag = 0 if self.pinhint > 0: self.PinShow(self.pinhint) # self.PinGroupBox = self.PinGroup() pass self.ShowPinHint(0) def PinShow(self,dir): self.PinGroupBox = self.PinGroup(self,dir) self.Hide() self.PinGroupBox.Show() def EnableInventoryTweak(self,gameWindow): self.gameWindow=gameWindow self.gameWindow.interface.wndInventory.inventoryTab[0].SetEvent(lambda arg=0: self.__SetInventoryPage(arg)) self.gameWindow.interface.wndInventory.inventoryTab[1].SetEvent(lambda arg=1: self.__SetInventoryPage(arg)) def __SetInventoryPage(self,arg): self.gameWindow.interface.wndInventory.SetInventoryPage(arg) for a in self.itemTabBar.tabList: itm = self.itemTabBar.tabList[a] if itm.index >= arg*45 and itm.index < (arg+1)*45: itm.blockBar.Show() else: itm.blockBar.Hide() help_on = 0 counter = 0 AboutWindow = None def OnUpdate(self): if self.AboutWindow: if self.AboutWindow.x_counter > 1: self.AboutWindow.x_counter -=1 self.AboutWindow.text6.SetText("Od: %0.1f" % (self.AboutWindow.x_counter/45.0)) elif self.AboutWindow.x_counter == 1: self.AboutWindow.Hide() # self.AboutWindow.Delete() if self.help_on == 1: (x,y) = self.itemTabBar.plusBar.GetLocalPosition() self.help_add_item.SetPosition(x+20,50) self.help_add_item.Show() self.help_stop_all.Show() self.help_minimize.Show() if self.itemTabBar.tabCount > 0: self.help_show_rare.SetPosition(25,164) self.help_show_rare.Show() self.help_rebuy.SetPosition(15,147) self.help_rebuy.Show() # self.help_duration.SetPosition(300,180) self.help_duration.SetPosition(190-5.5+self.but_speed.GetSliderPos()*int(35.5+self.but_speed.GetWidth()/2),180) self.help_duration.Show() else: self.help_show_rare.Hide() self.help_rebuy.Hide() self.help_duration.Hide() else: self.help_add_item.Hide() self.help_minimize.Hide() self.help_show_rare.Hide() self.help_rebuy.Hide() self.help_stop_all.Hide() self.help_duration.Hide() if self.drag == 1: (x1, y1) = self.GetGlobalPosition() # if x1 < 0: # x1 = 0 # elif x1 > wndMgr.GetScreenWidth()-520: # x1 = wndMgr.GetScreenWidth()-520 # if y1 < 0: # y1 = 0 # elif y1 > wndMgr.GetScreenHeight()-36-self.GetHeight(): # y1 = wndMgr.GetScreenHeight()-36-self.GetHeight() x1 = max(min(wndMgr.GetScreenWidth()-520,x1),0) y1 = max(min(wndMgr.GetScreenHeight()-36-self.GetHeight(),y1),0) self.SetPosition(x1,y1) if x1 < 30: self.ShowPinHint(1) elif wndMgr.GetScreenWidth()-x1-520 < 30: self.ShowPinHint(2) elif y1 < 30: self.ShowPinHint(3) elif wndMgr.GetScreenHeight()-y1-self.GetHeight() < 60: self.ShowPinHint(4) else: self.ShowPinHint(0) # self.SetPosition(x1+(x-self.drag_pos[0]),y1) pass if self.gameWindow != None: for a in self.itemTabBar.tabList: itm = self.itemTabBar.tabList[a] self.counter+=1 if self.counter >= int(self.but_speed.GetSliderPos()*MAX_SWITCH_DELAY_APPEND+MIN_SWITCH_DELAY): self.buyed = 0 self.buyed_rare = 0 self.counter = 0 for a in self.itemTabBar.tabList: itm = self.itemTabBar.tabList[a] itm.UpdateItem() # if itm. def about(self): self.AboutWindow = ui.ThinBoard() self.AboutWindow.SetParent(self) self.AboutWindow.SetSize(250,100) self.AboutWindow.SetWindowHorizontalAlignCenter() self.AboutWindow.SetWindowVerticalAlignCenter() self.AboutWindow.SetPosition(0,0) self.AboutWindow.Show() self.AboutWindow.x_counter = 550 self.AboutWindow.text1 = ui.TextLine() self.AboutWindow.text1.SetParent(self.AboutWindow) self.AboutWindow.text1.SetWindowHorizontalAlignCenter() self.AboutWindow.text1.SetHorizontalAlignCenter() self.AboutWindow.text1.SetPosition(0,5) self.AboutWindow.text1.SetText("Switchbot V2.2 by Mijago Kodowanie By xNukox.") self.AboutWindow.text1.SetPackedFontColor(ui.GenerateColor(58, 141, 221)) self.AboutWindow.text1.Show() self.AboutWindow.text2 = ui.TextLine() self.AboutWindow.text2.SetParent(self.AboutWindow) self.AboutWindow.text2.SetPosition(8,18) self.AboutWindow.text2.SetText("Ten switchbot został‚ opracowany prz Mijago, edytowany przez xNukox.") self.AboutWindow.text2.Show() self.AboutWindow.text3 = ui.TextLine() self.AboutWindow.text3.SetParent(self.AboutWindow) self.AboutWindow.text3.SetPosition(8,18+13) self.AboutWindow.text3.SetText("Nowe pomysły zawszę są mile widziane!") self.AboutWindow.text3.Show() self.AboutWindow.text4 = ui.TextLine() self.AboutWindow.text4.SetParent(self.AboutWindow) self.AboutWindow.text4.SetPosition(8,18+13*3) self.AboutWindow.text4.SetText("Nie rozprzestrzeniaj bota bez mojej wiedzy.") self.AboutWindow.text4.Show() self.AboutWindow.text5 = ui.TextLine() self.AboutWindow.text5.SetParent(self.AboutWindow) self.AboutWindow.text5.SetPosition(8,18+13*4) self.AboutWindow.text5.SetText("Zastosuj zatwierdzenie.") self.AboutWindow.text5.Show() self.AboutWindow.text6 = ui.TextLine() self.AboutWindow.text6.SetParent(self.AboutWindow) self.AboutWindow.text6.SetPosition(200,18+13*5) self.AboutWindow.text6.SetText("Od: %d" % self.AboutWindow.x_counter) self.AboutWindow.text6.Show() def Close(self): self.Hide() def Open(self): self.Show() class HelpBar(ui.Window): def __init__(self,width,text,centered = 0): ui.Window.__init__(self) self.AddFlag("not_pick") self.AddFlag("attach") img = ui.ExpandedImageBox() img.SetParent(self) img.LoadImage("d:/ymir work/ui/pattern/help_stick.tga") img.SetRenderingRect(0.0, -width, 0.0, 0.0) img.Show() self.img = img txt = ui.TextLine() txt=ui.TextLine() txt.SetParent(self) txt.SetText(text) txt.Show() img.SetPosition(0,18-width*img.GetHeight()) txt.SetPosition(0,0) txt.SetWindowHorizontalAlignCenter() if centered != 0: txt.SetHorizontalAlignCenter() # txt.SetPosition(0,0) self.txt = txt class DropDown(ui.Window): dropped = 0 dropstat = 0 last = 0 lastS = 0 maxh = 95 OnChange = None class Item(ui.ListBoxEx.Item): def __init__(self,parent, text,value=0): ui.ListBoxEx.Item.__init__(self) self.textBox=ui.TextLine() self.textBox.SetParent(self) self.textBox.SetText(text) # self.textBox.SetLimitWidth(parent.GetWidth()-132) self.textBox.Show() self.value = value def GetValue(self): return self.value def __del__(self): ui.ListBoxEx.Item.__del__(self) def __init__(self,parent,tt = "",down=1): ui.Window.__init__(self,"TOP_MOST") self.down = down self.SetParentProxy(parent) self.bg = ui.Bar("TOP_MOST") self.bg.SetParent(self) self.bg.SetPosition(0,0) self.bg.SetColor(0xc0000000) self.bg.OnMouseOverIn = self.bgMouseIn self.bg.OnMouseOverOut = self.bgMouseOut self.bg.OnMouseLeftButtonDown = self.ExpandMe self.bg.Show() self.act = ui.TextLine() self.act.SetParent(self.bg) self.act.SetPosition(4,2) self.act.SetText(tt) self.act.Show() self.GetText = self.act.GetText self.Drop = ui.Bar("TOP_MOST") self.Drop.SetParent(self.GetParentProxy()) self.Drop.SetPosition(0,21) # self.Drop.SetSize(150,95) self.Drop.SetSize(150,0) # self.Drop.SetColor(0xc00a0a0a) self.Drop.SetColor(0xff0a0a0a) self.ScrollBar = ui.ThinScrollBar() self.ScrollBar.SetParent(self.Drop) self.ScrollBar.SetPosition(132,0) # self.ScrollBar.SetScrollBarSize(95) self.ScrollBar.SetScrollBarSize(0) # self.ScrollBar.Show() self.DropList = ui.ListBoxEx() self.DropList.SetParent(self.Drop) self.DropList.itemHeight = 12 self.DropList.itemStep = 13 self.DropList.SetPosition(0,0) # self.DropList.SetSize(132,self.maxh) self.DropList.SetSize(132,13) self.DropList.SetScrollBar(self.ScrollBar) self.DropList.SetSelectEvent(self.SetTitle) self.DropList.SetViewItemCount(0) self.DropList.Show() if tt != "": self.AppendItemAndSelect(tt) self.selected = self.DropList.GetSelectedItem() self.SetSize(120,20) def __del__(self): ui.Window.__del__(self) c = 1 def AppendItem(self,text,value=0): self.c+=1 self.DropList.AppendItem(self.Item(self,text,value)) self.maxh = min(95,13*self.c) if self.c > 7: self.ScrollBar.Show() def AppendItemAndSelect(self,text,value=0): self.DropList.AppendItem(self.Item(self,text,value)) self.DropList.SelectIndex(len(self.DropList.itemList)-1) def SelectByAffectId(self,id): for x in self.DropList.itemList: if x.value == id: self.DropList.SelectItem(x) break def SetTitle(self,item): self.act.SetText(str(item.textBox.GetText())) self.last = self.DropList.basePos self.lastS = self.ScrollBar.GetPos() self.dropped = 0 self.selected = item if self.OnChange: self.OnChange() # self.Drop.Hide() def SetPosition(self,w,h): ui.Window.SetPosition(self,w,h) if self.down == 1: self.Drop.SetPosition(w,h+21) else: self.Drop.SetPosition(w,h-self.Drop.GetHeight()) def SetSize(self,w,h): ui.Window.SetSize(self,w,h) self.bg.SetSize(w,h) self.Drop.SetSize(w,0) self.DropList.SetSize(w-18,self.maxh) for x in self.DropList.itemList: x.SetSize(w-18,12) self.ScrollBar.SetPosition(w-18,0) def ExpandMe(self): if self.dropped == 1: # self.Drop.Hide() self.dropped = 0 else: # self.Drop.Show() self.dropped = 1 def OnUpdate(self): iter = 6 if self.Drop.GetHeight() < 50: self.ScrollBar.Hide() else: self.ScrollBar.Show() if self.dropped == 0 and self.dropstat == 1: if self.Drop.GetHeight() <=0: self.dropstat = 0 self.Drop.SetSize(self.Drop.GetWidth(),0) self.ScrollBar.SetScrollBarSize(self.Drop.GetHeight()) self.Drop.Hide() else: if self.Drop.GetHeight()-iter < 0: self.Drop.SetSize(self.Drop.GetWidth(),0) else: self.Drop.SetSize(self.Drop.GetWidth(),self.Drop.GetHeight()-iter) (w,h) = self.GetLocalPosition() self.SetPosition(w,h) self.ScrollBar.SetScrollBarSize(self.Drop.GetHeight()) self.DropList.SetViewItemCount(int(self.Drop.GetHeight()/13)) self.DropList.SetBasePos(self.last+1) self.DropList.SetBasePos(self.last) elif self.dropped == 1 and self.dropstat == 0: self.Drop.Show() self.SetTop() if self.Drop.GetHeight() >=self.maxh: self.Drop.SetSize(self.Drop.GetWidth(),self.maxh) self.ScrollBar.SetScrollBarSize(self.maxh) self.dropstat = 1 self.DropList.SetViewItemCount(7) self.ScrollBar.SetPos(self.lastS) else: self.ScrollBar.SetScrollBarSize(self.Drop.GetHeight()+iter) self.Drop.SetSize(self.Drop.GetWidth(),self.Drop.GetHeight()+iter) (w,h) = self.GetLocalPosition() self.SetPosition(w,h) self.DropList.SetViewItemCount(int(self.Drop.GetHeight()/13)) self.DropList.SetBasePos(self.last+1) self.DropList.SetBasePos(self.last) ## BG Hover def bgMouseIn(self): self.bg.SetColor(0xc00a0a0a) def bgMouseOut(self): self.bg.SetColor(0xc0000000) class Edit2(ui.EditLine): def __init__(self,main = "",ml = 99): ui.EditLine.__init__(self) self.SetText(main) self.main = main self.SetMax(ml) self.SetUserMax(ml) def GetText(self): res = ui.EditLine.GetText(self) if res == "": return "0" else: return res def __del__(self): ui.EditLine.__del__(self) def OnSetFocus(self): ui.EditLine.OnSetFocus(self) if ui.EditLine.GetText(self) == self.main: self.SetText("") def OnKillFocus(self): ui.EditLine.OnKillFocus(self) if ui.EditLine.GetText(self) == "": self.SetText(self.main) class CheckBox(ui.Window): checked = 0 eventUp =None eventDown=None def __init__(self,cont = ""): ui.Window.__init__(self) self.BG = ui.Bar("UI") self.BG.SetParent(self) self.BG.SetPosition(0,0) self.BG.SetSize(20,20) # self.BG.SetColor(0xc00b0b0b) self.BG.SetColor(COLOR_CHECKBOX_NOT_SELECTED) self.BG.OnMouseLeftButtonUp = self.Toggle self.OnMouseLeftButtonUp = self.Toggle self.BG.Show() self.Title = ui.TextLine() self.Title.SetParent(self) self.Title.SetPosition(25,2) self.Title.SetText(cont) self.Title.Show() self.stat = ui.TextLine() self.stat.SetParent(self.BG) self.stat.SetPosition(0,0) self.stat.SetWindowHorizontalAlignCenter() self.stat.SetWindowVerticalAlignCenter() self.stat.SetHorizontalAlignCenter() self.stat.SetVerticalAlignCenter() self.stat.SetSize(0,0) self.stat.SetText("") self.SetSize(25+self.Title.GetTextSize()[0]+5,20) self.stat.Show() def __del__(self): ui.ToggleButton.__del__(self) def Toggle(self): if self.checked == 1: self.OnToggleUp() else: self.OnToggleDown() def OnToggleUp(self): self.stat.SetText("") # self.BG.SetColor(0xc00b0b0b) self.BG.SetColor(COLOR_CHECKBOX_NOT_SELECTED) self.checked = 0 if self.eventUp: self.eventUp() def OnToggleDown(self): # self.BG.SetColor(0xf00b0b0b) self.BG.SetColor(COLOR_CHECKBOX_SELECTED) self.stat.SetText("X") self.checked = 1 if self.eventDown: self.eventDown()
  20. Dziś na pewnym forum natknąłem się na dość ciekawe urozmaicenie. Kolor Yang w EQ zmienia się, w zależności ile Yang posiadamy. [Hidden Content]] Wchodzimy do: root/uiinventory.py Szukamy: def RefreshStatus(self): money = player.GetElk() self.wndMoney.SetText(localeInfo.NumberToMoneyString(money)) Całą funkcję zamieniamy na: def RefreshStatus(self): money = player.GetElk() if money <= 100000000: self.wndMoney.SetFontColor(1.0, 0.2, 0.2) elif money >= 100000001 and money <= 1000000000: self.wndMoney.SetFontColor(1.0, 0.6, 0.2) elif money >= 1000000001 and money <= 1500000000: self.wndMoney.SetFontColor(1.0, 1.0, 0.2) elif money >= 1500000001: self.wndMoney.SetFontColor(0.6, 1.0, 0.2) self.wndMoney.SetText(localeInfo.NumberToMoneyString(money))
  21. Wchodzimy do: pack/root/uitooltip.py Szukamy: ATTRIBUTE_NEED_WIDTH = { Nad dodajemy: MAX_AFFECT_VALUE = { 0 : -1, item.APPLY_MAX_HP : 2000, item.APPLY_MAX_SP : 80, item.APPLY_CON : 12, item.APPLY_INT : 12, item.APPLY_STR : 12, item.APPLY_DEX : 12, item.APPLY_ATT_SPEED : 8, item.APPLY_MOV_SPEED : 20, item.APPLY_CAST_SPEED : 20, item.APPLY_HP_REGEN : 30, item.APPLY_SP_REGEN : 30, item.APPLY_POISON_PCT : 8, item.APPLY_STUN_PCT : 8, item.APPLY_SLOW_PCT : 8, item.APPLY_CRITICAL_PCT : 10, item.APPLY_PENETRATE_PCT : 10, item.APPLY_ATTBONUS_WARRIOR : 15, item.APPLY_ATTBONUS_ASSASSIN : 15, item.APPLY_ATTBONUS_SURA : 20, item.APPLY_ATTBONUS_SHAMAN : 15, item.APPLY_ATTBONUS_MONSTER : 0, item.APPLY_ATTBONUS_HUMAN : 10, item.APPLY_ATTBONUS_ANIMAL : 20, item.APPLY_ATTBONUS_ORC : 20, item.APPLY_ATTBONUS_MILGYO : 20, item.APPLY_ATTBONUS_UNDEAD : 20, item.APPLY_ATTBONUS_DEVIL : 20, item.APPLY_STEAL_HP : 10, item.APPLY_STEAL_SP : 10, item.APPLY_MANA_BURN_PCT : 10, item.APPLY_DAMAGE_SP_RECOVER : 0, item.APPLY_BLOCK : 15, item.APPLY_DODGE : 15, item.APPLY_RESIST_SWORD : 15, item.APPLY_RESIST_TWOHAND : 15, item.APPLY_RESIST_DAGGER : 15, item.APPLY_RESIST_BELL : 15, item.APPLY_RESIST_FAN : 15, item.APPLY_RESIST_BOW : 15, item.APPLY_RESIST_FIRE : 15, item.APPLY_RESIST_ELEC : 15, item.APPLY_RESIST_MAGIC : 15, item.APPLY_RESIST_WIND : 15, item.APPLY_REFLECT_MELEE : 10, item.APPLY_REFLECT_CURSE : 0, item.APPLY_POISON_REDUCE : 5, item.APPLY_KILL_SP_RECOVER : 0, item.APPLY_EXP_DOUBLE_BONUS : 20, item.APPLY_GOLD_DOUBLE_BONUS : 20, item.APPLY_ITEM_DROP_BONUS : 20, item.APPLY_POTION_BONUS : 0, item.APPLY_KILL_HP_RECOVER :0, item.APPLY_IMMUNE_STUN : 1, item.APPLY_IMMUNE_SLOW : 1, item.APPLY_IMMUNE_FALL : 0, item.APPLY_BOW_DISTANCE : 0, item.APPLY_DEF_GRADE_BONUS : 0, item.APPLY_ATT_GRADE_BONUS : 0, item.APPLY_MAGIC_ATT_GRADE : 0, item.APPLY_MAGIC_DEF_GRADE : 0, item.APPLY_MAX_STAMINA : 0, item.APPLY_MALL_ATTBONUS : 0, item.APPLY_MALL_DEFBONUS : 0, item.APPLY_MALL_EXPBONUS : 0, item.APPLY_MALL_ITEMBONUS : 0, item.APPLY_MALL_GOLDBONUS : 0, item.APPLY_SKILL_DAMAGE_BONUS : 0, item.APPLY_NORMAL_HIT_DAMAGE_BONUS : 0, item.APPLY_SKILL_DEFEND_BONUS : 0, item.APPLY_NORMAL_HIT_DEFEND_BONUS : 0, item.APPLY_PC_BANG_EXP_BONUS : 0, item.APPLY_PC_BANG_DROP_BONUS : 0, item.APPLY_RESIST_WARRIOR : 15, item.APPLY_RESIST_ASSASSIN : 15, item.APPLY_RESIST_SURA : 15, item.APPLY_RESIST_SHAMAN : 15, item.APPLY_MAX_HP_PCT : 0, item.APPLY_MAX_SP_PCT : 0, item.APPLY_ENERGY : 0, item.APPLY_COSTUME_ATTR_BONUS : 0, item.APPLY_MAGIC_ATTBONUS_PER : 0, item.APPLY_MELEE_MAGIC_ATTBONUS_PER : 0, item.APPLY_RESIST_ICE : 0, item.APPLY_RESIST_EARTH : 0, item.APPLY_RESIST_DARK : 0, item.APPLY_ANTI_CRITICAL_PCT : 0, item.APPLY_ANTI_PENETRATE_PCT : 0, } Szukamy: def __GetAttributeColor(self, index, value): if value > 0: if index >= 5: return self.SPECIAL_POSITIVE_COLOR2 else: return self.SPECIAL_POSITIVE_COLOR elif value == 0: return self.NORMAL_COLOR else: return self.NEGATIVE_COLOR Zamieniamy na: def __GetAttributeColor(self, index, value, type=0): if value == self.MAX_AFFECT_VALUE[type]: return self.SPECIAL_TITLE_COLOR if value > 0: if index >= 5: return self.SPECIAL_POSITIVE_COLOR2 else: return self.SPECIAL_POSITIVE_COLOR elif value == 0: return self.NORMAL_COLOR else: return self.NEGATIVE_COLOR Szukamy: if affectString: affectColor = self.__GetAttributeColor(i, value) self.AppendTextLine(affectString, affectColor) Zamieniamy na: if affectString: affectColor = self.__GetAttributeColor(i, value, type) self.AppendTextLine(affectString, affectColor) Jeśli dodawałeś nowe bony z mojego poradnika: Szukamy: item.APPLY_ANTI_PENETRATE_PCT : 0, Pod dodajemy: item.APPLY_ATTBONUS_STONE : 20, item.APPLY_ATTBONUS_BOSS : 20,
  22. Pokaże Wam jak zrobić kolorowy opis przedmiotu typu [uLEPSZACZ] czy [EPICKA ZBROJA] Wchodzimy do pliku /root/uitooltip.py [align=left]Szukamy: ### Hair Preview Image ### if self.__IsHair(itemVnum): self.__AppendHairIcon(itemVnum) ### Description ### self.AppendDescription(itemDesc, 26) self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR) [/align] [align=left]Pod dodajemy: if 19 == itemVnum: # 19 - ID Przedmiotu if 0 != metinSlot: self.AppendDescription("Przedmiot Specjalny", None, 0xff68e1ff) #kolor wybrany przez nas ( kolor wpisujemy po 0xff ) [/align] [align=center]Gotowe! [/align] [align=left]Generator Kolorów: [align=center][align=left] [/align] [/align] [/align] Pozdrawiam. * To tylko przedsmak tego co dla Was przygotowałem proszę daj + by zmotywować mnie do dalszego działania.
  23. Siema, macie tutaj przycisk, który wyświetli wam thinboarda z ilością fpsów. Wstawiam, bo w sumie nie potrzebne mi może ktoś będzie chciał... (jak coś to button też jest w paczce) GIF: Download: [Hidden Content] Nie daje skana, bo w paczce 3 pliki .tga i 2 pliki .py. Poradnik w paczce.
  24. Standardowo wyświetlanie statystyk postaci w oknie wyboru postaci, jest jakoś dziwnie balansowane, te belki dziwnie balansują. Nie jestem pewien czy takiego efektu oczekiwali ymirowscy. W każdym bądź razie nie wygląda to najlepiej więc, pokażę wam jak to zmienić. Po zmianie, belki statystyk będą wzrastać do samego końca. Po prostu nie będzie tego dziwnego balansu. Cały poradnik wykonamy w pack/root. 01: Otwieramy introselect.py i szukamy tego: float(valueHTH) / statesSummary, float(valueINT) / statesSummary, float(valueSTR) / statesSummary, float(valueDEX) / statesSummary I zmieniamy na to: float(valueHTH) / 90, # max stat float(valueINT) / 90, # max stat float(valueSTR) / 90, # max stat float(valueDEX) / 90 # max stat 02: Otwieramy introcreate.py i szukamy tego: float(self.stat[0])/float(statSummary), float(self.stat[1])/float(statSummary), float(self.stat[2])/float(statSummary), float(self.stat[3])/float(statSummary), I zmieniamy na to: float(self.stat[0])/90, #max stat float(self.stat[1])/90, #max stat float(self.stat[2])/90, #max stat float(self.stat[3])/90, #max stat Zapisujemy pliki i gotowe PS: Ten poradnik może cię zainteresować: Naprawa odświeżania statystyk postaci i ekwipunku.
  25. Miałem w sumie nie wrzucać ale lata już po necie a ja mam lepszy więc wjb Brakować w cliencie już nic nie powinno, w razie czego pw pisać. Nie pomagam przy implementacji :v [Hidden Content] [Hidden Content] [Hidden Content] pass: persergaCwel
×
×
  • Create New...