Differences

This shows you the differences between two versions of the page.

Link to this comparison view

modding_ui_control [2012/05/03 11:58]
184.70.162.50 created
modding_ui_control [2012/05/03 11:59] (current)
184.70.162.50
Line 5: Line 5:
 Once you have your screen, placed in the DATA\UI folder of your custom campaign, you can add a script line to show it in battle. This would be called at the very start, and one way to do this would be to add something of the form: Once you have your screen, placed in the DATA\UI folder of your custom campaign, you can add a script line to show it in battle. This would be called at the very start, and one way to do this would be to add something of the form:
  
-[code]+<code>
 if( GetTurn() == -1 ) if( GetTurn() == -1 )
 { {
- ShowUIScreen("MyUIScreenObject", "", "") ;+     ShowUIScreen("MyUIScreenObject", "", "") ;
 } }
-[/code]+</code>
  
 in the StartTurn function of the mission script. in the StartTurn function of the mission script.
  
 You now can show your UI control. But how to get the button actions etc? You will need a script connected to the UI control. First add a line of the form You now can show your UI control. But how to get the button actions etc? You will need a script connected to the UI control. First add a line of the form
 +<code>
 SCRIPT MyUIControlScript.bsf SCRIPT MyUIControlScript.bsf
 +</code>
 to the root object of your UI control in the UI TXT file. Then create the bsf file in the same folder as your UI file. You will need to add a function called to the root object of your UI control in the UI TXT file. Then create the bsf file in the same folder as your UI file. You will need to add a function called
 +<code>
 FUNCTION UI_OBJ_HANDLE(data, event, id) FUNCTION UI_OBJ_HANDLE(data, event, id)
 +</code>
 to catch button presses etc. You can check out the BSF files in the PLUGIN folder for examples on how to do so, but you will be using the IsUIObject function to determine the button pressed. You can also add a UI_OBJ_INIT function to the script if you wish, this is called when the UI object is loaded. to catch button presses etc. You can check out the BSF files in the PLUGIN folder for examples on how to do so, but you will be using the IsUIObject function to determine the button pressed. You can also add a UI_OBJ_INIT function to the script if you wish, this is called when the UI object is loaded.
  
modding_ui_control.txt · Last modified: 2012/05/03 11:59 by 184.70.162.50
 
Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki