Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###################################
- ############Dla MPCFORUM###########
- #####Zakaz dodawaia na inne fora###
- ########By DevBolt aka Cady########
- ###################################
- #IMPORT START
- import player, chat, constInfo, consoleModule, playerSettingModule, interfaceModule, event, game, uichat, uirunwindow, ui, dbg, app, time, uiwiki, tombola, item, locale, grp, uibonus, uiToolTip, ime, constInfo, net, stringCommander, background, snd
- #IMPORT END
- #CODE START
- class panelgracza(ui.BoardWithTitleBar):
- def __init__(self):
- ui.BoardWithTitleBar.__init__(self)
- self.BuildWindow()
- def __del__(self):
- ui.BoardWithTitleBar.__del__(self)
- def BuildWindow(self):
- self.SetSize(400, 180)
- self.SetCenterPosition()
- self.AddFlag('movable')
- self.AddFlag('float')
- self.SetTitleName('Panel Gracza: ' + player.GetName())
- self.comp = Component()
- self.teleporacja = self.comp.Button(self, '', 'Teleportacja', 10, 35, self.teleporacja, 'd:/ymir work/ui/game/TaskBar/Mall_Button_01.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_02.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_03.tga')
- self.polimorfia = self.comp.Button(self, '', 'Polimorfia', 10, 76, self.polimorfia, 'd:/ymir work/ui/game/TaskBar/Mall_Button_01.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_02.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_03.tga')
- self.radio = self.comp.Button(self, '', 'Radio', 10, 117, self.radio, 'd:/ymir work/ui/game/TaskBar/Mall_Button_01.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_02.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_03.tga')
- self.magazyn = self.comp.Button(self, '', 'Magazyn', 50, 35, self.magazyn, 'd:/ymir work/ui/game/TaskBar/Mall_Button_01.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_02.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_03.tga')
- self.itemshop = self.comp.Button(self, '', 'ItemShop', 50, 76, self.itemshop, 'd:/ymir work/ui/game/TaskBar/Mall_Button_01.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_02.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_03.tga')
- self.bonusy = self.comp.Button(self, '', 'Bonusy', 50, 117, self.bonusy, 'd:/ymir work/ui/game/TaskBar/Mall_Button_01.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_02.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_03.tga')
- self.bonusshitcher = self.comp.Button(self, '', 'Bonus Swither', 356, 35, self.bonusshitcher, 'd:/ymir work/ui/game/TaskBar/Mall_Button_01.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_02.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_03.tga')
- self.cos = self.comp.Button(self, '', 'COS', 356, 76, self.cos, 'd:/ymir work/ui/game/TaskBar/Mall_Button_01.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_02.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_03.tga')
- self.cos1 = self.comp.Button(self, '', 'COS1', 356, 117, self.cos1, 'd:/ymir work/ui/game/TaskBar/Mall_Button_01.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_02.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_03.tga')
- self.cos2 = self.comp.Button(self, '', 'COS2', 316, 35, self.cos2, 'd:/ymir work/ui/game/TaskBar/Mall_Button_01.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_02.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_03.tga')
- self.cos3 = self.comp.Button(self, '', 'COS2', 316, 76, self.cos3, 'd:/ymir work/ui/game/TaskBar/Mall_Button_01.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_02.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_03.tga')
- self.cos4 = self.comp.Button(self, '', 'COS', 316, 117, self.cos4, 'd:/ymir work/ui/game/TaskBar/Mall_Button_01.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_02.tga', 'd:/ymir work/ui/game/TaskBar/Mall_Button_03.tga')
- self.info = self.comp.Button(self, 'Informacje', '', 103, 65, self.info, 'd:/ymir work/ui/public/large_button_01.sub', 'd:/ymir work/ui/public/large_button_02.sub', 'd:/ymir work/ui/public/large_button_03.sub')
- self.eventy = self.comp.Button(self, 'Eventy', '', 210, 65, self.eventy, 'd:/ymir work/ui/public/large_button_01.sub', 'd:/ymir work/ui/public/large_button_02.sub', 'd:/ymir work/ui/public/large_button_03.sub')
- self.czas = self.comp.TextLine(self, 'Godzina:', 90, 26, self.comp.RGB(255, 255, 255))
- self.data = self.comp.TextLine(self, 'Data:', 270, 26, self.comp.RGB(255, 255, 255))
- ############Można było za pomocą pętli "try" ale to jest jeden z pierwszych paneli###############
- self.czasLine = ui.TextLine()
- self.czasLine.SetParent(self)
- self.czasLine.SetPackedFontColor(0xffffff00)
- self.czasLine.SetText(time.strftime("%H:%M:%S"))
- self.czasLine.SetPosition(90, 43)
- self.czasLine.Show()
- self.dataLine = ui.TextLine()
- self.dataLine.SetParent(self)
- self.dataLine.SetPackedFontColor(0xffffff00)
- self.dataLine.SetText(str(time.strftime("%Y-%m-%d")))
- self.dataLine.SetPosition(259, 43)
- self.dataLine.Show()
- self.informacje = ui.TextLine()
- self.informacje.SetParent(self)
- self.informacje.SetPackedFontColor(0xffffff00)
- self.informacje.SetText("Cady to mistrz nad mistrzami.Jakieś info dalej") ##Informacja
- self.informacje.SetPosition(100, 110)
- self.informacje.Hide()
- self.eve = ui.TextLine()
- self.eve.SetParent(self)
- self.eve.SetPackedFontColor(0xffffff00)
- self.eve.SetText("Dnia 28.09.2014 odbedzie się event OX.") #Jakieś info o eventach
- self.eve.SetPosition(100, 110)
- self.eve.Hide()
- self.prawa = ui.TextLine()
- self.prawa.SetParent(self)
- self.prawa.SetPackedFontColor(0xffffff00)
- self.prawa.SetText("By SerwerMt2") ##Prawa autorskie
- self.prawa.SetPosition(333, 160)
- self.prawa.Show()
- def teleporacja(self):
- event.QuestButtonClick(constInfo.cos) # Jeśli ktoś sie zna to sobie ustawi :P
- def polimorfia(self):
- event.QuestButtonClick(constInfo.cos) # Jeśli ktoś sie zna to sobie ustawi :P
- def radio(self):
- event.QuestButtonClick(constInfo.cos) # Jeśli ktoś sie zna to sobie ustawi :P
- def magazyn(self):
- event.QuestButtonClick(constInfo.cos) # Jeśli ktoś sie zna to sobie ustawi :P
- def itemshop(self):
- event.QuestButtonClick(constInfo.cos) # Jeśli ktoś sie zna to sobie ustawi :P
- def bonusy(self):
- event.QuestButtonClick(constInfo.cos) # Jeśli ktoś sie zna to sobie ustawi :P
- def bonusshitcher(self):
- event.QuestButtonClick(constInfo.cos) # Jeśli ktoś sie zna to sobie ustawi :P
- def cos(self):
- event.QuestButtonClick(constInfo.cos) # Jeśli ktoś sie zna to sobie ustawi :P
- def cos1(self):
- event.QuestButtonClick(constInfo.cos) # Jeśli ktoś sie zna to sobie ustawi :P
- def cos2(self):
- event.QuestButtonClick(constInfo.cos) # Jeśli ktoś sie zna to sobie ustawi :P
- def cos3(self):
- event.QuestButtonClick(constInfo.cos) # Jeśli ktoś sie zna to sobie ustawi :P
- def cos4(self):
- event.QuestButtonClick(constInfo.cos) # Jeśli ktoś sie zna to sobie ustawi :P
- def cos5(self):
- event.QuestButtonClick(constInfo.cos) # Jeśli ktoś sie zna to sobie ustawi :P
- def cos6(self):
- event.QuestButtonClick(constInfo.cos) # Jeśli ktoś sie zna to sobie ustawi :P
- def cos7(self):
- event.QuestButtonClick(constInfo.cos) # Jeśli ktoś sie zna to sobie ustawi :P
- def info(self):
- self.informacje.Show()
- self.eve.Hide()
- def eventy(self):
- self.eve.Show()
- self.informacje.Hide()
- def OnUpdate(self):
- self.czasLine.SetText(time.strftime("%H:%M:%S"))
- #CODE END
- class Component:
- def Button(self, parent, buttonName, tooltipText, x, y, func, UpVisual, OverVisual, DownVisual):
- button = ui.Button()
- button.SetParent(parent)
- button.SetPosition(x, y)
- button.SetUpVisual(UpVisual)
- button.SetOverVisual(OverVisual)
- button.SetDownVisual(DownVisual)
- button.SetText(buttonName)
- button.SetToolTipText(tooltipText)
- button.Show()
- button.SetEvent(func)
- return button
- def ToggleButton(self, parent, buttonName, tooltipText, x, y, funcUp, funcDown, UpVisual, OverVisual, DownVisual):
- button = ui.ToggleButton()
- button.SetParent(parent)
- button.SetPosition(x, y)
- button.SetUpVisual(UpVisual)
- button.SetOverVisual(OverVisual)
- button.SetDownVisual(DownVisual)
- button.SetText(buttonName)
- button.SetToolTipText(tooltipText)
- button.Show()
- button.SetToggleUpEvent(funcUp)
- button.SetToggleDownEvent(funcDown)
- return button
- def EditLine(self, parent, editlineText, x, y, width, heigh, max):
- SlotBar = ui.SlotBar()
- SlotBar.SetParent(parent)
- SlotBar.SetSize(width, heigh)
- SlotBar.SetPosition(x, y)
- SlotBar.Show()
- Value = ui.EditLine()
- Value.SetParent(SlotBar)
- Value.SetSize(width, heigh)
- Value.SetPosition(5, 1)
- Value.SetMax(max)
- Value.SetText(editlineText)
- Value.Show()
- return SlotBar, Value
- def TextLine(self, parent, textlineText, x, y, color):
- textline = ui.TextLine()
- textline.SetParent(parent)
- textline.SetPosition(x, y)
- if color != None:
- textline.SetFontColor(color[0], color[1], color[2])
- textline.SetText(textlineText)
- textline.Show()
- return textline
- def RGB(self, r, g, b):
- return (r*255, g*255, b*255)
- def SliderBar(self, parent, sliderPos, func, x, y):
- Slider = ui.SliderBar()
- Slider.SetParent(parent)
- Slider.SetPosition(x, y)
- Slider.SetSliderPos(sliderPos / 100)
- Slider.Show()
- Slider.SetEvent(func)
- return Slider
- def ExpandedImage(self, parent, x, y, img):
- image = ui.ExpandedImageBox()
- image.SetParent(parent)
- image.SetPosition(x, y)
- image.LoadImage(img)
- image.Show()
- return image
- def ThinBoard(self, parent, moveable, x, y, width, heigh, center):
- thin = ui.ThinBoard()
- if parent != None:
- thin.SetParent(parent)
- if moveable == TRUE:
- thin.AddFlag('movable')
- thin.AddFlag('float')
- thin.SetSize(width, heigh)
- thin.SetPosition(x, y)
- if center == TRUE:
- thin.SetCenterPosition()
- thin.Show()
- return thin
- panelgracza().Show()
Advertisement
Add Comment
Please, Sign In to add comment