Trying to merge the latest version of this into HR, and BUG is having a hissy fit about this section in CvEventManager.py:
BUG wants these events registered with it's own EventManager, but as usual it's a stupidly unintuitive process and I just can't get it to work. I'm slowly stripping the unneeded and frustrating parts of BUG out of HR, and while I've got rid of their GameUtils override, their EventManager stuff is a lot more entangled. My question for you though, is where and how are these events called? They're not in BTS' default EventManager and I can't find reference to them in any of the Platy Builder files (though I can see where the popups for them are created).
Code:
def __eventEditUnitNameApply(self, playerID, userData, popupReturn):
'Edit Unit Name Event'
iUnitID = userData[0]
unit = gc.getPlayer(playerID).getUnit(iUnitID)
newName = popupReturn.getEditBoxString(0)
if (len(newName) > 25):
newName = newName[:25]
unit.setName(newName)
## Platy Builder ##
if CyGame().GetWorldBuilderMode():
WBUnitScreen.WBUnitScreen().placeStats()
WBUnitScreen.WBUnitScreen().placeCurrentUnit()
def __eventWBLandmarkPopupBegin(self, argsList):
CyEngine().addLandmarkPopup(CyInterface().getMouseOverPlot())
return
def __eventWBLandmarkPopupApply(self, playerID, userData, popupReturn):
if (popupReturn.getEditBoxString(0)):
if (len(popupReturn.getEditBoxString(0))):
CyEngine().addLandmarkPopup(CyInterface().getMouseOverPlot())
return
def __eventWBPlayerScriptPopupApply(self, playerID, userData, popupReturn):
sScript = popupReturn.getEditBoxString(0)
gc.getPlayer(userData[0]).setScriptData(CvUtil.convertToStr(sScript))
WBPlayerScreen.WBPlayerScreen().placeScript()
return
def __eventWBCityScriptPopupApply(self, playerID, userData, popupReturn):
sScript = popupReturn.getEditBoxString(0)
pCity = gc.getPlayer(userData[0]).getCity(userData[1])
pCity.setScriptData(CvUtil.convertToStr(sScript))
WBCityEditScreen.WBCityEditScreen().placeStats()
return
def __eventWBUnitScriptPopupApply(self, playerID, userData, popupReturn):
sScript = popupReturn.getEditBoxString(0)
pUnit = gc.getPlayer(userData[0]).getUnit(userData[1])
pUnit.setScriptData(CvUtil.convertToStr(sScript))
WBUnitScreen.WBUnitScreen().placeScript()
return
def __eventWBScriptPopupBegin(self):
return
def __eventWBGameScriptPopupApply(self, playerID, userData, popupReturn):
sScript = popupReturn.getEditBoxString(0)
CyGame().setScriptData(CvUtil.convertToStr(sScript))
WBGameDataScreen.WBGameDataScreen().placeScript()
return
def __eventWBPlotScriptPopupApply(self, playerID, userData, popupReturn):
sScript = popupReturn.getEditBoxString(0)
pPlot = CyMap().plot(userData[0], userData[1])
pPlot.setScriptData(CvUtil.convertToStr(sScript))
WBPlotScreen.WBPlotScreen().placeScript()
return
BUG wants these events registered with it's own EventManager, but as usual it's a stupidly unintuitive process and I just can't get it to work. I'm slowly stripping the unneeded and frustrating parts of BUG out of HR, and while I've got rid of their GameUtils override, their EventManager stuff is a lot more entangled. My question for you though, is where and how are these events called? They're not in BTS' default EventManager and I can't find reference to them in any of the Platy Builder files (though I can see where the popups for them are created).