op2_sdk:textdialogbox

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
op2_sdk:textdialogbox [2016/03/28 18:15] vagabondop2_sdk:textdialogbox [2016/12/28 19:03] (current) vagabond
Line 1: Line 1:
 ====== In Game Text Dialog Box ====== ====== In Game Text Dialog Box ======
  
-A text dialog box can be opened when a new colony mission is started to give background story and mission briefings. +The Outpost 2 SDK supports adding custom dialog boxes during single player scenarios. Often dialog boxes are used to provide mission briefings or background story for colony missions. Sierra's odasl library can format dialog boxes to match the Outpost 2 UI theme.
  
-Creating the text dialog box programmatically requires the following steps+Creating an Outpost themed text dialog box requires the following steps:
  
   * Write up the briefing/backstory in rich text format (RTF).   * Write up the briefing/backstory in rich text format (RTF).
Line 19: Line 19:
 Typically, the RTF file is saved as briefing.rtf and added to the root directory of the scenario's project. Typically, the RTF file is saved as briefing.rtf and added to the root directory of the scenario's project.
  
-**Note:** //Although Microsoft Word can create and save RTF documents, it is not recommended. Microsoft Word adds large amounts of metadata to the document that is not necessary for Outpost 2, typically increasing a small amount of text from about 3 kb to about 50 kb. This file size increase will carry into the compiled DLL.//+**Note:** Although Microsoft Word can create and save RTF documents, it is not recommended. Microsoft Word adds large amounts of metadata to the document that is not necessary for Outpost 2, typically increasing a small amount of text from about 3 kb to about 50 kb. This file size increase will carry into the compiled DLL.
  
 **Example RTF file** **Example RTF file**
Line 50: Line 50:
 To add a resource script file and associated resource header: To add a resource script file and associated resource header:
  
-  - Right click on your project in the solution explorer. -> Add -> New Item... -> Visual C++ -> Resource -> Resource File (.rc) -> Add.+  - Right click on your project in the solution explorer. -> Add -> New Item... -> Visual C++ -> Resource -> Resource File (.rc) -> Add. (Using the default filename is fine.)
  
-Resource Scripts by default is placed in the Resource Files filter in the Solution Explorer. Use the Solution Explorer (or your favorite text editor) to open the file file in text view. You can also access the Resource Script from the Visual Studio Resource View, which defaults to opening on the left side of Visual Studio. The Resource View allows graphical depiction of Dialog Boxes defined in the resource script file. Alternative programs like Resource Hacker can also load Resource Scripts.+By default resource Scripts are placed in the Resource Files filter in the Solution Explorer. Use the Solution Explorer (or your favorite text editor) to open the file file in text view. You can also access the Resource Script from the Visual Studio Resource View, which defaults to opening on the left side of Visual Studio. The Resource View allows graphical depiction of Dialog Boxes defined in the resource script file. Alternative programs like Resource Hacker can also load Resource Scripts.
  
 Below is a sample resource script file that provides a dialog box before a scenario is initialized. The dialog box will include the contents of briefing.rtf in a rich text box. Below is a sample resource script file that provides a dialog box before a scenario is initialized. The dialog box will include the contents of briefing.rtf in a rich text box.
Line 239: Line 239:
 **Note:** //0x prefix on a number indicates it is in hexadecimal form.// **Note:** //0x prefix on a number indicates it is in hexadecimal form.//
  
 +**Resource Header Example**
 <code cpp> <code cpp>
 //{{NO_DEPENDENCIES}} //{{NO_DEPENDENCIES}}
 // Microsoft Visual C++ generated include file. // Microsoft Visual C++ generated include file.
-// Used by RisingFromTheAshes.rc+// Used by Resource.rc
 // //
 #define IDR_MISSIONTEXT                 102 #define IDR_MISSIONTEXT                 102
Line 267: Line 268:
 Once the resource script and resource header have been included, the briefing screen must be initialized from the code. You will also have to include the Sierra library odasl in your project to ensure the dialog is formatted similar to other Outpost 2 menus. Once the resource script and resource header have been included, the briefing screen must be initialized from the code. You will also have to include the Sierra library odasl in your project to ensure the dialog is formatted similar to other Outpost 2 menus.
  
-  - Add odasl.h and odasl.lib to your project. Typically, files are placed in a subfolder/project filter.+  - Add a reference to the Outpost2Dialog project, which can be found with the rest of the APIs. odasl.h and odasl.lib are contained in this project and are required to skin the Dialog Window in the Outpost 2 theme.
   - Create a reference to the DLL instance from DllMain (HINSTANCE hInst).   - Create a reference to the DLL instance from DllMain (HINSTANCE hInst).
   - Add code to initialize and open the window. Typically this code is placed in it's own cpp file named briefing.cpp.   - Add code to initialize and open the window. Typically this code is placed in it's own cpp file named briefing.cpp.
Line 376: Line 377:
  - //Go Back to [[op2_sdk:software_development_kit_sdk|Outpost 2 Mapmaking]]//\\  - //Go Back to [[op2_sdk:software_development_kit_sdk|Outpost 2 Mapmaking]]//\\
  - //Go Back to [[outpost_2:outpost_2|Outpost 2 Main page]]//\\  - //Go Back to [[outpost_2:outpost_2|Outpost 2 Main page]]//\\
- - //Go Back to [[http://wiki.outpostuniverse.org/doku.php?id=start|Wiki Home Page]]//+ - //Go Back to [[http://wiki.outpost2.net/doku.php?id=start|Wiki Home Page]]//
  • op2_sdk/textdialogbox.1459188926.txt.gz
  • Last modified: 2016/03/28 18:15
  • by vagabond