Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
wbview.cpp
Go to the documentation of this file.
1/*
2** Command & Conquer Generals Zero Hour(tm)
3** Copyright 2025 Electronic Arts Inc.
4**
5** This program is free software: you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation, either version 3 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19// wbview.cpp : implementation file
20//
21
22#include "stdafx.h"
23#include "resource.h"
24#include "CUndoable.h"
25#include "CFixTeamOwnerDialog.h"
26#include "worldbuilder.h"
27#include "worldbuilderdoc.h"
28#include "wbview.h"
29#include "wheightmapedit.h"
30#include "MainFrm.h"
31#include "Common/Debug.h"
34#include "GlobalLightOptions.h"
35#include "PlayerListDlg.h"
36#include "TeamsDialog.h"
37#include "LayersList.h"
38
39#ifdef _INTERNAL
40// for occasional debugging...
41//#pragma optimize("", off)
42//#pragma MESSAGE("************************************** WARNING, optimization disabled for debugging purposes")
43#endif
45
47// WbView
48
49IMPLEMENT_DYNCREATE(WbView, CView)
50
53 m_centerPt(15,40,0),
54 m_hysteresis(0),
59{
60 Int showWay = ::AfxGetApp()->GetProfileInt(MAIN_FRAME_SECTION, "ShowWaypoints", 1);
61 m_showWaypoints = (showWay!=0);
62 Int showPoly = ::AfxGetApp()->GetProfileInt(MAIN_FRAME_SECTION, "ShowPolygonTriggers", 1);
63 m_showPolygonTriggers = (showPoly!=0);
64 Int showObj = ::AfxGetApp()->GetProfileInt(MAIN_FRAME_SECTION, "ShowObjectIcons", 1);
65 m_showObjects = (showObj!=0);
66 Int showNames = ::AfxGetApp()->GetProfileInt(MAIN_FRAME_SECTION, "ShowNames", 1);
67 m_showNames = (showNames!=0);
68 Int snapToGrid = ::AfxGetApp()->GetProfileInt(MAIN_FRAME_SECTION, "SnapToGrid", 0);
69 m_snapToGrid = (snapToGrid!=0);
70 Int showTerrain = ::AfxGetApp()->GetProfileInt(MAIN_FRAME_SECTION, "ShowTerrain", 1);
71 m_showTerrain = (showTerrain!=0);
72}
73
77
78
79BEGIN_MESSAGE_MAP(WbView, CView)
80 //{{AFX_MSG_MAP(WbView)
81 ON_WM_RBUTTONUP()
82 ON_WM_RBUTTONDOWN()
83 ON_WM_MOUSEMOVE()
84 ON_WM_LBUTTONUP()
85 ON_WM_LBUTTONDOWN()
86 ON_WM_MBUTTONUP()
87 ON_WM_MBUTTONDOWN()
88 ON_WM_SETCURSOR()
89 ON_WM_KEYDOWN()
90 ON_WM_KEYUP()
91 ON_COMMAND(ID_EDIT_DELETE, OnEditDelete)
92 ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
93 ON_UPDATE_COMMAND_UI(ID_EDIT_COPY, OnUpdateEditCopy)
94 ON_COMMAND(ID_EDIT_CUT, OnEditCut)
95 ON_UPDATE_COMMAND_UI(ID_EDIT_CUT, OnUpdateEditCut)
96 ON_COMMAND(ID_EDIT_PASTE, OnEditPaste)
97 ON_UPDATE_COMMAND_UI(ID_EDIT_PASTE, OnUpdateEditPaste)
98 ON_COMMAND(ID_VIEW_SNAPTOGRID, OnViewSnaptogrid)
99 ON_UPDATE_COMMAND_UI(ID_VIEW_SNAPTOGRID, OnUpdateViewSnaptogrid)
100 ON_COMMAND(ID_VIEW_SHOW_OBJECTS, OnViewShowObjects)
101 ON_UPDATE_COMMAND_UI(ID_VIEW_SHOW_OBJECTS, OnUpdateViewShowObjects)
102 ON_COMMAND(ID_EDIT_SELECTDUP, OnEditSelectdup)
103 ON_COMMAND(ID_EDIT_SELECTSIMILAR, OnEditSelectsimilar)
104 ON_COMMAND(ID_EDIT_REPLACE, OnEditReplace)
105 ON_COMMAND(ID_EDIT_SELECTINVALIDTEAM, OnEditSelectinvalidteam)
106 ON_COMMAND(ID_OBJECTPROPERTIES_REFLECTSINMIRROR, OnObjectpropertiesReflectsinmirror)
107 ON_COMMAND(ID_LOCK_HORIZONTAL, OnLockHorizontal)
108 ON_UPDATE_COMMAND_UI(ID_LOCK_HORIZONTAL, OnUpdateLockHorizontal)
109 ON_COMMAND(ID_EDIT_GLOBALLIGHTOPTIONS, OnEditGloballightoptions)
110 ON_COMMAND(ID_VIEW_SHOWWAYPOINTS, OnViewShowwaypoints)
111 ON_UPDATE_COMMAND_UI(ID_VIEW_SHOWWAYPOINTS, OnUpdateViewShowwaypoints)
112 ON_COMMAND(ID_VIEW_SHOWPOLYGONTRIGGERS, OnViewShowpolygontriggers)
113 ON_UPDATE_COMMAND_UI(ID_VIEW_SHOWPOLYGONTRIGGERS, OnUpdateViewShowpolygontriggers)
114 ON_COMMAND(ID_EDIT_PLAYERLIST, OnEditPlayerlist)
115 ON_COMMAND(ID_EDIT_WORLDINFO, OnEditWorldinfo)
116 ON_COMMAND(ID_EDIT_TEAMLIST, OnEditTeamlist)
117 ON_COMMAND(ID_TEAM_EDIT, OnEditTeamlist)
118 ON_UPDATE_COMMAND_UI(ID_OBJECTPROPERTIES_REFLECTSINMIRROR, OnUpdateObjectpropertiesReflectsinmirror)
119 ON_COMMAND(ID_EDIT_PICKSTRUCTS, OnPickStructures)
120 ON_UPDATE_COMMAND_UI(ID_EDIT_PICKSTRUCTS, OnUpdatePickStructures)
121 ON_COMMAND(ID_EDIT_PICKINFANTRY, OnPickInfantry)
122 ON_UPDATE_COMMAND_UI(ID_EDIT_PICKINFANTRY, OnUpdatePickInfantry)
123 ON_COMMAND(ID_EDIT_PICKVEHICLES, OnPickVehicles)
124 ON_UPDATE_COMMAND_UI(ID_EDIT_PICKVEHICLES, OnUpdatePickVehicles)
125 ON_COMMAND(ID_EDIT_PICKSHRUBBERY, OnPickShrubbery)
126 ON_UPDATE_COMMAND_UI(ID_EDIT_PICKSHRUBBERY, OnUpdatePickShrubbery)
127 ON_COMMAND(ID_EDIT_PICKMANMADE, OnPickManMade)
128 ON_UPDATE_COMMAND_UI(ID_EDIT_PICKMANMADE, OnUpdatePickManMade)
129 ON_COMMAND(ID_EDIT_PICKNATURAL, OnPickNatural)
130 ON_UPDATE_COMMAND_UI(ID_EDIT_PICKNATURAL, OnUpdatePickNatural)
131 ON_COMMAND(ID_EDIT_PICKDEBRIS, OnPickDebris)
132 ON_UPDATE_COMMAND_UI(ID_EDIT_PICKDEBRIS, OnUpdatePickDebris)
133 ON_COMMAND(ID_EDIT_PICKANYTHING, OnPickAnything)
134 ON_UPDATE_COMMAND_UI(ID_EDIT_PICKANYTHING, OnUpdatePickAnything)
135 ON_COMMAND(ID_EDIT_PICKWAYPOINTS, OnPickWaypoints)
136 ON_UPDATE_COMMAND_UI(ID_EDIT_PICKWAYPOINTS, OnUpdatePickWaypoints)
137 ON_COMMAND(ID_EDIT_PICKROADS, OnPickRoads)
138 ON_UPDATE_COMMAND_UI(ID_EDIT_PICKROADS, OnUpdatePickRoads)
139 ON_COMMAND(ID_EDIT_PICKSOUNDS, OnPickSounds)
140 ON_UPDATE_COMMAND_UI(ID_EDIT_PICKSOUNDS, OnUpdatePickSounds)
141 ON_COMMAND(ID_VIEW_LABELS, OnShowNames)
142 ON_UPDATE_COMMAND_UI(ID_VIEW_LABELS, OnUpdateShowNames)
143 ON_COMMAND(ID_VALIDATION_FIXTEAMS, OnValidationFixTeams)
144 ON_COMMAND(ID_VIEW_SHOW_TERRAIN, OnShowTerrain)
145 ON_UPDATE_COMMAND_UI(ID_VIEW_SHOW_TERRAIN, OnUpdateShowTerrain)
146 ON_WM_CREATE()
147
148 //}}AFX_MSG_MAP
149END_MESSAGE_MAP()
150
152// WbView drawing
153
154void WbView::OnDraw(CDC* pDC)
155{
156 DEBUG_ASSERTCRASH((0),("oops"));
157}
158
160// WbView diagnostics
161
162#ifdef _DEBUG
163void WbView::AssertValid() const
164{
165 CView::AssertValid();
166}
167
168void WbView::Dump(CDumpContext& dc) const
169{
170 CView::Dump(dc);
171}
172#endif //_DEBUG
173
175// WbView message handlers
176
177// ----------------------------------------------------------------------------
178void WbView::mouseDown(TTrackingMode m, CPoint viewPt)
179{
180 // can happen if you press 2 mouse buttons. DEBUG_ASSERTCRASH((m_trackingMode==TRACK_NONE),("oops"));
182 return;
183
184 SetCapture();
185 m_mouseDownPoint = viewPt;
187 m_trackingMode = m;
188 WbApp()->updateCurTool(m == TRACK_R || m == TRACK_M);
189 WbApp()->lockCurTool();
190 // If we have a tool, invoke it's mouse down method.
191 if (WbApp()->getCurTool()) {
192 WbApp()->getCurTool()->mouseDown(m, viewPt, this, WbDoc());
193 }
194}
195
196// ----------------------------------------------------------------------------
197void WbView::mouseMove(TTrackingMode m, CPoint viewPt)
198{
199 MSG msg;
200 while (::PeekMessage(&msg, m_hWnd, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE)) {
201 viewPt.x = (short)LOWORD(msg.lParam); // horizontal position of cursor
202 viewPt.y = (short)HIWORD(msg.lParam); // vertical position of cursor
203 DEBUG_LOG(("Peek mouse %d, %d\n", viewPt.x, viewPt.y));
204 }
205
206 if (m_trackingMode == TRACK_NONE) {
207 // Don't lock while the mouse is up.
208 m_doLockAngle = false;
209 } else {
211 }
212 if (m_trackingMode == m) {
213 WbApp()->updateCurTool(false);
214 if (WbApp()->getCurTool()) {
215 WbApp()->getCurTool()->mouseMoved(m, viewPt, this, WbDoc());
216 }
217 }
218 if (CMainFrame::GetMainFrame()->isAutoSaving()) {
219 return;
220 }
221
223 // If the user is measuring stuff, no need to do the rest of the text.
224 CString str;
226 str.Format("Diameter (in feet): %f", m_rulerLength * 2.0f);
227 } else {
228 str.Format("Length (in feet): %f", m_rulerLength);
229 }
230 CMainFrame::GetMainFrame()->SetMessageText(str);
231 return;
232 }
233
234 // Generate the status text display with coordinates and height.
235 Coord3D cpt;
236 viewToDocCoords(viewPt, &cpt);
237
240 Int totalObjects = 0;
241 Int totalWaypoints = 0;
242 Int numSelected = 0;
243 while(pObj) {
244 if (pObj->isSelected()) {
245 numSelected++;
246 }
248 Int flags = pObj->getFlags();
249 if (!(pObj->isWaypoint() || (flags & flagsWeDontWant) != 0))
250 ++totalObjects;
251 else
252 ++totalWaypoints;
253
254 pObj = pObj->getNext();
255 }
256
257 // See if the cursor is over an object.
259 while (pObj) {
260 if (picked(pObj, cpt)) {
261 break;
262 }
263 pObj = pObj->getNext();
264 }
265 if (pObj==NULL) {
266 pObj = picked3dObjectInView(viewPt);
267 }
268 Real height = TheTerrainRenderObject->getHeightMapHeight(cpt.x, cpt.y, NULL);
269 CString str, str2, str3;
270 // If a layer has been activated, display it.
271 if (strcmp(AsciiString::TheEmptyString.str(), LayersList::TheActiveLayerName.c_str()) != 0) {
272 str.Format("Active Layer: (%s) %d object(s), ", LayersList::TheActiveLayerName.c_str(), totalObjects);
273 } else {
274 str.Format("%d object(s), ", totalObjects);
275 }
276 str2.Format("%d waypoint(s), ", totalWaypoints);
277 str3.Format("(%.2f,%.2f), height %.2f", cpt.x, cpt.y, height);
278 str += str2;
279 str += str3;
280 if (numSelected) {
281 CString numSel;
282 numSel.Format("(%d selected) ", numSelected);
283 str += numSel;
284 }
285 if (pObj) {
286 // If we have an object, add the object's name and index to the status.
287 const char *pName;
288 const char *pFullName = pObj->getName().str();
289 Coord3D loc = *pObj->getLocation();
290 pName = pFullName;
291 while (*pFullName) {
292 if (*pFullName == '/') {
293 pName = pFullName+1;
294 }
295 pFullName++;
296 }
297
298 Bool exists;
299 AsciiString objectID = pObj->getProperties()->getAsciiString(TheKey_uniqueID, &exists);
300 CString obj;
301 if (exists) {
302 obj.Format(" - object %s(%.2f,%.2f)", objectID.str(), loc.x, loc.y);
303 } else {
304 obj.Format(" - object %s(%.2f,%.2f)", pName, loc.x, loc.y);
305 }
306 str += obj;
307 }
308 RGBColor color;
309 pMap->getTerrainColorAt(cpt.x, cpt.y, &color);
310 CString colorStr;
311 colorStr.Format("{r%f,g%f,b%f}", color.red,color.green,color.blue);
312 str += colorStr;
313 CMainFrame::GetMainFrame()->SetMessageText(str);
314}
315
316// ----------------------------------------------------------------------------
317void WbView::mouseUp(TTrackingMode m, CPoint viewPt)
318{
319 //DEBUG_ASSERTCRASH((m_trackingMode!=TRACK_NONE),("oops"));
321 return;
322
323 if (GetCapture() == this)
324 {
325 ReleaseCapture();
326 }
327
328 // If we were tracking a tool, call its mouseup method.
329 if (WbApp()->getCurTool()) {
330 WbApp()->getCurTool()->mouseUp(m, viewPt, this, WbDoc());
331 // Give warning messages at this point.
333 if (pMap->tooManyTextures()) {
334 AfxMessageBox(IDS_TOO_MANY_TILES);
335 }
336 if (pMap->tooManyBlends()) {
337 AfxMessageBox(IDS_TOO_MANY_BLENDS);
338 }
339 pMap->clearStatus();
340 }
341 WbApp()->unlockCurTool();
342 // We don't update the tool while tracking down, wouldn't want the eyedropper
343 // to suddenly turn into the flood fill tool, so now we update in case a key
344 // was released while tracking.
345 WbApp()->updateCurTool(false);
347}
348
349void WbView::OnMouseMove(UINT nFlags, CPoint point)
350{
352}
353
354void WbView::OnRButtonUp(UINT nFlags, CPoint point)
355{
356 mouseUp(TRACK_R, point);
357}
358
359void WbView::OnRButtonDown(UINT nFlags, CPoint point)
360{
361 mouseDown(TRACK_R, point);
362}
363
364void WbView::OnLButtonUp(UINT nFlags, CPoint point)
365{
366 mouseUp(TRACK_L, point);
367}
368
369void WbView::OnLButtonDown(UINT nFlags, CPoint point)
370{
371 mouseDown(TRACK_L, point);
372}
373
374void WbView::OnMButtonUp(UINT nFlags, CPoint point)
375{
376 mouseUp(TRACK_M, point);
377}
378
379void WbView::OnMButtonDown(UINT nFlags, CPoint point)
380{
381 mouseDown(TRACK_M, point);
382}
383
384//=============================================================================
385// WbView::pickedInView
386//=============================================================================
388//=============================================================================
390{
391 Coord3D cloc = *pObj->getLocation();
392 if (!m_showObjects && !pObj->isWaypoint()) {
393 return PICK_NONE;
394 }
395 if (!m_showWaypoints && !WaypointTool::isActive() && pObj->isWaypoint()) {
396 return PICK_NONE;
397 }
398
399 Bool doArrow = pObj->isSelected();
400 // Check and see if we are within 1/2 cell size of the center.
401 Coord3D cpt = docPt;
402 cpt.x -= cloc.x;
403 cpt.y -= cloc.y;
404 cpt.z = 0;
405 if (cpt.length() < 0.5f*MAP_XY_FACTOR+m_hysteresis) {
406 return PICK_CENTER;
407 }
408 if (pObj->getFlag(FLAG_ROAD_FLAGS) || pObj->getFlag(FLAG_BRIDGE_FLAGS) || pObj->isWaypoint()) {
409 doArrow = false;
410 }
411 // Check and see if we are within 1 cell size of the center.
412 if (doArrow && cpt.length() < 1.5f*MAP_XY_FACTOR+m_hysteresis) {
413 return PICK_ARROW;
414 }
415 return PICK_NONE;
416}
417
418//=============================================================================
420{
422 // If we are editing with a tool, draw the map being edited, if one exists.
423 if (m_trackingMode != TRACK_NONE && WbApp()->getCurTool()) {
424 pMap = WbApp()->getCurTool()->getHeightMap();
425 }
426 // If we aren't editing, or the tool doesn't provide a map, use the current one.
427 if (pMap == NULL) {
428 pMap = WbDoc()->GetHeightMap();
429 }
430 return pMap;
431}
432
433//=============================================================================
435{
437 if (pMap==NULL) return;
438#if 0
439 if (m_centerPt.X >= pMap->getXExtent()) m_centerPt.X = pMap->getXExtent()-1;
440 if (m_centerPt.X<0) m_centerPt.X = 0;
441 if (m_centerPt.Y >= pMap->getYExtent()) m_centerPt.Y = pMap->getYExtent() - 1;
442 if (m_centerPt.Y<0) m_centerPt.Y=0;
443#endif
444}
445
446//=============================================================================
447// WbView::OnSetCursor
448//=============================================================================
450//=============================================================================
451BOOL WbView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
452{
453 if (nHitTest == HTCLIENT) {
454 // If we are tracking in our window, update the tool.
455 WbApp()->updateCurTool(false);
456 if (WbApp()->getCurTool()) {
457 // Let the current tool set it's cursor.
458 WbApp()->getCurTool()->setCursor();
459 } else {
460 // Else just use the system arrow cursor. This shouldn't normally happen.
461 ::SetCursor(::LoadCursor(NULL, IDC_ARROW));
462 }
463 return(0);
464 }
465 // Otherwise let the parent window handle the other cursors like window resize etc.
466 return(CView::OnSetCursor(pWnd, nHitTest, message));
467}
468
469
472{
475 return;
476 }
477 }
478 CWorldBuilderDoc* pDoc = WbDoc();
479 // create a delete undoable.
481 // Execute it.
482 pDoc->AddAndDoUndoable(pUndo);
483 REF_PTR_RELEASE(pUndo); // belongs to pDoc now.
484}
485
488void WbView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
489{
490 if (nChar == VK_DELETE || nChar == VK_BACK) {
491 OnEditDelete();
492 }
493 WbApp()->updateCurTool(false);
494 OnSetCursor(this,HTCLIENT,0);
495}
496
499void WbView::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
500{
501 WbApp()->updateCurTool(false);
502 OnSetCursor(this,HTCLIENT,0);
503}
504
506{
507 MapObject *pTheCopy = NULL;
508 MapObject *pTmp = NULL;
509
511 // Note - map segments come in pairs. So copy both.
512 MapObject *pMapObj;
513 MapObject *pMapObj2;
514 for (pMapObj = MapObject::getFirstMapObject(); pMapObj; pMapObj = pMapObj->getNext()) {
515 if (pMapObj->getFlag(FLAG_ROAD_POINT1)) {
516 pMapObj2 = pMapObj->getNext();
517 DEBUG_ASSERTCRASH(pMapObj2 && pMapObj2->getFlag(FLAG_ROAD_POINT2), ("oops"));
518 if (pMapObj2==NULL) break;
519 if (!pMapObj2->getFlag(FLAG_ROAD_POINT2)) continue;
520 // If one end of a road segment is selected, both are.
521 if (pMapObj->isSelected() || pMapObj2->isSelected()) {
522 pMapObj->setSelected(true);
523 pMapObj2->setSelected(true);
524 }
525 }
526 if (pMapObj->isWaypoint()) {
527 pMapObj->setSelected(false);
528 }
529 }
530
532 while (pObj) {
533 if (pObj->isSelected()) {
534 pTmp = pObj->duplicate();
535 pTmp->setNextMap(pTheCopy);
536 pTheCopy = pTmp;
537 }
538 pObj = pObj->getNext();
539 }
540 WbApp()->setMapObjPasteList(pTheCopy);
541 pTheCopy = NULL; // belongs to the app.
542}
543
544void WbView::OnUpdateEditCopy(CCmdUI* pCmdUI)
545{
546 pCmdUI->Enable();
547}
548
550{
551 OnEditCopy();
552 OnEditDelete();
553}
554
555void WbView::OnUpdateEditCut(CCmdUI* pCmdUI)
556{
557 pCmdUI->Enable();
558}
559
561{
562 CWorldBuilderDoc* pDoc = WbDoc();
563 MapObject *pTheCopy = NULL;
564 MapObject *pTmp = NULL;
565
566 /* First, clear the selection. */
568
570 while (pObj) {
571 pTmp = pObj->duplicate();
572 pTmp->setNextMap(pTheCopy);
573 pTmp->validate();
574
575 pTheCopy = pTmp;
576 pTmp->setSelected(true);
577 pObj = pObj->getNext();
578 }
579 AddObjectUndoable *pUndo = new AddObjectUndoable(pDoc, pTheCopy);
580 pDoc->AddAndDoUndoable(pUndo);
581 REF_PTR_RELEASE(pUndo); // belongs to pDoc now.
582 pTheCopy = NULL; // undoable owns it now.
583
584}
585
588{
590 Invalidate(false);
591 WbView *pView = (WbView *)WbDoc()->GetActive2DView();
592 if (pView != NULL && pView != this) {
593 pView->Invalidate(!m_showObjects);
594 }
595 ::AfxGetApp()->WriteProfileInt(MAIN_FRAME_SECTION, "ShowObjectIcons", m_showObjects?1:0);
596}
597
600{
601 pCmdUI->SetCheck(m_showObjects?1:0);
602}
603
604void WbView::OnUpdateEditPaste(CCmdUI* pCmdUI)
605{
606 MapObject *pTheCopy = WbApp()->getMapObjPasteList();
607 pCmdUI->Enable(pTheCopy != NULL);
608}
609
611{
613 ::AfxGetApp()->WriteProfileInt(MAIN_FRAME_SECTION, "SnapToGrid", m_snapToGrid?1:0);
614}
615
617{
618 pCmdUI->SetCheck(m_snapToGrid?1:0);
619}
620
622{
624 if (pMap==NULL) return;
625 pMap->selectDuplicates();
626}
628{
630 if (pMap==NULL) return;
631 pMap->selectSimilar();
632}
634{
636 if (pMap==NULL) return;
637 pMap->selectInvalidTeam();
638}
639
641{
643 if (pMap==NULL) return;
644
646 for (MapObject* pObj = MapObject::getFirstMapObject(); pObj; pObj = pObj->getNext()) {
647 if (pObj->isSelected()) {
648 const ThingTemplate* tt = pObj->getThingTemplate();
649 if (tt) {
650 sort = tt->getEditorSorting();
651 break;
652 }
653 }
654 }
655
656 PickUnitDialog dlg;
657 if (sort == ES_NONE) {
658 for (int i = ES_FIRST; i<ES_NUM_SORTING_TYPES; i++) {
660 }
661 } else {
662 dlg.SetAllowableType(sort);
663 }
664 dlg.SetFactionOnly(false);
665 if (dlg.DoModal() == IDOK) {
666 const ThingTemplate* thing = dlg.getPickedThing();
667 if (thing) {
670 pDoc->AddAndDoUndoable(pUndo);
671 pUndo->SetThingTemplate(thing);
672 REF_PTR_RELEASE(pUndo); // belongs to pDoc now.
673 }
674 }
675}
676
677
680{
681 Bool reflects = false;
682 Bool multiple = false;
683 Bool first = true;
684
685 MapObject *pMapObj;
686 for (pMapObj = MapObject::getFirstMapObject(); pMapObj; pMapObj = pMapObj->getNext()) {
687 if (!pMapObj->isSelected()) {
688 continue;
689 }
690 if (pMapObj->getFlag(FLAG_DRAWS_IN_MIRROR)) {
691 if (!first && !reflects) {
692 multiple = true;
693 }
694 reflects = true;
695 } else {
696 if (!first && reflects) {
697 multiple = true;
698 }
699 }
700 first = false;
701 }
702 Int val=0;
703 if (reflects) val = 1;
704 if (multiple) val = 2;
705 pCmdUI->SetCheck(val);
706}
707
709{
710 Bool reflects = false;
711
712 MapObject *pMapObj;
713 for (pMapObj = MapObject::getFirstMapObject(); pMapObj; pMapObj = pMapObj->getNext()) {
714 if (!pMapObj->isSelected()) {
715 continue;
716 }
717 if (pMapObj->getFlag(FLAG_DRAWS_IN_MIRROR)) {
718 reflects = true;
719 }
720 }
721
722 CWorldBuilderDoc* pDoc = WbDoc();
723 ModifyFlagsUndoable *pUndo = new ModifyFlagsUndoable(pDoc, FLAG_DRAWS_IN_MIRROR, !reflects);
724 pDoc->AddAndDoUndoable(pUndo);
725 REF_PTR_RELEASE(pUndo); // belongs to pDoc now.
726}
727
728// This is actually lock angle - used to be horizontal & vertical, now just 1.
733
734// This is actually lock angle - used to be horizontal & vertical, now just 1.
736{
737 pCmdUI->SetCheck(m_lockAngle?1:0);
738}
739
740// Obsolete. Delete Jan15,2002 if nobody complains about it being missing. jba.
742{
743// m_lockVertical = !m_lockVertical;
744// if (m_lockVertical) {
745// m_lockHorizontal = false;
746// }
747}
748
749// Obsolete. Delete Jan15,2002 if nobody complains about it being missing. jba.
750void WbView::OnUpdateLockVertical(CCmdUI* pCmdUI)
751{
752// pCmdUI->SetCheck(m_lockVertical?1:0);
753}
754
756{
758
759// GlobalLightOptions globalLightDialog(this);
760// globalLightDialog.DoModal();
761// Coord3D lightRay;
762// lightRay.x=0.0f;lightRay.y=0.0f;lightRay.z=-1.0f; //default light above terrain.
763// doLightFeedback(false,lightRay,0); //turn off the light direction indicator
764}
765
767{
769 ::AfxGetApp()->WriteProfileInt(MAIN_FRAME_SECTION, "ShowWaypoints", m_showWaypoints?1:0);
771}
772
774{
775 pCmdUI->SetCheck(m_showWaypoints?1:0);
776}
777
779{
781 ::AfxGetApp()->WriteProfileInt(MAIN_FRAME_SECTION, "ShowPolygonTriggers", m_showPolygonTriggers?1:0);
782}
783
785{
786 pCmdUI->SetCheck(m_showPolygonTriggers?1:0);
787}
788
790{
791 PlayerListDlg dlg;
792 dlg.DoModal();
793}
794
796{
797 // TODO jkmcd: are we going to ever use this? If so, implement it.
798#if 0
800 Dict dcopy = *d;
801 MapObjectProps editor(&dcopy, "Edit World Info", NULL);
802 if (editor.DoModal() == IDOK)
803 {
804 CWorldBuilderDoc* pDoc = WbDoc();
805 DictItemUndoable *pUndo = new DictItemUndoable(d, dcopy, NAMEKEY_INVALID);
806 pDoc->AddAndDoUndoable(pUndo);
807 REF_PTR_RELEASE(pUndo); // belongs to pDoc now.
808 }
809#endif
810}
811
816
818{
819 pCmdUI->SetCheck((m_pickConstraint == ES_STRUCTURE)?1:0);
820}
821
826
827void WbView::OnUpdatePickInfantry(CCmdUI* pCmdUI)
828{
829 pCmdUI->SetCheck((m_pickConstraint == ES_INFANTRY)?1:0);
830}
831
836
837void WbView::OnUpdatePickVehicles(CCmdUI* pCmdUI)
838{
839 pCmdUI->SetCheck((m_pickConstraint == ES_VEHICLE)?1:0);
840}
841
846
847void WbView::OnUpdatePickShrubbery(CCmdUI* pCmdUI)
848{
849 pCmdUI->SetCheck((m_pickConstraint == ES_SHRUBBERY)?1:0);
850}
851
856
857void WbView::OnUpdatePickManMade(CCmdUI* pCmdUI)
858{
859 pCmdUI->SetCheck((m_pickConstraint == ES_MISC_MAN_MADE)?1:0);
860}
861
866
867void WbView::OnUpdatePickNatural(CCmdUI* pCmdUI)
868{
869 pCmdUI->SetCheck((m_pickConstraint == ES_MISC_NATURAL)?1:0);
870}
871
876
877void WbView::OnUpdatePickDebris(CCmdUI* pCmdUI)
878{
879 pCmdUI->SetCheck((m_pickConstraint == ES_DEBRIS)?1:0);
880}
881
886
887void WbView::OnUpdatePickAnything(CCmdUI* pCmdUI)
888{
889 pCmdUI->SetCheck((m_pickConstraint == ES_NONE)?1:0);
890}
891
896
897void WbView::OnUpdatePickWaypoints(CCmdUI* pCmdUI)
898{
899 pCmdUI->SetCheck((m_pickConstraint == ES_WAYPOINT)?1:0);
900}
901
906
907void WbView::OnUpdatePickRoads(CCmdUI* pCmdUI)
908{
909 pCmdUI->SetCheck((m_pickConstraint == ES_ROAD)?1:0);
910}
911
916
917void WbView::OnUpdatePickSounds(CCmdUI* pCmdUI)
918{
919 pCmdUI->SetCheck((m_pickConstraint == ES_AUDIO) ? 1 : 0);
920}
921
923{
924 m_showNames = m_showNames ? false : true;
925 Invalidate(false);
926 WbView *pView = (WbView *)WbDoc()->GetActive2DView();
927 if (pView != NULL && pView != this) {
928 pView->Invalidate(false);
929 }
930
931 ::AfxGetApp()->WriteProfileInt(MAIN_FRAME_SECTION, "ShowNames", m_showNames?1:0);
932}
933
934void WbView::OnUpdateShowNames(CCmdUI* pCmdUI)
935{
936 pCmdUI->SetCheck(m_showNames ? 1 : 0);
937}
938
940{
941 Bool anyFixes = false;
942 Int i;
943 // Check for duplicate teams.
944 for (i = 0; i < TheSidesList->getNumTeams(); ++i)
945 {
946 Dict *d = TheSidesList->getTeamInfo(i)->getDict();
947
948 AsciiString tname = d->getAsciiString(TheKey_teamName);
949 Int j;
950 for (j=0; j<i; j++) {
951 Dict *prevd = TheSidesList->getTeamInfo(j)->getDict();
952 if (prevd->getAsciiString(TheKey_teamName).compare(tname)==0) {
953 anyFixes = true;
954 CString msg;
955 msg.Format(IDS_DUPLICATE_TEAM_REMOVED, tname.str());
956 AfxMessageBox(msg, MB_OK);
957 TheSidesList->removeTeam(i);
958 i--;
959 break;
960 }
961 }
962 }
963
964 // Check for teams with invalid owners.
965 for (i = 0; i < TheSidesList->getNumTeams(); ++i)
966 {
967 Dict *d = TheSidesList->getTeamInfo(i)->getDict();
968 AsciiString oname = d->getAsciiString(TheKey_teamOwner);
969 AsciiString tname = d->getAsciiString(TheKey_teamName);
970 SidesInfo* pSide = TheSidesList->findSideInfo(oname);
971 Bool found = pSide!=NULL;
972 if (!found) {
973 CString msg;
974 msg.Format(IDS_PLAYERLESS_TEAM_REMOVED, tname.str(), oname.str());
975 AfxMessageBox(msg, MB_OK);
976 anyFixes = true;
977 TheSidesList->removeTeam(i);
978 i--;
979 }
980 }
981
982 // Check for objects with invalid teams. [8/8/2003]
983 MapObject *pMapObj;
984 for (pMapObj = MapObject::getFirstMapObject(); pMapObj; pMapObj = pMapObj->getNext())
985 {
986 // there is no validation code for these items as of yet.
987 if (pMapObj->isScorch() || pMapObj->isWaypoint() || pMapObj->isLight() || pMapObj->getFlag(FLAG_ROAD_FLAGS) || pMapObj->getFlag(FLAG_BRIDGE_FLAGS))
988 {
989 continue;
990 }
991
992 if (pMapObj->getThingTemplate()==NULL) {
993 continue; // Objects that don't have templates don't need teams. [8/8/2003]
994 }
995 // at this point, only objects with models and teams should be left to process
996
997 AsciiString name = pMapObj->getName();
998 AsciiString tmplName = pMapObj->getThingTemplate()->getName();
999
1000 // the following code verifies and fixes the team name, player name, and faction linkages
1001 Bool teamExists;
1002 AsciiString teamName = pMapObj->getProperties()->getAsciiString(TheKey_originalOwner, &teamExists);
1003 if (teamExists) {
1004 TeamsInfo *teamInfo = TheSidesList->findTeamInfo(teamName);
1005 if (teamInfo) {
1006 AsciiString teamOwner = teamInfo->getDict()->getAsciiString(TheKey_teamOwner);
1007 SidesInfo* pSide = TheSidesList->findSideInfo(teamOwner);
1008 if (!pSide) {
1009 teamExists = false;
1010 DEBUG_LOG(("Side '%s' could not be found in sides list!\n", teamOwner.str()));
1011 }
1012 } else {
1013 // Couldn't find team. [8/8/2003]
1014 teamExists = false;
1015 }
1016 } else {
1017 // Object doesn't even have a team name at all. bad. jba. [8/8/2003]
1018 teamExists = false;
1019 }
1020 if (!teamExists) {
1021 // Query the user for a player, and stick it on the default team. [8/8/2003]
1022 AsciiString warning;
1023 warning.format("Object '%s' named '%s' on team '%s' - team doesn't exist. Select player for object...",
1024 tmplName.str(), name.str(), teamName.str());
1025
1026 anyFixes = true;
1027 ::AfxMessageBox(warning.str(), MB_OK);
1028 TeamsInfo ti;
1030 if (fix.DoModal() == IDOK) {
1031 if (fix.pickedValidTeam()) {
1032 AsciiString team;
1033 team.set("team");
1034 team.concat(fix.getSelectedOwner());
1035 if (TheSidesList->findTeamInfo(team)==NULL) {
1036 team.set("team"); // neutral.
1037 }
1038 pMapObj->getProperties()->setAsciiString(TheKey_originalOwner, team);
1039 }
1040 }
1041 }
1042 }
1043
1044
1045 if (anyFixes) {
1046 // Show a message indicating success.
1047 AfxMessageBox(IDS_TEAMS_FIXED, MB_OK|MB_ICONWARNING);
1048 } else {
1049 AfxMessageBox(IDS_NO_PROBLEMS, MB_OK);
1050 }
1051}
1052
1054{
1056 Invalidate(false);
1057 WbView *pView = (WbView *)WbDoc()->GetActive2DView();
1058 if (pView != NULL && pView != this) {
1059 pView->Invalidate(false);
1060 }
1061
1062 ::AfxGetApp()->WriteProfileInt(MAIN_FRAME_SECTION, "ShowTerrain", m_showTerrain ? 1 : 0);
1063}
1064
1066{
1067 pCmdUI->SetCheck(m_showTerrain ? 1 : 0);
1068}
1069
1070
1072{
1073 CTeamsDialog dlg;
1074 dlg.DoModal();
1075}
1076
1077// A sleazy hack for a sleazy hack.
1078extern HWND ApplicationHWnd;
1079int WbView::OnCreate(LPCREATESTRUCT lpcs)
1080{
1081 ApplicationHWnd = m_hWnd;
1082 return CView::OnCreate(lpcs);
1083}
1084
1085void WbView::rulerFeedbackInfo(Coord3D &point1, Coord3D &point2, Real dist)
1086{
1087 m_rulerPoints[0] = point1;
1088 m_rulerPoints[1] = point2;
1089 m_rulerLength = dist;
1090}
BaseHeightMapRenderObjClass * TheTerrainRenderObject
The one-of for the terrain rendering object.
#define NULL
Definition BaseType.h:92
bool Bool
Definition BaseType.h:132
#define FALSE
Definition BaseType.h:113
float Real
Definition BaseType.h:124
#define DEBUG_ASSERTCRASH(c, m)
Definition Debug.h:193
#define DEBUG_LOG(m)
Definition Debug.h:157
HWND ApplicationHWnd
our application window handle
Definition WinMain.cpp:79
#define VK_BACK
Definition keyboard.h:129
#define VK_DELETE
Definition keyboard.h:167
unsigned int UINT
Definition bittype.h:63
@ false
Definition bool.h:59
#define MAIN_FRAME_SECTION
Definition MainFrm.h:56
#define MAP_XY_FACTOR
Definition MapObject.h:60
@ FLAG_ROAD_POINT1
If set, is the first point in a road segment.
Definition MapObject.h:66
@ FLAG_ROAD_POINT2
If set, is the second point in a road segment.
Definition MapObject.h:67
@ FLAG_ROAD_JOIN
If set, this road end does a generic alpha join.
Definition MapObject.h:74
@ FLAG_DRAWS_IN_MIRROR
If set, draws in water mirror.
Definition MapObject.h:65
@ FLAG_ROAD_FLAGS
If nonzero, object is a road piece.
Definition MapObject.h:68
@ FLAG_ROAD_CORNER_ANGLED
If set, the road corner is angled rather than curved.
Definition MapObject.h:69
@ FLAG_ROAD_CORNER_TIGHT
Definition MapObject.h:73
@ FLAG_BRIDGE_FLAGS
If nonzero, object is a bridge piece.
Definition MapObject.h:72
@ NAMEKEY_INVALID
SidesList * TheSidesList
singleton instance of SidesList
EditorSortingType
Definition ThingSort.h:37
@ ES_INFANTRY
Definition ThingSort.h:42
@ ES_NUM_SORTING_TYPES
Definition ThingSort.h:55
@ ES_MISC_MAN_MADE
Definition ThingSort.h:45
@ ES_SHRUBBERY
Definition ThingSort.h:44
@ ES_AUDIO
Definition ThingSort.h:49
@ ES_DEBRIS
Definition ThingSort.h:47
@ ES_WAYPOINT
Definition ThingSort.h:53
@ ES_VEHICLE
Definition ThingSort.h:43
@ ES_NONE
Definition ThingSort.h:40
@ ES_STRUCTURE
Definition ThingSort.h:41
@ ES_ROAD
Definition ThingSort.h:52
@ ES_FIRST
Definition ThingSort.h:38
@ ES_MISC_NATURAL
Definition ThingSort.h:46
TTrackingMode
Definition Tool.h:31
@ TRACK_L
Definition Tool.h:33
@ TRACK_M
Definition Tool.h:34
@ TRACK_R
Definition Tool.h:35
@ TRACK_NONE
Definition Tool.h:32
#define ID_VIEW_SHOWWAYPOINTS
Definition resource.h:643
#define ID_TEAM_EDIT
Definition resource.h:638
#define ID_EDIT_TEAMLIST
Definition resource.h:654
#define ID_EDIT_PICKANYTHING
Definition resource.h:675
#define ID_EDIT_GLOBALLIGHTOPTIONS
Definition resource.h:642
#define IDS_PLAYERLESS_TEAM_REMOVED
Definition resource.h:760
#define ID_LOCK_HORIZONTAL
Definition resource.h:639
#define ID_EDIT_SELECTSIMILAR
Definition resource.h:662
#define ID_VIEW_SHOWPOLYGONTRIGGERS
Definition resource.h:645
#define ID_EDIT_PICKROADS
Definition resource.h:703
#define ID_EDIT_SELECTINVALIDTEAM
Definition resource.h:679
#define IDS_TOO_MANY_TILES
Definition resource.h:734
#define IDS_TOO_MANY_BLENDS
Definition resource.h:735
#define ID_EDIT_DELETE
Definition resource.h:613
#define ID_VIEW_SNAPTOGRID
Definition resource.h:619
#define ID_VIEW_SHOW_TERRAIN
Definition resource.h:716
#define ID_VIEW_SHOW_OBJECTS
Definition resource.h:609
#define IDS_NO_PROBLEMS
Definition resource.h:758
#define ID_EDIT_PICKINFANTRY
Definition resource.h:669
#define ID_OBJECTPROPERTIES_REFLECTSINMIRROR
Definition resource.h:616
#define IDS_DUPLICATE_TEAM_REMOVED
Definition resource.h:759
#define ID_EDIT_PICKVEHICLES
Definition resource.h:670
#define ID_EDIT_PICKMANMADE
Definition resource.h:672
#define ID_VIEW_LABELS
Definition resource.h:677
#define ID_EDIT_SELECTDUP
Definition resource.h:620
#define ID_EDIT_PICKNATURAL
Definition resource.h:673
#define ID_EDIT_PICKSOUNDS
Definition resource.h:715
#define ID_EDIT_PICKSHRUBBERY
Definition resource.h:671
#define ID_EDIT_PLAYERLIST
Definition resource.h:646
#define ID_VALIDATION_FIXTEAMS
Definition resource.h:712
#define IDS_TEAMS_FIXED
Definition resource.h:751
#define ID_EDIT_WORLDINFO
Definition resource.h:647
#define ID_EDIT_PICKWAYPOINTS
Definition resource.h:676
#define ID_EDIT_PICKDEBRIS
Definition resource.h:674
#define ID_EDIT_PICKSTRUCTS
Definition resource.h:668
#define BOOL
Definition Wnd_File.h:57
CWorldBuilderApp * WbApp()
AddObjectUndoable.
Definition CUndoable.h:95
void concat(const AsciiString &stringSrc)
int compare(const AsciiString &stringSrc) const
const char * str() const
void set(const AsciiString &stringSrc)
static AsciiString TheEmptyString
void format(AsciiString format,...)
static CMainFrame * GetMainFrame()
Definition MainFrm.h:88
void OnEditGloballightoptions()
Definition MainFrm.cpp:423
void setMapObjPasteList(MapObject *list)
Note - the app owns this, and will delete it on close.
MapObject * getMapObjPasteList(void)
Note - read only data - make yourself a copy.
void updateCurTool(Bool forceHand)
Check to see if any keyboard overrides are changing the current tool.
static CWorldBuilderDoc * GetActiveDoc()
void AddAndDoUndoable(Undoable *pUndo)
WorldHeightMapEdit * GetHeightMap()
static CWorldBuilderView * GetActive2DView()
Definition Dict.h:67
void setAsciiString(NameKeyType key, const AsciiString &value)
Definition Dict.cpp:496
AsciiString getAsciiString(NameKeyType key, Bool *exists=NULL) const
Definition Dict.cpp:314
static std::string TheActiveLayerName
Definition LayersList.h:129
MapObject * duplicate(void)
Allocates a copy. Caller is responsible for delete-ing this when done with it.
void validate(void)
Bool isLight(void) const
Definition MapObject.h:147
Int getFlags(void) const
Definition MapObject.h:142
const Coord3D * getLocation(void) const
Get the center point.
Definition MapObject.h:126
const ThingTemplate * getThingTemplate(void) const
void setSelected(Bool sel)
Definition MapObject.h:145
Dict * getProperties()
return the object's property sheet.
Definition MapObject.h:123
static MapObject * getFirstMapObject(void)
Definition MapObject.h:182
Bool isScorch(void) const
Definition MapObject.h:149
Bool getFlag(Int flag) const
Definition MapObject.h:141
AsciiString getName(void) const
Gets the object name.
Definition MapObject.h:130
void setNextMap(MapObject *nextMap)
Link the next map object.
Definition MapObject.h:125
Bool isWaypoint(void) const
Definition MapObject.h:148
MapObject * getNext(void) const
Next map object in the list. Not a copy, don't delete it.
Definition MapObject.h:134
Bool isSelected(void) const
Definition MapObject.h:144
static Dict * getWorldDict()
Definition MapObject.h:183
void SetThingTemplate(const ThingTemplate *thing)
const ThingTemplate * getPickedThing(void)
void SetAllowableType(EditorSortingType sort)
void SetFactionOnly(Bool faction)
static void clearSelection(void)
Clears the selected objects selected flags.
static Bool deleteSelectedPolygon(void)
Delete the selected polygon or point.
static Bool isActive(void)
Definition PolygonTool.h:71
Dict * getDict()
Definition SidesList.h:88
const AsciiString & getName() const
return the name of this template
EditorSortingType getEditorSorting() const
get the editor sorting
virtual void setCursor(void)
Definition Tool.cpp:60
virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView *pView, CWorldBuilderDoc *pDoc)
Definition Tool.h:80
virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView *pView, CWorldBuilderDoc *pDoc)
Definition Tool.h:79
virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView *pView, CWorldBuilderDoc *pDoc)
True if the tool tracks the terrain, generally false if it modifies the terrain heights.
Definition Tool.h:78
virtual WorldHeightMapEdit * getHeightMap(void)
Definition Tool.h:81
static Bool isActive(void)
Vector3 m_centerPt
Definition wbview.h:58
afx_msg void OnUpdatePickWaypoints(CCmdUI *pCmdUI)
Definition wbview.cpp:897
afx_msg void OnUpdateEditPaste(CCmdUI *pCmdUI)
Definition wbview.cpp:604
afx_msg void OnViewSnaptogrid()
Definition wbview.cpp:610
afx_msg void OnMouseMove(UINT nFlags, CPoint point)
Definition wbview.cpp:349
afx_msg void OnRButtonDown(UINT nFlags, CPoint point)
Definition wbview.cpp:359
afx_msg BOOL OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message)
Definition wbview.cpp:451
afx_msg int OnCreate(LPCREATESTRUCT lpcs)
Definition wbview.cpp:1079
afx_msg void OnViewShowObjects()
Definition wbview.cpp:587
WbView()
Definition wbview.cpp:51
static Bool m_snapToGrid
Definition wbview.h:69
Bool m_showObjects
Flag whether object icons are drawn in the 2d and 3d view.
Definition wbview.h:71
afx_msg void OnEditPlayerlist()
Definition wbview.cpp:789
afx_msg void OnLockHorizontal()
Definition wbview.cpp:729
afx_msg void OnEditGloballightoptions()
Definition wbview.cpp:755
CWorldBuilderDoc * WbDoc()
Definition wbview.h:141
afx_msg void OnUpdateViewShowpolygontriggers(CCmdUI *pCmdUI)
Definition wbview.cpp:784
afx_msg void OnPickManMade()
Definition wbview.cpp:852
afx_msg void OnUpdatePickDebris(CCmdUI *pCmdUI)
Definition wbview.cpp:877
Coord3D m_rulerPoints[2]
Definition wbview.h:92
WorldHeightMapEdit * getTrackingHeightMap()
Definition wbview.cpp:419
afx_msg void OnEditCopy()
Definition wbview.cpp:505
afx_msg void OnEditSelectdup()
Definition wbview.cpp:621
Bool m_showWaypoints
Definition wbview.h:75
void mouseDown(TTrackingMode m, CPoint viewPt)
Definition wbview.cpp:178
afx_msg void OnUpdateObjectpropertiesReflectsinmirror(CCmdUI *pCmdUI)
Definition wbview.cpp:679
afx_msg void OnUpdateViewShowObjects(CCmdUI *pCmdUI)
Definition wbview.cpp:599
void constrainCenterPt()
Definition wbview.cpp:434
afx_msg void OnUpdatePickSounds(CCmdUI *pCmdUI)
Definition wbview.cpp:917
afx_msg void OnEditWorldinfo()
Definition wbview.cpp:795
afx_msg void OnViewShowpolygontriggers()
Definition wbview.cpp:778
afx_msg void OnUpdatePickRoads(CCmdUI *pCmdUI)
Definition wbview.cpp:907
virtual MapObject * picked3dObjectInView(CPoint viewPt)
Definition wbview.h:146
afx_msg void OnValidationFixTeams()
Definition wbview.cpp:939
Bool m_doLightFeedback
Definition wbview.h:97
afx_msg void OnMButtonUp(UINT nFlags, CPoint point)
Definition wbview.cpp:374
afx_msg void OnViewShowwaypoints()
Definition wbview.cpp:766
afx_msg void OnLButtonDown(UINT nFlags, CPoint point)
Definition wbview.cpp:369
afx_msg void OnPickDebris()
Definition wbview.cpp:872
afx_msg void OnUpdatePickShrubbery(CCmdUI *pCmdUI)
Definition wbview.cpp:847
afx_msg void OnMButtonDown(UINT nFlags, CPoint point)
Definition wbview.cpp:379
CPoint m_mouseDownPoint
Definition wbview.h:85
virtual TPickedStatus picked(MapObject *pObj, Coord3D docPt)
Definition wbview.cpp:389
afx_msg void OnUpdateEditCut(CCmdUI *pCmdUI)
Definition wbview.cpp:555
afx_msg void OnUpdatePickVehicles(CCmdUI *pCmdUI)
Definition wbview.cpp:837
Bool m_doLockAngle
True if we are currently locking.
Definition wbview.h:83
afx_msg void OnPickAnything()
Definition wbview.cpp:882
afx_msg void OnEditPaste()
Definition wbview.cpp:560
Real m_hysteresis
Definition wbview.h:79
Bool m_lockAngle
Reflects the ui button.
Definition wbview.h:81
void mouseMove(TTrackingMode m, CPoint viewPt)
Definition wbview.cpp:197
virtual Bool viewToDocCoords(CPoint curPt, Coord3D *newPt, Bool constrained=true)
Definition wbview.h:110
afx_msg void OnEditSelectsimilar()
Definition wbview.cpp:627
afx_msg void OnShowTerrain()
Definition wbview.cpp:1053
afx_msg void OnUpdateEditCopy(CCmdUI *pCmdUI)
Definition wbview.cpp:544
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
Definition wbview.cpp:488
afx_msg void OnUpdatePickAnything(CCmdUI *pCmdUI)
Definition wbview.cpp:887
afx_msg void OnPickRoads()
Definition wbview.cpp:902
afx_msg void OnEditTeamlist()
Definition wbview.cpp:1071
Coord3D m_mouseDownDocPoint
Definition wbview.h:86
afx_msg void OnUpdateLockVertical(CCmdUI *pCmdUI)
Definition wbview.cpp:750
void mouseUp(TTrackingMode m, CPoint viewPt)
Definition wbview.cpp:317
afx_msg void OnUpdatePickManMade(CCmdUI *pCmdUI)
Definition wbview.cpp:857
afx_msg void OnObjectpropertiesReflectsinmirror()
Definition wbview.cpp:708
Bool m_showNames
Flag whether names are drawn in the 2d and 3d view.
Definition wbview.h:73
afx_msg void OnUpdateViewSnaptogrid(CCmdUI *pCmdUI)
Definition wbview.cpp:616
afx_msg void OnEditDelete()
Definition wbview.cpp:471
EditorSortingType m_pickConstraint
Definition wbview.h:99
Real m_rulerLength
Definition wbview.h:93
afx_msg void OnPickNatural()
Definition wbview.cpp:862
TTrackingMode m_trackingMode
Definition wbview.h:57
afx_msg void OnPickVehicles()
Definition wbview.cpp:832
afx_msg void OnPickStructures()
Definition wbview.cpp:812
afx_msg void OnUpdateShowNames(CCmdUI *pCmdUI)
Definition wbview.cpp:934
afx_msg void OnUpdateLockHorizontal(CCmdUI *pCmdUI)
Definition wbview.cpp:735
Bool m_showPolygonTriggers
Definition wbview.h:76
virtual ~WbView()
Definition wbview.cpp:74
afx_msg void OnPickInfantry()
Definition wbview.cpp:822
afx_msg void OnUpdateShowTerrain(CCmdUI *pCmdUI)
Definition wbview.cpp:1065
afx_msg void OnPickWaypoints()
Definition wbview.cpp:892
afx_msg void OnPickSounds()
Definition wbview.cpp:912
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
Definition wbview.cpp:499
afx_msg void OnEditCut()
Definition wbview.cpp:549
Bool m_showTerrain
Flag whether terrain is rendered or not. (Useful for debugging)
Definition wbview.h:77
afx_msg void OnRButtonUp(UINT nFlags, CPoint point)
Definition wbview.cpp:354
int m_doRulerFeedback
Definition wbview.h:91
afx_msg void OnLButtonUp(UINT nFlags, CPoint point)
Definition wbview.cpp:364
afx_msg void OnShowNames()
Definition wbview.cpp:922
afx_msg void OnUpdateViewShowwaypoints(CCmdUI *pCmdUI)
Definition wbview.cpp:773
afx_msg void OnUpdatePickInfantry(CCmdUI *pCmdUI)
Definition wbview.cpp:827
afx_msg void OnEditReplace()
Definition wbview.cpp:640
virtual void OnDraw(CDC *pDC)
Definition wbview.cpp:154
afx_msg void OnEditSelectinvalidteam()
Definition wbview.cpp:633
afx_msg void OnPickShrubbery()
Definition wbview.cpp:842
afx_msg void OnUpdatePickStructures(CCmdUI *pCmdUI)
Definition wbview.cpp:817
void rulerFeedbackInfo(Coord3D &point1, Coord3D &point2, Real dist)
Definition wbview.cpp:1085
afx_msg void OnLockVertical()
Definition wbview.cpp:741
afx_msg void OnUpdatePickNatural(CCmdUI *pCmdUI)
Definition wbview.cpp:867
Bool tooManyTextures(void)
Bool selectDuplicates(void)
Selects any dupicate map objects.
void clearStatus(void)
Status methods.
Bool selectInvalidTeam(void)
Selects any objects with invalid teams.
Bool selectSimilar(void)
Selects any dupicate map objects.
Int getXExtent(void)
number of vertices in x
void getTerrainColorAt(Real x, Real y, RGBColor *pColor)
Int getYExtent(void)
number of vertices in y
MSG msg
Definition patch.cpp:409
#define REF_PTR_RELEASE(x)
Definition refcount.h:80
Real x
Definition BaseType.h:333
Real y
Definition BaseType.h:333
Real length(void) const
Definition BaseType.h:335
Real z
Definition BaseType.h:333
Real blue
Definition BaseType.h:462
Real green
Definition BaseType.h:462
Real red
Definition BaseType.h:462
TPickedStatus
Definition wbview.h:36
@ PICK_NONE
Definition wbview.h:37
@ PICK_ARROW
Definition wbview.h:39
@ PICK_CENTER
Definition wbview.h:38
@ RULER_NONE
Definition wbview.h:43
@ RULER_CIRCLE
Definition wbview.h:45