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

Method LoadDecl

neo/tools/decl/DialogEntityDefEditor.cpp:169–210  ·  view source on GitHub ↗

================ DialogEntityDefEditor::LoadDecl ================ */

Source from the content-addressed store, hash-verified

167================
168*/
169void DialogEntityDefEditor::LoadDecl( idDeclEntityDef *decl ) {
170 int numLines = 0;
171 CRect rect;
172
173 this->decl = decl;
174
175 // Fill up the spawnclass box with all spawn classes
176 /*
177 idTypeInfo *c = idClass::GetClass("idClass");
178 for (; c; c = c->next) {
179 spawnclassCombo.AddString(c->classname);
180 }
181 */
182
183 // Fill up the inherit box with all entitydefs
184 int numDecls = declManager->GetNumDecls(DECL_ENTITYDEF);
185 for (int i=0; i<numDecls; i++) {
186 const idDecl *d = declManager->DeclByIndex(DECL_ENTITYDEF, i, false);
187 if (d) {
188 inheritCombo.AddString(d->GetName());
189 }
190 }
191
192 firstLine = decl->GetLineNum();
193
194 char *declText = (char *)_alloca( ( decl->GetTextLength() + 1 ) * sizeof( char ) );
195 decl->GetText( declText );
196
197 PopulateLists( declText );
198
199 SetWindowText( va( "EntityDef Editor (%s, line %d)", decl->GetFileName(), decl->GetLineNum() ) );
200
201 // Hack to get it to reflow the window
202 GetWindowRect( rect );
203 rect.bottom++;
204 MoveWindow( rect );
205
206 testButton.EnableWindow( FALSE );
207 okButton.EnableWindow( FALSE );
208
209 UpdateStatusBar();
210}
211
212/*
213=================

Callers

nothing calls this directly

Calls 9

vaFunction · 0.85
GetNumDeclsMethod · 0.80
DeclByIndexMethod · 0.80
AddStringMethod · 0.80
GetNameMethod · 0.45
GetLineNumMethod · 0.45
GetTextLengthMethod · 0.45
GetTextMethod · 0.45
GetFileNameMethod · 0.45

Tested by

no test coverage detected