Auswahl Reich - code python

07/30/2015 14:12 historia1233#1
Hallo. Ich möchte hinzufugen neue button und ich will werde das war immer noch ausgewählt, weil ich will hinzufugen auswahl Reich . Ich würde für den Code python fragen. Sehr bitte. Vielen dank.

Entschuldigung, aber meine Deutsch nicht so gut. xd
07/30/2015 16:06 Poccix#2
Deine Deutsch gar nicht gut, richtig.
Can you write your question in english? :)
07/30/2015 16:40 cersus2015#3
er meint ob mann noch ein reich oder ein button fürs reich hinzufügen kann
07/30/2015 16:46 historia1233#4
I must add choice kingdoms. I don't make selection. I want to do choice to one kingdom was marked permanently (pressed). I ask for the code in python. Thanks. :)
07/30/2015 19:29 Poccix#5
If i'm right, you want to say "You must select this kingdom - all other are disabled",
so you can use this to do that.

-------
introempire.py search for:
Code:
		self.empireID=app.GetRandom(1, 3)
replace with:
Code:
		self.empireID = 3
1 = Red Kingdom / 2 = Yellow Kingdom / 3 = Blue Kingdom

search for:
Code:
	class EmpireButton(ui.Window):
replace complete function with:
Code:
	class EmpireButton(ui.Window):
		def __init__(self, owner, arg):
			ui.Window.__init__(self)
			self.owner = owner
			self.arg = arg
			self.disabled = None
			
		def OnMouseOverIn(self):
			if self.disabled:
				return
			self.owner.OnOverInEmpire(self.arg)
			
		def OnMouseOverOut(self):
			if self.disabled:
				return
			self.owner.OnOverOutEmpire(self.arg)
			
		def OnMouseLeftButtonDown(self):
			if self.disabled:
				return
			if self.owner.empireID != self.arg:
				self.owner.OnSelectEmpire(self.arg)

		def DisableKingdom(self):
			self.disabled = True
search for:
Code:
			self.empireAreaButton[key] = btn
add under this:
Code:
			if key != self.empireID:
				btn.DisableKingdom()
search for:
Code:
			self.leftButton		= GetObject("left_button")
			self.rightButton	= GetObject("right_button")
add under this:
Code:
			self.leftButton.Hide()
			self.rightButton.Hide()