multiple choice window question

Caesium

Radiant!
Joined
Jan 14, 2006
Messages
526
Hi!

I'm trying to merge some modifications.
While doing this, I had an idea.
How would it be, if there was a menu popup before the first turn where I could choose, which integrated modification i would like to activate for the game and which not.
My vision is a multiple choice window that returns a value for each modification to the CvEventManager.py; from this point I know how to program this.
But how to program a popup window with multiple choice options that returns these values?
If someone's got a hint, I would be very pleased.
 
I creatd a popup, but i don't know, how to get the values of the checked and unchecked boxes

Is there anybody who can help me with this?

PHP:
from CvPythonExtensions import *
import CvUtil
import PyHelpers
import Popup as PyPopup
import CvCustomEventManager
import random
import ScreenInput
from CvPythonExtensions import *
			
# globals
gc = CyGlobalContext()
localText = CyTranslator()
UserProfile = CyUserProfile()

class ModChooser:
	def __init__(self):
		self.list = []

	def onGameStart(self, argslist):
		'Mods wählen'
		CvUtil.pyPrint('Test')
		CvCustomEventManager.CvCustomEventManager().beginEvent(7505)

			
	def eventModChooserBegin(self, argslist):
		popup = PyPopup.PyPopup(7505, EventContextTypes.EVENTCONTEXT_ALL)
		popup.setHeaderString('ModChooser')
		popup.createPythonCheckBoxes(12, 1)
		popup.setCheckBoxText(0, 'GreenMod', 1)
		popup.setCheckBoxText(1, 'AbandonRazeDemolish', 1)
		popup.setCheckBoxText(2, 'FreeTech', 1)
		popup.setCheckBoxText(3, 'Terraform', 1)
		popup.setCheckBoxText(4, 'SettlerReligion', 1)
		popup.setCheckBoxText(5, 'CulturalDecay', 1)
		popup.setCheckBoxText(6, 'RealFort', 1)
		popup.setCheckBoxText(7, 'Caravan', 1)
		popup.setCheckBoxText(8, 'TechErforscht', 1)
		popup.setCheckBoxText(9, 'Leader', 1)
		popup.setCheckBoxText(10, 'Adaption', 1)
		popup.setCheckBoxText(11, 'CivII', 1)
		popup.addButton("OK")
		popup.launch(False, PopupStates.POPUPSTATE_IMMEDIATE)
		return


	def eventModChooserApply(self, playerID, userData, popupReturn):
		return
 
Back
Top Bottom