Tipologie server(PvM / PvP): -
*Resursă folosită: svf-pentru-resurse/osf-owsap-server-fil ... 95195.html
*ServerFiles utilizat: -
*Syserr: gol
Poză:
*Detalii suplimentare:
Salutare, incerc sa scot sistemul de advanced pvp din serverfiles-ul lui owsap. Am scos partea de surse, problema e la py. Tin sa precizez ca duelul merge cum trebuie cel tactic si normal, adica sistemul e functional. Problema este la tooltip peste acele bonusuri pe care le enumera acolo cu imagini.
Mai precis sa fiu, in imaginea de jos se intelege mai exact ceea ce vreau sa zic.
https://gyazo.com/9d8b417d1555b3aadf27124239833f67
La mine cand dau cu mouse-ul peste acele imagini, nu apare scrisul acela. In rest totul merge cum trebuie, tooltip-ul de pe semnul intrebarii functioneaza, doar cel de pe imaginile cu bonusuri nu vrea, nu reusesc sa ii dau de cap.
aici este si codul
uicommon.py
Cod: Selectaţi tot
if app.ENABLE_SPECIAL_PVP_DUEL_OPTION:
class QuestionDuelOptionDialog(ui.ScriptWindow):
AFFECT_GAP = 35
AFFECT_PER_LINE = 4
AFFECT_DICT = {
1 : (localeInfo.DUEL_SUSPEND_AFFECT_POISION, "d:/ymir work/ui/skill/common/affect/poison.sub"),
2 : (localeInfo.DUEL_SUSPEND_AFFECT_SLOW, "d:/ymir work/ui/skill/common/affect/slow.sub"),
3 : (localeInfo.DUEL_SUSPEND_AFFECT_STUN, "d:/ymir work/ui/skill/common/affect/stun.sub"),
4 : (localeInfo.DUEL_SUSPEND_AFFECT_CRITICAL, "d:/ymir work/ui/skill/common/affect/critical.sub"),
5 : (localeInfo.DUEL_SUSPEND_AFFECT_PENETRATE, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
} # LIMIT = 8
INFO_TOOLTIP_LIST = [
localeInfo.DUEL_OPTION_TOOLTIP_LINE1,
localeInfo.DUEL_OPTION_TOOLTIP_LINE2,
]
def __init__(self):
ui.ScriptWindow.__init__(self)
self.toolTip = uiToolTip.ToolTip()
self.InfoToolTipButton = None
self.InfoToolTip = None
self.SuspendedAffectButton = {}
self.SuspendedAffectToolTip = {}
self.__LoadWindow()
def __del__(self):
ui.ScriptWindow.__del__(self)
def Show(self):
self.SetCenterPosition()
ui.ScriptWindow.Show(self)
self.SetTop()
def Hide(self):
wndMgr.Hide(self.hWnd)
def Close(self):
self.Hide()
def OnPressEscapeKey(self):
self.Close()
return True
def Destroy(self):
self.toolTip = None
self.InfoToolTipButton = None
self.InfoToolTip = None
self.SuspendedAffectButton = {}
self.SuspendedAffectToolTip = {}
def __LoadScript(self, fileName):
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, fileName)
def __LoadWindow(self):
try:
self.__LoadScript("UIScript/QuestionDuelOptionDialog.py")
except:
import exception
exception.Abort("QuestionDuelOptionDialog.__LoadWindow.__LoadScript")
try:
self.__BindObjects()
except:
import exception
exception.Abort("QuestionDuelOptionDialog.__LoadWindow.__BindObjects")
try:
self.__BindEvents()
except:
import exception
exception.Abort("QuestionDuelOptionDialog.__LoadWindow.__BindEvents")
def __BindObjects(self):
self.BoardMessage = self.GetChild("message")
self.AffectThinBoard = self.GetChild("affect_thinboard")
self.CloseButton = self.GetChild("close_button")
self.OptionButton1 = self.GetChild("option_button1")
self.OptionButton2 = self.GetChild("option_button2")
self.InfoToolTipButton = self.GetChild("info_tooltip_button")
self.__BindEvents()
def __BindEvents(self):
self.CloseButton.SetEvent(ui.__mem_func__(self.Close))
self.InfoToolTip = self.__CreateGameTypeToolTip(localeInfo.DUEL_OPTION_TOOLTIP_TITLE, self.INFO_TOOLTIP_LIST)
self.InfoToolTip.SetTop()
self.InfoToolTipButton.SetToolTipWindow(self.InfoToolTip)
self.__AppendSuspendedAffectBlock()
def __CreateGameTypeToolTip(self, title, descList):
toolTip = uiToolTip.ToolTip()
toolTip.SetTitle(title)
toolTip.AppendSpace(7)
for desc in descList:
toolTip.AutoAppendTextLine(desc)
toolTip.AlignHorizonalCenter()
toolTip.SetTop()
return toolTip
def __AppendSuspendedAffectBlock(self):
if not self.AFFECT_DICT:
return
for i in xrange(len(self.AFFECT_DICT)):
index = i + 1
if index > 8:
break
self.SuspendedAffectButton[index] = ui.Button()
self.SuspendedAffectButton[index].SetParent(self.AffectThinBoard)
self.SuspendedAffectButton[index].SetUpVisual(self.AFFECT_DICT[index][1])
self.SuspendedAffectButton[index].SetOverVisual(self.AFFECT_DICT[index][1])
self.SuspendedAffectButton[index].SetDownVisual(self.AFFECT_DICT[index][1])
self.SuspendedAffectButton[index].SetOverEvent(ui.__mem_func__(self.__AffectButtonOverIn), index)
self.SuspendedAffectButton[index].SetOverOutEvent(ui.__mem_func__(self.__AffectButtonOverOut), index)
if index <= self.AFFECT_PER_LINE:
self.SuspendedAffectButton[index].SetPosition((-self.AFFECT_GAP + 15) + self.AFFECT_GAP * index, 8)
else:
self.SuspendedAffectButton[index].SetPosition((-self.AFFECT_GAP + 15) + self.AFFECT_GAP * (index - self.AFFECT_PER_LINE), 8 + self.AFFECT_GAP + 2)
self.SuspendedAffectButton[index].Show()
def __AffectButtonOverIn(self, index):
tooltip = self.AFFECT_DICT[index][0]
arglen = len(str(tooltip))
pos_x, pos_y = wndMgr.GetMousePosition()
self.toolTip.ClearToolTip()
self.toolTip.SetThinBoardSize(11 * arglen)
self.toolTip.SetToolTipPosition(pos_x + 50, pos_y + 50)
self.toolTip.AppendTextLine(tooltip, 0xffffff00)
self.toolTip.Show()
def __AffectButtonOverOut(self, index):
self.toolTip.Hide()
def SetText(self, text):
self.BoardMessage.SetText(text)
def SetDuelOption1(self, event):
self.OptionButton1.SetEvent(event)
def SetDuelOption2(self, event):
self.OptionButton2.SetEvent(event)



