As it puts in the description, being in the window to choose empire in my case (jinno and shinsoo) does not let me click on either.
I leave the root / introempire.py and the selectempirewindow.py
See if someone finds the fault.
No errors appear on sysser.
INTROEMPIRE
import ui
import net
import wndMgr
import dbg
import app
import event
import _weakref
import localeInfo
import uiScriptLocale
import uiCommon
class SelectEmpireWindow(ui.ScriptWindow):
class EmpireButton(ui.Window):
def __init__(self, owner, arg):
ui.Window.__init__(self)
self.owner = owner
self.arg = arg
def OnMouseOverIn(self):
self.owner.OnOverInEmpire(self.arg)
def OnMouseOverOut(self):
self.owner.OnOverOutEmpire(self.arg)
def OnMouseLeftButtonDown(self):
if self.owner.empireID != self.arg:
self.owner.OnSelectEmpire(self.arg)
def __init__(self, stream):
ui.ScriptWindow.__init__(self)
net.SetPhaseWindow(net.PHASE_WINDOW_EMPIRE, self)
self.stream = stream
self.empireID = 1
self.empireArea = {}
self.empireAreaButton = {}
self.empireAreaCurAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_C:0.0 }
self.empireAreaDestAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_C:0.0 }
def __del__(self):
ui.ScriptWindow.__del__(self)
net.SetPhaseWindow(net.PHASE_WINDOW_EMPIRE, 0)
def Close(self):
self.ClearDictionary()
self.selectButton = None
self.exitButton = None
self.empireArea = None
self.KillFocus()
self.Hide()
app.HideCursor()
event.Destroy()
def Open(self):
self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
self.SetWindowName("SelectEmpireWindow")
self.Show()
self.__LoadScript("d:/ymir work/interface/wybor_krolestwa/SelectEmpireWindow.py")
self.OnSelectEmpire(self.empireID)
self.__CreateButtons()
app.ShowCursor()
def __CreateButtons(self):
for key, img in self.empireArea.items():
img.SetAlpha(0.0)
(x, y) = img.GetGlobalPosition()
btn = self.EmpireButton(_weakref.proxy(self), key)
btn.SetParent(self)
btn.SetPosition(x, y)
btn.SetSize(img.GetWidth(), img.GetHeight())
btn.Show()
self.empireAreaButton[key] = btn
def OnOverInEmpire(self, arg):
self.empireAreaDestAlpha[arg] = 1.0
def OnOverOutEmpire(self, arg):
if arg != self.empireID:
self.empireAreaDestAlpha[arg] = 0.0
def OnSelectEmpire(self, arg):
for key in self.empireArea.keys():
self.empireAreaDestAlpha[key] = 0.0
self.empireAreaDestAlpha[arg] = 1.0
self.empireID = arg
img = {1: "shinsoo", 3:"jinno"}
def __LoadScript(self, fileName):
try:
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, fileName)
except:
import exception
exception.Abort("SelectEmpireWindow.__LoadScript.LoadObject")
try:
self.wybieram_jinno = self.GetChild("WybierzJinno")
self.wybieram_shinsoo = self.GetChild("WybierzShinsoo")
self.exit = self.GetChild("exit")
except:
import exception
exception.Abort("SelectEmpireWindow.__LoadScript.BindObject")
self.wybieram_jinno.SetEvent(ui.__mem_func__(self._wybieram_jinno))
self.wybieram_shinsoo.SetEvent(ui.__mem_func__(self._wybieram_shinsoo))
self.exit.SetEvent(ui.__mem_func__(self.OnPressExitKey))
def _wybieram_jinno(self):
self.empireID = 3
self.Wybieranie()
def _wybieram_shinsoo(self):
self.empireID = 1
self.Wybieranie()
def Wybieranie(self):
EMPIRE_NAME = {
net.EMPIRE_A : "Shinsoo",
net.EMPIRE_B : "",
net.EMPIRE_C : "Jinno"
}
questionDialog = uiCommon.QuestionDialog()
questionDialog.SetText(" "+EMPIRE_NAME[self.empireID]+"'ya katýlmak istermisin?")
questionDialog.SetAcceptEvent(ui.__mem_func__(self.__krolestwo_open))
questionDialog.SetCancelEvent(ui.__mem_func__(self.__krolestwo_close))
questionDialog.Open()
self.questionDialog = questionDialog
def __krolestwo_open(self):
self.questionDialog.Hide()
net.SendSelectEmpirePacket(self.empireID)
self.stream.SetCreateCharacterPhase()
def __krolestwo_close(self):
self.questionDialog.Hide()
def ClickExitButton(self):
self.stream.SetLoginPhase()
def OnUpdate(self):
self.__UpdateAlpha(self.empireArea, self.empireAreaCurAlpha, self.empireAreaDestAlpha)
def __UpdateAlpha(self, dict, curAlphaDict, destAlphaDict):
for key, img in dict.items():
curAlpha = curAlphaDict[key]
destAlpha = destAlphaDict[key]
if abs(destAlpha - curAlpha) / 10 > 0.0001:
curAlpha += (destAlpha - curAlpha) / 7
else:
curAlpha = destAlpha
curAlphaDict[key] = curAlpha
img.SetAlpha(curAlpha)
def OnPressEscapeKey(self):
self.ClickExitButton()
return TRUE
def OnPressExitKey(self):
self.ClickExitButton()
return TRUE
class ReselectEmpireWindow(SelectEmpireWindow):
def ClickSelectButton(self):
net.SendSelectEmpirePacket(self.empireID)
self.stream.SetCreateCharacterPhase()
def ClickExitButton(self):
self.stream.SetSelectCharacterPhase()
//////////////////////////////////////////////////////////////////////////////
SELECTEMPIREWINDOW
window = {
"name" : "SelectEmpireWindow",
"x" : 0,
"y" : 0,
"width" : SCREEN_WIDTH,
"height" : SCREEN_HEIGHT,
"children" :
(
{
"name" : "BackGround",
"type" : "expanded_image",
"x" : 0,
"y" : 0,
"x_scale" : float(SCREEN_WIDTH) / 1280.0,
"y_scale" : float(SCREEN_HEIGHT) / 720.0,
"image" : "d:/ymir work/interface/wybor_krolestwa/tlo.jpg",
"children" :
(
{"name":"LogoSerwera","type":"image","x":20,"y":-210,"horizontal_align":"center","image":"d:/ymir work/interface/logowanie/logo.tga","horizontal_align":"center","vertical_align":"center",},
{
"name":"Shinsoo",
"type":"image",
"x" : -200,
"y":SCREEN_HEIGHT/9,
"horizontal_align":"center",
"vertical_align":"center",
"image":"d:/ymir work/interface/wybor_krolestwa/shinsoo.tga",
"children":
(
{
"name" : "WybierzShinsoo",
"type" : "button",
"x" : 0,
"y":135,
"horizontal_align":"center",
"default_image" : "d:/ymir work/interface/wybor_krolestwa/wybierz_01.tga",
"over_image" : "d:/ymir work/interface/wybor_krolestwa/wybierz_02.tga",
"down_image" : "d:/ymir work/interface/wybor_krolestwa/wybierz_02.tga",
},
),
},
{
"name":"Jinno",
"type":"image",
"x" : 200,
"y":SCREEN_HEIGHT/9,
"horizontal_align":"center",
"vertical_align":"center",
"image":"d:/ymir work/interface/wybor_krolestwa/jinno.tga",
"children":
(
{
"name" : "WybierzJinno",
"type" : "button",
"x" : 0,
"y":135,
"horizontal_align":"center",
"default_image" : "d:/ymir work/interface/wybor_krolestwa/wybierz_01.tga",
"over_image" : "d:/ymir work/interface/wybor_krolestwa/wybierz_02.tga",
"down_image" : "d:/ymir work/interface/wybor_krolestwa/wybierz_02.tga",
},
),
},
{"name":"exit","type":"button","x":50,"y":15,"default_image":"d:/ymir work/interface/logowanie/wyjdz_01.tga","over_image":"d:/ymir work/interface/logowanie/wyjdz_02.tga","down_image":"d:/ymir work/interface/logowanie/wyjdz_02.tga", "horizontal_align":"right",},
),
},
),
}