HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Dialog Issues

09-18-2006, 03:34 AM#1
Limb_Smasher
Situtation:
when you select a unit a dialog box appears and gives you 2 options, yes or no. when you choose no you have the ability to select the unit again and have the same opprotunity to decide between Yes or No.

Problem:
When you select the unit for the second time you get the option for yes and no and then another yes and no. for the third time you get 3 yes's and 3 no's and so on and so on.

How do i prevent the dialog box from growing?
09-18-2006, 03:48 AM#2
The_AwaKening
There's a problem in your trigger, but no one will be able to help if you don't post the related triggers.
09-18-2006, 03:59 AM#3
Jazradel
It sounds like your adding the buttons to the dialog everytime you select it.

You either have to remove the buttons when you hide the dialog or only add them once (a initialization trigger then show/hide the dialog as needed).
09-18-2006, 04:06 AM#4
Limb_Smasher
Alright sorry about that i didnt know that showing the trigger would be needed.

Quote:
Events
Player - Player 1 (Red) Selects a unit
Conditions
(Unit-type of (Triggering unit)) Equal to Unit
Actions
Dialog - Change the title of DialogSelection[0] to Title
Dialog - Create a dialog button for DialogSelection[0] labelled ButtonTitle
Set ButtonYes[0] = (Last created dialog Button)
Dialog - Create a dialog button for DialogSelection[0] labelled ButtonTitle
Set ButtonNo[0] = (Last created dialog Button)
Dialog - Show DialogSelection[0] for Player 1 (Red)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Clicked dialog button) Equal to ButtonYes[0]
Then - Actions
Dialog - Clear DialogSelection[0]
Dialog - Hide DialogSelection[0] for Player 1 (Red)
Else - Actions
Do nothing

i just removed the triggers that had nothing to do with the problem so it would be easier to read.
09-18-2006, 09:43 AM#5
oNdizZ
for a quick and simple solution, add a
Dialog - Clear DialogSelection[0]
to the top of the actions (=above Dialog - Change the title of Dia...)