Today, I'm really hoping someone will be able to help me out!
While working on the first dialog for my map, I have come across an obstacle which prevents me from being able to listen to my custom buttons (defined in XML Layout).
> Dialog - Create a Modal dialog of size (800,750) at (0, 0) relative to Center of screen
> Dialog - Hide the background image, and Show (Last created dialog)
> Variable - Set votingDialog = (Last created dialog)
> Dialog - Create a Panel for dialog votingDialog using the Template VotingDialog/VotingDialogPanel
> Variable - Set votingDialogPanel = (Last created dialog item)
Trigger > Hooking up Voting Panel and Buttons:
Actions (continuation):
> Dialog - Hook up an existing Panel called VoteButtonsPanel in dialog item votingDialogPanel
> Variable - Set voteButtonsPanel = (Last created dialog item)
> General - For each integer i from 0 to 2 with increment 1, do (Actions)
-> Actions
->> In Custom Script - Hook up an existing Button called "ChoiceButton" + IntToString(i) in dialog item voteButtonsPanel
->> In Custom Script - Set votingDialogOptionButtons[i] = (Last created dialog item)
So far:
First, the Modal dialog is created and saved in the variable votingDialog.
Secondly, a Panel dialog item is created from template.
This also creates all the dialogs/frames the template contains!
This dialog item is then saved in votingDialogPanel.
Then, the VoteButtonsPanel is hooked up to it's variable voteButtonsPanel, from the main votingDialogPanel.
The voteButtonsPanel basically contains 3 ChoiceButtons (named ChoiceButton0, 1 and 2 respectively).
From there on I can hook up the 3 ChoiceButtons and save them into the votingDialogOptionButtons array for later use.
Trigger > Voting Dialog Event Listener:
Events:
> Dialog - Any Dialog Item is used by Player Any Player with event type Clicked
Actions:
> General - Switch (Actions) depending on (Used dialog item)
-> Cases
->> If (votingDialogOptionButtons[0])
->>> etc..
->> If (votingDialogOptionButtons[1])
->>> etc..
->> If (votingDialogOptionButtons[2])
->>> etc..
At last, the trigger which is supposed to handle the Dialog Events, but I'm not sure whether the hook ups went correctly, as execution doesn't seem to reach the Event Listener part.
Main problem if it isn't clear:
I can't get a Button created from XML Layout Template to properly Hook up with my Dialog Item variables, Seemingly leaving no option for me to interact much with Buttons created from a Template. No errors shown really.
If anyone knows, how can you use a Panel with Buttons defined in SC2Layout together with your triggers?
(The thing I'm trying to achieve here)
Thanks (at least) for taking time to read this!
(G2G fast, be back with more info later if needed)
Some hours later, after having saved and restarted the editor, my buttons have finally started working!
After working with the UI section of the editor, I suspect there might be some delay/glitchyness to it when it comes to applying the changes to the In-game test document.
I was about to answer that i faced the same problem and couldn't make it work. That is - buttons defined inside panel template didn't fire the trigger. In the end i resorted to creating buttons one by one. (I was still creating them from template though).
It's interesting that you made it work in the end, without doing anything specific. I guess i'll give it another chance at the next occasion.
it has more to do that the test map cache doesnt get updated for a variety of reasons. when such thing happens, go to maps/test/ and delet all files there
Hello Mappers,
Today, I'm really hoping someone will be able to help me out! While working on the first dialog for my map, I have come across an obstacle which prevents me from being able to listen to my custom buttons (defined in XML Layout).
The relevant details are as follows:
So far:
At last, the trigger which is supposed to handle the Dialog Events, but I'm not sure whether the hook ups went correctly, as execution doesn't seem to reach the Event Listener part.
Main problem if it isn't clear:
I can't get a Button created from XML Layout Template to properly Hook up with my Dialog Item variables, Seemingly leaving no option for me to interact much with Buttons created from a Template. No errors shown really.
If anyone knows, how can you use a Panel with Buttons defined in SC2Layout together with your triggers? (The thing I'm trying to achieve here)
Thanks (at least) for taking time to read this!
(G2G fast, be back with more info later if needed)
Greetz.
Update:
Some hours later, after having saved and restarted the editor, my buttons have finally started working!
After working with the UI section of the editor, I suspect there might be some delay/glitchyness to it when it comes to applying the changes to the In-game test document.
I was about to answer that i faced the same problem and couldn't make it work. That is - buttons defined inside panel template didn't fire the trigger. In the end i resorted to creating buttons one by one. (I was still creating them from template though).
It's interesting that you made it work in the end, without doing anything specific. I guess i'll give it another chance at the next occasion.
it has more to do that the test map cache doesnt get updated for a variety of reasons. when such thing happens, go to maps/test/ and delet all files there
Go play Antioch Chronicles Remastered!
Also, coming soon, Antioch Episode 3: Thoughts in Chaos!
Dont like mapster's ugly white? Try Mapster's Classic Skin!