Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ui
- import net
- import chr
- import player
- import wndMgr
- import item
- import emotion
- import uiCommon
- import app
- import uiUploadMark
- import guild
- import quest
- import mouseModule
- import chat
- import playerSettingModule
- import uiToolTip
- import uiPickMoney
- import localeInfo
- import constInfo
- import dbg
- import skill
- import uiScriptLocale
- from _weakref import proxy
- def unsigned32(n):
- return n & 0xFFFFFFFFL
- FACE_IMAGE_DICT = {
- playerSettingModule.RACE_WARRIOR_M : "d:/ymir work/interface/Illumina_vegas/faces/small/icon_mwarrior.tga",
- playerSettingModule.RACE_WARRIOR_W : "d:/ymir work/interface/Illumina_vegas/faces/small/icon_wwarrior.tga",
- playerSettingModule.RACE_ASSASSIN_M : "d:/ymir work/interface/Illumina_vegas/faces/small/icon_mninja.tga",
- playerSettingModule.RACE_ASSASSIN_W : "d:/ymir work/interface/Illumina_vegas/faces/small/icon_wninja.tga",
- playerSettingModule.RACE_SURA_M : "d:/ymir work/interface/Illumina_vegas/faces/small/icon_msura.tga",
- playerSettingModule.RACE_SURA_W : "d:/ymir work/interface/Illumina_vegas/faces/small/icon_wsura.tga",
- playerSettingModule.RACE_SHAMAN_M : "d:/ymir work/interface/Illumina_vegas/faces/small/icon_mshaman.tga",
- playerSettingModule.RACE_SHAMAN_W : "d:/ymir work/interface/Illumina_vegas/faces/small/icon_wshaman.tga",
- }
- GRADE_ADD_MEMBER_AUTHORITY = 1
- GRADE_REMOVE_MEMBER_AUTHORITY = 2
- GRADE_NOTICE_AUTHORITY = 3
- GRADE_SKILL_AUTHORITY = 4
- class GuildWindow(ui.ScriptWindow):
- GUILD_SKILL_ACTIVE_SLOT = 1
- def __init__(self):
- ui.ScriptWindow.__init__(self, "TOP_MOST")
- self.Load()
- def __del__(self):
- ui.ScriptWindow.__del__(self)
- def Close(self):
- self.board.Hide()
- def Load(self):
- # boards
- self.status = None
- self.status3 = None
- self.status5 = None
- self.status7 = None
- self.status10 = None
- # boards
- self.LoadGui()
- self.can_continue = 1
- self.objPos = 0
- self.objPos2 = 0
- self.objPos3 = 0
- self.tooltip_in = 0
- self.markSelectDialog=uiUploadMark.MarkSelectDialog()
- self.markSelectDialog.SAFE_SetSelectEvent(self.__OnSelectMark)
- def LoadGui(self):
- self.tooltipSkill = uiToolTip.SkillToolTip()
- self.tooltipSkill.Hide()
- self.board = ui.BoardWithTitleBarAndSelect()
- self.board.AddFlag("movable")
- self.board.SetPosition(100,67)
- self.board.SetSize(370,350)
- self.board.SetTitleName(uiScriptLocale.GUILD_TITLE)
- self.board.SetCloseEvent(self.Close)
- self.board.SetButtons(5)
- self.board.SetButtonText(0,uiScriptLocale.GUILD_PAGE_1)
- self.board.SetButtonText(1,uiScriptLocale.GUILD_PAGE_2)
- self.board.SetButtonText(2,uiScriptLocale.GUILD_PAGE_3)
- self.board.SetButtonText(3,uiScriptLocale.GUILD_PAGE_4)
- self.board.SetButtonText(4,uiScriptLocale.GUILD_PAGE_5)
- self.board.SetButtonEvent(0,self.Status)
- self.board.SetButtonEvent(1,self.Chat)
- self.board.SetButtonEvent(2,self.Membrii)
- self.board.SetButtonEvent(3,self.Abilitati)
- self.board.SetButtonEvent(4,self.Grad)
- self.board.SetTop()
- self.board.Hide()
- self.offerDialog = uiPickMoney.PickMoneyDialog()
- self.offerDialog.LoadDialog()
- self.offerDialog.SetMax(9)
- self.offerDialog.SetTitleName(localeInfo.GUILD_OFFER_EXP)
- self.offerDialog.SetAcceptEvent(ui.__mem_func__(self.OnOffer))
- self.OpenBoard(0)
- def Status(self):
- self.OpenBoard(0)
- def Chat(self):
- self.OpenBoard(1)
- def Membrii(self):
- self.OpenBoard(2)
- def Abilitati(self):
- self.OpenBoard(3)
- def Grad(self):
- self.OpenBoard(4)
- def CloseOthers(self):
- if self.status != None and self.status.IsShow():
- self.status.Hide()
- self.status2.Hide()
- self.status2_1.Hide()
- if self.status3 != None and self.status3.IsShow():
- self.status3.Hide()
- self.status4.Hide()
- if self.status5 != None and self.status5.IsShow():
- self.status5.Hide()
- self.status6.Hide()
- if self.status7 != None and self.status7.IsShow():
- self.status7.Hide()
- self.status8.Hide()
- self.status9.Hide()
- if self.status10 != None and self.status10.IsShow():
- self.status10.Hide()
- self.status11.Hide()
- def OpenBoard(self, int):
- self.page = int
- self.board.SetSelected(int)
- self.CloseOthers()
- net.SendGuildRefreshCommentsPacket(0)
- if int == 0:
- self.status = ui.NewBoard()
- self.status.SetParent(self.board)
- self.status.SetSize(372,110)
- self.status.SetPosition(8,36)
- self.status.Show()
- self.stema = ui.ImageBox()
- self.stema.SetParent(self.status)
- self.stema.SetPosition(17,17)
- self.stema.LoadImage("d:/ymir work/interface/Illumina_vegas/guild/guildicon_slot.tga")
- self.stema.Show()
- self.img_guild = ui.MarkBox()
- self.img_guild.SetParent(self.stema)
- self.img_guild.SetPosition(10,10)
- self.img_guild.SetScale(3.3)
- # self.img_guild.LoadImage(guild.GetMarkImageFilenameByMarkID(net.GetGuildID()))
- self.img_guild.Show()
- self.lv_img = ui.ImageBox()
- self.lv_img.SetParent(self.stema)
- self.lv_img.SetPosition(45,35)
- self.lv_img.Show()
- self.lv_img.LoadImage("d:/ymir work/interface/Illumina_vegas/character/level_round.tga")
- self.btn_img = ui.NewButton()
- self.btn_img.SetParent(self.stema)
- self.btn_img.SetPosition(0,0)
- self.btn_img.SetUpVisual("d:/ymir work/interface/Illumina_vegas/guild/guildicon_slot_click.tga")
- self.btn_img.SetOverVisual("d:/ymir work/interface/Illumina_vegas/guild/guildicon_slot_click.tga")
- self.btn_img.SetDownVisual("d:/ymir work/interface/Illumina_vegas/guild/guildicon_slot_click.tga")
- self.btn_img.SetEvent(lambda : self.__OnClickSelectGuildMarkButton())
- self.btn_img.Show()
- self.schimb_simb = ui.TextLine()
- self.schimb_simb.SetParent(self.stema)
- self.schimb_simb.SetPosition(0,-9)
- self.schimb_simb.SetWindowHorizontalAlignCenter()
- self.schimb_simb.SetHorizontalAlignCenter()
- self.schimb_simb.SetText(uiScriptLocale.GUILD_INFO_MARK)
- self.schimb_simb.SetFontColor(0.902, 0.816, 0.635)
- self.schimb_simb.Show()
- self.lv = ui.TextLine()
- self.lv.SetParent(self.lv_img)
- self.lv.SetPosition(0,9)
- self.lv.SetWindowHorizontalAlignCenter()
- self.lv.SetHorizontalAlignCenter()
- self.lv.SetText(str(guild.GetGuildLevel()))
- self.lv.SetFontColor(0.902, 0.816, 0.635)
- self.lv.Show()
- self.inputs,self.text,self.imgexp, u = {},{},{},0
- for i in xrange(2):
- self.inputs[i] = ui.ImageBox()
- self.inputs[i].SetParent(self.status)
- self.inputs[i].SetPosition(110+u,28)
- self.inputs[i].LoadImage("d:/ymir work/interface/Illumina_vegas/chenare/chenar1.tga")
- self.inputs[i].Show()
- self.text[i] = ui.TextLine()
- self.text[i].SetParent(self.inputs[i])
- if i == 0:
- self.text[i].SetText(uiScriptLocale.GUILD_MEMBER_NAME)
- else:
- self.text[i].SetText(uiScriptLocale.GUILD_INFO_MASTER)
- self.text[i].SetPosition(0,6)
- self.text[i].SetWindowHorizontalAlignCenter()
- self.text[i].SetHorizontalAlignCenter()
- self.text[i].SetPackedFontColor(0xffa08784)
- self.text[i].Show()
- self.imgexp[i] = ui.ExpandedImageBox()
- self.imgexp[i].SetParent(self.status)
- self.imgexp[i].SetPosition(105,85)
- if i == 0:
- self.imgexp[i].LoadImage("d:/ymir work/interface/Illumina_vegas/character/exp_gauge_empty.tga")
- else:
- self.imgexp[i].LoadImage("d:/ymir work/interface/Illumina_vegas/character/exp_gauge_full.tga")
- if i == 1:
- self.imgexp[i].SetPercentage(50,100)
- self.imgexp[i].Show()
- u += 140
- self.leader_image = ui.ImageBox()
- self.leader_image.SetParent(self.status)
- self.leader_image.SetPosition(224,28)
- self.leader_image.LoadImage("d:/ymir work/interface/Illumina_vegas/guild/leader.tga")
- self.leader_image.Show()
- self.percent = ui.TextLine()
- self.percent.SetParent(self.status)
- self.percent.SetPosition(110,65)
- self.percent.SetText("100%")
- self.percent.SetPackedFontColor(0xfff8d090)
- self.percent.Show()
- curExp, lastExp = guild.GetGuildExperience()
- curExp *= 100
- lastExp *= 100
- self.exp = ui.TextLine()
- self.exp.SetParent(self.status)
- self.exp.SetPosition(173,65)
- self.exp.SetText("EXP: "+str(curExp)+ " " +uiScriptLocale.CHARACTER_FROM +" "+str(lastExp))
- self.exp.SetPackedFontColor(0xffa08784)
- self.exp.Show()
- self.status2 = ui.NewBoard()
- self.status2.SetParent(self.board)
- self.status2.SetSize(372,85)
- self.status2.SetPosition(7,33+115)
- self.status2.Show()
- self.cant_j, self.lv_m, self.slot_input, u = {},{},{},0
- for i in xrange(2):
- self.cant_j[i] = ui.TextLine()
- self.cant_j[i].SetParent(self.status2)
- self.cant_j[i].SetPosition(25,18+u)
- if i == 0:
- self.cant_j[i].SetText(uiScriptLocale.GUILD_INFO_MEMBER_NUM)
- else:
- self.cant_j[i].SetText(uiScriptLocale.GUILD_INFO_MEMBER_AVG_LEVEL)
- self.cant_j[i].SetPackedFontColor(0xffa08784)
- self.cant_j[i].Show()
- self.slot_input[i] = ui.ImageBox()
- self.slot_input[i].SetParent(self.status2)
- self.slot_input[i].SetPosition(100,12+u)
- self.slot_input[i].LoadImage("d:/ymir work/interface/Illumina_vegas/chenare/chenar1_small.tga")
- self.slot_input[i].Show()
- self.lv_m[i] = ui.TextLine()
- self.lv_m[i].SetParent(self.slot_input[i])
- self.lv_m[i].SetPosition(0,5)
- if i == 0:
- self.lv_m[i].SetText("0 / 0")
- else:
- self.lv_m[i].SetText("0")
- self.lv_m[i].SetWindowHorizontalAlignCenter()
- self.lv_m[i].SetHorizontalAlignCenter()
- self.lv_m[i].SetPackedFontColor(0xffa07970)
- self.lv_m[i].Show()
- u+= 30
- self.slot_btn = ui.ImageBox()
- self.slot_btn.SetParent(self.status2)
- self.slot_btn.SetPosition(230,2)
- self.slot_btn.LoadImage("d:/ymir work/interface/Illumina_vegas/guild/button_slot.tga")
- self.slot_btn.Show()
- self.btn_exp = ui.NewButton()
- self.btn_exp.SetParent(self.slot_btn)
- self.btn_exp.SetPosition(7,5)
- self.btn_exp.SetUpVisual("d:/ymir work/interface/Illumina_vegas/guild/buttons/button_guild_normal.tga")
- self.btn_exp.SetOverVisual("d:/ymir work/interface/Illumina_vegas/guild/buttons/button_guild_hover.tga")
- self.btn_exp.SetDownVisual("d:/ymir work/interface/Illumina_vegas/guild/buttons/button_guild_active.tga")
- self.btn_exp.SetText(uiScriptLocale.GUILD_INFO_OFFER_EXP)
- self.btn_exp.SetEvent(lambda : self.__OnClickOfferButton())
- self.btn_exp.Show()
- self.status2_1 = ui.NewBoard()
- self.status2_1.SetParent(self.board)
- self.status2_1.SetSize(372,103)
- self.status2_1.SetPosition(7,33+115+87)
- self.status2_1.Show()
- self.slot_btn3 = ui.ImageBox()
- self.slot_btn3.SetParent(self.status2_1)
- self.slot_btn3.SetPosition(230,2)
- self.slot_btn3.LoadImage("d:/ymir work/interface/Illumina_vegas/guild/button_slot.tga")
- self.slot_btn3.Show()
- self.btn_img2= ui.NewButton()
- self.btn_img2.SetParent(self.slot_btn3)
- self.btn_img2.SetPosition(7,5)
- self.btn_img2.SetUpVisual("d:/ymir work/interface/Illumina_vegas/guild/buttons/button_guild_normal.tga")
- self.btn_img2.SetOverVisual("d:/ymir work/interface/Illumina_vegas/guild/buttons/button_guild_hover.tga")
- self.btn_img2.SetDownVisual("d:/ymir work/interface/Illumina_vegas/guild/buttons/button_guild_active.tga")
- self.btn_img2.SetText(uiScriptLocale.GUILD_WAR_DECLARE)
- self.btn_img2.SetEvent(lambda : self.__Battle())
- self.btn_img2.Show()
- elif int == 1:
- self.status3 = ui.NewBoard()
- self.status3.SetParent(self.board)
- self.status3.SetSize(372,235)
- self.status3.SetPosition(8,36)
- self.status3.Show()
- self.scrollbar = ui.ScrollBarNewDesign()
- self.scrollbar.SetParent(self.status3)
- self.scrollbar.SetPosition(350,15)
- self.scrollbar.SetScrollBarSize(210)
- self.scrollbar.SetScrollEvent(self.__OnScroll)
- self.scrollbar.Show()
- self.status4 = ui.NewBoard()
- self.status4.SetParent(self.board)
- self.status4.SetSize(372,65)
- self.status4.SetPosition(7,272)
- self.status4.Show()
- self.image_type = ui.ImageBox()
- self.image_type.SetParent(self.status4)
- self.image_type.SetPosition(9,8)
- self.image_type.LoadImage("d:/ymir work/interface/Illumina_vegas/guild/chenar_chat.tga")
- self.image_type.Show()
- self.commentSlot = ui.SpecialEditLine()
- self.commentSlot.SetParent(self.status4)
- self.commentSlot.SetPosition(18,16)
- self.commentSlot.SetSize(121,25)
- self.commentSlot.SetMax(35)
- self.commentSlot.OnIMEReturn = ui.__mem_func__(self.OnPostComment)
- self.commentSlot.SetIMEFlag(0)
- self.commentSlot.SetPlaceHolderText("Scrie un mesaj ...")
- self.commentSlot.SetPackedFontColor(0xffa07970)
- self.commentSlot.Show()
- self.objPos = 0
- self.scrollbar.SetPos(0)
- self.LoadScroll()
- elif int == 2:
- self.status5 = ui.NewBoard()
- self.status5.SetParent(self.board)
- self.status5.SetSize(372,30)
- self.status5.SetPosition(8,36)
- self.status5.Show()
- texts = {1 : uiScriptLocale.SELECT_NAME,2 : uiScriptLocale.GUILD_RASA,3 : uiScriptLocale.GUILD_MEMBER_LEVEL, 4 : uiScriptLocale.GUILD_MEMBER_SPECIFIC_GRAVITY,5 : uiScriptLocale.GUILD_MEMBER_RANK,}
- self.players_t,u = {}, 0
- for i in xrange(5):
- self.players_t[i] = ui.TextLine()
- self.players_t[i].SetParent(self.status5)
- self.players_t[i].SetPosition(60+u,17)
- self.players_t[i].SetText(texts[i+1])
- self.players_t[i].SetFontColor(0.902, 0.816, 0.635)
- self.players_t[i].Show()
- if i == 0:
- u += 60
- elif i == 1 or i == 2:
- u += 45
- else:
- u+= 60
- self.status6 = ui.NewBoard()
- self.status6.SetParent(self.board)
- self.status6.SetSize(372,255)
- self.status6.SetPosition(7,33+17+32)
- self.status6.Show()
- self.scrollbar = ui.ScrollBarNewDesign2()
- self.scrollbar.SetParent(self.status6)
- self.scrollbar.SetPosition(350,15)
- self.scrollbar.SetScrollBarSize(225)
- self.scrollbar.SetScrollEvent(self.__OnScroll2)
- self.scrollbar.Show()
- self.objPos2 = 0
- self.scrollbar.SetPos(0)
- self.LoadScroll2()
- elif int == 3:
- self.status7 = ui.NewBoard()
- self.status7.SetParent(self.board)
- self.status7.SetSize(372,130)
- self.status7.SetPosition(8,36)
- self.status7.Show()
- self.titulo = ui.TextLine()
- self.titulo.SetParent(self.status7)
- self.titulo.SetPosition(0,25)
- self.titulo.SetText(uiScriptLocale.GUILD_SKILL_STATE)
- self.titulo.SetFontColor(0.902, 0.816, 0.635)
- self.titulo.SetWindowHorizontalAlignCenter()
- self.titulo.SetHorizontalAlignCenter()
- self.titulo.Show()
- self.bar = ui.ImageBox()
- self.bar.SetParent(self.status7)
- self.bar.SetPosition(0,20)
- self.bar.LoadImage("d:/ymir work/interface/Illumina_vegas/horizontal_bar/center.tga")
- self.bar.SetWindowHorizontalAlignCenter()
- self.bar.Show()
- self.p_d = ui.TextLine()
- self.p_d.SetParent(self.status7)
- self.p_d.SetPosition(0,55)
- self.p_d.SetWindowHorizontalAlignCenter()
- self.p_d.SetHorizontalAlignCenter()
- self.p_d.SetText(uiScriptLocale.CHARACTER_PSTATUS)
- self.p_d.SetFontColor(0.424, 0.337, 0.329)
- self.p_d.Show()
- self.skills = ui.GridSlotWindow()
- self.skills.SetParent(self.status7)
- self.skills.SetPosition(0,80)
- self.skills.ArrangeSlot(210, 6, 1, 32, 32,3,0)
- self.skills.SetSlotBaseImage("d:/ymir work/ui/slot.tga",1.0,1.0,1.0,1.0)
- self.skills.SetWindowHorizontalAlignCenter()
- self.skills.Show()
- self.skills.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
- self.skills.SetOverInItemEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OverInItem(slotNumber, type))
- self.skills.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
- self.skills.SetSelectItemSlotEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OnPickUpGuildSkill(slotNumber, type))
- self.skills.SetUnselectItemSlotEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OnUseGuildSkill(slotNumber, type))
- self.skills.SetPressedSlotButtonEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OnUpGuildSkill(slotNumber, type))
- self.skills.AppendSlotButton("d:/ymir work/interface/Illumina_vegas/button/char_buttons/plus_01_normal.tga",\
- "d:/ymir work/interface/Illumina_vegas/button/char_buttons/plus_02_hover.tga",\
- "d:/ymir work/interface/Illumina_vegas/button/char_buttons/plus_03_active.tga")
- self.status8 = ui.NewBoard()
- self.status8.SetParent(self.board)
- self.status8.SetSize(372,115)
- self.status8.SetPosition(7,33+134)
- self.status8.Show()
- self.titlu2 = ui.TextLine()
- self.titlu2.SetParent(self.status8)
- self.titlu2.SetPosition(0,15)
- self.titlu2.SetText(uiScriptLocale.GUILD_SKILL_POWER)
- self.titlu2.SetFontColor(0.902, 0.816, 0.635)
- self.titlu2.SetWindowHorizontalAlignCenter()
- self.titlu2.SetHorizontalAlignCenter()
- self.titlu2.Show()
- self.bar2 = ui.ImageBox()
- self.bar2.SetParent(self.titlu2)
- self.bar2.SetPosition(0,-5)
- self.bar2.LoadImage("d:/ymir work/interface/Illumina_vegas/horizontal_bar/center.tga")
- self.bar2.SetWindowHorizontalAlignCenter()
- self.bar2.Show()
- curPoint, maxPoint = guild.GetDragonPowerPoint()
- maxPoint = max(maxPoint, 1)
- self.text = ui.TextLine()
- self.text.SetParent(self.status8)
- self.text.SetPosition(0,50)
- self.text.SetText(uiScriptLocale.ENERGY_DISPONIBLE + " "+str(curPoint) + " / " + str(maxPoint))
- self.text.SetFontColor(0.424, 0.337, 0.329)
- self.text.SetWindowHorizontalAlignCenter()
- self.text.SetHorizontalAlignCenter()
- self.text.Show()
- self.img = {}
- for i in xrange(2):
- self.img[i] = ui.ExpandedImageBox()
- self.img[i].SetParent(self.status8)
- self.img[i].SetPosition(0,75)
- self.img[i].SetWindowHorizontalAlignCenter()
- if i == 0:
- self.img[i].LoadImage("d:/ymir work/interface/Illumina_vegas/guild/energy_gauge_empty.tga")
- else:
- self.img[i].LoadImage("d:/ymir work/interface/Illumina_vegas/guild/energy_gauge_full.tga")
- self.img[i].SetPercentage(80,100)
- self.img[i].Show()
- self.status9 = ui.NewBoard()
- self.status9.SetParent(self.board)
- self.status9.SetSize(372,55)
- self.status9.SetPosition(7,33+138+112)
- self.status9.Show()
- self.slot_btn = ui.ImageBox()
- self.slot_btn.SetParent(self.status9)
- self.slot_btn.SetPosition(0,1)
- self.slot_btn.SetWindowHorizontalAlignCenter()
- self.slot_btn.LoadImage("d:/ymir work/interface/Illumina_vegas/guild/button_slot.tga")
- self.slot_btn.Show()
- self.btn_img = ui.NewButton()
- self.btn_img.SetParent(self.slot_btn)
- self.btn_img.SetPosition(7,5)
- self.btn_img.SetUpVisual("d:/ymir work/interface/Illumina_vegas/guild/buttons/button_guild_normal.tga")
- self.btn_img.SetOverVisual("d:/ymir work/interface/Illumina_vegas/guild/buttons/button_guild_hover.tga")
- self.btn_img.SetDownVisual("d:/ymir work/interface/Illumina_vegas/guild/buttons/button_guild_active.tga")
- self.btn_img.SetText(uiScriptLocale.GUILD_SKIlL_HEAL_GSP)
- self.btn_img.SetEvent(lambda : self.__OnOpenHealGSPBoard())
- self.btn_img.Show()
- elif int == 4:
- self.status10 = ui.NewBoard()
- self.status10.SetParent(self.board)
- self.status10.SetSize(372,30)
- self.status10.SetPosition(8,36)
- self.status10.Show()
- texts = {0 : "Nr.", 1 : uiScriptLocale.SELECT_NAME,2 : uiScriptLocale.GUILD_GRADE_PERMISSION_JOIN,3 : uiScriptLocale.GUILD_GRADE_PERMISSION_DELETE, 4 : uiScriptLocale.GUILD_GRADE_PERMISSION_NOTICE,5 : uiScriptLocale.GUILD_GRADE_PERMISSION_SKILL,}
- self.players_t,u = {}, 0
- for i in xrange(6):
- self.players_t[i] = ui.TextLine()
- self.players_t[i].SetParent(self.status10)
- self.players_t[i].SetPosition(30+u,17)
- self.players_t[i].SetText(texts[i])
- self.players_t[i].SetFontColor(0.902, 0.816, 0.635)
- self.players_t[i].Show()
- if i == 0:
- u += 45
- elif i == 1:
- u += 65
- elif i == 2:
- u += 40
- elif i == 3:
- u+= 65
- else:
- u+= 45
- self.status11 = ui.NewBoard()
- self.status11.SetParent(self.board)
- self.status11.SetSize(372,257)
- self.status11.SetPosition(7,33+17+31)
- self.status11.Show()
- self.scrollbar = ui.ScrollBarNewDesign2()
- self.scrollbar.SetParent(self.status11)
- self.scrollbar.SetPosition(350,15)
- self.scrollbar.SetScrollBarSize(225)
- self.scrollbar.SetScrollEvent(self.__OnScroll3)
- self.scrollbar.Show()
- self.objPos3 = 0
- self.scrollbar.SetPos(0)
- self.LoadScroll3()
- def LoadScroll3(self):
- total = 13
- pos = self.objPos3
- if total >= 8:
- self.obj_count3 = 8
- else:
- self.obj_count3 = total
- z=0
- self.img_rank, u = {}, 0
- self.idx = {}
- self.checkbox,self.checkbox2,self.checkbox3,self.checkbox4 = {},{},{},{}
- self.names = {}
- for i in xrange(1,self.obj_count3):
- realPos = pos+i
- name, authority = guild.GetGradeData(int(realPos))
- self.img_rank[i] = ui.ExpandedImageBox()
- self.img_rank[i].SetParent(self.status11)
- self.img_rank[i].SetPosition(20,20+u)
- self.img_rank[i].LoadImage("d:/ymir work/interface/Illumina_vegas/guild/dialog_rank_slot.tga")
- self.img_rank[i].Show()
- self.idx[i] = ui.TextLine()
- self.idx[i].SetParent(self.img_rank[i])
- self.idx[i].SetPosition(10,6)
- self.idx[i].SetText(str(int(realPos))+".")
- self.idx[i].SetPackedFontColor(0xffcaa76f)
- self.idx[i].Show()
- self.names[i] = ui.EditableTextSlot(self.img_rank[i], 30, 2)
- self.names[i].SetEvent(ui.__mem_func__(self.OnOpenChangeGradeName), i)
- self.names[i].SetText(name)
- self.names[i].Show()
- # self.names[i] = ui.TextLine()
- # self.names[i].SetParent(self.img_rank[i])
- # self.names[i].SetPosition(40,6)
- # self.names[i].SetText(name)
- # self.names[i].Show()
- event1 = lambda argSelf=proxy(self), argIndex=int(realPos), argAuthority=1<<0: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
- event2 = lambda argSelf=proxy(self), argIndex=int(realPos), argAuthority=1<<1: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
- event3 = lambda argSelf=proxy(self), argIndex=int(realPos), argAuthority=1<<2: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
- event4 = lambda argSelf=proxy(self), argIndex=int(realPos), argAuthority=1<<3: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
- self.checkbox[i] = ui.CheckBox(self.img_rank[i],122,3,event1)
- self.checkbox2[i] = ui.CheckBox(self.img_rank[i],173,3,event2)
- self.checkbox3[i] = ui.CheckBox(self.img_rank[i],225,3,event3)
- self.checkbox4[i] = ui.CheckBox(self.img_rank[i],275,3,event4)
- self.checkbox[i].SetCheck(authority & guild.AUTH_ADD_MEMBER)
- self.checkbox4[i].SetCheck(authority & guild.AUTH_SKILL)
- self.checkbox3[i].SetCheck(authority & guild.AUTH_NOTICE)
- self.checkbox2[i].SetCheck(authority & guild.AUTH_REMOVE_MEMBER)
- u += 30
- def LoadScroll2(self):
- curMemberCount, maxMemberCount = guild.GetGuildMemberCount()
- pos = self.objPos2
- if curMemberCount >= 7:
- self.obj_count2 = 7
- else:
- self.obj_count2 = curMemberCount
- z=0
- self.players, u = {}, 0
- self.names,self.imgs,self.levels,self.inverts,self.pos = {},{},{},{},{}
- for i in xrange(self.obj_count2):
- realPos = pos+i
- pid, name, grade, race, level, offer, general = guild.GetMemberData(realPos)
- if not name or name == "":
- break
- guildExperienceSummary = guild.GetGuildExperienceSummary()
- offerPercentage = 0
- if guildExperienceSummary > 0:
- offerPercentage = int(float(offer) / float(guildExperienceSummary) * 100.0)
- self.players[i] = ui.ImageBox()
- self.players[i].SetParent(self.status6)
- self.players[i].SetPosition(25,20+u)
- self.players[i].LoadImage("d:/ymir work/interface/Illumina_vegas/guild/dialog_member_slot.tga")
- self.players[i].Show()
- self.pos[i] = ui.NewComboBox()
- self.pos[i].SetParent(self.players[i])
- self.pos[i].SetPosition(218,3)
- self.pos[i].SetSize(90,23)
- self.pos[i].SetCurrentItem(guild.GetGradeName(grade))
- masterName = guild.GetGuildMasterName()
- mainCharacterName = player.GetMainCharacterName()
- if mainCharacterName == masterName:
- self.pos[i].Enable()
- self.pos[i].SetEvent(lambda gradeNumber, lineIndex=realPos, argSelf=proxy(self): argSelf.OnChangeMemberGrade(lineIndex, gradeNumber))
- self.pos[i].Show()
- self.pos[i].ClearItem()
- for e in xrange(14):
- self.pos[i].InsertItem(e+2, guild.GetGradeName(e+2))
- self.pos[i].SetCurrentItem(guild.GetGradeName(grade))
- self.names[i] = ui.TextLine()
- self.names[i].SetParent(self.players[i])
- self.names[i].SetPosition(25,7)
- self.names[i].SetText(name)
- self.names[i].SetFontColor(0.902, 0.816, 0.635)
- self.names[i].Show()
- self.imgs[i] = ui.ImageBox()
- self.imgs[i].SetParent(self.players[i])
- self.imgs[i].SetPosition(93,2)
- self.imgs[i].LoadImage(FACE_IMAGE_DICT[race])
- self.imgs[i].Show()
- self.levels[i] = ui.TextLine()
- self.levels[i].SetParent(self.players[i])
- self.levels[i].SetPosition(140,7)
- self.levels[i].SetText(str(level))
- self.levels[i].SetFontColor(0.424, 0.337, 0.329)
- self.levels[i].Show()
- self.inverts[i] = ui.TextLine()
- self.inverts[i].SetParent(self.players[i])
- self.inverts[i].SetPosition(185,7)
- self.inverts[i].SetText(str(offerPercentage)+"%")
- self.inverts[i].SetFontColor(0.424, 0.337, 0.329)
- self.inverts[i].Show()
- u+= 30
- import dbg
- for e in xrange(self.obj_count2 -1, -1, -1):
- #dbg.TraceError(str(e)+"settop()")
- self.pos[e].SetTop()
- def LoadScroll(self):
- net.SendGuildRefreshCommentsPacket(0)
- pos = self.objPos
- if guild.GetGuildBoardCommentCount() >= 6:
- self.obj_count = 6
- else:
- self.obj_count = guild.GetGuildBoardCommentCount()
- self.delete,self.important, self.spaces,self.names,self.comments, u = {},{},{},{},{}, 0
- for i in xrange(self.obj_count):
- realPos = pos+i
- commentID, chrName, comment = self.__GetGuildBoardCommentData(realPos)
- if chrName == "Noname":
- break
- self.spaces[i] = ui.ImageBox()
- self.spaces[i].SetParent(self.status3)
- self.spaces[i].SetPosition(20,20+u)
- self.spaces[i].LoadImage("d:/ymir work/interface/Illumina_vegas/guild/dialog_message_slot.tga")
- self.spaces[i].Show()
- self.names[i] = ui.TextLine()
- self.names[i].SetParent(self.spaces[i])
- self.names[i].SetPosition(24,8)
- self.names[i].SetText(chrName)
- self.names[i].SetPackedFontColor(0xffcaa76f)
- self.names[i].Show()
- self.important[i] = ui.ImageBox()
- self.important[i].SetParent(self.spaces[i])
- self.important[i].SetPosition(87,8)
- self.important[i].LoadImage("d:/ymir work/interface/Illumina_vegas/guild/dialog_message_importantmsg.tga")
- self.comments[i] = ui.TextLine()
- self.comments[i].SetParent(self.spaces[i])
- self.comments[i].SetPosition(110,8)
- if "!" == comment[0]:
- self.comments[i].SetText(comment[1:])
- self.comments[i].SetPackedFontColor(0xffdb9b93)
- self.important[i].Show()
- else:
- self.comments[i].SetText(comment)
- self.comments[i].SetPackedFontColor(0xffa08784)
- self.comments[i].Show()
- masterName = guild.GetGuildMasterName()
- mainCharacterName = player.GetMainCharacterName()
- if mainCharacterName == chrName or (masterName == mainCharacterName):
- self.delete[i] = ui.Button()
- self.delete[i].SetParent(self.spaces[i])
- self.delete[i].SetPosition(305,7)
- self.delete[i].SetUpVisual("d:/ymir work/interface/Illumina_vegas/guild/close_mini_01_normal.tga")
- self.delete[i].SetOverVisual("d:/ymir work/interface/Illumina_vegas/guild/close_mini_02_hover.tga")
- self.delete[i].SetDownVisual("d:/ymir work/interface/Illumina_vegas/guild/close_mini_03_active.tga")
- self.delete[i].SetEvent(lambda x = realPos: self.OnDeleteComment(x))
- self.delete[i].Show()
- u += 35
- def OnUpdate(self):
- if self.page == 0:
- # net.SendGuildRefreshCommentsPacket(0)
- curMemberCount, maxMemberCount = guild.GetGuildMemberCount()
- self.lv_m[0].SetText(str(curMemberCount)+" / "+str(maxMemberCount))
- self.lv_m[1].SetText(str(guild.GetGuildMemberLevelAverage()))
- self.text[0].SetText(guild.GetGuildName())
- self.text[1].SetText(player.GetName())
- self.img_guild.SetIndex(net.GetGuildID())
- self.img_guild.SetScale(3.3)
- self.lv.SetText(str(guild.GetGuildLevel()))
- curExp, lastExp = guild.GetGuildExperience()
- curExp *= 100
- lastExp *= 100
- total = curExp + lastExp
- self.imgexp[1].SetPercentage(curExp,total)
- self.exp.SetText("EXP: "+str(curExp)+ " " +uiScriptLocale.CHARACTER_FROM +" "+str(total))
- self.percent.SetText("%s %.2f%%" % ("", float(curExp) / max(1, float(total)) * 100))
- elif self.page == 1:
- if guild.GetGuildBoardCommentCount() >= 6:
- self.obj_count = 6
- else:
- self.obj_count = guild.GetGuildBoardCommentCount()
- net.SendGuildRefreshCommentsPacket(0)
- # self.objPos = self.scrollbar.GetPos() * (guild.GetGuildBoardCommentCount()-8)
- # self.LoadScroll()
- elif self.page == 2:
- curMemberCount, maxMemberCount = guild.GetGuildMemberCount()
- if curMemberCount >= 5:
- self.obj_count2 = 5
- else:
- self.obj_count2 = curMemberCount
- pos = self.objPos2
- for i in xrange(self.obj_count2):
- realPos = pos+i
- pid, name, grade, race, level, offer, general = guild.GetMemberData(realPos)
- if not name or name == "":
- break
- guildExperienceSummary = guild.GetGuildExperienceSummary()
- offerPercentage = 0
- if guildExperienceSummary > 0:
- offerPercentage = int(float(offer) / float(guildExperienceSummary) * 100.0)
- self.inverts[i].SetText(str(offerPercentage)+"%")
- self.pos[i].SetCurrentItem(guild.GetGradeName(grade))
- if self.pos[int(realPos)].CheckOpen() == 1:
- self.open = 1
- for e in xrange(self.obj_count2):
- self.pos[e].Hide()
- # dbg.TraceError("Hide "+str(e))
- # dbg.TraceError("Show "+str(int(realPos)))
- self.pos[int(realPos)].Show()
- #self.pos[int(realPos)].SetTop()
- # elif self.pos[int(realPos)].CheckOpen() == 0:
- # self.pos[int(realPos)].Show()
- elif self.page == 3:
- skillPoint = guild.GetGuildSkillPoint()
- self.p_d.SetText(uiScriptLocale.CHARACTER_PSTATUS + " " +str(skillPoint))
- if self.tooltip_in == 0:
- for i in xrange(len(playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST)):
- slotIndex = 210+i
- skillIndex = playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST[i]
- skillLevel = guild.GetSkillLevel(slotIndex)
- # dbg.TraceError("slotIndex"+str(slotIndex)+" skillLevel+"+str(skillLevel))
- skillMaxLevel = skill.GetSkillMaxLevel(skillIndex)
- self.skills.SetSlotCount(slotIndex, skillLevel)
- if skillLevel <= 0:
- self.skills.DisableCoverButton(slotIndex)
- else:
- self.skills.EnableCoverButton(slotIndex)
- skillPoint = guild.GetGuildSkillPoint()
- if skillPoint > 0:
- if skillLevel < skillMaxLevel:
- self.skills.ShowSlotButton(slotIndex)
- self.skills.SetSkillSlot(slotIndex, skillIndex, 0)
- self.skills.SetCoverButton(slotIndex)
- self.skills.RefreshSlot()
- curPoint, maxPoint = guild.GetDragonPowerPoint()
- maxPoint = max(maxPoint, 1)
- self.text.SetText("Energie: "+str(curPoint) + " / " + str(maxPoint))
- self.img[1].SetPercentage(curPoint,maxPoint)
- if self.page == 4:
- if 13 >= 10:
- self.obj_count3 = 10
- else:
- self.obj_count3 = 13
- pos = self.objPos3
- for i in xrange(1,self.obj_count3):
- realPos = pos+i
- name, authority = guild.GetGradeData(int(realPos))
- self.checkbox[i].SetCheck(authority & guild.AUTH_ADD_MEMBER)
- self.checkbox4[i].SetCheck(authority & guild.AUTH_SKILL)
- self.checkbox3[i].SetCheck(authority & guild.AUTH_NOTICE)
- self.checkbox2[i].SetCheck(authority & guild.AUTH_REMOVE_MEMBER)
- self.names[i].SetText(name)
- def OnChangeMemberGrade(self, id, gradeNumber):
- PID = guild.MemberIndexToPID(id)
- net.SendGuildChangeMemberGradePacket(PID, gradeNumber)
- self.objPos2 = 0
- self.scrollbar.SetPos(0)
- self.LoadScroll2()
- def __GetGuildBoardCommentData(self, index):
- commentID, chrName, comment = guild.GetGuildBoardCommentData(index)
- if 0==commentID:
- if ""==chrName:
- chrName=localeInfo.UI_NONAME
- if ""==comment:
- comment=localeInfo.UI_NOCONTENTS
- return commentID, chrName, comment
- def OnPostComment(self):
- text = self.commentSlot.GetText()
- if not text:
- return FALSE
- if not guild.MainPlayerHasAuthority(guild.AUTH_NOTICE):
- chat.AppendChat(1,localeInfo.GUILD_NO_NOTICE_PERMISSION)
- return
- net.SendGuildPostCommentPacket(text[:50])
- self.commentSlot.SetText("")
- self.objPos = 0
- self.scrollbar.SetPos(0)
- self.LoadScroll()
- return TRUE
- def OnDeleteComment(self, index):
- commentID, chrName, comment = self.__GetGuildBoardCommentData(index)
- net.SendGuildDeleteCommentPacket(commentID)
- self.LoadScroll()
- def __OnScroll(self):
- net.SendGuildRefreshCommentsPacket(0)
- self.objPos = self.scrollbar.GetPos() * (guild.GetGuildBoardCommentCount()-6)
- self.LoadScroll()
- def __OnScroll2(self):
- curMemberCount, maxMemberCount = guild.GetGuildMemberCount()
- self.objPos2 = self.scrollbar.GetPos() * (curMemberCount-6)
- self.LoadScroll2()
- def __OnScroll3(self):
- self.objPos3 = self.scrollbar.GetPos() * (14-10)
- self.LoadScroll3()
- def __OnClickOfferButton(self):
- curEXP = unsigned32(player.GetStatus(player.EXP))
- if curEXP <= 100:
- chat.AppendChat(1,localeInfo.GUILD_SHORT_EXP)
- # chat.AppendChat(1,localeInfo.GUILD_SHORT_EXP);
- # chat.AppendChat(1,localeInfo.GUILD_SHORT_EXP);
- return
- self.offerDialog.Open(curEXP, 100)
- def OnOffer(self, exp):
- net.SendGuildOfferPacket(exp)
- def SetState(self,idx):
- self.OpenBoard(idx)
- def __OnClickSelectGuildMarkButton(self):
- if guild.GetGuildLevel() < int(localeInfo.GUILD_MARK_MIN_LEVEL):
- chat.AppendChat(1,localeInfo.GUILD_MARK_NOT_ENOUGH_LEVEL)
- elif not guild.MainPlayerHasAuthority(guild.AUTH_NOTICE):
- chat.AppendChat(1,localeInfo.GUILD_NO_NOTICE_PERMISSION)
- else:
- self.markSelectDialog.Open()
- def __OnSelectMark(self, markFileName):
- ret = net.UploadMark("upload/"+markFileName)
- # MARK_BUG_FIX
- if net.ERROR_MARK_UPLOAD_NEED_RECONNECT == ret:
- chat.AppendChat(1,localeInfo.UPLOAD_MARK_UPLOAD_NEED_RECONNECT)
- return ret
- # END_OF_MARK_BUG_FIX
- def OnPickUpGuildSkill(self, skillSlotIndex, type):
- dbg.TraceError("1")
- mouseController = mouseModule.CMouseController()
- # skillSlotIndex = skillSlotIndex+58
- if FALSE == mouseController.isAttached():
- dbg.TraceError("2")
- skillIndex = player.GetSkillIndex(skillSlotIndex)
- skillLevel = guild.GetSkillLevel(skillSlotIndex)
- dbg.TraceError("3 "+str(skillIndex)+"_"+str(skillLevel))
- if skill.CanUseSkill(skillIndex) and skillLevel > 0:
- dbg.TraceError("4")
- if app.IsPressed(app.DIK_LCONTROL):
- player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_SKILL, skillSlotIndex)
- return
- mouseController.AttachObject(self, player.SLOT_TYPE_SKILL, skillSlotIndex, skillIndex)
- dbg.TraceError("5")
- else:
- mouseController.DeattachObject()
- def OnUseGuildSkill(self, slotNumber, type):
- skillIndex = player.GetSkillIndex(slotNumber)
- skillLevel = guild.GetSkillLevel(slotNumber)
- if skillLevel <= 0:
- return
- player.UseGuildSkill(slotNumber)
- def OnUpGuildSkill(self, slotNumber, type):
- skillIndex = player.GetSkillIndex(slotNumber)
- net.SendChatPacket("/gskillup " + str(skillIndex))
- def OverInItem(self, slotNumber, type):
- if mouseModule.mouseController.isAttached():
- return
- skillIndex = player.GetSkillIndex(slotNumber)
- skillLevel = guild.GetSkillLevel(slotNumber)
- self.tooltipSkill.SetSkill(skillIndex, skillLevel)
- self.tooltip_in = 1
- def OverOutItem(self):
- self.tooltipSkill.HideToolTip()
- self.tooltip_in = 0
- ## Guild Skill
- def __OnOpenHealGSPBoard(self):
- curPoint, maxPoint = guild.GetDragonPowerPoint()
- if maxPoint - curPoint <= 0:
- chat.AppendChat(1,localeInfo.GUILD_CANNOT_HEAL_GSP_ANYMORE)
- return
- pickDialog = uiPickMoney.PickMoneyDialog()
- pickDialog.LoadDialog()
- pickDialog.SetMax(9)
- pickDialog.SetTitleName(localeInfo.GUILD_HEAL_GSP)
- pickDialog.SetAcceptEvent(ui.__mem_func__(self.__OnOpenHealGSPQuestionDialog))
- pickDialog.Open(maxPoint - curPoint, 1)
- self.pickDialog = pickDialog
- def __OnOpenHealGSPQuestionDialog(self, healGSP):
- money = healGSP * constInfo.GUILD_MONEY_PER_GSP
- questionDialog = uiCommon.QuestionDialog()
- questionDialog.SetText(localeInfo.GUILD_DO_YOU_HEAL_GSP % (money, healGSP))
- questionDialog.SetAcceptEvent(ui.__mem_func__(self.__OnHealGSP))
- questionDialog.SetCancelEvent(ui.__mem_func__(self.__OnCloseQuestionDialog))
- questionDialog.SetWidth(400)
- questionDialog.Open()
- questionDialog.healGSP = healGSP
- self.questionDialog = questionDialog
- def __OnHealGSP(self):
- net.SendGuildChargeGSPPacket(self.questionDialog.healGSP)
- self.__OnCloseQuestionDialog()
- def __OnCloseQuestionDialog(self):
- if self.questionDialog:
- self.questionDialog.Close()
- self.questionDialog = None
- def OnCheckAuthority(self, argIndex, argAuthority):
- name, authority = guild.GetGradeData(argIndex)
- net.SendGuildChangeGradeAuthorityPacket(argIndex, authority ^ argAuthority)
- def OnChangeGradeName(self, gradeNumber):
- if len(gradeName) == 0:
- gradeName = localeInfo.GUILD_DEFAULT_GRADE
- net.SendGuildChangeGradeNamePacket(gradeNumber, gradeName)
- return TRUE
- def OnOpenChangeGradeName(self, arg):
- self.cambiar = arg
- self.a = uiCommon.InputDialog()
- self.a.SetTitle("Nuevo Grado")
- self.a.SetAcceptEvent(ui.__mem_func__(self.__OnchangeName))
- self.a.SetCancelEvent(ui.__mem_func__(self.__OnCloseQuestionDialog2))
- self.a.Open()
- def __OnchangeName(self):
- gradeName = self.a.GetText()
- if len(gradeName) == 0:
- gradeName = localeInfo.GUILD_DEFAULT_GRADE
- net.SendGuildChangeGradeNamePacket(self.cambiar, gradeName)
- self.__OnCloseQuestionDialog2()
- def __OnCloseQuestionDialog2(self):
- if self.a:
- self.a.Close()
- self.cambiar = None
- self.a = None
- def CanOpen(self):
- return guild.IsGuildEnable()
- def IsShow(self):
- if self.board.IsShow():
- return True
- else:
- return False
- def ForceClose(self):
- self.board.Hide()
- def Show(self):
- if self.board.IsShow():
- self.board.Hide()
- else:
- self.board.Show()
- def Close(self):
- self.board.Hide()
- def __Battle(self):
- mainCharacterName = player.GetMainCharacterName()
- masterName = guild.GetGuildMasterName()
- if mainCharacterName == masterName:
- import snd
- import uiproguildwar
- self.uiProGuildWars = uiproguildwar.ProGuildWarWindow()
- if not player.IsObserverMode():
- if constInfo.PRO_GUILD_PAGE == 0:
- snd.PlaySound("sound/ui/click.wav")
- self.uiProGuildWars.Open()
- else:
- chat.AppendChat(1,"Numai liderul poate folosii comanda asta.")
- def OnPressEscapeKey(self):
- self.Close()
- return TRUE
- # x=GuildWindow().Show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement