GameDirectorSB 27-03-23 [v1.24] World Editor Brushes
@@ -161,15 +161,14 @@ | ||
161 | 161 | // ************************************************************************* |
162 | 162 | int A_World::Get_Brush_Count() |
163 | 163 | { |
164 | - | |
165 | - m_pDoc = (CFusionDoc*)App->m_pMainFrame->GetCurrentDoc(); | |
166 | - | |
167 | - Level *pLevel = m_pDoc->pLevel; | |
168 | - BrushList *pList = Level_GetBrushes (m_pDoc->pLevel); | |
169 | - | |
170 | - int Count = 0; | |
171 | - Brush * b; | |
172 | - b = pList->First; | |
164 | + m_pDoc = (CFusionDoc*)App->m_pMainFrame->GetCurrentDoc(); | |
165 | + | |
166 | + Level *pLevel = m_pDoc->pLevel; | |
167 | + BrushList *pList = Level_GetBrushes (m_pDoc->pLevel); | |
168 | + | |
169 | + int Count = 0; | |
170 | + Brush * b; | |
171 | + b = pList->First; | |
173 | 172 | while (b != NULL) |
174 | 173 | { |
175 | 174 | Count++; |
@@ -178,3 +177,30 @@ | ||
178 | 177 | |
179 | 178 | return Count; |
180 | 179 | } |
180 | + | |
181 | +// ************************************************************************* | |
182 | +// * Get_Brush_ByIndex:- Terry and Hazel Flanigan 2023 * | |
183 | +// ************************************************************************* | |
184 | +Brush* int A_World::Get_Brush_ByIndex(int Index) | |
185 | +{ | |
186 | + m_pDoc = (CFusionDoc*)App->m_pMainFrame->GetCurrentDoc(); | |
187 | + | |
188 | + Level *pLevel = m_pDoc->pLevel; | |
189 | + BrushList *pList = Level_GetBrushes (m_pDoc->pLevel); | |
190 | + | |
191 | + int Count = 0; | |
192 | + Brush * b; | |
193 | + b = pList->First; | |
194 | + while (b != NULL) | |
195 | + { | |
196 | + if (Count == Index) | |
197 | + { | |
198 | + return b; | |
199 | + } | |
200 | + | |
201 | + Count++; | |
202 | + b = b->Next; | |
203 | + } | |
204 | + | |
205 | + return NULL; | |
206 | +} |
@@ -39,7 +39,10 @@ | ||
39 | 39 | void Set_Current_3DT_Paths(void); |
40 | 40 | void Get_FileName_FromPath(char *pString, char *FileName); |
41 | 41 | void Set_Current_TxlPath(void); |
42 | + | |
43 | + // Brush Percific | |
42 | 44 | int Get_Brush_Count(); |
45 | + Brush* Get_Brush_ByIndex(int Index); | |
43 | 46 | |
44 | 47 | |
45 | 48 |
@@ -30,6 +30,8 @@ | ||
30 | 30 | { |
31 | 31 | GroupsDlg_Hwnd = NULL; |
32 | 32 | Groups_Dlg_Created = NULL; |
33 | + | |
34 | + Selected_Brush = NULL; | |
33 | 35 | } |
34 | 36 | |
35 | 37 | A_TabsGroups_Dlg::~A_TabsGroups_Dlg(void) |
@@ -132,7 +134,7 @@ | ||
132 | 134 | |
133 | 135 | if (LOWORD(wParam) == IDC_BT_GD_BRUSHPROPERTIES) |
134 | 136 | { |
135 | - Debug | |
137 | + App->CL_TabsGroups_Dlg->Start_Properties_Dlg(); | |
136 | 138 | return TRUE; |
137 | 139 | } |
138 | 140 |
@@ -195,43 +197,21 @@ | ||
195 | 197 | m_pDoc = (CFusionDoc*)App->m_pMainFrame->GetCurrentDoc(); |
196 | 198 | |
197 | 199 | int c ; |
198 | - int i ; | |
199 | - Brush * b; | |
200 | - CEntity * pEnt; | |
201 | - char szBuffer[64]; // Should have a limit for entity/brush name | |
202 | - geBoolean bChanged = FALSE ; // You get selchanges on cursor movements that don't change selection... | |
200 | + geBoolean bChanged = FALSE ; | |
203 | 201 | |
204 | 202 | c = App->CL_World->Get_Brush_Count(); |
203 | + | |
205 | 204 | if( c > 0 ) |
206 | 205 | { |
207 | - //b = (Brush *)m_BrushList.GetItemData( Index ); | |
208 | - // for( i=0; i<c; i++ ) | |
209 | - // { | |
210 | - // m_BrushList.GetText( i, szBuffer ) ; | |
211 | - // if( szBuffer[1] == 'B' ) // Brush | |
212 | - // { | |
213 | - // b = (Brush *)m_BrushList.GetItemData( i ); | |
214 | - // if( m_BrushList.GetSel( i ) ) | |
215 | - // { // User says brush should be selected | |
216 | - // if( pDoc->BrushIsSelected( b ) == GE_FALSE ) | |
217 | - // { | |
218 | - // pDoc->DoBrushSelection( b, brushSelToggle ) ; | |
219 | - // bChanged = GE_TRUE ; | |
220 | - // } | |
221 | - // } | |
222 | - // else | |
223 | - // { // User says don't select | |
224 | - // if( pDoc->BrushIsSelected( b ) == GE_TRUE ) | |
225 | - // { | |
226 | - // pDoc->DoBrushSelection( b, brushSelToggle ) ; | |
227 | - // bChanged = GE_TRUE ; | |
228 | - // } | |
229 | - // } | |
230 | - | |
231 | - // } | |
232 | - // } | |
206 | + m_pDoc->ResetAllSelections() ; | |
207 | + m_pDoc->UpdateSelected(); | |
208 | + | |
209 | + Selected_Brush = App->CL_World->Get_Brush_ByIndex( Index ); | |
210 | + m_pDoc->DoBrushSelection( Selected_Brush, brushSelToggle) ; | |
211 | + bChanged = GE_TRUE; | |
233 | 212 | } |
234 | 213 | |
214 | + | |
235 | 215 | if( bChanged ) |
236 | 216 | { |
237 | 217 | m_pDoc->UpdateSelected() ; |
@@ -267,6 +247,193 @@ | ||
267 | 247 | char buff[100]; |
268 | 248 | SetDlgItemText(GroupsDlg_Hwnd, IDC_BRUSHCOUNT, itoa(Count, buff, 10)); |
269 | 249 | } |
250 | +} | |
270 | 251 | |
271 | - //Level_EnumBrushes (pDoc->pLevel, &CallbackData, ::ListboxAddBrushes); | |
252 | +// ************************************************************************* | |
253 | +// * Start_Properties_Dlg:- Terry and Hazel Flanigan 2023 * | |
254 | +// ************************************************************************* | |
255 | +void A_TabsGroups_Dlg::Start_Properties_Dlg() | |
256 | +{ | |
257 | + DialogBox(App->hInst, (LPCTSTR)IDD_SB_BRUSH_PROPERTIES, App->MainHwnd, (DLGPROC)Properties_Proc); | |
272 | 258 | } |
259 | + | |
260 | +// ************************************************************************* | |
261 | +// * Properties_Proc:- Terry and Hazel Flanigan 2023 * | |
262 | +// ************************************************************************* | |
263 | +LRESULT CALLBACK A_TabsGroups_Dlg::Properties_Proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) | |
264 | +{ | |
265 | + | |
266 | + switch (message) | |
267 | + { | |
268 | + case WM_INITDIALOG: | |
269 | + { | |
270 | + SendDlgItemMessage(hDlg, IDC_BRUSH_PROPERTIESLIST, WM_SETFONT, (WPARAM)App->Font_CB15, MAKELPARAM(TRUE, 0)); | |
271 | + | |
272 | + App->CL_TabsGroups_Dlg->List_BrushData(hDlg); | |
273 | + return TRUE; | |
274 | + } | |
275 | + case WM_CTLCOLORSTATIC: | |
276 | + { | |
277 | + /*if (GetDlgItem(hDlg, IDC_ST_GD_GROUPS) == (HWND)lParam) | |
278 | + { | |
279 | + SetBkColor((HDC)wParam, RGB(0, 0, 0)); | |
280 | + SetTextColor((HDC)wParam, RGB(0, 0, 255)); | |
281 | + SetBkMode((HDC)wParam, TRANSPARENT); | |
282 | + return (UINT)App->AppBackground; | |
283 | + } | |
284 | + | |
285 | + if (GetDlgItem(hDlg, IDC_BRUSHCOUNT) == (HWND)lParam) | |
286 | + { | |
287 | + SetBkColor((HDC)wParam, RGB(0, 0, 0)); | |
288 | + SetTextColor((HDC)wParam, RGB(0, 0, 0)); | |
289 | + SetBkMode((HDC)wParam, TRANSPARENT); | |
290 | + return (UINT)App->AppBackground; | |
291 | + } | |
292 | + | |
293 | + if (GetDlgItem(hDlg, IDC_ST_GD_BRUSHCOUNT) == (HWND)lParam) | |
294 | + { | |
295 | + SetBkColor((HDC)wParam, RGB(0, 0, 0)); | |
296 | + SetTextColor((HDC)wParam, RGB(0, 0, 0)); | |
297 | + SetBkMode((HDC)wParam, TRANSPARENT); | |
298 | + return (UINT)App->AppBackground; | |
299 | + }*/ | |
300 | + | |
301 | + return FALSE; | |
302 | + } | |
303 | + | |
304 | + case WM_CTLCOLORDLG: | |
305 | + { | |
306 | + return (LONG)App->AppBackground; | |
307 | + } | |
308 | + | |
309 | + case WM_NOTIFY: | |
310 | + { | |
311 | + LPNMHDR some_item = (LPNMHDR)lParam; | |
312 | + | |
313 | + /*if (some_item->idFrom == IDC_BTTDAPPLY && some_item->code == NM_CUSTOMDRAW) | |
314 | + { | |
315 | + LPNMCUSTOMDRAW item = (LPNMCUSTOMDRAW)some_item; | |
316 | + App->Custom_Button_Normal(item); | |
317 | + return CDRF_DODEFAULT; | |
318 | + }*/ | |
319 | + | |
320 | + return CDRF_DODEFAULT; | |
321 | + } | |
322 | + | |
323 | + case WM_COMMAND: | |
324 | + { | |
325 | + /*if (LOWORD(wParam) == IDC_GD_BRUSHLIST) | |
326 | + { | |
327 | + App->CL_TabsGroups_Dlg->List_Selection_Changed(); | |
328 | + | |
329 | + return TRUE; | |
330 | + } | |
331 | + | |
332 | + if (LOWORD(wParam) == IDC_BT_GD_BRUSHPROPERTIES) | |
333 | + { | |
334 | + Debug | |
335 | + return TRUE; | |
336 | + } | |
337 | + | |
338 | + if (LOWORD(wParam) == IDC_BTTEST) | |
339 | + { | |
340 | + App->CL_TabsGroups_Dlg->Fill_ListBox(); | |
341 | + return TRUE; | |
342 | + }*/ | |
343 | + | |
344 | + // ----------------------------------------------------------------- | |
345 | + if (LOWORD(wParam) == IDOK) | |
346 | + { | |
347 | + //App->CL_TextureDialog->f_TextureDlg_Active = 0; | |
348 | + EndDialog(hDlg, LOWORD(wParam)); | |
349 | + return TRUE; | |
350 | + } | |
351 | + | |
352 | + if (LOWORD(wParam) == IDCANCEL) | |
353 | + { | |
354 | + //App->CL_TextureDialog->f_TextureDlg_Active = 0; | |
355 | + EndDialog(hDlg, LOWORD(wParam)); | |
356 | + return TRUE; | |
357 | + } | |
358 | + | |
359 | + break; | |
360 | + } | |
361 | + } | |
362 | + return FALSE; | |
363 | +} | |
364 | + | |
365 | +struct tag_FaceList | |
366 | +{ | |
367 | + int NumFaces; | |
368 | + int Limit; | |
369 | + Face **Faces; | |
370 | + geBoolean Dirty; | |
371 | + Box3d Bounds; | |
372 | +}; | |
373 | + | |
374 | +// ************************************************************************* | |
375 | +// * List_BrushData Terry Flanigan * | |
376 | +// ************************************************************************* | |
377 | +void A_TabsGroups_Dlg::List_BrushData(HWND hDlg) | |
378 | +{ | |
379 | + int c = App->CL_World->Get_Brush_Count(); | |
380 | + | |
381 | + if( c > 0 ) | |
382 | + { | |
383 | + char buf[255]; | |
384 | + | |
385 | + sprintf(buf, "%s%s", "Brush Name ",Selected_Brush->Name); | |
386 | + SendDlgItemMessage(hDlg, IDC_BRUSH_PROPERTIESLIST, LB_ADDSTRING, (WPARAM)0, (LPARAM)buf); | |
387 | + | |
388 | + float HullSize = Selected_Brush->HullSize; | |
389 | + sprintf(buf, "%s%f", "Hull Size = ",HullSize); | |
390 | + SendDlgItemMessage(hDlg, IDC_BRUSH_PROPERTIESLIST, LB_ADDSTRING, (WPARAM)0, (LPARAM)buf); | |
391 | + | |
392 | + int Type = Selected_Brush->Type; | |
393 | + sprintf(buf, "%s%i", "Type = ",Type); | |
394 | + SendDlgItemMessage(hDlg, IDC_BRUSH_PROPERTIESLIST, LB_ADDSTRING, (WPARAM)0, (LPARAM)buf); | |
395 | + | |
396 | + int GrouplID = Selected_Brush->GroupId; | |
397 | + sprintf(buf, "%s%i", "Group ID = ",GrouplID); | |
398 | + SendDlgItemMessage(hDlg, IDC_BRUSH_PROPERTIESLIST, LB_ADDSTRING, (WPARAM)0, (LPARAM)buf); | |
399 | + | |
400 | + int ModelID = Selected_Brush->ModelId; | |
401 | + sprintf(buf, "%s%i", "Model ID = ",ModelID); | |
402 | + SendDlgItemMessage(hDlg, IDC_BRUSH_PROPERTIESLIST, LB_ADDSTRING, (WPARAM)0, (LPARAM)buf); | |
403 | + | |
404 | + /*int FaceLimit = Selected_Brush->BList->; | |
405 | + sprintf(buf, "%s%i", "Face Limit = ",FaceLimit); | |
406 | + SendDlgItemMessage(hDlg, IDC_BRUSH_PROPERTIESLIST, LB_ADDSTRING, (WPARAM)0, (LPARAM)buf);*/ | |
407 | + } | |
408 | + | |
409 | + //sprintf(buf, "%s%s", "File = ",App->CL_World->mCurrent_3DT_File); | |
410 | + //SendDlgItemMessage(hDlg, IDC_LISTGROUP, LB_ADDSTRING, (WPARAM)0, (LPARAM)buf); | |
411 | + | |
412 | + //sprintf(buf, "%s%s", "Path = ",App->CL_World->mCurrent_3DT_Path); | |
413 | + //SendDlgItemMessage(hDlg, IDC_LISTGROUP, LB_ADDSTRING, (WPARAM)0, (LPARAM)buf); | |
414 | + // | |
415 | + //sprintf(buf, "%s%s", "Path and File = ",App->CL_World->mCurrent_3DT_PathAndFile); | |
416 | + //SendDlgItemMessage(hDlg, IDC_LISTGROUP, LB_ADDSTRING, (WPARAM)0, (LPARAM)buf); | |
417 | + | |
418 | + ////-------------------------------- | |
419 | + //sprintf(buf, "%s", " "); | |
420 | + //SendDlgItemMessage(hDlg, IDC_LISTGROUP, LB_ADDSTRING, (WPARAM)0, (LPARAM)buf); | |
421 | + | |
422 | + //sprintf(buf, "%s", " "); | |
423 | + //SendDlgItemMessage(hDlg, IDC_LISTGROUP, LB_ADDSTRING, (WPARAM)0, (LPARAM)buf); | |
424 | + | |
425 | + //// ----------------------------------------- TXL_FilePath | |
426 | + //sprintf(buf, "%s", "TXL File --------------------------------"); | |
427 | + //SendDlgItemMessage(hDlg, IDC_LISTGROUP, LB_ADDSTRING, (WPARAM)0, (LPARAM)buf); | |
428 | + | |
429 | + //sprintf(buf, "File = %s",App->CL_World->mCurrent_TXL_FileName); | |
430 | + //SendDlgItemMessage(hDlg, IDC_LISTGROUP, LB_ADDSTRING, (WPARAM)0, (LPARAM)buf); | |
431 | + | |
432 | + //sprintf(buf, "Path and File = %s",App->CL_World->mCurrent_TXL_FilePath); | |
433 | + //SendDlgItemMessage(hDlg, IDC_LISTGROUP, LB_ADDSTRING, (WPARAM)0, (LPARAM)buf); | |
434 | + | |
435 | + // | |
436 | + //sprintf(buf, "%s%i", "Brush Count = ",App->CL_World->Get_Brush_Count()); | |
437 | + //SendDlgItemMessage(hDlg, IDC_LISTGROUP, LB_ADDSTRING, (WPARAM)0, (LPARAM)buf); | |
438 | + | |
439 | +} |
@@ -31,6 +31,7 @@ | ||
31 | 31 | |
32 | 32 | void Show_GroupsDialog(bool Show); |
33 | 33 | void Start_GroupsDialog(); |
34 | + void Start_Properties_Dlg(); | |
34 | 35 | |
35 | 36 | void Fill_ListBox(); |
36 | 37 |
@@ -41,9 +42,13 @@ | ||
41 | 42 | private: |
42 | 43 | |
43 | 44 | static LRESULT CALLBACK Groups_Proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); |
45 | + static LRESULT CALLBACK Properties_Proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); | |
44 | 46 | |
45 | 47 | void List_Selection_Changed(); |
46 | 48 | void OnSelchangeBrushlist(int Index); |
47 | 49 | |
50 | + void List_BrushData(HWND hDlg); | |
51 | + | |
52 | + Brush* Selected_Brush; | |
48 | 53 | CFusionDoc *m_pDoc; |
49 | 54 | }; |
@@ -114,6 +114,8 @@ | ||
114 | 114 | #define IDD_SB_TABSTEXTURES 258 |
115 | 115 | #define IDD_MESSAGE 259 |
116 | 116 | #define IDD_SB_TABSDIALOG 260 |
117 | +#define IDD_DIALOG3 261 | |
118 | +#define IDD_SB_BRUSH_PROPERTIES 261 | |
117 | 119 | #define IDC_RESET_ALL 1000 |
118 | 120 | #define IDC_EDIT1 1001 |
119 | 121 | #define IDC_EDIT10 1002 |
@@ -526,8 +528,8 @@ | ||
526 | 528 | #define IDC_ST_GD_GROUPS 1382 |
527 | 529 | #define IDC_BRUSHCOUNT 1383 |
528 | 530 | #define IDC_ST_GD_BRUSHCOUNT 1384 |
529 | -#define IDC_BUTTON2 1385 | |
530 | 531 | #define IDC_BT_GD_BRUSHPROPERTIES 1385 |
532 | +#define IDC_BRUSH_PROPERTIESLIST 1386 | |
531 | 533 | #define ID_BRUSH_PRIMITIVES_CUBE 32771 |
532 | 534 | #define ID_BRUSH_PRIMITIVES_PYRAMID 32772 |
533 | 535 | #define ID_BRUSH_PRIMITIVES_SPHEROID 32773 |
@@ -705,9 +707,9 @@ | ||
705 | 707 | #ifdef APSTUDIO_INVOKED |
706 | 708 | #ifndef APSTUDIO_READONLY_SYMBOLS |
707 | 709 | #define _APS_3D_CONTROLS 1 |
708 | -#define _APS_NEXT_RESOURCE_VALUE 261 | |
710 | +#define _APS_NEXT_RESOURCE_VALUE 262 | |
709 | 711 | #define _APS_NEXT_COMMAND_VALUE 33056 |
710 | -#define _APS_NEXT_CONTROL_VALUE 1386 | |
712 | +#define _APS_NEXT_CONTROL_VALUE 1387 | |
711 | 713 | #define _APS_NEXT_SYMED_VALUE 112 |
712 | 714 | #endif |
713 | 715 | #endif |