<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.thedarkmod.com/index.php?action=history&amp;feed=atom&amp;title=GUI_Scripting%3A_Preprocessor_Directives</id>
	<title>GUI Scripting: Preprocessor Directives - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.thedarkmod.com/index.php?action=history&amp;feed=atom&amp;title=GUI_Scripting%3A_Preprocessor_Directives"/>
	<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_Preprocessor_Directives&amp;action=history"/>
	<updated>2026-04-18T07:27:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_Preprocessor_Directives&amp;diff=29804&amp;oldid=prev</id>
		<title>Geep: /* #Defines with Macro Parameters */  TIP about space(s) before &quot;\&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_Preprocessor_Directives&amp;diff=29804&amp;oldid=prev"/>
		<updated>2022-08-22T18:46:50Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;#Defines with Macro Parameters: &lt;/span&gt;  TIP about space(s) before &amp;quot;\&amp;quot;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:46, 22 August 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l174&quot;&gt;Line 174:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 174:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This highlights some of the #define macro language features:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This highlights some of the #define macro language features:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* A backslash at the end of a line indicates the #define continues on the next line.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* A backslash at the end of a line indicates the #define continues on the next line&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. TIP: One or more spaces before the &quot;\&quot; helps keep the parser from getting confused&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Given a passed template parameter, in this case &amp;quot;rootWindow&amp;quot;:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Given a passed template parameter, in this case &amp;quot;rootWindow&amp;quot;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** A &amp;quot;#&amp;quot; before it is a &amp;quot;stringizing operator&amp;quot;, which causes the corresponding actual argument to be enclosed in double quotes.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** A &amp;quot;#&amp;quot; before it is a &amp;quot;stringizing operator&amp;quot;, which causes the corresponding actual argument to be enclosed in double quotes.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Geep</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_Preprocessor_Directives&amp;diff=29712&amp;oldid=prev</id>
		<title>Geep: Geep moved page GUi Scripting: Preprocessor Directives to GUI Scripting: Preprocessor Directives: typo</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_Preprocessor_Directives&amp;diff=29712&amp;oldid=prev"/>
		<updated>2022-07-21T18:51:51Z</updated>

		<summary type="html">&lt;p&gt;Geep moved page &lt;a href=&quot;/index.php?title=GUi_Scripting:_Preprocessor_Directives&quot; class=&quot;mw-redirect&quot; title=&quot;GUi Scripting: Preprocessor Directives&quot;&gt;GUi Scripting: Preprocessor Directives&lt;/a&gt; to &lt;a href=&quot;/index.php?title=GUI_Scripting:_Preprocessor_Directives&quot; title=&quot;GUI Scripting: Preprocessor Directives&quot;&gt;GUI Scripting: Preprocessor Directives&lt;/a&gt;: typo&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:51, 21 July 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Geep</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_Preprocessor_Directives&amp;diff=29648&amp;oldid=prev</id>
		<title>Geep: /* #Define Naming Conventions in TDM */</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_Preprocessor_Directives&amp;diff=29648&amp;oldid=prev"/>
		<updated>2022-07-13T20:15:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;#Define Naming Conventions in TDM&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:15, 13 July 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l180&quot;&gt;Line 180:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 180:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===#Define Naming Conventions in TDM===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===#Define Naming Conventions in TDM===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Routinely, #defined item names are all-upper-case, with underscore as the word separator.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you need to #define the same color vector in two ways, so it can be used to initialize a property and also in a transition statement, one convention is to name them the same, except for a leading &amp;quot;S&amp;quot; (for &amp;quot;string&amp;quot;), e.g.:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you need to #define the same color vector in two ways, so it can be used to initialize a property and also in a transition statement, one convention is to name them the same, except for a leading &amp;quot;S&amp;quot; (for &amp;quot;string&amp;quot;), e.g.:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #define INACTIVE_COLOR		0,0,0,0.50&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #define INACTIVE_COLOR		0,0,0,0.50&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Geep</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_Preprocessor_Directives&amp;diff=29646&amp;oldid=prev</id>
		<title>Geep: /* See Also */</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_Preprocessor_Directives&amp;diff=29646&amp;oldid=prev"/>
		<updated>2022-07-13T17:51:05Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;See Also&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:51, 13 July 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l189&quot;&gt;Line 189:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 189:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See Also==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See Also==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* More about [https://docs.microsoft.com/en-us/cpp/preprocessor/c-cpp-preprocessor-reference?view=msvc-170 C/C++ prepocessing syntax and semantics]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* More about [https://docs.microsoft.com/en-us/cpp/preprocessor/c-cpp-preprocessor-reference?view=msvc-170 C/C++ prepocessing syntax and semantics]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* A [https://forums.thedarkmod.com/index.php?/topic/20100-idtech-4-gui-scripting/#comment-439769 2019 forum post from HMart] discussed the problems with #defines for color vectors, and alternatives like [GUI Scripting: User Variables | user variables].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* A [https://forums.thedarkmod.com/index.php?/topic/20100-idtech-4-gui-scripting/#comment-439769 2019 forum post from HMart] discussed the problems with #defines for color vectors, and alternatives like &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[&lt;/ins&gt;[GUI Scripting: User Variables | user variables&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]&lt;/ins&gt;].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Geep</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_Preprocessor_Directives&amp;diff=29645&amp;oldid=prev</id>
		<title>Geep: Add &quot;#Define Naming Conventions in TDM&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_Preprocessor_Directives&amp;diff=29645&amp;oldid=prev"/>
		<updated>2022-07-13T17:49:57Z</updated>

		<summary type="html">&lt;p&gt;Add &amp;quot;#Define Naming Conventions in TDM&amp;quot;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:49, 13 July 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l178&quot;&gt;Line 178:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 178:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** A &amp;quot;#&amp;quot; before it is a &amp;quot;stringizing operator&amp;quot;, which causes the corresponding actual argument to be enclosed in double quotes.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** A &amp;quot;#&amp;quot; before it is a &amp;quot;stringizing operator&amp;quot;, which causes the corresponding actual argument to be enclosed in double quotes.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** A &amp;quot;##&amp;quot; is a &amp;quot;token-pasting operator&amp;quot;. Placed between tokens (either with actual arguments or literals), it causes concatenation to form another token.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** A &amp;quot;##&amp;quot; is a &amp;quot;token-pasting operator&amp;quot;. Placed between tokens (either with actual arguments or literals), it causes concatenation to form another token.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;===#Define Naming Conventions in TDM===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If you need to #define the same color vector in two ways, so it can be used to initialize a property and also in a transition statement, one convention is to name them the same, except for a leading &quot;S&quot; (for &quot;string&quot;), e.g.:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; #define INACTIVE_COLOR		0,0,0,0.50&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; #define SINACTIVE_COLOR		&quot;0 0 0 0.50&quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If #defining items for the main menu system, the prefix &quot;MM_&quot; is commonplace:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; #define MM_BUTTON_FONTSCALE		0.32&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See Also==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See Also==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* More about [https://docs.microsoft.com/en-us/cpp/preprocessor/c-cpp-preprocessor-reference?view=msvc-170 C/C++ prepocessing syntax and semantics]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* More about [https://docs.microsoft.com/en-us/cpp/preprocessor/c-cpp-preprocessor-reference?view=msvc-170 C/C++ prepocessing syntax and semantics]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* A [https://forums.thedarkmod.com/index.php?/topic/20100-idtech-4-gui-scripting/#comment-439769 2019 forum post from HMart] discussed the problems with #defines for color vectors, and alternatives like [GUI Scripting: User Variables | user variables].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* A [https://forums.thedarkmod.com/index.php?/topic/20100-idtech-4-gui-scripting/#comment-439769 2019 forum post from HMart] discussed the problems with #defines for color vectors, and alternatives like [GUI Scripting: User Variables | user variables].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Geep</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_Preprocessor_Directives&amp;diff=29596&amp;oldid=prev</id>
		<title>Geep: create this article</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_Preprocessor_Directives&amp;diff=29596&amp;oldid=prev"/>
		<updated>2022-07-03T03:02:03Z</updated>

		<summary type="html">&lt;p&gt;create this article&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;This page is part of a series. See [[GUI Scripting Language]] for overview.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Preprocessor directives, familiar from C, can be used inside TDM .gui files. The engine handles these in Parser.cpp. Seen throughout the TDM core are:&lt;br /&gt;
* #include &amp;#039;&amp;#039;path&amp;#039;&amp;#039;&lt;br /&gt;
* #define &amp;#039;&amp;#039;name &amp;lt;token-string&amp;gt;&amp;#039;&amp;#039;&lt;br /&gt;
* #define &amp;#039;&amp;#039;name&amp;#039;&amp;#039;(&amp;#039;&amp;#039;ID1,...,IDn&amp;#039;&amp;#039;) &amp;#039;&amp;#039;&amp;lt;token-string referencing IDs&amp;gt;&amp;#039;&amp;#039;&lt;br /&gt;
* #undef &amp;#039;&amp;#039;name&amp;#039;&amp;#039;&lt;br /&gt;
* #if(&amp;#039;&amp;#039;constant-expression&amp;#039;&amp;#039;)...#elif(&amp;#039;&amp;#039;constant-expression&amp;#039;&amp;#039;)...#else...#endif&lt;br /&gt;
* #ifdef &amp;#039;&amp;#039;name&amp;#039;&amp;#039; and #ifndef &amp;#039;&amp;#039;name&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These additional directives are supported but have little or no usage in TDM .guis:&lt;br /&gt;
&lt;br /&gt;
* #warning &amp;#039;&amp;#039;string&amp;#039;&amp;#039; and #error &amp;#039;&amp;#039;string&amp;#039;&amp;#039;&lt;br /&gt;
* #if defined(...) and #elif defined(...).       &amp;#039;&amp;#039;Unlike #ifdef, #if defined(...) supports compound conditionals, such as:&amp;#039;&amp;#039;&lt;br /&gt;
 #if defined(WIN32) || defined(LINUX)&lt;br /&gt;
* #eval and #evalfloat         &amp;#039;&amp;#039;(These both take a float and return its absolute decimal value. Evalfloat forces 2 digits after the decimal point. Related to currency or version number?)&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These further directives are parsed but emit a &amp;quot;not supported&amp;quot; message:&lt;br /&gt;
* #line&lt;br /&gt;
* #pragma&lt;br /&gt;
&lt;br /&gt;
==#Includes==&lt;br /&gt;
This can be used to chain .guis together, particular to provide reusable #defines. For both core and FM files, a typical path to a standard file is:&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;guis/readables/readable.guicode&amp;quot;&lt;br /&gt;
&lt;br /&gt;
As usual with TDM, the path given will be searched both relative to the &amp;lt;FM&amp;gt; install, and the overall TDM install. Here&amp;#039;s an example of an FM-specific inclusion (from &amp;quot;TD3: Heart of Lone Salvation&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;guis/lords_log.gui&amp;quot;&lt;br /&gt;
&lt;br /&gt;
As a final example, file mainmenu_custom_defs.gui (which allows mapper customization of the main menu system) is #included into TDM&amp;#039;s Main Menu GUI.&lt;br /&gt;
&lt;br /&gt;
==#Defines==&lt;br /&gt;
===#Defines of Floats===&lt;br /&gt;
It is commonplace to #define float variables, such as:&lt;br /&gt;
&lt;br /&gt;
 #define HEIGTH 640&lt;br /&gt;
 #define WIDTH  480&lt;br /&gt;
 &lt;br /&gt;
 windowDef Desktop {&lt;br /&gt;
 	rect 0,0, HEIGTH,WIDTH&lt;br /&gt;
 	...&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Defined macros can take part in calculations. Consider the Objectives page. Each visible objective&amp;#039;s text is represented by a separate windowDef, with a calculated vertical offset. For the third currently-seen objective:&lt;br /&gt;
&lt;br /&gt;
 windowDef Obj_t3_parent&lt;br /&gt;
 {&lt;br /&gt;
   rect   POS_START_X, POS_OBJ1_START_Y+2*SIZE_OBJ_HEIGHT, SIZE_OBJ_WIDTH, SIZE_OBJ_HEIGHT&lt;br /&gt;
 ...&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===#Defines of Vectors===&lt;br /&gt;
A shortcoming of id Software&amp;#039;s gui scripting language is the inconsistency of how vectors (e.g., colors) are defined and used:&lt;br /&gt;
* Sometimes  with commas (like  1,1,1,1), other times with only whitespace (like 1 1 1 1).&lt;br /&gt;
* Sometimes with surrounding double-quotation marks, other times not.&lt;br /&gt;
&lt;br /&gt;
As a result, while it is possible to use #define for colors, it may cause confusion:&lt;br /&gt;
 #define WHITE 1,1,1,1&lt;br /&gt;
 #define BLACK 0,0,0,1&lt;br /&gt;
 &lt;br /&gt;
 windowDef Desktop {&lt;br /&gt;
   rect 0,0,640,480&lt;br /&gt;
   backcolor BLACK   // Syntax is correct here &lt;br /&gt;
 &lt;br /&gt;
   onTime 1000 {&lt;br /&gt;
     transition &amp;quot;backcolor&amp;quot; &amp;quot;BLACK&amp;quot; &amp;quot;WHITE&amp;quot; &amp;quot;200&amp;quot;; // WRONG! Syntax here doesn&amp;#039;t want commas!&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Nevertheless, with care, it&amp;#039;s OK. Here&amp;#039;s an example. In mainmenu_defs.gui, these are #defined:&lt;br /&gt;
&lt;br /&gt;
 #define MM_SUCCESS_TITLE_START_COLOR	&amp;quot;0.70 0.60 0.4 0&amp;quot;&lt;br /&gt;
 #define MM_SUCCESS_TITLE_END_COLOR	&amp;quot;0.92 0.85 0.6 1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Then, in mainmenu_background.gui (which #includes mainmenu_defs.gui):&lt;br /&gt;
&lt;br /&gt;
 // Large text &amp;quot;Mission Complete&amp;quot; appearing when mission is finished&lt;br /&gt;
 windowDef SuccessBackgroundTitle&lt;br /&gt;
 {&lt;br /&gt;
    ...&lt;br /&gt;
 &lt;br /&gt;
  onTime 0&lt;br /&gt;
  {&lt;br /&gt;
     set &amp;quot;forecolor&amp;quot;            MM_SUCCESS_TITLE_START_COLOR;&lt;br /&gt;
     ...&lt;br /&gt;
     transition &amp;quot;forecolor&amp;quot;     MM_SUCCESS_TITLE_START_COLOR MM_SUCCESS_TITLE_END_COLOR &amp;quot;3000&amp;quot; &amp;quot;0.1&amp;quot; &amp;quot;0.9&amp;quot;;&lt;br /&gt;
     ...&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===#Defines with Multiple Statements===&lt;br /&gt;
&lt;br /&gt;
For convenient GUI code reuse, it is possible to contain whole or multiple statements in a #define. Here&amp;#039;s an example from mainmenu_background.gui:&lt;br /&gt;
&lt;br /&gt;
 #define GLEAM_STEP_1	transition &amp;quot;matcolor&amp;quot; &amp;quot;1, 1, 1, 0&amp;quot; &amp;quot;1, 1, 1, 0.8&amp;quot; &amp;quot;300&amp;quot;; transition &amp;quot;rotate&amp;quot; &amp;quot;0&amp;quot; &amp;quot;6&amp;quot; &amp;quot;400&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
===#Defines with Macro Parameters===&lt;br /&gt;
&lt;br /&gt;
A #define can take one or more macro parameters and be used as a template. As a complex example, in mainmenu_background.gui, there are #defines of BACKGROUND_DEFAULT_BEHAVIOR_START and of ..._END. These are used to provide common code for visual objects (gleams, chains) floating over the Mission Success and (shown here) Mission Failure screens. Using these macros turns this...&lt;br /&gt;
&lt;br /&gt;
 windowDef FailureBackgroundChains&lt;br /&gt;
 {&lt;br /&gt;
 	rect		0,0,640,480&lt;br /&gt;
 &lt;br /&gt;
 	BACKGROUND_DEFAULT_BEHAVIOR_START(FailureBackgroundChains)&lt;br /&gt;
 	&amp;#039;&amp;#039;Not shown: initialization &amp;quot;set&amp;quot; commands for additional windowDefs below.&amp;#039;&amp;#039;&lt;br /&gt;
 &lt;br /&gt;
 	BACKGROUND_DEFAULT_BEHAVIOR_END&lt;br /&gt;
 	&amp;#039;&amp;#039;Not shown: additional windowDefs.&amp;#039;&amp;#039;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
...into effectively this (shown here pretty-printed)...&lt;br /&gt;
&lt;br /&gt;
 windowDef FailureBackgroundChains&lt;br /&gt;
 {&lt;br /&gt;
  	rect		0,0,640,480&lt;br /&gt;
  &lt;br /&gt;
  	visible 0&lt;br /&gt;
 	notime 1&lt;br /&gt;
 	windowDef FailureBackgroundChainsInit&lt;br /&gt;
 	{&lt;br /&gt;
 		notime 1&lt;br /&gt;
 		onTime 0&lt;br /&gt;
 		{&lt;br /&gt;
 			set &amp;quot;FailureBackgroundChains::visible&amp;quot; 1;&lt;br /&gt;
 			resetTime FailureBackgroundChains 0;&lt;br /&gt;
 			set &amp;quot;notime&amp;quot; 1;&lt;br /&gt;
 		}&lt;br /&gt;
 	}&lt;br /&gt;
 	windowDef FailureBackgroundChainsEnd&lt;br /&gt;
 	{&lt;br /&gt;
 		notime 1&lt;br /&gt;
 		onTime 0&lt;br /&gt;
 		{&lt;br /&gt;
 		&amp;#039;&amp;#039;Not shown: initialization &amp;quot;set&amp;quot; commands for additional windowDefs below.&amp;#039;&amp;#039;&lt;br /&gt;
 		set &amp;quot;FailureBackgroundChainsSmallAnchor::notime&amp;quot; 1;&lt;br /&gt;
  		set &amp;quot;FailureBackgroundChainsBigAnchor::notime&amp;quot; 1;&lt;br /&gt;
 		}&lt;br /&gt;
 	}                                                           &lt;br /&gt;
  	&amp;#039;&amp;#039;Not shown: additional windowDefs.&amp;#039;&amp;#039;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The macros are:&lt;br /&gt;
&lt;br /&gt;
 #define BACKGROUND_DEFAULT_BEHAVIOR_START(rootWindow)            \&lt;br /&gt;
 	visible 0                                                \&lt;br /&gt;
 	notime 1                                                 \&lt;br /&gt;
 	windowDef rootWindow##Init                               \&lt;br /&gt;
 	{                                                        \&lt;br /&gt;
 		notime 1                                         \&lt;br /&gt;
 		onTime 0                                         \&lt;br /&gt;
 		{                                                \&lt;br /&gt;
 			set #rootWindow ## &amp;quot;::visible&amp;quot; 1;        \&lt;br /&gt;
 			resetTime rootWindow 0;                  \&lt;br /&gt;
 			set &amp;quot;notime&amp;quot; 1;                          \&lt;br /&gt;
 		}                                                \&lt;br /&gt;
 	}                                                        \&lt;br /&gt;
 	windowDef rootWindow##End                                \&lt;br /&gt;
 	{                                                        \&lt;br /&gt;
 		notime 1                                         \&lt;br /&gt;
 		onTime 0                                         \&lt;br /&gt;
 		{                                                \&lt;br /&gt;
 			set #rootWindow ## &amp;quot;::visible&amp;quot; 0;        \&lt;br /&gt;
 			set #rootWindow ## &amp;quot;::notime&amp;quot; 1;         \&lt;br /&gt;
 			set &amp;quot;notime&amp;quot; 1;                          \&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 #define BACKGROUND_DEFAULT_BEHAVIOR_END                          \&lt;br /&gt;
 		}                                                \&lt;br /&gt;
 	}                                                        \&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
This highlights some of the #define macro language features:&lt;br /&gt;
* A backslash at the end of a line indicates the #define continues on the next line.&lt;br /&gt;
* Given a passed template parameter, in this case &amp;quot;rootWindow&amp;quot;:&lt;br /&gt;
** A &amp;quot;#&amp;quot; before it is a &amp;quot;stringizing operator&amp;quot;, which causes the corresponding actual argument to be enclosed in double quotes.&lt;br /&gt;
** A &amp;quot;##&amp;quot; is a &amp;quot;token-pasting operator&amp;quot;. Placed between tokens (either with actual arguments or literals), it causes concatenation to form another token.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* More about [https://docs.microsoft.com/en-us/cpp/preprocessor/c-cpp-preprocessor-reference?view=msvc-170 C/C++ prepocessing syntax and semantics]&lt;br /&gt;
* A [https://forums.thedarkmod.com/index.php?/topic/20100-idtech-4-gui-scripting/#comment-439769 2019 forum post from HMart] discussed the problems with #defines for color vectors, and alternatives like [GUI Scripting: User Variables | user variables].&lt;/div&gt;</summary>
		<author><name>Geep</name></author>
	</entry>
</feed>