Since COL has no wonders there are no movies for any building in game. That provokes a bug when opening the Wonder Movie Popup (ctrl + shift + W) because of 2 reasons:
Here is a modification of that popup to solve both:
Now there is a cancel button (do nothing except close the popup).
Default selection is NONE which will not play anything if there are no movies available.
This works for COL and BTS (designed for mods which disabled wonder movies).
Both files contained in *\Assets\Python
Text in green are the additions, the rest is Vanilla code. No other changes done, only added.
In CvDebugTools.py:
In CvEventManager.py:
- You can not close the popup without performing an action (Cancel).
- The list of available movies is NULL so there is a NULL default selection and that provokes an inmediate CTD when trying to play a NULL movie.
Here is a modification of that popup to solve both:
Now there is a cancel button (do nothing except close the popup).
Default selection is NONE which will not play anything if there are no movies available.
This works for COL and BTS (designed for mods which disabled wonder movies).
Both files contained in *\Assets\Python
Text in green are the additions, the rest is Vanilla code. No other changes done, only added.
In CvDebugTools.py:
Code:
def wonderMovie( self ):
'ShowWonder Movie'
popup = CyPopup(CvUtil.EventShowWonder, EventContextTypes.EVENTCONTEXT_ALL, True)
popup.setHeaderString( "Wonder Movie", CvUtil.FONT_CENTER_JUSTIFY )
popup.createPullDown(0)
[COLOR="green"] #DOANE Wonder Movie Fix: Check for no selection to avoid crashes if movie list is None
popup.addPullDownString( "NONE", -1, 0 ) #Add no Movie as default selection (ID = -1)
#END DOANE[/COLOR]
for i in range(gc.getNumBuildingInfos()):
szMovieFile = gc.getBuildingInfo(i).getMovie()
if (szMovieFile != None and len(szMovieFile) > 0):
popup.addPullDownString( gc.getBuildingInfo(i).getDescription(), i, 0 )
[COLOR="green"] #DOANE Wonder Movie Fix
popup.addSeparator()
popup.addButton("Cancel")
popup.addSeparator()
#END DOANE[/COLOR]
popup.launch(true, PopupStates.POPUPSTATE_IMMEDIATE)
In CvEventManager.py:
Code:
def __eventShowWonderApply(self, playerID, netUserData, popupReturn):
'Wonder Movie Apply'
[COLOR="green"]#DOANE Wonder Movie Fix: Check for no selection to avoid crashes if movie list is NULL
autoIdx = popupReturn.getButtonClicked()
wonderID = popupReturn.getSelectedPullDownValue( 0 )
if (autoIdx == 0): #Cancel button
return
if (wonderID == -1): #If no Movie is selected (ID = -1), exit
return
#END DOANE[/COLOR]
if (getChtLvl() > 0):
CvDebugTools.CvDebugTools().applyWonderMovie( (popupReturn) )