MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / InitScriptEvents

Method InitScriptEvents

neo/tools/script/DialogScriptEditor.cpp:135–179  ·  view source on GitHub ↗

================ DialogScriptEditor::InitScriptEvents ================ */

Source from the content-addressed store, hash-verified

133================
134*/
135void DialogScriptEditor::InitScriptEvents( void ) {
136 int index;
137 idParser src;
138 idToken token;
139 idStr whiteSpace;
140 scriptEventInfo_t info;
141
142 if ( !src.LoadFile( "script/doom_events.script" ) ) {
143 return;
144 }
145
146 scriptEvents.Clear();
147
148 while( src.ReadToken( &token ) ) {
149 if ( token == "scriptEvent" ) {
150
151 src.GetLastWhiteSpace( whiteSpace );
152 index = whiteSpace.Find( "//" );
153 if ( index != -1 ) {
154 info.help = whiteSpace.Right( whiteSpace.Length() - index );
155 info.help.Replace( "\r", "" );
156 info.help.Replace( "\n", "\r\n" );
157 } else {
158 info.help = "";
159 }
160
161 src.ExpectTokenType( TT_NAME, 0, &token );
162
163 info.parms = token;
164
165 src.ExpectTokenType( TT_NAME, 0, &token );
166
167 info.name = token;
168
169 src.ExpectTokenString( "(" );
170
171 info.parms += " " + info.name + "(";
172 while( src.ReadToken( &token ) && token != ";" ) {
173 info.parms.Append( " " + token );
174 }
175
176 scriptEvents.Append( info );
177 }
178 }
179}
180
181/*
182================

Callers

nothing calls this directly

Calls 11

ReplaceMethod · 0.80
LoadFileMethod · 0.45
ClearMethod · 0.45
ReadTokenMethod · 0.45
GetLastWhiteSpaceMethod · 0.45
FindMethod · 0.45
RightMethod · 0.45
LengthMethod · 0.45
ExpectTokenTypeMethod · 0.45
ExpectTokenStringMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected