Ayyıldız2 | 2008 TR Yapısı • 1-99 Orta Emek Destan • Oto Avsız • 10 Temmuz 21:00 HEMEN TIKLA!
Official Bonus Tablosu Düzeltme
Root/ uicharacterdetails.py aç
Arat:
Değiştir:
Arat:
Değiştir:
uitooltip.py dosyasını açın ve def AutoAppendTextLine(self, text, color = FONT_COLOR, centerAlign = True): arayın:
Kod bloğu ardından şunu ekleyin:
ui.py açın
Arat:
Müsait bir yere ekleyin varsa değiştirin:
ThinBoard (Window) arayın:
Değiştirin yoksa ekleyin
Root/ uicharacterdetails.py aç
Arat:
Kod:
for i in xrange(self.UI_MAX_COUNT):
self.labelTextList[i].SetOverEvent( ui.__mem_func__(self.__ButtonOverIn), i )
self.labelTextList[i].SetOverOutEvent( ui.__mem_func__(self.__ButtonOverOut), i )
Değiştir:
Kod:
for i in xrange(self.UI_MAX_COUNT):
self.labelTextList[i].ShowToolTip = lambda arg=i: self.__ButtonOverIn(arg)
self.labelTextList[i].HideToolTip = lambda arg=i: self.__ButtonOverOut(arg)
Arat:
Kod:
if i+self.LabelLineCount < self.UI_MAX_COUNT:
self.labelTextList[i+self.LabelLineCount].SetOverEvent( ui.__mem_func__(self.__ButtonOverIn), self.LabelLineCount + self.startline_endlinecount )
self.labelTextList[i+self.LabelLineCount].SetOverOutEvent( ui.__mem_func__(self.__ButtonOverOut), self.LabelLineCount + self.startline_endlinecount )
Değiştir:
Kod:
if i+self.LabelLineCount < self.UI_MAX_COUNT:
self.labelTextList[i+self.LabelLineCount].ShowToolTip = lambda arg=self.LabelLineCount + self.startline_endlinecount: self.__ButtonOverIn(arg)
self.labelTextList[i+self.LabelLineCount].HideToolTip = lambda arg=self.LabelLineCount + self.startline_endlinecount: self.__ButtonOverOut(arg)
uitooltip.py dosyasını açın ve def AutoAppendTextLine(self, text, color = FONT_COLOR, centerAlign = True): arayın:
Kod bloğu ardından şunu ekleyin:
Kod:
def SetThinBoardSize(self, width, height = 12):
self.toolTipWidth = width
self.toolTipHeight = height
ui.py açın
Arat:
Kod:
elif Type == "thinboard":
parent.Children[Index] = ThinBoard()
parent.Children[Index].SetParent(parent)
self.LoadElementThinBoard(parent.Children[Index], ElementValue, parent)
Müsait bir yere ekleyin varsa değiştirin:
Kod:
elif Type == "thinboard_gold":
parent.Children[Index] = ThinBoardGold()
parent.Children[Index].SetParent(parent)
self.LoadElementThinBoard(parent.Children[Index], ElementValue, parent)
elif Type == "thinboard_circle":
parent.Children[Index] = ThinBoardCircle()
parent.Children[Index].SetParent(parent)
self.LoadElementThinBoard(parent.Children[Index], ElementValue, parent)
ThinBoard (Window) arayın:
Değiştirin yoksa ekleyin
Kod:
class ThinBoardGold(Window):
CORNER_WIDTH = 16
CORNER_HEIGHT = 16
LINE_WIDTH = 16
LINE_HEIGHT = 16
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.MakeBase()
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.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.GetWidth()
#self.Base.GetHeight()
"""
Defalt Width : 128, Height : 128
0.0 > 128, 1.0 > 256
"""
if self.Base:
self.Base.SetRenderingRect(0, 0, (float(width)-32)/float(self.Base.GetWidth()) - 1.0, (float(height)-32)/float(self.Base.GetHeight()) - 1.0)
def MakeBase(self):
self.Base = ExpandedImageBox()
self.Base.AddFlag("not_pick")
self.Base.LoadImage("d:/ymir work/ui/pattern/Board_Base.tga")
self.Base.SetParent(self)
self.Base.SetPosition(16, 16)
self.Base.SetAlpha(0.8)
self.Base.Show()
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 = 4
CORNER_HEIGHT = 4
LINE_WIDTH = 4
LINE_HEIGHT = 4
BOARD_COLOR = grp.GenerateColor(0.0, 0.0, 0.0, 1.0)
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()
Son düzenleme:
En Çok Reaksiyon Alan Mesajlar
Official Bonus Tablosu Düzeltme
Root/ uicharacterdetails.py aç
Arat:
Kod:for i in xrange(self.UI_MAX_COUNT): self.labelTextList[i].SetOverEvent( ui.__mem_func__(self.__ButtonOverIn), i ) self.labelTextList[i].SetOverOutEvent( ui.__mem_func__(self.__ButtonOverOut), i )
Değiştir:
Kod:for i in xrange(self.UI_MAX_COUNT): self.labelTextList[i].ShowToolTip = lambda arg=i: self.__ButtonOverIn(arg) self.labelTextList[i].HideToolTip = lambda arg=i: self.__ButtonOverOut(arg)
Arat:
Kod:if i+self.LabelLineCount < self.UI_MAX_COUNT: self.labelTextList[i+self.LabelLineCount].SetOverEvent( ui.__mem_func__(self.__ButtonOverIn), self.LabelLineCount + self.startline_endlinecount ) self.labelTextList[i+self.LabelLineCount].SetOverOutEvent( ui.__mem_func__(self.__ButtonOverOut), self.LabelLineCount + self.startline_endlinecount )
Değiştir:
Kod:if i+self.LabelLineCount < self.UI_MAX_COUNT: self.labelTextList[i+self.LabelLineCount].ShowToolTip = lambda arg=self.LabelLineCount + self.startline_endlinecount: self.__ButtonOverIn(arg) self.labelTextList[i+self.LabelLineCount].HideToolTip = lambda arg=self.LabelLineCount + self.startline_endlinecount: self.__ButtonOverOut(arg)
uitooltip.py dosyasını açın ve def AutoAppendTextLine(self, text, color = FONT_COLOR, centerAlign = True): arayın:
Kod bloğu ardından şunu ekleyin:
Kod:def SetThinBoardSize(self, width, height = 12): self.toolTipWidth = width self.toolTipHeight = height
ui.py açın
Arat:
Kod:elif Type == "thinboard": parent.Children[Index] = ThinBoard() parent.Children[Index].SetParent(parent) self.LoadElementThinBoard(parent.Children[Index], ElementValue, parent)
Müsait bir yere ekleyin varsa değiştirin:
Kod:elif Type == "thinboard_gold": parent.Children[Index] = ThinBoardGold() parent.Children[Index].SetParent(parent) self.LoadElementThinBoard(parent.Children[Index], ElementValue, parent) elif Type == "thinboard_circle": parent.Children[Index] = ThinBoardCircle() parent.Children[Index].SetParent(parent) self.LoadElementThinBoard(parent.Children[Index], ElementValue, parent)
ThinBoard (Window) arayın:
Değiştirin yoksa ekleyin
Kod:class ThinBoardGold(Window): CORNER_WIDTH = 16 CORNER_HEIGHT = 16 LINE_WIDTH = 16 LINE_HEIGHT = 16 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.MakeBase() 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.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.GetWidth() #self.Base.GetHeight() """ Defalt Width : 128, Height : 128 0.0 > 128, 1.0 > 256 """ if self.Base: self.Base.SetRenderingRect(0, 0, (float(width)-32)/float(self.Base.GetWidth()) - 1.0, (float(height)-32)/float(self.Base.GetHeight()) - 1.0) def MakeBase(self): self.Base = ExpandedImageBox() self.Base.AddFlag("not_pick") self.Base.LoadImage("d:/ymir work/ui/pattern/Board_Base.tga") self.Base.SetParent(self) self.Base.SetPosition(16, 16) self.Base.SetAlpha(0.8) self.Base.Show() 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 = 4 CORNER_HEIGHT = 4 LINE_WIDTH = 4 LINE_HEIGHT = 4 BOARD_COLOR = grp.GenerateColor(0.0, 0.0, 0.0, 1.0) 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()
Öğeyi görmek için üye olmalısınız.Paylaşım için teşekkürler.
Official Bonus Tablosu Düzeltme
Root/ uicharacterdetails.py aç
Arat:
Kod:for i in xrange(self.UI_MAX_COUNT): self.labelTextList[i].SetOverEvent( ui.__mem_func__(self.__ButtonOverIn), i ) self.labelTextList[i].SetOverOutEvent( ui.__mem_func__(self.__ButtonOverOut), i )
Değiştir:
Kod:for i in xrange(self.UI_MAX_COUNT): self.labelTextList[i].ShowToolTip = lambda arg=i: self.__ButtonOverIn(arg) self.labelTextList[i].HideToolTip = lambda arg=i: self.__ButtonOverOut(arg)
Arat:
Kod:if i+self.LabelLineCount < self.UI_MAX_COUNT: self.labelTextList[i+self.LabelLineCount].SetOverEvent( ui.__mem_func__(self.__ButtonOverIn), self.LabelLineCount + self.startline_endlinecount ) self.labelTextList[i+self.LabelLineCount].SetOverOutEvent( ui.__mem_func__(self.__ButtonOverOut), self.LabelLineCount + self.startline_endlinecount )
Değiştir:
Kod:if i+self.LabelLineCount < self.UI_MAX_COUNT: self.labelTextList[i+self.LabelLineCount].ShowToolTip = lambda arg=self.LabelLineCount + self.startline_endlinecount: self.__ButtonOverIn(arg) self.labelTextList[i+self.LabelLineCount].HideToolTip = lambda arg=self.LabelLineCount + self.startline_endlinecount: self.__ButtonOverOut(arg)
uitooltip.py dosyasını açın ve def AutoAppendTextLine(self, text, color = FONT_COLOR, centerAlign = True): arayın:
Kod bloğu ardından şunu ekleyin:
Kod:def SetThinBoardSize(self, width, height = 12): self.toolTipWidth = width self.toolTipHeight = height
ui.py açın
Arat:
Kod:elif Type == "thinboard": parent.Children[Index] = ThinBoard() parent.Children[Index].SetParent(parent) self.LoadElementThinBoard(parent.Children[Index], ElementValue, parent)
Müsait bir yere ekleyin varsa değiştirin:
Kod:elif Type == "thinboard_gold": parent.Children[Index] = ThinBoardGold() parent.Children[Index].SetParent(parent) self.LoadElementThinBoard(parent.Children[Index], ElementValue, parent) elif Type == "thinboard_circle": parent.Children[Index] = ThinBoardCircle() parent.Children[Index].SetParent(parent) self.LoadElementThinBoard(parent.Children[Index], ElementValue, parent)
ThinBoard (Window) arayın:
Değiştirin yoksa ekleyin
Kod:class ThinBoardGold(Window): CORNER_WIDTH = 16 CORNER_HEIGHT = 16 LINE_WIDTH = 16 LINE_HEIGHT = 16 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.MakeBase() 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.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.GetWidth() #self.Base.GetHeight() """ Defalt Width : 128, Height : 128 0.0 > 128, 1.0 > 256 """ if self.Base: self.Base.SetRenderingRect(0, 0, (float(width)-32)/float(self.Base.GetWidth()) - 1.0, (float(height)-32)/float(self.Base.GetHeight()) - 1.0) def MakeBase(self): self.Base = ExpandedImageBox() self.Base.AddFlag("not_pick") self.Base.LoadImage("d:/ymir work/ui/pattern/Board_Base.tga") self.Base.SetParent(self) self.Base.SetPosition(16, 16) self.Base.SetAlpha(0.8) self.Base.Show() 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 = 4 CORNER_HEIGHT = 4 LINE_WIDTH = 4 LINE_HEIGHT = 4 BOARD_COLOR = grp.GenerateColor(0.0, 0.0, 0.0, 1.0) 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()
Paylaşım için teşekkürler.
Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)
Benzer konular
- Cevaplar
- 0
- Görüntüleme
- 505
- Cevaplar
- 42
- Görüntüleme
- 4K
- Cevaplar
- 13
- Görüntüleme
- 1K
