forked from macroquest/eqlib
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCXWnd.h
1170 lines (1040 loc) · 49 KB
/
CXWnd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* MacroQuest: The extension platform for EverQuest
* Copyright (C) 2002-2022 MacroQuest Authors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2, as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#pragma once
#include "Common.h"
#include "Containers.h"
#include "CXStr.h"
#include "UIHelpers.h"
#include "XMLData.h"
#include <mq/base/Color.h>
#ifdef IsMinimized
#undef IsMinimized
#endif
#ifdef IsMaximized
#undef IsMaximized
#endif
#ifdef GetWindowText
#undef GetWindowText
#endif
namespace eqlib {
class CRadioGroup;
class CSidlManagerBase;
class CTextureFont;
// Message types for WndNotifications
#define XWM_LCLICK 1
#define XWM_LMOUSEUP 2
#define XWM_RCLICK 3
#define XWM_LDBLCLICK 4
#define XWM_RDBLCLICK 5
#define XWM_HITENTER 6
#define XWM_TAB 7
#define XWM_SHIFTTAB 8
#define XWM_QMARKBOX 9
#define XWM_CLOSE 10
#define XWM_CHILDCLOSED 11
#define XWM_TOOLTIP 12
#define XWM_REQUESTINFO 13
#define XWM_NEWVALUE 14
#define XWM_COLUMNCLICK 15
#define XWM_SORTREQUEST 16
#define XWM_LISTBOX_EDIT_UPDATE 17
#define XWM_CLICKSTICKSTART 18
#define XWM_IS_LINK_ACTIVE 19
#define XWM_MENUSELECT 20
#define XWM_MOUSEOVER 21
#define XWM_HISTORY 22
#define XWM_LCLICKHOLD 23
#define XWM_RCLICKHOLD 24
#define XWM_LBUTTONUPAFTERHELD 25
#define XWM_RBUTTONUPAFTERHELD 26
#define XWM_LINK 27
#define XWM_FINDERITEMOPEN 28
#define XWM_MAXIMIZEBOX 29
#define XWM_TITLEBAR 30
#define XWM_ACHIEVEMENTLINK 31
#define XWM_NOTSURE32 32
#define XWM_DIALOGRESPONSELINK 33
#define XWM_SPELL_LINK 34
#define XWM_FOCUS 35
#define XWM_LOSTFOCUS 36
#define XWM_RELOAD_FROM_SIDL 37
#define XWM_ACTIVATE 38
#define XWM_SLIDER_COMPLETE 39
#define XWM_SLIDER_COMPLEX_EX 40
#define XWM_COLORPICKER_COMPLETE 41
#define XWM_TEXTENTRY_COMPLETE 42
#define XWM_FILESELECTION_COMPLETE 43
#define XWM_ICONSELECTION_COMPLETE 44
#define XWM_RELOAD_INI 45
#define XWM_THUMBTRACK 46
#define XWM_SELITEM_DOWN 47
#define XWM_FIRST_USER 48
#define XWM_RSELITEM_DOWN 49
#define XWM_OUTPUT_TEXT 50
#define XWM_COMMANDLINK 51
#define XWM_RAIDINVITE_LINK 52
#define XWM_FACTION_LINK 53
// Defines for CXWnd WindowStyle
#define CWS_VSCROLL 0x00000001
#define CWS_HSCROLL 0x00000002
#define CWS_TITLE 0x00000004
#define CWS_CLOSE 0x00000008
#define CWS_TILEBOX 0x00000010
#define CWS_MINIMIZE 0x00000020
#define CWS_BORDER 0x00000040
#define CWS_RELATIVERECT 0x00000080
#define CWS_AUTOSTRETCHV 0x00000100
#define CWS_RESIZEALL 0x00000200
#define CWS_TRANSPARENT 0x00000400
#define CWS_USEMYALPHA 0x00000800
#define CWS_DOCKING 0x00001000
#define CWS_TOOLTIP_NODELAY 0x00002000
#define CWS_FRAMEWND 0x00004000
#define CWS_NOHITTEST 0x00008000
#define CWS_QMARK 0x00010000
#define CWS_NOMOVABLE 0x00020000
#define CWS_MAXIMIZE 0x00040000
#define CWS_AUTOVSCROLL 0x00080000
#define CWS_AUTOHSCROLL 0x00100000
#define CWS_CLIENTMOVABLE 0x00200000
#define CWS_AUTOSTRETCH 0x00400000
#define CWS_TRANSPARENTCONTROL 0x00800000
#define CWS_RESIZEBORDER CWS_BORDER | CWS_RESIZEALL
#define ToggleBit(field, bit) ((field) ^= (bit));
#define BitOn(field, bit) ((field) |= (bit));
#define BitOff(field, bit) ((field) &= (~bit));
#define BitSet(field, bit) ((field) |= (1 << bit));
#define BitClear(field, bit) ((field) &= (~(1 << bit)));
// End CXWnd WindowStyle Defines
// For use with CXWndManager
enum eKeyboardFlags {
KeyboardFlags_Shift = 0x01,
KeyboardFlags_Ctrl = 0x02,
KeyboardFlags_LAlt = 0x04,
KeyboardFlags_RAlt = 0x08,
KeyboardFlags_Alt = KeyboardFlags_LAlt | KeyboardFlags_RAlt,
};
enum EScrollCode
{
ScrollCodeUp,
ScrollCodeUpContinue,
ScrollCodeDown,
ScrollCodeDownContinue,
ScrollCodeAbsolute,
ScrollCodePageUp,
ScrollCodePageDown
};
enum EWndRuntimeType
{
WRT_WND = 0,
WRT_LISTWND,
WRT_EDITWND,
WRT_TREEWND,
WRT_PAGEWND,
WRT_TABWND,
WRT_HOTKEYWND,
WRT_EDITHOTKEYWND,
WRT_RANGESLIDERWND,
WRT_STMLWND,
WRT_BROWSERWND,
WRT_MODALMESSAGEWND,
WRT_CHECKBOXWND,
WRT_SIDLSCREENWND,
WRT_SLIDERWND,
WRT_LABEL,
WRT_BUTTON,
WRT_GAUGE,
WRT_COMBOBOX,
WRT_CHATWND,
WRT_HELPWND,
};
EQLIB_API const char* EWndRuntimeTypeToString(EWndRuntimeType type);
using EDockAction = uint32_t;
//----------------------------------------------------------------------------
struct [[offsetcomments]] SDragDropInfo
{
/*0x00*/ bool m_rightMouse;
/*0x08*/ CXWnd* sourceWnd;
/*0x10*/ CXWnd* targetWnd;
/*0x18*/ CXPoint sourcePos;
/*0x20*/ CXPoint targetPos;
/*0x28*/ int message;
/*0x30*/ uintptr_t data;
/*0x38*/
};
class [[offsetcomments]] CClickStickInfo
{
CClickStickInfo() = default;
virtual ~CClickStickInfo() {}
/*0x08*/ CXWnd* sourceWnd;
/*0x10*/ CXWnd* targetWnd;
/*0x18*/ CXPoint sourcePos;
/*0x20*/ CXPoint targetPos;
/*0x28*/ int message;
/*0x30*/ uintptr_t data;
/*0x38*/
};
class CLayoutStrategy
{
public:
~CLayoutStrategy() {}
virtual bool LayoutChildren(CXWnd* wnd) {}
};
class CursorClass
{
public:
enum { eNumCursors = 7 };
enum eCursorTypes
{
eArrow,
eMove,
eBeam,
eNorthEastSouthWest,
eNorthWestSouthEast,
eNorthSouth,
eEastWest
};
enum eDisplayMode
{
eNormal,
eScreenShot
};
const char* CursorName[eNumCursors];
HCURSOR CursorList[eNumCursors];
bool bScreenShotMode;
};
//============================================================================
// CXWnd
//============================================================================
// @sizeof(CXWnd) == 0x268 :: 2022-08-15 (live) @ 0x14051c896
constexpr size_t CXWnd_size = 0x268;
constexpr size_t CXWnd_vftable_size = 0x2D0;
class [[offsetcomments]] CXWnd
: public TListNode<CXWnd> // node in list of siblings
, public TList<CXWnd> // list of children
{
public:
EQLIB_OBJECT CXWnd(CXWnd* parent = nullptr, uint32_t id = 0, CXRect rect = {});
//----------------------------------------------------------------------------
EQLIB_OBJECT virtual bool IsValid() const { return ValidCXWnd; }
EQLIB_OBJECT virtual ~CXWnd();
EQLIB_OBJECT virtual int DrawNC() const;
EQLIB_OBJECT virtual int Draw() { return 0; }
EQLIB_OBJECT virtual int PostDraw() { return 0; }
EQLIB_OBJECT virtual int DrawCursor(const CXPoint& mousePos, const CXRect& clip, bool& drawn);
EQLIB_OBJECT virtual int DrawChildItem(const CXWnd* child, void* item) const { return 0; }
EQLIB_OBJECT virtual int DrawCaret() const { return 0; }
EQLIB_OBJECT virtual int DrawBackground() const;
EQLIB_OBJECT virtual int DrawTooltip(const CXWnd* wnd) const;
EQLIB_OBJECT virtual int DrawTooltipAtPoint(const CXPoint& pos, const CXStr& tooltip = {}) const;
EQLIB_OBJECT virtual CXRect GetMinimizedRect() const;
EQLIB_OBJECT virtual int DrawTitleBar(const CXRect& rect) const;
EQLIB_OBJECT virtual HCURSOR GetCursorToDisplay() const;
EQLIB_OBJECT virtual int HandleLButtonDown(const CXPoint& pos, uint32_t flags);
EQLIB_OBJECT virtual int HandleLButtonUp(const CXPoint& pos, uint32_t flags);
EQLIB_OBJECT virtual int HandleLButtonHeld(const CXPoint& pos, uint32_t flags);
EQLIB_OBJECT virtual int HandleLButtonUpAfterHeld(const CXPoint& pos, uint32_t flags);
EQLIB_OBJECT virtual int HandleRButtonDown(const CXPoint& pos, uint32_t flags);
EQLIB_OBJECT virtual int HandleRButtonUp(const CXPoint& pos, uint32_t flags);
EQLIB_OBJECT virtual int HandleRButtonHeld(const CXPoint& pos, uint32_t flags);
EQLIB_OBJECT virtual int HandleRButtonUpAfterHeld(const CXPoint& pos, uint32_t flags);
EQLIB_OBJECT virtual int HandleWheelButtonDown(const CXPoint& pos, uint32_t flags);
EQLIB_OBJECT virtual int HandleWheelButtonUp(const CXPoint& pos, uint32_t flags);
EQLIB_OBJECT virtual int HandleMouseMove(const CXPoint& pos, uint32_t flags);
EQLIB_OBJECT virtual int HandleWheelMove(const CXPoint& pos, int scroll, uint32_t flags);
EQLIB_OBJECT virtual int HandleKeyboardMsg(uint32_t message, uint32_t flags, bool down);
EQLIB_OBJECT virtual int HandleMouseLeave();
EQLIB_OBJECT virtual int OnDragDrop(SDragDropInfo* info);
EQLIB_OBJECT virtual HCURSOR GetDragDropCursor(SDragDropInfo* info) const;
EQLIB_OBJECT virtual bool QueryDropOK(SDragDropInfo* info) const;
EQLIB_OBJECT virtual int OnClickStick(CClickStickInfo* info, uint32_t flags, bool unk);
EQLIB_OBJECT virtual HCURSOR GetClickStickCursor(CClickStickInfo* info) const;
EQLIB_OBJECT virtual bool QueryClickStickDropOK(CClickStickInfo* info) const;
EQLIB_OBJECT virtual int WndNotification(CXWnd* sender, uint32_t message, void* data = nullptr);
EQLIB_OBJECT virtual void OnWndNotification();
EQLIB_OBJECT virtual void Activate() { Show(true); }
EQLIB_OBJECT virtual void Deactivate() { Show(false); }
EQLIB_OBJECT bool IsActive() const { return bActive; }
EQLIB_OBJECT virtual int OnShow();
EQLIB_OBJECT virtual int OnMove(const CXRect& rect);
EQLIB_OBJECT virtual int OnResize(int w, int h);
EQLIB_OBJECT virtual int OnBeginMoveOrResize();
EQLIB_OBJECT virtual int OnCompleteMoveOrResize();
EQLIB_OBJECT virtual int OnMinimizeBox();
EQLIB_OBJECT bool IsMinimized() const { return Minimized; }
EQLIB_OBJECT void SetMinimized(bool bValue) { Minimized = bValue; }
EQLIB_OBJECT virtual int OnMaximizeBox();
EQLIB_OBJECT bool IsMaximized() const { return bMaximized; }
EQLIB_OBJECT virtual int OnTileBox();
EQLIB_OBJECT bool IsTiled() const { return bTiled; }
EQLIB_OBJECT virtual int OnTile() { return 0; }
EQLIB_OBJECT virtual int OnSetFocus(CXWnd* old);
EQLIB_OBJECT virtual int OnKillFocus(CXWnd* old);
EQLIB_OBJECT virtual int OnProcessFrame();
EQLIB_OBJECT virtual int OnVScroll(EScrollCode code, int pos);
EQLIB_OBJECT virtual int OnHScroll(EScrollCode code, int pos);
EQLIB_OBJECT virtual int OnBroughtToTop() { return 0; }
EQLIB_OBJECT virtual int OnActivate(CXWnd* old) { return 0; }
EQLIB_OBJECT virtual int Show(bool show = true, bool bringToTop = true, bool updateLayout = true);
EQLIB_OBJECT virtual bool AboutToShow();
EQLIB_OBJECT virtual bool AboutToHide();
EQLIB_OBJECT virtual int RequestDockInfo(EDockAction action, CXWnd* wnd, CXRect* rect) { return 0; }
EQLIB_OBJECT virtual CXStr GetTooltip() const { return Tooltip; }
EQLIB_OBJECT void SetTooltip(const CXStr& Value) { Tooltip = Value; }
EQLIB_OBJECT virtual void Unknown0x0EC();
EQLIB_OBJECT virtual int HitTest(const CXPoint& pos, int* result) const;
EQLIB_OBJECT virtual CXRect GetHitTestRect(int code) const;
EQLIB_OBJECT virtual CXRect GetInnerRect() const;
EQLIB_OBJECT virtual CXRect GetClientRect() const;
EQLIB_OBJECT virtual CXRect GetClientClipRect() const;
EQLIB_OBJECT virtual CXSize GetMinSize(bool withBorder = true) const;
EQLIB_OBJECT virtual CXSize GetMaxSize(bool withBorder = true) const;
EQLIB_OBJECT virtual CXSize GetUntileSize() const { return Location.GetSize(); }
EQLIB_OBJECT virtual bool IsPointTransparent(const CXPoint& point) const { return false; }
EQLIB_OBJECT virtual bool ShouldProcessChildrenFrames() const { return IsVisible() && !IsMinimized(); }
EQLIB_OBJECT virtual bool ShouldProcessControllerFrame() const { return IsVisible() && !IsMinimized(); }
EQLIB_OBJECT virtual void SetDrawTemplate(CXWndDrawTemplate* drawTemplate) { DrawTemplate = drawTemplate; }
EQLIB_OBJECT virtual int UpdateGeometry(const CXRect& rect, bool updateLayout = true, bool forceUpdateLayout = false,
bool completeMoveOrResize = false, bool moveAutoStretch = false);
EQLIB_OBJECT virtual int Move(const CXPoint& point);
EQLIB_OBJECT virtual void SetWindowText(const CXStr& text) { WindowText = text; }
DEPRECATE("Use SetWindowText instead of SetWindowTextA") inline void SetWindowTextA(const CXStr& text) { this->SetWindowText(text); }
EQLIB_OBJECT CXStr GetWindowText() const { return WindowText; }
EQLIB_OBJECT virtual CXWnd* GetChildWndAt(const CXPoint& pos, bool, bool) const;
EQLIB_OBJECT virtual CScreenPieceTemplate* GetSidlPiece(const CXStr& screenId, bool top = true) const;
EQLIB_OBJECT virtual const CXStr* GetWindowName() const { return nullptr; }
EQLIB_OBJECT virtual int SetVScrollPos(int pos);
EQLIB_OBJECT virtual int SetHScrollPos(int pos);
EQLIB_OBJECT virtual int AutoSetVScrollPos(CXRect rect);
EQLIB_OBJECT virtual int AutoSetHScrollPos(CXRect rect);
EQLIB_OBJECT virtual void SetAttributesFromSidl(CParamScreenPiece* screenPiece);
EQLIB_OBJECT virtual void OnReloadSidl() {}
EQLIB_OBJECT virtual bool HasActivatedFirstTimeAlert() const { return false; }
EQLIB_OBJECT virtual void SetHasActivatedFirstTimeAlert(bool) {}
EQLIB_OBJECT virtual const CXSize& GetMinClientSize() const { return MinClientSize; }
EQLIB_OBJECT void SetMinClientSize(const CXSize& pt) { MinClientSize = pt; }
EQLIB_OBJECT virtual const CXSize& GetMaxClientSize() const { return MaxClientSize; }
EQLIB_OBJECT virtual CEditWnd* GetActiveEditWnd() const { return nullptr; }
EQLIB_OBJECT virtual void UpdateLayout(bool finish = false);
void SetClientRectDirty(bool dirty);
bool IsClientRectDirty() const { return bClientRectChanged; }
bool IsClientClipRectDirty() const { return bClientClipRectChanged; }
bool IsScreenClipRectDirty() const { return bScreenClipRectChanged; }
DEPRECATE("CGetWindowText: Use GetWindowText() instead") CXStr CGetWindowText() const { return GetWindowText(); }
DEPRECATE("CSetWindowText: Use SetWindowText() instead") void CSetWindowText(const CXStr& text) { SetWindowText(text); }
// Renamed Move -> UpdateLayout to avoid having two virtuals with the same name. This just exists for backwards compatibility.
inline int Move(const CXRect& rect, bool updateLayout = true, bool forceUpdateLayout = false,
bool completeMoveOrResize = false, bool moveAutoStretch = false)
{
return UpdateGeometry(rect, updateLayout, forceUpdateLayout, completeMoveOrResize, moveAutoStretch);
}
public:
// functions we have offsets for
EQLIB_OBJECT bool IsType(EWndRuntimeType eType) const;
EQLIB_OBJECT CXWnd* SetFocus();
EQLIB_OBJECT void ClrFocus();
EQLIB_OBJECT int Destroy();
EQLIB_OBJECT void Refade();
EQLIB_OBJECT int ProcessTransition();
EQLIB_OBJECT void BringToTop(bool bRecurse = true);
EQLIB_OBJECT void StartFade(unsigned char, uint32_t);
EQLIB_OBJECT int Minimize(bool);
EQLIB_OBJECT bool IsReallyVisible() const;
EQLIB_OBJECT int DoAllDrawing() const;
EQLIB_OBJECT int DrawChildren() const;
EQLIB_OBJECT void Center();
EQLIB_OBJECT void Right();
EQLIB_OBJECT CXRect GetScreenClipRect() const;
EQLIB_OBJECT bool IsDescendantOf(CXWnd const*) const;
EQLIB_OBJECT const CTAFrameDraw* GetBorderFrame() const;
EQLIB_OBJECT CXRect GetScreenRect() const;
EQLIB_OBJECT int Resize(int Width, int Height, bool bUpdateLayout = true, bool bCompleteMoveOrResize = false, bool bMoveAutoStretch = false);
EQLIB_OBJECT CXWnd* SetParent(CXWnd*, bool);
EQLIB_OBJECT void SetMouseOver(bool);
EQLIB_OBJECT void SetKeyTooltip(int, int);
EQLIB_OBJECT int SetFont(CTextureFont*);
EQLIB_OBJECT static void DrawColoredRect(const CXRect& rect, COLORREF color, const CXRect& clipRect);
//EQLIB_OBJECT bool HasFocus() const;
//EQLIB_OBJECT const CButtonDrawTemplate* GetCloseBoxTemplate() const;
//EQLIB_OBJECT const CButtonDrawTemplate* GetMinimizeBoxTemplate() const;
//EQLIB_OBJECT const CButtonDrawTemplate* GetTileBoxTemplate() const;
//EQLIB_OBJECT const CTAFrameDraw* GetTitlebarHeader() const;
//EQLIB_OBJECT CXRect GetRelativeRect() const;
//EQLIB_OBJECT CXWnd* GetChildWndAt(CXPoint*, int, int) const;
//EQLIB_OBJECT int DrawCloseBox() const;
//EQLIB_OBJECT int DrawHScrollbar(int, int, int) const;
//EQLIB_OBJECT int DrawMinimizeBox() const;
//EQLIB_OBJECT int DrawTileBox() const;
//EQLIB_OBJECT int DrawVScrollbar(int, int, int) const;
//EQLIB_OBJECT int GetWidth() const;
//EQLIB_OBJECT void Bottom();
//EQLIB_OBJECT void BringChildWndToTop(CXWnd*);
//EQLIB_OBJECT void Left();
//EQLIB_OBJECT void SetFirstChildPointer(CXWnd*);
//EQLIB_OBJECT void SetLookLikeParent();
//EQLIB_OBJECT void SetNextSibPointer(CXWnd*);
// -----------------------------------------------------------------------
EQLIB_OBJECT UIType GetType() const;
EQLIB_OBJECT CXMLData* GetXMLData() const;
EQLIB_OBJECT CXMLData* GetXMLData(CXMLDataManager* dataMgr) const;
EQLIB_OBJECT CXWnd* GetChildItem(const CXStr&);
EQLIB_OBJECT CXWnd* GetChildItem(CXMLDataManager* dataMgr, const CXStr&);
EQLIB_OBJECT bool IsVisible() const { return dShow; }
EQLIB_OBJECT void SetVisible(bool bValue) { dShow = bValue; }
EQLIB_OBJECT void SetClickThrough(bool bValue) { bClickThrough = bValue; }
EQLIB_OBJECT void SetMaximizable(bool bValue) { bMaximizable = bValue; }
EQLIB_OBJECT CTextureFont* GetFont() const { return pFont; }
EQLIB_OBJECT void SetEscapable(bool bValue) { CloseOnESC = bValue; }
EQLIB_OBJECT void SetEscapableLocked(bool bValue) { bEscapableLocked = bValue; }
EQLIB_OBJECT CXWnd* GetParentWindow() const { return ParentWindow; }
EQLIB_OBJECT CXWnd* GetParent() const { return ParentWindow; }
EQLIB_OBJECT void SetParentWindow(CXWnd* pWnd) { ParentWindow = pWnd; };
EQLIB_OBJECT const CXWnd* GetFirstChildWnd() const { return GetFirstNode(); }
EQLIB_OBJECT CXWnd* GetFirstChildWnd() { return GetFirstNode(); }
EQLIB_OBJECT const CXWnd* GetNextSiblingWnd() const { return GetNext(); }
EQLIB_OBJECT CXWnd* GetNextSiblingWnd() { return GetNext(); }
EQLIB_OBJECT int GetVScrollMax() const { return VScrollMax; }
EQLIB_OBJECT int GetVScrollPos() const { return VScrollPos; }
EQLIB_OBJECT int GetHScrollMax() const { return HScrollMax; }
EQLIB_OBJECT int GetHScrollPos() const { return HScrollPos; }
EQLIB_OBJECT bool IsMouseOver() const { return MouseOver; }
EQLIB_OBJECT CXRect GetLocation() const { return Location; }
EQLIB_OBJECT void SetLocation(const CXRect& r) { Location = r; }
EQLIB_OBJECT CXRect GetOldLocation() { return OldLocation; }
EQLIB_OBJECT void SetNeedsSaving(bool bValue) { bNeedsSaving = bValue; }
EQLIB_OBJECT void SetClientRectChanged(bool bValue) { bClientRectChanged = bValue; }
EQLIB_OBJECT COLORREF GetBGColor() const { return BGColor; }
EQLIB_OBJECT void SetBGColor(COLORREF Value) { BGColor = Value; }
EQLIB_OBJECT void SetBGColor(mq::MQColor Value) { BGColor = Value.ToARGB(); }
EQLIB_OBJECT void SetDisabledBackground(COLORREF Value) { DisabledBackground = Value; }
EQLIB_OBJECT COLORREF GetDisabledBackground() const { return DisabledBackground; }
EQLIB_OBJECT bool IsEnabled() const { return Enabled; }
EQLIB_OBJECT void SetEnabled(bool bValue) { Enabled = bValue; }
EQLIB_OBJECT uint32_t GetWindowStyle() const { return WindowStyle; }
EQLIB_OBJECT void SetWindowStyle(uint32_t Value) { WindowStyle = Value; }
EQLIB_OBJECT void AddStyle(uint32_t Value) { WindowStyle |= Value; }
EQLIB_OBJECT void RemoveStyle(uint32_t Value) { WindowStyle &= ~Value; }
EQLIB_OBJECT void SetClipToParent(bool bValue) { bClipToParent = bValue; }
EQLIB_OBJECT void SetUseInLayoutHorizontal(bool bValue) { bUseInLayoutHorizontal = bValue; }
EQLIB_OBJECT void SetUseInLayoutVertical(bool bValue) { bUseInLayoutVertical = bValue; }
EQLIB_OBJECT void SetZLayer(int Value) { ZLayer = Value; }
EQLIB_OBJECT int GetZLayer() const { return ZLayer; }
EQLIB_OBJECT CXWndDrawTemplate* GetDrawTemplate() const { return DrawTemplate; }
EQLIB_OBJECT void SetActive(bool bValue) { bActive = bValue; }
EQLIB_OBJECT void SetLocked(bool bValue) { Locked = bValue; }
EQLIB_OBJECT bool IsLocked() const { return Locked; }
EQLIB_OBJECT void SetFades(bool bValue) { Fades = bValue; }
EQLIB_OBJECT bool GetFades() const { return Fades; }
EQLIB_OBJECT void SetFaded(bool bValue) { Faded = bValue; }
EQLIB_OBJECT bool GetFaded() const { return Faded; }
EQLIB_OBJECT void SetFadeDelay(int Value) { FadeDelay = Value; }
EQLIB_OBJECT int GetFadeDelay() const { return FadeDelay; }
EQLIB_OBJECT void SetBGType(uint32_t Value) { BGType = Value; }
EQLIB_OBJECT uint32_t GetBGType() const { return BGType; }
EQLIB_OBJECT void SetFadeDuration(uint32_t Value) { FadeDuration = Value; }
EQLIB_OBJECT uint32_t GetFadeDuration() const { return FadeDuration; }
EQLIB_OBJECT void SetAlpha(uint8_t Value) { Alpha = Value; }
EQLIB_OBJECT uint8_t GetAlpha() const { return Alpha; }
EQLIB_OBJECT void SetFadeToAlpha(uint8_t Value) { FadeToAlpha = Value; }
EQLIB_OBJECT uint8_t GetFadeToAlpha() const { return FadeToAlpha; }
EQLIB_OBJECT bool GetClickable() const { return Clickable; }
EQLIB_OBJECT void SetClickable(bool bValue) { Clickable = bValue; }
EQLIB_OBJECT void SetData(int64_t Value) { Data = Value; }
EQLIB_OBJECT int64_t GetData() const { return Data; }
EQLIB_OBJECT void SetClickThroughMenuItemStatus(bool bValue) { bClickThroughMenuItemStatus = bValue; }
EQLIB_OBJECT void SetShowClickThroughMenuItem(bool bValue) { bShowClickThroughMenuItem = bValue; }
EQLIB_OBJECT void SetBottomAnchoredToTop(bool bValue) { bBottomAnchoredToTop = bValue; }
EQLIB_OBJECT void SetLeftAnchoredToLeft(bool bValue) { bLeftAnchoredToLeft = bValue; }
EQLIB_OBJECT void SetRightAnchoredToLeft(bool bValue) { bRightAnchoredToLeft = bValue; }
EQLIB_OBJECT void SetTopAnchoredToTop(bool bValue) { bTopAnchoredToTop = bValue; }
EQLIB_OBJECT void SetOffsets(const CXRect& rect)
{
TopOffset = rect.top;
BottomOffset = rect.bottom;
LeftOffset = rect.left;
RightOffset = rect.right;
}
EQLIB_OBJECT void SetTopOffset(int Value) { TopOffset = Value; }
EQLIB_OBJECT int GetTopOffset() const { return TopOffset; }
EQLIB_OBJECT void SetBottomOffset(int Value) { BottomOffset = Value; }
EQLIB_OBJECT int GetBottomOffset() const { return BottomOffset; }
EQLIB_OBJECT void SetLeftOffset(int Value) { LeftOffset = Value; }
EQLIB_OBJECT int GetLeftOffset() const { return LeftOffset; }
EQLIB_OBJECT void SetRightOffset(int Value) { RightOffset = Value; }
EQLIB_OBJECT int GetRightOffset() const { return RightOffset; }
EQLIB_OBJECT int GetXMLIndex() const { return XMLIndex; }
EQLIB_OBJECT void SetXMLTooltip(const CXStr& Value) { XMLToolTip = Value; }
EQLIB_OBJECT CXStr GetXMLTooltip() const { return XMLToolTip; }
EQLIB_OBJECT void SetCRNormal(mq::MQColor Value) { CRNormal = Value.ToARGB(); }
EQLIB_OBJECT void SetCRNormal(COLORREF Value) { CRNormal = Value; }
EQLIB_OBJECT void SetBringToTopWhenClicked(bool bValue) { bBringToTopWhenClicked = bValue; }
EQLIB_OBJECT bool GetNeedsSaving() const { return bNeedsSaving; }
EQLIB_OBJECT int GetParentAndContextMenuArrayIndex() const { return ParentAndContextMenuArrayIndex; }
EQLIB_OBJECT CXStr GetXMLName() const;
EQLIB_OBJECT CXStr GetTypeName() const;
inline int ParentWndNotification(CXWnd* sender, uint32_t message, void* data) const
{
if (pController)
{
pController->WndNotification(sender, message, data);
}
if (ParentWindow)
{
return ParentWindow->WndNotification(sender, message, data);
}
return 0;
}
struct [[offsetcomments]] VirtualFunctionTable
{
/*0x000*/ void* IsValid;
/*0x008*/ void* Destructor;
/*0x010*/ void* DrawNC;
/*0x018*/ void* Draw;
/*0x020*/ void* PostDraw;
/*0x028*/ void* DrawCursor;
/*0x030*/ void* DrawChildItem;
/*0x038*/ void* DrawCaret;
/*0x040*/ void* DrawBackground;
/*0x048*/ void* DrawTooltip;
/*0x050*/ void* DrawTooltipAtPoint;
/*0x058*/ void* GetMinimizedRect;
/*0x060*/ void* DrawTitleBar;
/*0x068*/ void* GetCursorToDisplay;
/*0x070*/ void* HandleLButtonDown;
/*0x078*/ void* HandleLButtonUp;
/*0x080*/ void* HandleLButtonHeld;
/*0x088*/ void* HandleLButtonUpAfterHeld;
/*0x090*/ void* HandleRButtonDown;
/*0x098*/ void* HandleRButtonUp;
/*0x0a0*/ void* HandleRButtonHeld;
/*0x0a8*/ void* HandleRButtonUpAfterHeld;
/*0x0b0*/ void* HandleWheelButtonDown;
/*0x0b8*/ void* HandleWheelButtonUp;
/*0x0c0*/ void* HandleMouseMove;
/*0x0c8*/ void* HandleWheelMove;
/*0x0d0*/ void* HandleKeyboardMsg;
/*0x0d8*/ void* HandleMouseLeave;
/*0x0e0*/ void* OnDragDrop;
/*0x0e8*/ void* GetDragDropCursor;
/*0x0f0*/ void* QueryDropOK;
/*0x0f8*/ void* OnClickStick;
/*0x100*/ void* GetClickStickCursor;
/*0x108*/ void* QueryClickStickDropOK;
/*0x110*/ void* WndNotification;
/*0x118*/ void* OnWndNotification;
/*0x120*/ void* Activate;
/*0x128*/ void* Deactivate;
/*0x130*/ void* OnShow;
/*0x138*/ void* OnMove;
/*0x140*/ void* OnResize;
/*0x148*/ void* OnBeginMoveOrResize;
/*0x150*/ void* OnCompleteMoveOrResize;
/*0x158*/ void* OnMinimizeBox;
/*0x160*/ void* OnMaximizeBox;
/*0x168*/ void* OnTileBox;
/*0x170*/ void* OnTile;
/*0x178*/ void* OnSetFocus;
/*0x180*/ void* OnKillFocus;
/*0x188*/ void* OnProcessFrame;
/*0x190*/ void* OnVScroll;
/*0x198*/ void* OnHScroll;
/*0x1a0*/ void* OnBroughtToTop;
/*0x1a8*/ void* OnActivate;
/*0x1b0*/ void* Show;
/*0x1b8*/ void* AboutToShow;
/*0x1c0*/ void* AboutToHide;
/*0x1c8*/ void* RequestDockInfo;
/*0x1d0*/ void* GetTooltip;
/*0x1d8*/ void* Unknown0x0EC;
/*0x1e0*/ void* HitTest;
/*0x1e8*/ void* GetHitTestRect;
/*0x1f0*/ void* GetInnerRect;
/*0x1f8*/ void* GetClientRect;
/*0x200*/ void* GetClientClipRect;
/*0x208*/ void* GetMinSize;
/*0x210*/ void* GetMaxSize;
/*0x218*/ void* GetUntileSize;
/*0x220*/ void* IsPointTransparent;
/*0x228*/ void* ShouldProcessChildrenFrames;
/*0x230*/ void* ShouldProcessControllerFrame;
/*0x238*/ void* SetDrawTemplate;
/*0x240*/ void* UpdateGeometry;
/*0x248*/ void* Move;
/*0x250*/ void* SetWindowText;
/*0x258*/ void* GetChildWndAt;
/*0x260*/ void* GetSidlPiece;
/*0x268*/ void* GetWindowName;
/*0x270*/ void* SetVScrollPos;
/*0x278*/ void* SetHScrollPos;
/*0x280*/ void* AutoSetVScrollPos;
/*0x288*/ void* AutoSetHScrollPos;
/*0x290*/ void* SetAttributesFromSidl;
/*0x298*/ void* OnReloadSidl;
/*0x2a0*/ void* HasActivatedFirstTimeAlert;
/*0x2a8*/ void* SetHasActivatedFirstTimeAlert;
/*0x2b0*/ void* GetMinClientSize;
/*0x2b8*/ void* GetMaxClientSize;
/*0x2c0*/ void* GetActiveEditWnd;
/*0x2c8*/ void* UpdateLayout;
/*0x2d0*/
};
// Returns the current instance of this class's vftable. Might represent some other
// inherited class (and not CXWnd's)
inline VirtualFunctionTable* GetVFTable()
{
if (this == nullptr) return nullptr;
return *reinterpret_cast<VirtualFunctionTable**>(this);
}
// points to the eq instance of the virtual function table for this class
static VirtualFunctionTable* sm_vftable;
// Always allocate using custom eq allocators
EQLIB_OBJECT static void* operator new(std::size_t sz);
EQLIB_OBJECT static void* operator new[](std::size_t sz);
EQLIB_OBJECT static void operator delete(void* ptr);
EQLIB_OBJECT static void operator delete[](void* ptr);
// @start: CXWnd Members
/*0x030*/ bool bNeedsSaving; // will be true if you move or resize the window
/*0x031*/ bool bHCenterTooltip;
/*0x034*/ uint32_t BlinkFadeStartTime;
/*0x038*/ int TopOffset;
/*0x03c*/ bool bClickThroughMenuItemStatus; // on/off
/*0x040*/ int managerArrayIndex;
/*0x044*/ bool CloseOnESC; // found in CSidlScreenWnd__StoreIniInfo_x, close when ESC is pressed
/*0x048*/ int RightOffset;
/*0x04c*/ bool Clickable; // found in CChatWindow__CChatWindow_x and the button handlers
/*0x04d*/ bool bMaximizable;
/*0x050*/ int BottomOffset;
/*0x054*/ bool Fades;
/*0x055*/ bool bBorder2;
/*0x058*/ CLayoutStrategy* pLayoutStrategy;
/*0x060*/ bool bBottomAnchoredToTop;
/*0x064*/ int BlinkDuration;
/*0x068*/ uint32_t WindowStyle; // bit 1 - vertical scroll, bit 2 - horizontal scroll, bit 4 - title bar?, bit 8 - border
/*0x06c*/ uint32_t BlinkFadeDuration;
/*0x070*/ uint8_t FadeToAlpha; // found in CSidlScreenWnd__StoreIniInfo_x
/*0x074*/ int HScrollMax;
/*0x078*/ int BlinkState;
/*0x07c*/ bool Locked; // found in CSidlScreenWnd__LoadIniInfo_x
/*0x080*/ CStaticTintedBlendAnimationTemplate* TitlePiece;
/*0x088*/ uint32_t FadeDelay;
/*0x08c*/ bool bIsParentOrContextMenuWindow;
/*0x090*/ ArrayClass2<unsigned int> RuntimeTypes; // Size 0x1c
/*0x0b0*/ int64_t Data;
/*0x0b8*/ CXSize MinClientSize;
/*0x0c0*/ uint8_t bResizableMask;
/*0x0c4*/ CXRect OldLocation;
/*0x0d4*/ bool bClientRectChanged;
/*0x0d5*/ bool Enabled;
/*0x0d6*/ bool bAction;
/*0x0d7*/ uint8_t FadeAlpha;
/*0x0d8*/ bool bUseInLayoutVertical;
/*0x0dc*/ int ZLayer; // found in CXWndManager__DrawWindows_x
/*0x0e0*/ CXRect ClientRect;
/*0x0f0*/ CXWndDrawTemplate* DrawTemplate;
/*0x0f8*/ COLORREF BGColor; // DO NOT CHNAGE THIS TO AN ARGBCOLOR, it will break the padding since its a union that has bytes in it.
/*0x0fc*/ bool bMarkedForDelete;
/*0x100*/ CXRect TransitionRect;
/*0x110*/ CXWnd* ParentWindow; // CXWnd__IsDescendantOf_x has this one, If this is NULL, coordinates are absolute...
/*0x118*/ bool bIsTransitioning;
/*0x120*/ CTextureAnimation* IconTextureAnim;
/*0x128*/ bool bShowClickThroughMenuItem; // shows/hides the click through option on the window menu
/*0x130*/ CXWnd* FocusProxy;
/*0x138*/ int BlinkStartTimer;
/*0x13c*/ bool Minimized;
/*0x13d*/ bool bTopAnchoredToTop;
/*0x13e*/ bool MouseOver; // found in CXWnd__SetMouseOver_x
/*0x140*/ uint32_t FadeDuration;
/*0x144*/ uint32_t BlinkFadeFreq;
/*0x148*/ bool bClipToParent;
/*0x149*/ bool bRightAnchoredToLeft;
/*0x14a*/ bool bLeftAnchoredToLeft;
/*0x150*/ CTextObjectInterface* pTextObject;
/*0x158*/ bool bBringToTopWhenClicked;
/*0x159*/ bool bBorder;
/*0x15c*/ int ParentAndContextMenuArrayIndex;
/*0x160*/ bool dShow;
/*0x164*/ CXRect IconRect;
/*0x174*/ CXRect ClipRectClient;
/*0x184*/ uint8_t TargetAlpha;
/*0x185*/ uint8_t StartAlpha;
/*0x188*/ CXRect ClipRectScreen;
/*0x198*/ uint32_t BackgroundDrawType;
/*0x19c*/ uint32_t LastBlinkFadeRefreshTime;
/*0x1a0*/ uint32_t LastTimeMouseOver;
/*0x1a4*/ CXRect Location;
/*0x1b4*/ CXSize MaxClientSize;
/*0x1c0*/ CStaticTintedBlendAnimationTemplate* TitlePiece2;
/*0x1c8*/ bool Faded;
/*0x1d0*/ CTextObjectInterface* pTipTextObject;
/*0x1d8*/ bool bScreenClipRectChanged;
/*0x1dc*/ int DeleteCount;
/*0x1e0*/ int HScrollPos;
/*0x1e4*/ bool bMaximized;
/*0x1e5*/ bool bUseInLayoutHorizontal;
/*0x1e6*/ bool bTiled;
/*0x1e7*/ bool bActive;
/*0x1e8*/ ControllerBase* pController;
/*0x1f0*/ uint32_t TransitionDuration;
/*0x1f4*/ int LeftOffset;
/*0x1f8*/ bool bEscapableLocked;
/*0x1fc*/ uint32_t TransitionStartTick;
/*0x200*/ bool bFullyScreenClipped;
/*0x204*/ uint32_t BGType; // found in CSidlScreenWnd__StoreIniInfo_x
/*0x208*/ COLORREF CRNormal; // found in OnProcessFrame
/*0x210*/ CXStr XMLToolTip; // found in CSidlManager__CreateLabel_x
/*0x218*/ COLORREF DisabledBackground;
/*0x21c*/ uint8_t Alpha;
/*0x21d*/ bool ValidCXWnd; // IsValid has this one
/*0x220*/ CXStr Tooltip; // found in CSidlManager__CreateLabel_x
/*0x228*/ bool bClientClipRectChanged;
/*0x229*/ bool bCaptureTitle;
/*0x230*/ CXStr DataStr;
/*0x238*/ bool bClickThrough; // if true you can click through the window, well it doesnt work for our chatwindow (yet) so more work is needed to figure out why
/*0x23c*/ int VScrollPos;
/*0x240*/ int Transition;
/*0x244*/ bool bKeepOnScreen;
/*0x245*/ bool Unlockable; // found in CSidlScreenWnd__LoadIniInfo_x related to Locked
/*0x248*/ int VScrollMax;
/*0x250*/ CTextureFont* pFont;
/*0x258*/ uint32_t XMLIndex;
/*0x260*/ CXStr WindowText; // CXWnd__GetWindowTextA_x has this one
/*0x268*/
// @end: CXWnd Members
};
inline namespace deprecated {
using CXWND DEPRECATE("Use CXWnd instead of CXWND") = CXWnd;
using PCXWND DEPRECATE("Use CXWnd* instead of PCXWND") = CXWnd*;
}
SIZE_CHECK(CXWnd, CXWnd_size);
SIZE_CHECK2(CXWnd_vftable, CXWnd::VirtualFunctionTable, CXWnd_vftable_size);
//============================================================================
// CSidlScreenWnd
//============================================================================
enum eIniFlags
{
eIniFlag_None = 0,
eIniFlag_Position = 0x0001,
eIniFlag_Size = 0x0002,
eIniFlag_Font = 0x0004,
eIniFlag_Alpha = 0x0008,
eIniFlag_Color = 0x0010,
eIniFlag_Visibility = 0x0100,
eIniFlag_FirstTimeVisibility = 0x0200,
eIniFlag_MinMaxState = 0x0400,
eIniFlag_All = 0xffffffff
};
// @sizeof(CSidlScreenWnd) == 0x2d0 :: 2022-08-15 (live) @ 0x1405392a1
constexpr size_t CSidlScreenWnd_size = 0x2d0;
constexpr size_t CSidlScreenWnd_vftable_size = 0x300;
class [[offsetcomments]] CSidlScreenWnd : public CXWnd
{
public:
//EQLIB_OBJECT CSidlScreenWnd(CXWnd* parent, uint32_t id, const CXRect& rect, const CXStr& Screen); // CSidlScreenWnd__CSidlScreenWnd
EQLIB_OBJECT CSidlScreenWnd(CXWnd* parent, const CXStr& Screen, int IniFlags, int IniVersion = 1, char* BlockName = nullptr); // CSidlScreenWnd__CSidlScreenWnd1
EQLIB_OBJECT CSidlScreenWnd(CXWnd* parent = nullptr, const CXStr& Screen = CXStr()); // CSidlScreenWnd__CSidlScreenWnd2
EQLIB_OBJECT virtual ~CSidlScreenWnd();
//----------------------------------------------------------------------------
// virtuals that are overwritten
EQLIB_OBJECT virtual int OnResize(int width, int height) override;
EQLIB_OBJECT virtual int DrawBackground() const override;
EQLIB_OBJECT virtual int WndNotification(CXWnd* wnd, uint32_t message, void* data) override;
EQLIB_OBJECT virtual int HandleRButtonDown(const CXPoint& pos, uint32_t flags) override;
EQLIB_OBJECT virtual int OnShow() override;
EQLIB_OBJECT virtual CScreenPieceTemplate* GetSidlPiece(const CXStr& screenId, bool topLevel = true) const override;
EQLIB_OBJECT virtual const CXStr* GetWindowName() const override;
EQLIB_OBJECT virtual bool HasActivatedFirstTimeAlert() const override;
EQLIB_OBJECT virtual void SetHasActivatedFirstTimeAlert(bool) override;
//----------------------------------------------------------------------------
// new virtuals
EQLIB_OBJECT virtual int OnZone();
EQLIB_OBJECT virtual int OnPreZone();
EQLIB_OBJECT virtual void LoadIniInfo();
EQLIB_OBJECT virtual void StoreIniInfo();
EQLIB_OBJECT virtual CSidlScreenWnd* AsSidlScreenWnd();
EQLIB_OBJECT virtual bool GetScreenWndType();
//----------------------------------------------------------------------------
// data members
/*0x268*/ bool bControlsCreated;
/*0x270*/ CXStr SidlText; // found in CChatWindow__WndNotification_x*
/*0x278*/ CScreenTemplate* SidlPiece; // CScreenPieceTemplate (important)
/*0x280*/ ArrayClass<CRadioGroup*> RadioGroup;
/*0x298*/ bool bInitVisibility;
/*0x299*/ bool bVisibleBeforeResize;
/*0x29c*/ int IniFlags;
/*0x2a0*/ CXStr IniStorageName; // found in CSidlScreenWnd__LoadSidlScreen
/*0x2a8*/ int IniVersion;
/*0x2ac*/ int LastResX;
/*0x2b0*/ int LastResY;
/*0x2b4*/ bool bLastResFullscreen;
/*0x2b8*/ int ContextMenuID;
/*0x2c0*/ CXWnd* pFirstVScrollChild;
/*0x2c8*/ int ContextMenuTipID;
/*0x2cc*/ bool bHasActivatedFirstTimeAlert;
/*0x2d0*/
//----------------------------------------------------------------------------
// functions that we provide offsets for
//EQLIB_OBJECT CXWnd* GetChildItem(const CXStr&, bool bDebug);
EQLIB_OBJECT int DrawSidlPiece(CScreenPieceTemplate*, const CXRect&, const CXRect&) const;
EQLIB_OBJECT void CalculateHSBRange();
EQLIB_OBJECT void CalculateVSBRange();
EQLIB_OBJECT void CreateChildrenFromSidl(DWORD = 0);
EQLIB_OBJECT void EnableIniStorage(int, char*);
EQLIB_OBJECT void Init(int, const CXStr&, int, int, int);
EQLIB_OBJECT void LoadIniListWnd(CListWnd*, char*);
EQLIB_OBJECT void StoreIniVis();
EQLIB_OBJECT int ConvertToRes(int, int, int, int);
EQLIB_OBJECT void LoadSidlScreen();
//----------------------------------------------------------------------------
//EQLIB_OBJECT void Init(CXWnd*, uint32_t, const CXRect&, const CXStr&, int, char*);
//EQLIB_OBJECT void SetScreen(const CXStr&);
//EQLIB_OBJECT void AddButtonToRadioGroup(const CXStr&, CButtonWnd*);
//EQLIB_OBJECT CXRect GetSidlPieceRect(CScreenPieceTemplate*, const CXRect&) const;
//EQLIB_OBJECT void StoreIniListWnd(CListWnd const*, char*);
struct [[offsetcomments]] VirtualFunctionTable : public CXWnd::VirtualFunctionTable
{
/*0x2d0*/ void* OnZone;
/*0x2d8*/ void* OnPreZone;
/*0x2e0*/ void* LoadIniInfo;
/*0x2e8*/ void* StoreIniInfo;
/*0x2f0*/ void* AsSidlScreenWnd;
/*0x2f8*/ void* GetScreenWndType;
/*0x300*/
};
// Returns the current instance of this class's vftable. Might represent some other
// inherited class (and not CSidlScreenWnd's)
inline VirtualFunctionTable* GetVFTable()
{
if (this == nullptr) return nullptr;
return *reinterpret_cast<VirtualFunctionTable**>(this);
}
inline void ReplaceVFTable(VirtualFunctionTable* table)
{
if (this == nullptr) return;
*reinterpret_cast<VirtualFunctionTable**>(this) = table;
}
// points to the eq instance of the virtual function table for this class
static VirtualFunctionTable* sm_vftable;
};
SIZE_CHECK(CSidlScreenWnd, CSidlScreenWnd_size);
SIZE_CHECK2(CSidlScreenWnd_vftable, CSidlScreenWnd::VirtualFunctionTable, CSidlScreenWnd_vftable_size);
inline namespace deprecated {
using CSIDLWND DEPRECATE("Use CSidlScreenWnd instead of CSIDLWND") = CSidlScreenWnd;
using PCSIDLWND DEPRECATE("Use CSidlScreenWnd* instead of PCSIDLWND") = CSidlScreenWnd*;
}
//============================================================================
// CXWndManager
//============================================================================
enum EWndManagerMode
{
WndManagerModeNormal,
WndManagerModeMoving,
WndManagerModeSizingLeft,
WndManagerModeSizingTop,
WndManagerModeSizingRight,
WndManagerModeSizingBottom,
WndManagerModeSizingTopLeft,
WndManagerModeSizingTopRight,
WndManagerModeSizingBottomLeft,
WndManagerModeSizingBototmRight,
WndManagerModeVScrollUp,
WndManagerModeVScrollPageUp,
WndManagerModeVScrollPageDown,
WndManagerModeVScrollDown,
WndManagerModeVScrollAbsolute,
WndManagerModeHScrollLeft,
WndManagerModeHScrollRight,
WndManagerModeHScrollAbsolute,
WndManagerModeHScrollPageLeft,
WndManagerModeHScrollPageRight,
WndManagerModeTyping,
WndManagerModeFrameButton,
WndManagerModeDragDrop,
WndManagerModeUnknown23,
WndManagerModeUnknown24,
};
class [[offsetcomments]] CXWndManager
{
public:
CXWndManager(CSidlManagerBase* sidlManager, HWND* wnd, CXPoint point);
virtual ~CXWndManager();
//----------------------------------------------------------------------------
// virtuals
virtual bool CanSendMouseMessage(CXWnd* wnd) const;
virtual bool CanSendKeyboardMessage(CXWnd* wnd) const;
virtual bool CanDraw(CXWnd* wnd) const;
virtual ControllerBase* CreateController(CXStr controller, int type);
//----------------------------------------------------------------------------
// defined methods
EQLIB_OBJECT int DrawCursor() const;
EQLIB_OBJECT int DrawWindows() const;
EQLIB_OBJECT uint32_t GetKeyboardFlags() const;
EQLIB_OBJECT int HandleKeyboardMsg(uint32_t, bool);
EQLIB_OBJECT int RemoveWnd(CXWnd*);
CTextureFont* GetFont(int FontIndex) const
{
if (FontIndex < FontsArray.GetCount())
{
return FontsArray[FontIndex];
}