Rise
The Vieneo Province
DialogBase.cpp
Go to the documentation of this file.
1 #include "DialogBase.h"
2 
3 #include <clocale>
4 
5 #include "../gui.h"
6 #include "../Sound.h"
7 #include "../Networking.h"
8 #include "../GameClass.h" // for trace
9 #include "../Viewscreen/Viewscreen.h"
10 #include "InformationDialog.h"
11 
12 HMI* DialogBase::gui = nullptr;
13 Logger* DialogBase::logger = nullptr;
16 
17 DialogBase::DialogBase(const short id)
18 {
19  logger->AddToCallStack("DialogBase::ctor");
20  dialogid = id;
21 
22  //BASE CONSTRUCTOR (THIS ONE) ALWAYS GETS CALLED FIRST
23 
24  //START DEFAULT INIT ----- NEEDS CLEANING AFTERWARDS
25  windowdefaultlocation = D3DXVECTOR3(static_cast<float>(rand() % 200), static_cast<float>(rand() % 200), 0);
26  defaultwidth = rand() % 256 + 52 + 16; // minimum is 52+16
27  defaultheight = (rand() % 30 + 2) * 16; // minimum is 2
28  tabs = rand() % 2; // this gets saved
29  for (short s = 0; s < MAX_TAB; s++)
30  tabusedefaultlang[s] = tabstr[s][0] = 0;
31  activetab = 0; // this gets saved
32  sortfield = -1; // this gets saved
33  linetop = 0;
34  linecursel = -1;
35  lineact = -1;
36  linedsp = 0;
37  linetot = 0L;
39  clipboardrecord = 0;
40 
41  fields = 0;
42  ZeroMemory(&fieldline, MAX_LINES * MAX_FIELDS * HELP_SIZE);
44  ZeroMemory(&fieldx, sizeof(short) * MAX_FIELDS);
45  ZeroMemory(&fieldeffectivewidth, sizeof(short) * MAX_FIELDS);
46  for (int i = 0; i < MAX_FIELDS; i++)
47  fieldsortable[i] = true;
48  showfields = false;
49 
50  allowresize = true;
51  allowscroll = true;
52  allowmove = true;
53  dockedto = -1;
54  usesHUD = false;
55  active = false;
56  allowclose = true;
57 
58  editfield = -1;
59  editline = -1;
60  edittab = -1;
61 
62  actions = 0;
63  actionslider = 0.0f; // init
64  actionoffset = 0;
65  ZeroMemory(&actionenabled, MAX_ACTION);
66  ZeroMemory(&actiontoggle, MAX_ACTION);
67 
68  msgbarcolor = 0; // normal
69  msgbartext[0] = 0;
70 
71  for (short s = 0; s < MAX_TAB; s++)
72  tabflash[s] = false;
73 
74  icon = -1;
75  iconsource.top = 32;
76  iconsource.bottom = 64;
77 
78  text = 0; // clear
79  normalinterlace = true;
80 }
81 
83 {
84  logger->AddToCallStack("DialogBase::InitializeDialog");
85  // char msg[99];
86  // sprintf_s(msg, 99, "DialogBase::InitializeDialog(%i)...", t);
87  // logger->Log(msg);
88 
89  //Gets called in the constructors of the dialogs
90  //Bit of generic initialisation, thats need to happen AFTER specific
91  //settings are set in the dialog specific contructor
92  dialogs[t]->iconsource.left = 32 * dialogs[t]->icon;
93  dialogs[t]->iconsource.right = dialogs[t]->iconsource.left + 32;
94 
95  // locations are based on a 1280x768
98 
100 
101  dialogs[t]->layer = 1; // must not be 0
102 
103  if (t != D_INFORMATION)
104  {
105  dialogs[t]->enabled = true;
106  }
107  else
108  {
109  dialogs[t]->enabled = false;
110  dialogs[t]->active = false;
111  }
112 }
113 
115 {
116  gui = g;
117  logger = g->game->logger;
118  logger->AddToCallStack("DialogBase::Initialize");
119 }
120 
121 void DialogBase::UpdateAllActiveDialogs(float fElapsedTime)
122 {
123  logger->AddToCallStack("DialogBase::UpdateAllActiveDialogs");
124  for (short t = 0; t < D_ENUMERATION; t++)
125  {
126  if (dialogs[t]->active)
127  {
129  {
133  CheckMoved(t);
134  }
135  else if ((dialogs[t]->windowlocation.x + dialogs[t]->width) * gui->game->displayscale < 100 * gui->game->displayscale)
136  {
140  CheckMoved(t);
141  }
142 
144  {
148  CheckMoved(t);
149  }
150  else if ((dialogs[t]->windowlocation.y + dialogs[t]->width) * gui->game->displayscale < 100 * gui->game->displayscale)
151  {
155  CheckMoved(t);
156  }
157 
158 
159  if (dialogs[t]->windowseeklocation.z != -1.0f)
160  {
161  if (dialogs[t]->windowseeklocation.z >= 0.0f)
162  {
163  dialogs[t]->windowseeklocation.z = 0.0f;
164  D3DXVec3Lerp(&dialogs[t]->windowlocation, &dialogs[t]->windowlocation, &dialogs[t]->windowseeklocation, fElapsedTime);
165  D3DXVECTOR3 diff = dialogs[t]->windowlocation - dialogs[t]->windowseeklocation;
166  if (D3DXVec3Length(&diff) < 1.0f)
167  {
169  dialogs[t]->windowseeklocation.z = -1.0f;
170  }
171  }
172  else
173  dialogs[t]->windowseeklocation.z += fElapsedTime;
174 
175  CheckMoved(t);
176  }
177 
178  if (dialogs[t]->actionslider != static_cast<float>(dialogs[t]->actionoffset))
179  {
180  float speed = 4.0f * fElapsedTime;
181  if (speed > 1.0f)
182  speed = 1.0f;
183  dialogs[t]->actionslider += (static_cast<float>(dialogs[t]->actionoffset) - dialogs[t]->actionslider) * speed;
184  if (fabsf(dialogs[t]->actionslider - static_cast<float>(dialogs[t]->actionoffset)) < 0.03125f)
185  dialogs[t]->actionslider = static_cast<float>(dialogs[t]->actionoffset);
186  }
187  dialogs[t]->Update();
188  }
189  }
190 }
191 
192 void DialogBase::IconClick(short icon_id)
193 {
194  logger->AddToCallStack("DialogBase::IconClick");
195  const short t = icon_id;
196  if (gui->icon[t].dialog > -1 && dialogs[gui->icon[t].dialog]->enabled)
197  {
199 
200  if (dialogs[gui->icon[t].dialog]->dockedto != -1)
202  if (dialogs[gui->icon[t].dialog]->active) // now active
203  {
205 
206  dialogs[t]->UpdateMenu(-1);
207  CheckMoved(gui->icon[t].dialog);
208 
209  if (gui->icon[t].dialog == D_CONFIGURATION)
211  }
212  else if (dialogs[gui->icon[t].dialog]->windowseeklocation.z != -1.0f)
214 
216  gui->minimized = false;
217  }
218  else
219  {
220  if (gui->icon[t].dialog == -2) // exit L_DIALOG_EXIT
221  {
223  gui->game->RequestClose();
224  }
225  else if (gui->icon[t].dialog == -1) // minimize all L_DIALOG_MINIMIZEALL
226  {
228  if (!gui->minimized)
229  {
230  gui->minimized = true;
231 
232  // gotta first clear out the status of all the windows because docked windows handle their own stuff
233  for (short s = 0; s < D_ENUMERATION; s++)
234  dialogs[s]->minimized = false;
235 
236  for (short s = 0; s < D_ENUMERATION; s++)
237  {
238  if (s == D_INFORMATION)
239  continue;
240 
241  if (dialogs[s]->active)
242  dialogs[s]->Close(true);
243  }
244  }
245  else
246  {
247  gui->minimized = false;
248  for (short s = 0; s < D_ENUMERATION; s++)
249  {
250  if (s == D_INFORMATION)
251  continue;
252 
253  if (dialogs[s]->minimized)
254  {
255  dialogs[s]->active = true;
256  dialogs[s]->minimized = false;
257  dialogs[s]->UpdateMenu(-1);
258  }
259  }
260  }
261  }
262  }
263 
264  gui->g_bLeftClick = false;
265 }
266 
267 void DialogBase::ClickEditableField(short t, const int field)
268 {
269  logger->AddToCallStack("DialogBase::ClickEditableField");
270  if (gui->ptCursor.x > dialogs[t]->fieldx[field] && gui->ptCursor.x <= (dialogs[t]->fieldx[field] + dialogs[t]->fieldeffectivewidth[field]))
271  {
273  if (t == D_WAYPOINTMANAGER && field == 2 && dialogs[t]->linecursel != 0) return; // only edit field 2 on top line... how do we configure THAT?!
274  if (t == D_WAYPOINTMANAGER && field == 1 && gui->game->bus->waypoint.at(dialogs[t]->linecursel).location.x == 0.0f) return; // don't let them edit non-existant waypoint
275  if (t == D_WAYPOINTMANAGER && field == 1 && gui->game->bus->waypoint.at(dialogs[t]->linecursel).type != 0) return; // don't let them edit TDZ, FAF, FIX
276 
278  dialogs[t]->editfield = field;
279  gui->Editing = true;
280  const auto topMargin = static_cast<int>(max(0.0f, (32.0f - 32.0f * gui->game->displayscale)) * 0.5f); // so min is 32 so if it is 10 then 22 ... 11 top and bottom
281  dialogs[t]->HUD.GetEditBox(IDC_FIELDEDIT)->SetSize(static_cast<int>((dialogs[t]->fieldeffectivewidth[field] + 20) * gui->game->displayscale), 32);
282  dialogs[t]->HUD.GetEditBox(IDC_FIELDEDIT)->SetLocation(static_cast<int>(((dialogs[t]->fieldx[field] - dialogs[t]->windowlocation.x) - 5) * gui->game->displayscale), static_cast<int>(((dialogs[t]->linecursel - dialogs[t]->linetop) * 16 - 7) * gui->game->displayscale - topMargin));
283  if (wcscmp(dialogs[t]->fieldline[(dialogs[t]->linecursel - dialogs[t]->linetop)][field], L"Unsaved waypoint, click here to rename and save!") != 0)
284  dialogs[t]->HUD.GetEditBox(IDC_FIELDEDIT)->SetText(dialogs[t]->fieldline[(dialogs[t]->linecursel - dialogs[t]->linetop)][field], false);
285  else
286  dialogs[t]->HUD.GetEditBox(IDC_FIELDEDIT)->SetText(L"", false);
287  dialogs[t]->HUD.GetEditBox(IDC_FIELDEDIT)->SetVisible(true);
288  dialogs[t]->HUD.GetEditBox(IDC_FIELDEDIT)->HandleMouse(WM_LBUTTONDOWN, gui->ptClick, 0, 0);
289  gui->g_bLeftDown = false;
290  }
291 }
292 
294 {
295  logger->AddToCallStack("DialogBase::CheckDialogMouse");
296 
297  bool hit = false;
298  if (!hit)
299  {
300 #pragma region Actual windows (dialogs)
301  for (short r = 0; r < D_ENUMERATION; r++) // top most to bottom
302  {
303  if (hit)
304  break;
305 
306  const short t = draworder[r];
307 
308  if (dialogs[t]->active &&
309  gui->ptCursor.x >= dialogs[t]->windowlocation.x && gui->ptCursor.x < (dialogs[t]->windowlocation.x + dialogs[t]->width) &&
310  gui->ptCursor.y >= dialogs[t]->windowlocation.y && gui->ptCursor.y < (dialogs[t]->windowlocation.y + dialogs[t]->height + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + (dialogs[t]->actions ? 32 : 0) + 32))
311  {
312 
313  // check tabs first (non-conforming to the box)
314  if (dialogs[t]->tabs && gui->ptCursor.y >= dialogs[t]->windowlocation.y && gui->ptCursor.y < (dialogs[t]->windowlocation.y + 16))
315  {
316  // tabs line
317  for (short s = 0; s < dialogs[t]->tabs; s++)
318  {
319  if (gui->ptCursor.x >= dialogs[t]->tabx[s] && gui->ptCursor.x < (dialogs[t]->tabx[s] + dialogs[t]->tabwidth[s]))
320  {
321  // mouse cursor on this tab
322  if (gui->cursoroverwindow == -1)
323  gui->cursoroverwindow = t;
324 
325  if (gui->g_bLeftClick && !hit)
326  {
327  //This means a tab is clicked :)
328  dialogs[t]->TabClick(s);
329 
330  hit = true;
331  s = dialogs[t]->tabs; // done with loop
332  }
333  else if (gui->g_bDropped && !hit && gui->dragt > -1 && gui->dragline != -1) // was drug and dropped
334  {
335  if (DraggingItem(t, s)) // sets a cursor
336  dialogs[t]->DragDropItem(s);
337 
338  SetCursor(LoadCursor(nullptr, IDC_ARROW));
339  gui->currentCursor = IDC_ARROW;
340 
341  gui->helpboxlang = -1;
342  hit = true;
343  s = dialogs[t]->tabs;
344  gui->dragt = -1; gui->dragline = -1;
345  }
346  else if (gui->g_bDragging && !hit && gui->dragt > -1 && gui->dragline != -1) // item being drug
347  {
348  DraggingItem(t, s);
349  // no hit on dragging
350  hit = true;
351  }
353  hit = true;
354  }
355  }
356  }
357  else if (gui->ptCursor.y >= (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0)) && gui->ptCursor.y < (dialogs[t]->windowlocation.y + dialogs[t]->height + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + (dialogs[t]->actions ? 32 : 0) + 32))
358  {
359  // mouse cursor is in the square confines of the window... for mouseover and buttons only, no drag
360  if (gui->cursoroverwindow == -1)
361  gui->cursoroverwindow = t;
362 
363  if ((gui->g_bLeftClick || gui->g_bLeftDown || gui->g_bDropped || gui->g_bLeftDouble) && !hit)
364  {
365  if (dialogs[t]->actions && !gui->g_bDragging && gui->ptCursor.y >= (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + dialogs[t]->height) && gui->ptCursor.y < (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + dialogs[t]->height + 32))
366  {
367  // actions line
368  if (gui->ptCursor.x >= (dialogs[t]->windowlocation.x + dialogs[t]->width - 16) && gui->ptCursor.x < (dialogs[t]->windowlocation.x + dialogs[t]->width))
369  {
370  // scroll actions right
372  dialogs[t]->actionoffset++;
373  hit = true;
374  // clearedit=true;
375  }
376  else if (gui->ptCursor.x >= dialogs[t]->windowlocation.x && gui->ptCursor.x < (dialogs[t]->windowlocation.x + 16))
377  {
378  // scroll actions left
379  if (dialogs[t]->actionoffset > 0)
380  dialogs[t]->actionoffset--;
381  if (t == D_COMMUNICATIONS && dialogs[t]->editfield != -1) // stop input
382  dialogs[t]->actionoffset = 0;
383  hit = true;
384  // clearedit=true;
385  }
386  else if ((gui->g_bLeftClick || gui->g_bDropped) && gui->ptCursor.x >= (dialogs[t]->windowlocation.x + 17) && gui->ptCursor.x < (dialogs[t]->windowlocation.x + dialogs[t]->width - 17))
387  {
388  //Action Icon is clicked!
389  const long icon = (gui->ptCursor.x - (static_cast<long>(dialogs[t]->windowlocation.x) + 18) + static_cast<long>(dialogs[t]->actionslider * 32.0f)) / 32;
391  hit = true;
392  }
393  }
394  else if (gui->g_bLeftClick && dialogs[t]->showfields && gui->ptCursor.y >= (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8) && gui->ptCursor.y < (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0)) && gui->ptCursor.x < (dialogs[t]->windowlocation.x + dialogs[t]->width - 16))
395  {
396  // field titles
397  for (short fie = 0; fie < dialogs[t]->fields; fie++)
398  {
399  if (dialogs[t]->fieldsortable[fie] && gui->ptCursor.x > dialogs[t]->fieldx[fie] && gui->ptCursor.x <= (dialogs[t]->fieldx[fie] + dialogs[t]->fieldeffectivewidth[fie]))
400  {
401  if (dialogs[t]->sortfield == fie)
403  else
404  {
405  dialogs[t]->sortfield = fie;
406  dialogs[t]->sortdirection = 1;
407  }
408  dialogs[t]->UpdateMenu(-1);
409  break;
410  }
411  }
412  hit = true;
413  }
414  else if (gui->ptCursor.y >= (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0)) && gui->ptCursor.y < (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + dialogs[t]->height))
415  {
416  // list area vertically
417  if (gui->ptCursor.x < (dialogs[t]->windowlocation.x + dialogs[t]->width - 16))
418  {
419  const long oldlinecursel = dialogs[t]->linecursel;
420  // list area horizontally
421  if (gui->g_bLeftClick)
422  {
423  dialogs[t]->linecursel = (gui->ptCursor.y - (dialogs[t]->tabs ? 16 : 0) - 8 - (dialogs[t]->showfields ? 16 : 0) - static_cast<long>(dialogs[t]->windowlocation.y)) / 16 + dialogs[t]->linetop;
424  if (dialogs[t]->linecursel >= dialogs[t]->linetot)
425  dialogs[t]->linecursel = -1;
426  dialogs[t]->ClearEdit();
427  dialogs[t]->UpdateMenu(-1);
428  }
429  else if (gui->g_bLeftDouble)
430  dialogs[t]->DoubleClickLine();
431 
432 
433  if (gui->g_bLeftDown && gui->dragt == -1 && gui->dragline == -1 && dialogs[t]->linecursel != -1 && (gui->ptCursor.x != gui->ptClick.x || gui->ptCursor.y != gui->ptClick.y))
434  {
435  // make sure we clicked here, not dragged nothingness to here and picked it up
436  if (gui->ptClick.y >= (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0)) && gui->ptClick.y < (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + dialogs[t]->height) &&
437  gui->ptClick.x >= dialogs[t]->windowlocation.x && gui->ptClick.x < (dialogs[t]->windowlocation.x + dialogs[t]->width - 16))
438  {
439  gui->dragt = t;
440  gui->dragline = dialogs[t]->linecursel; // includes linetop component
441  hit = true;
442  dialogs[t]->ClearEdit();
443  }
444  }
445  else if (gui->g_bLeftClick && !gui->g_bLeftDouble && // using clickup makes sure we are selecting to edit
446  dialogs[t]->linecursel == oldlinecursel && // must have selected previously
447  oldlinecursel != -1 && // must not be null/undefined/unselected
448  dialogs[t]->editline == -1) // not already editing
449  {
450  if (t == D_WAYPOINTMANAGER)
451  {
453 
454  // description area
455  ClickEditableField(t, 1);
456  ClickEditableField(t, 2);
457  }
458  else if (t == D_PEOPLEMANAGER)
459  {
460  // description area
461  ClickEditableField(t, 7);
462  }
463  }
464  else if (gui->g_bLeftDouble && t == DD_COMMUNICATIONS && dialogs[t]->linecursel != -1)
465  {
466  // find this guy and center it on him in his folder
468  if (temptab != -1)
469  {
470  dialogs[D_PEOPLEMANAGER]->activetab = temptab;
472  //ActiveTab(D_PEOPLEMANAGER);
473  }
475  if (dialogs[D_PEOPLEMANAGER]->linecursel != -1)
479  //PopUpDialog(D_PEOPLEMANAGER);
480  }
481  else if (gui->g_bLeftDown && gui->dragt != t && gui->dragt > -1) // drug something from elsewhere
482  {
484  }
485  else if (gui->g_bDropped && gui->dragt != t && gui->dragt > -1)
486  {
487  if (DraggingItem(t, dialogs[t]->activetab))
489 
490  SetCursor(LoadCursor(nullptr, IDC_ARROW));
491  gui->currentCursor = IDC_ARROW;
492 
493  gui->helpboxlang = -1;
494  hit = true;
495  gui->dragt = -1;
496  gui->dragline = -1;
497  }
498  }
499  else if (dialogs[t]->scrollbarheight && gui->dragt == -1 && dialogs[t]->allowscroll)
500  {
501  // scroll bar area
502  if (gui->ptCursor.y >= (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0)) && gui->ptCursor.y < (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + 16))
503  {
504  // scroll up button
505  const long oldlinetop = dialogs[t]->linetop;
506  if (gui->g_bLeftClick || gui->g_fDownCounterTime > 1.0f)
507  {
508  dialogs[t]->linetop--;
510  }
511  if (dialogs[t]->linetop < 0)
512  dialogs[t]->linetop = 0;
513  if (oldlinetop != dialogs[t]->linetop)
514  {
515  dialogs[t]->UpdateMenu(-1);
516  UpdateScrollBar(t);
517  }
518  hit = true;
519  }
520  else if (gui->ptCursor.y >= (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + dialogs[t]->height - 16) && gui->ptCursor.y < (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + dialogs[t]->height))
521  {
522  // scroll down button
523  const long oldlinetop = dialogs[t]->linetop;
524  if (gui->g_bLeftClick || gui->g_fDownCounterTime > 1.0f)
525  {
526  dialogs[t]->linetop++;
528  // WCHAR str[99];
529  // swprintf_s(str, 99, L"top %i dsp %i tot %i", dialog[t].linetop, dialog[t].linedsp, dialog[t].linetot);
530  // DXUT_ERR_MSGBOX(str, S_OK);
531  }
532  if ((dialogs[t]->linetop + dialogs[t]->linedsp) > dialogs[t]->linetot)
533  dialogs[t]->linetop = dialogs[t]->linetot - dialogs[t]->linedsp;
534  if (oldlinetop != dialogs[t]->linetop)
535  {
536  dialogs[t]->UpdateMenu(-1);
537  UpdateScrollBar(t);
538  }
539  hit = true;
540  // clearedit=true;
541  }
542  else if (gui->ptClick.y < (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + 16 + dialogs[t]->scrollbartop) ||
543  gui->ptClick.y >= (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + 16 + dialogs[t]->scrollbartop + dialogs[t]->scrollbarheight))
544  {
545  if (gui->g_bLeftClick)
546  {
547  // scroll bar rail itself (click, not drag)
548  const float scrollheight = static_cast<float>(dialogs[t]->height) - 32;
549  dialogs[t]->scrollbartop = static_cast<short>(gui->ptClick.y) - static_cast<short>(dialogs[t]->windowlocation.y) - (dialogs[t]->tabs ? 16 : 0) - 8 - (dialogs[t]->showfields ? 16 : 0) - 16 - dialogs[t]->scrollbarheight / 2;
550  if (dialogs[t]->scrollbartop < 0)
551  dialogs[t]->scrollbartop = 0;
552  if (dialogs[t]->scrollbartop > (scrollheight - dialogs[t]->scrollbarheight))
553  dialogs[t]->scrollbartop = static_cast<short>(scrollheight) - dialogs[t]->scrollbarheight;
554  const long oldlinetop = dialogs[t]->linetop;
555  dialogs[t]->linetop = static_cast<long>(static_cast<float>(dialogs[t]->scrollbartop) / scrollheight * static_cast<float>(dialogs[t]->linetot));
556  if (dialogs[t]->linetop != oldlinetop)
557  {
558  dialogs[t]->UpdateMenu(-1);
559  }
560  hit = true;
561  }
562  }
563  }
564  }
565  else if (gui->g_bLeftClick)
566  {
567  if (dialogs[t]->allowclose &&
568  gui->ptClick.x >= (dialogs[t]->windowlocation.x + dialogs[t]->width - 32 - 16) && gui->ptClick.x < (dialogs[t]->windowlocation.x + dialogs[t]->width - 32) &&
569  gui->ptClick.y >= (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + dialogs[t]->height + (dialogs[t]->actions ? 32 : 0) + 16) && gui->ptClick.y < (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + dialogs[t]->height + (dialogs[t]->actions ? 32 : 0) + 32))
570  {
571  dialogs[t]->Close(false);
572  hit = true;
573  }
574  else if (dialogs[t]->allowresize &&
575  gui->ptClick.x >= (dialogs[t]->windowlocation.x + dialogs[t]->width - 32 - 16 - 16) && gui->ptClick.x < (dialogs[t]->windowlocation.x + dialogs[t]->width - 32 - 16) &&
576  gui->ptClick.y >= (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + dialogs[t]->height + (dialogs[t]->actions ? 32 : 0) + 16) && gui->ptClick.y < (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + dialogs[t]->height + (dialogs[t]->actions ? 32 : 0) + 32))
577  {
578  // maximize
579  dialogs[t]->windowseeklocation = D3DXVECTOR3(0, designedHeightC * 0.5f - 32.0f - static_cast<float>(dialogs[t]->height + 8 + 32 + (dialogs[t]->actions ? 32 : 0) + (dialogs[t]->tabs ? 16 : 0) + (dialogs[t]->showfields ? 16 : 0)) * 0.5f, 0);
580  hit = true;
581  }
582  else
583  hit = true; // if there isn't an element described but we clicked it
584  }
585  else if (gui->g_bDropped)
586  {
587  gui->g_bDropped = false;
588  // was possibly resize resizinging, we don't want it adjusting even 16 pixel lines until we are done
589  if (dialogs[t]->allowresize && gui->ptClick.x >= (dialogs[t]->windowlocation.x + dialogs[t]->width - 32) && gui->ptClick.x < (dialogs[t]->windowlocation.x + dialogs[t]->width) &&
590  gui->ptClick.y >= (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + dialogs[t]->height + (dialogs[t]->actions ? 32 : 0)) && gui->ptClick.y < (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + dialogs[t]->height + (dialogs[t]->actions ? 32 : 0) + 32))
591  {
592  CheckHeight(t);
593  if (t == D_COMMUNICATIONS)
594  {
596 
598  }
599  CheckWidth(t);
600  hit = true;
601  }
602  }
603  // hit=true;
604  }
606  hit = true;
607  }
608  }
609  if (dialogs[t]->active && gui->g_bDragging)
610  {
611  // mouse was clicked in the confines of the window and dragged
612  if (dialogs[t]->allowresize &&
613  gui->ptClick.x >= (dialogs[t]->windowlocation.x + dialogs[t]->width - 32) && gui->ptClick.x < (dialogs[t]->windowlocation.x + dialogs[t]->width) &&
614  gui->ptClick.y >= (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + dialogs[t]->height + (dialogs[t]->actions ? 32 : 0)) && gui->ptClick.y < (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + dialogs[t]->height + (dialogs[t]->actions ? 32 : 0) + 32))
615  {
616  // resize
617  if (t == DD_COMMUNICATIONS)
618  {
619  dialogs[D_COMMUNICATIONS]->height += static_cast<short>(gui->ptCursor.y - gui->ptClick.y);
621  }
622  else
623  {
624  dialogs[t]->height += static_cast<short>(gui->ptCursor.y - gui->ptClick.y);
625  gui->ptClick.y = gui->ptCursor.y + CheckHeight(t);
626  }
627 
628  dialogs[t]->width += static_cast<short>(gui->ptCursor.x - gui->ptClick.x);
629  gui->ptClick.x = gui->ptCursor.x + CheckWidth(t);
630  if (t == D_COMMUNICATIONS)
631  {
632  dialogs[DD_COMMUNICATIONS]->width -= static_cast<short>(gui->ptCursor.x - gui->ptClick.x);
633  const short b = CheckWidth(DD_COMMUNICATIONS);
634  // dialog[t].width-=b;
635  gui->ptClick.x = gui->ptCursor.x + b;
636  }
637 
638  if (t == D_COMMUNICATIONS)
639  {
641  }
642  hit = true;
643  gui->dragt = -1;
644  gui->dragline = -1;
645  }
646  else if (gui->ptClick.x >= dialogs[t]->windowlocation.x && gui->ptClick.x < (dialogs[t]->windowlocation.x + dialogs[t]->width) &&
647  ((gui->ptClick.y >= (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0)) && gui->ptClick.y < (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8)) ||
648  (gui->ptClick.y >= (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + dialogs[t]->height + (dialogs[t]->actions ? 32 : 0)) &&
649  gui->ptClick.y < (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + dialogs[t]->height + (dialogs[t]->actions ? 32 : 0) + 32))))
650  {
651  // move
652  if (dialogs[t]->allowmove)
653  {
654  if (t == DD_COMMUNICATIONS)
655  {
658  dialogs[D_COMMUNICATIONS]->windowseeklocation.z = -1.0f; // in case it is animated
660  }
661  else
662  {
663  dialogs[t]->windowlocation.x += gui->ptCursor.x - gui->ptClick.x;
664  dialogs[t]->windowlocation.y += gui->ptCursor.y - gui->ptClick.y;
665  dialogs[t]->windowseeklocation.z = -1.0f; // in case it is animated
666  }
667  gui->ptClick.x = gui->ptCursor.x;
668  gui->ptClick.y = gui->ptCursor.y;
669  CheckMoved(t);
670  }
671  hit = true;
672  gui->dragt = -1; gui->dragline = -1;
673  }
674  else if (gui->g_bLeftDown &&
675  gui->ptClick.x >= (dialogs[t]->windowlocation.x + dialogs[t]->width - 16) &&
676  gui->ptClick.x < (dialogs[t]->windowlocation.x + dialogs[t]->width) &&
677  gui->ptClick.y >= (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0)) &&
678  gui->ptClick.y < (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + dialogs[t]->height))
679  {
680  if (dialogs[t]->scrollbarheight && gui->dragt < 0) // -1 or -2
681  {
682  gui->dragt = -2; // scrollbar dragging rail
683  if (gui->ptClick.y >= (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + 16 + dialogs[t]->scrollbartop) &&
684  gui->ptClick.y < (dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0) + 16 + dialogs[t]->scrollbartop + dialogs[t]->scrollbarheight))
685  {
686  char msg[999];
687  sprintf_s(msg, 999, "Dialog %i was ptClick.y %i ptCursor.y %i scrollbartop %i linetop %i",
688  t, gui->ptClick.y, gui->ptCursor.y, dialogs[t]->scrollbartop, dialogs[t]->linetop);
689  logger->Log(msg);
690  // scroll bar itself
691  dialogs[t]->scrollbartop += static_cast<short>(gui->ptCursor.y - gui->ptClick.y); // reposition based on where they clicked first
692  gui->ptClick.y = gui->ptCursor.y; // follow where they drag it
693  if (dialogs[t]->scrollbartop < 0) // too far
694  {
695  gui->ptClick.y -= dialogs[t]->scrollbartop;
696  dialogs[t]->scrollbartop = 0;
697  }
698  const float scrollheight = static_cast<float>(dialogs[t]->height) - 32; // minus the two buttons
699  const long oldlinetop = dialogs[t]->linetop;
700  if (dialogs[t]->scrollbartop > (scrollheight - dialogs[t]->scrollbarheight))
701  {
702  gui->ptClick.y -= dialogs[t]->scrollbartop - (static_cast<long>(scrollheight) - dialogs[t]->scrollbarheight);
703  dialogs[t]->scrollbartop = static_cast<short>(scrollheight) - dialogs[t]->scrollbarheight;
704  dialogs[t]->linetop = dialogs[t]->linetot - dialogs[t]->linedsp;
705  }
706  else
707  dialogs[t]->linetop = static_cast<long>(static_cast<float>(dialogs[t]->scrollbartop) / scrollheight * static_cast<float>(dialogs[t]->linetot));
708  if (dialogs[t]->linetop != oldlinetop)
709  dialogs[t]->UpdateMenu(-1);
710 
711  dialogs[t]->ClearEdit();
712  sprintf_s(msg, 999, "Dialog %i now ptClick.y %i ptCursor.y %i scrollbartop %i linetop %i",
713  t, gui->ptClick.y, gui->ptCursor.y, dialogs[t]->scrollbartop, dialogs[t]->linetop);
714  logger->Log(msg);
715  }
716  }
717  hit = true;
718  }
719  }
720 
721  if (hit)
722  {
723  BringToFront(t);
724  break;
725  }
726  }
727 #pragma endregion
728  }
729 }
730 
731 void DialogBase::TabClick(short clicked_tab)
732 {
733  logger->AddToCallStack("DialogBase::TabClick");
734  if (clicked_tab != activetab) // if tab wasn't the active one, make it active
735  {
736  activetab = clicked_tab;
737  ClearEdit();
738  ActiveTab();
739  }
740 }
741 
742 void DialogBase::DrawAllActiveDialogs(float fElapsedTime)
743 {
744  logger->AddToCallStack("DialogBase::DrawAllActiveDialogs");
745 
746  gui->grippy = false;
747 
748  for (short runi = (D_ENUMERATION - 1); runi >= 0; runi--)
749  {
750  const short t = draworder[runi];
751 
752  // window
753  if (dialogs[t]->active)
754  {
755  D3DXVECTOR3 floorlocation;
756  floorlocation.x = floorf(dialogs[t]->windowlocation.x);
757  floorlocation.y = floorf(dialogs[t]->windowlocation.y);
758  floorlocation.z = floorf(dialogs[t]->windowlocation.z);
759  RECT rect;
760  D3DXVECTOR3 tracked = floorlocation;
761  if (dialogs[t]->tabs)
762  {
763  DWORD temptextcolor, tempcolor;
764  // TABS are 16 tall
765  for (short q = 0; q < dialogs[t]->tabs; q++)
766  {
767  long fonty = static_cast<long>(tracked.y) + 2;
768  rect.left = 9 - dialogs[t]->tabwidth[q];
769  rect.right = 9;
770  if (q != dialogs[t]->activetab)
771  {
772  // inactive flashing tab
773  if (gui->g_bTabLit && dialogs[t]->tabflash[q])
774  {
775  rect.top = 48;
776  rect.bottom = 64;
777  temptextcolor = 0xFF000000;
778  }
779  else // inactive tab not flashing
780  {
781  rect.top = 16;
782  rect.bottom = 32;
783  temptextcolor = 0xFF778589;
784  }
785  tempcolor = 0xFFC0E8FF;
786  }
787  else
788  {
789  // active tab
790  rect.top = 0;
791  rect.bottom = 16;
792  temptextcolor = 0xFFC0C0C0;
793  tempcolor = 0xFFBCE6FF;
794  fonty++;
795  }
796 
797  gui->g_pTextSprite->Draw(gui->m_pddsGUILateral, &rect, nullptr, &tracked, tempcolor);
798  rect.left = static_cast<long>(tracked.x) + 2;
799  rect.top = fonty;
800  rect.right = rect.bottom = -1;
801  gui->g_pFont->DrawTextW(gui->g_pTextSprite, dialogs[t]->tabeffectivestr[q], -1, &rect, DT_NOCLIP, temptextcolor);
802  dialogs[t]->tabx[q] = static_cast<short>(tracked.x);
803  tracked.x += dialogs[t]->tabwidth[q];
804  }
805  tracked.x = floorlocation.x;
806  tracked.y += 16;
807  }
808 
809  // header is 8 tall
810  rect.top = 32;
811  rect.left = 62;
812  rect.right = rect.left + dialogs[t]->width;
813  rect.bottom = 40;
814  gui->g_pTextSprite->Draw(gui->m_pddsGUILateral, &rect, nullptr, &tracked, 0xFFFFFFFF);
815  tracked.y += 8;
816 
817  // fields are 16 tall
818  if (dialogs[t]->fields)
819  {
820  if (dialogs[t]->showfields)
821  {
822  // background
823  rect.top = 32 + 8;
824  rect.left = 62;
825  rect.right = rect.left + dialogs[t]->width;
826  rect.bottom = 56;
827  gui->g_pTextSprite->Draw(gui->m_pddsGUILateral, &rect, nullptr, &tracked, 0xFFFFFFFF);
828  }
829 
830  for (short q = 0; q < dialogs[t]->fields; q++)
831  {
832  dialogs[t]->fieldx[q] = static_cast<short>(tracked.x);
833 
834  if (dialogs[t]->showfields &&
835  dialogs[t]->fieldtype[q] != FIELD_ICON &&
836  dialogs[t]->fieldtype[q] != FIELD_RANKICON &&
837  dialogs[t]->fieldtype[q] != FIELD_ALLIANCEICON) // not a logo
838  {
839  // text
840  rect.top = static_cast<long>(tracked.y) + 2;
841  rect.left = static_cast<long>(tracked.x) + 5;
842  rect.right = rect.bottom = -1;
843  gui->g_pFont->DrawTextW(gui->g_pTextSprite, dialogs[t]->fieldeffectivetitle[q], -1, &rect, DT_NOCLIP, 0xFF808080);
844  }
845 
846  tracked.x += dialogs[t]->fieldeffectivewidth[q];
847  }
848 
849  tracked.x = floorlocation.x;
850  if (dialogs[t]->showfields)
851  tracked.y += 16;
852  }
853 
854  // list is height tall
855  rect.left = rect.top = 0;
856  rect.right = dialogs[t]->width - (dialogs[t]->allowscroll ? 16 : 0);
857  rect.bottom = dialogs[t]->height;
858  if (dialogs[t]->normalinterlace)
859  gui->g_pTextSprite->Draw(gui->m_pddsGUIInterlace, &rect, nullptr, &tracked, 0xFFFFFFFF);
860  else
861  gui->g_pTextSprite->Draw(gui->m_pddsGUIInterlace2, &rect, nullptr, &tracked, 0xFFFFFFFF);
862 
863  // net stats
864  dialogs[t]->Draw(&tracked);
865 
866  // Highlighted list item background
867  if ((gui->dragt == -1 || gui->dragt != t) && dialogs[t]->linecursel != -1 && (dialogs[t]->linecursel - dialogs[t]->linetop) > -1 && (dialogs[t]->linecursel - dialogs[t]->linetop) < dialogs[t]->linedsp)
868  {
869  RECT temprect;
870  temprect.top = 16; temprect.left = 63; temprect.right = temprect.left + dialogs[t]->width - 16; temprect.bottom = 32;
871  D3DXVECTOR3 temptracked = D3DXVECTOR3(tracked.x + 1, tracked.y + 16 * (dialogs[t]->linecursel - dialogs[t]->linetop), 0.0f);
872  gui->g_pTextSprite->Draw(gui->m_pddsGUILateral, &temprect, nullptr, &temptracked, 0xFFFFFFFF);
873  }
874 
875  // list items
876  for (short q = 0; q < dialogs[t]->fields; q++) // these are fields
877  {
878  for (short pn = 0; pn < dialogs[t]->linedsp; pn++) // these are the lines
879  {
880  if (dialogs[t]->fieldtype[q] == FIELD_VARTEXT || dialogs[t]->fieldtype[q] == FIELD_FIXEDTEXT) // fixed/variable text
881  {
882  rect.top = static_cast<long>(tracked.y) + 2 + 16 * pn;
883  rect.left = static_cast<long>(tracked.x) + 5;
884  rect.right = rect.bottom = -1;
885  if (gui->dragt != t || gui->dragline != (dialogs[t]->linetop + pn))
886  {
887  if (dialogs[t]->lineact == (dialogs[t]->linetop + pn))
888  gui->g_pFont->DrawTextW(gui->g_pTextSprite, dialogs[t]->fieldeffectiveline[pn][q], -1, &rect, DT_NOCLIP, 0xFFFFFFFF);
889  else
890  gui->g_pFont->DrawTextW(gui->g_pTextSprite, dialogs[t]->fieldeffectiveline[pn][q], -1, &rect, DT_NOCLIP, 0xFFAEAEAE);
891  }
892  else // floating
893  {
894  rect.top += -gui->ptClick.y + gui->ptCursor.y;
895  rect.left += -gui->ptClick.x + gui->ptCursor.x;
896  if (dialogs[t]->lineact == (dialogs[t]->linetop + pn))
897  gui->g_pFont->DrawTextW(gui->g_pTextSprite, dialogs[t]->fieldeffectiveline[pn][q], -1, &rect, DT_NOCLIP, 0x80FFFFFF);
898  else
899  gui->g_pFont->DrawTextW(gui->g_pTextSprite, dialogs[t]->fieldeffectiveline[pn][q], -1, &rect, DT_NOCLIP, 0x80AEAEAE);
900  }
901  }
902  else if (dialogs[t]->fieldtype[q] == FIELD_MULTILINECHAT) // multilinechat
903  {
904  if (dialogs[t]->fieldline[pn][q][0] != 32767)
905  {
906  if (wcsncmp(dialogs[t]->fieldline[pn][q], L"TC_WAYPOINT,", 12) != 0) // chat
907  {
908  rect.top = static_cast<long>(tracked.y) + 16 * pn;
909  rect.left = static_cast<long>(tracked.x) + 5; // 5 is margin
910  rect.right = rect.left + dialogs[t]->fieldeffectivewidth[q] - 5; // 5 is margin
911  rect.bottom = static_cast<long>(floorlocation.y) + 16 + 8 + dialogs[t]->height;
912  if (gui->dragt != t || gui->dragline != (dialogs[t]->linetop + pn))
913  {
914  gui->g_pChatFont->DrawText(gui->g_pTextSprite, dialogs[t]->fieldline[pn][q], -1, &rect, DT_WORDBREAK, 0xFFAEAEAE);
915  }
916  else // floating
917  {
918  rect.top += -gui->ptClick.y + gui->ptCursor.y;
919  rect.left += -gui->ptClick.x + gui->ptCursor.x;
920  rect.right += -gui->ptClick.x + gui->ptCursor.x;
921  rect.bottom += -gui->ptClick.y + gui->ptCursor.y;
922  gui->g_pChatFont->DrawText(gui->g_pTextSprite, dialogs[t]->fieldline[pn][q], -1, &rect, DT_WORDBREAK, 0x80AEAEAE);
923  }
924  }
925  else // tokenized
926  {
927  RECT textrect;
928  textrect.top = static_cast<long>(tracked.y) + 16 * pn;
929  textrect.left = static_cast<long>(tracked.x) + 5 + 16 + 5; // 5 is margin and 16 is the icon with another margin
930  textrect.right = rect.left + dialogs[t]->fieldeffectivewidth[q] - 5;// 5 is margins +(long)dialogs[t]->windowlocation.x - (long)dialogs[t]->fieldx[q];
931  textrect.bottom = static_cast<long>(floorlocation.y) + 16 + 8 + dialogs[t]->height;
932  WCHAR str[99];
933 
934  D3DXVECTOR3 tempvec;
935  tempvec.x = tracked.x + 5;
936  tempvec.y = tracked.y + 1 + 16 * pn;
937  tempvec.z = 0.0f; // line, field, text
938 
939  // Deserialize
940  Swaypoint tempwaypoint;
941  WCHAR waypointName[80];
942  setlocale(LC_ALL, "English");
943  swscanf_s(dialogs[t]->fieldline[pn][q], L"TC_WAYPOINT,%i,%f,%f,%f,%[^\n]", &tempwaypoint.uniqueid, &tempwaypoint.location.x, &tempwaypoint.location.y, &tempwaypoint.location.z, &waypointName, sizeof waypointName);
944  gui->SetLocale();
945  wcscpy_s(str, 99, waypointName);
946 
947  rect.left = 225; rect.right = 239;
948  rect.top = 97; rect.bottom = 111;
949  if (dialogs[t]->lineact == (dialogs[t]->linetop + pn))
950  {
951  rect.top += 16; rect.bottom += 16;
952  }
953  if (gui->dragt != t || gui->dragline != (dialogs[t]->linetop + pn))
954  {
955  gui->g_pChatFont->DrawTextW(gui->g_pTextSprite, str, -1, &textrect, DT_WORDBREAK, 0xFFAEAEAE);
956  }
957  else // floating
958  {
959  tempvec.x += -gui->ptClick.x + gui->ptCursor.x;
960  tempvec.y += -gui->ptClick.y + gui->ptCursor.y;
961  textrect.top += -gui->ptClick.y + gui->ptCursor.y;
962  textrect.left += -gui->ptClick.x + gui->ptCursor.x;
963  textrect.right += -gui->ptClick.x + gui->ptCursor.x;
964  textrect.bottom += -gui->ptClick.y + gui->ptCursor.y;
965  gui->g_pChatFont->DrawText(gui->g_pTextSprite, str, -1, &textrect, DT_WORDBREAK, 0xFFAEAEAE);
966 
967  }
968  gui->g_pTextSprite->Draw(gui->m_pddsGUIActions, &rect, nullptr, &tempvec, 0xFFFFFFFF);
969  }
970  }
971  }
972  else if (dialogs[t]->fieldtype[q] == FIELD_ICON && dialogs[t]->fieldline[pn][q][0] != 0) // must be a logo, check that there is an icon
973  {
974  rect.top = 96;
975  rect.bottom = 112;
976  if (dialogs[t]->linecursel == (dialogs[t]->linetop + pn))
977  {
978  rect.top += 16;
979  rect.bottom += 16;
980  }
981  rect.left = (dialogs[t]->fieldline[pn][q][0] - 1) * 16;
982  rect.right = rect.left + 16;
983  D3DXVECTOR3 tempvec = D3DXVECTOR3(tracked.x + 7, tracked.y + 16 * pn, tracked.z);
984  if (gui->dragt != t || gui->dragline != (dialogs[t]->linetop + pn))
985  gui->g_pTextSprite->Draw(gui->m_pddsGUIActions, &rect, nullptr, &tempvec, 0xFFFFFFFF);
986  else
987  {
988  tempvec.x += static_cast<float>(gui->ptCursor.x - gui->ptClick.x);
989  tempvec.y += static_cast<float>(gui->ptCursor.y - gui->ptClick.y);
990  gui->g_pTextSprite->Draw(gui->m_pddsGUIActions, &rect, nullptr, &tempvec, 0xFFFFFFFF);
991  }
992  if (!gui->g_bDragging && // if we click the icon to drag the row we don't need it's helpboxlang
993  gui->ptCursor.x >= tempvec.x && gui->ptCursor.x < (tempvec.x + 16) && gui->ptCursor.y >= tempvec.y && gui->ptCursor.y < (tempvec.y + 16))
994  gui->helpboxlang = L_ICON_MARKED + dialogs[t]->fieldline[pn][q][0] - 1;
995  }
996  else if (dialogs[t]->fieldtype[q] == FIELD_RANKICON && dialogs[t]->fieldline[pn][q][1])
997  {
998  rect.top = dialogs[t]->fieldline[pn][q][0] * 32;
999  rect.bottom = rect.top + 16;
1000  if (dialogs[t]->linecursel == (dialogs[t]->linetop + pn))
1001  {
1002  rect.top += 16; // highlight
1003  rect.bottom += 16;
1004  }
1005  rect.left = (dialogs[t]->fieldline[pn][q][1] - 1) * 32; // ranks start at 1
1006  rect.right = rect.left + 32;
1007  D3DXVECTOR3 tempvec = D3DXVECTOR3(tracked.x + 7, tracked.y + 16 * pn, tracked.z);
1008  if (gui->dragt != t || gui->dragline != (dialogs[t]->linetop + pn))
1009  gui->g_pTextSprite->Draw(gui->m_pddsGUIRanks, &rect, nullptr, &tempvec, 0xFFFFFFFF);
1010  else
1011  {
1012  tempvec.x += static_cast<float>(gui->ptCursor.x - gui->ptClick.x);
1013  tempvec.y += static_cast<float>(gui->ptCursor.y - gui->ptClick.y);
1014  gui->g_pTextSprite->Draw(gui->m_pddsGUIRanks, &rect, nullptr, &tempvec, 0xFFFFFFFF);
1015  }
1016  if (!gui->g_bDragging &&
1017  gui->ptCursor.x >= tempvec.x && gui->ptCursor.x < (tempvec.x + 16) && gui->ptCursor.y >= tempvec.y && gui->ptCursor.y < (tempvec.y + 16))
1018  gui->helpboxlang = L_RANKICONMILITARY1 + 12 * dialogs[t]->fieldline[pn][q][0] + dialogs[t]->fieldline[pn][q][1] - 1;
1019  }
1020  }
1021  tracked.x += dialogs[t]->fieldeffectivewidth[q];
1022  }
1023  tracked.x = floorlocation.x + dialogs[t]->width - (dialogs[t]->allowscroll ? 16 : 0);
1024 
1025  if (dialogs[t]->allowscroll)
1026  {
1027  // scroll up
1028  rect.left = 40;
1029  rect.top = 96;
1030  rect.right = 56;
1031  rect.bottom = 112;
1032  gui->g_pTextSprite->Draw(gui->m_pddsGUILateral, &rect, nullptr, &tracked, 0xFFFFFFFF);
1033  tracked.y += 16;
1034 
1035  // scroll rail
1036  rect.left = 0;
1037  rect.top = 0;
1038  rect.right = 16;
1039  rect.bottom = dialogs[t]->height - 32;
1040  gui->g_pTextSprite->Draw(gui->m_pddsGUIScroll, &rect, nullptr, &tracked, 0xFFFFFFFF);
1041  tracked.y += dialogs[t]->scrollbartop;
1042 
1043  // scroll button top
1044  rect.left = 24;
1045  rect.top = 109;
1046  rect.right = 40;
1047  rect.bottom = 111;
1048  gui->g_pTextSprite->Draw(gui->m_pddsGUILateral, &rect, nullptr, &tracked, 0xFFFFFFFF);
1049  tracked.y += 2;
1050 
1051  // scroll bar vertical repeat (guts)
1052  rect.left = 0;
1053  rect.top = 0;
1054  rect.right = 16;
1055  rect.bottom = dialogs[t]->scrollbarheight - 4;
1056  gui->g_pTextSprite->Draw(gui->m_pddsGUIScrollButton, &rect, nullptr, &tracked, 0xFFFFFFFF);
1057  tracked.y += dialogs[t]->scrollbarheight - 4;
1058 
1059  // scroll button button
1060  rect.left = 24;
1061  rect.top = 113;
1062  rect.right = 40;
1063  rect.bottom = 115;
1064  gui->g_pTextSprite->Draw(gui->m_pddsGUILateral, &rect, nullptr, &tracked, 0xFFFFFFFF);
1065  tracked.y += 2;
1066  tracked.y += dialogs[t]->height - 32 - dialogs[t]->scrollbarheight - dialogs[t]->scrollbartop;
1067 
1068  // scroll down
1069  rect.left = 40;
1070  rect.top = 112;
1071  rect.right = 56;
1072  rect.bottom = 128;
1073  gui->g_pTextSprite->Draw(gui->m_pddsGUILateral, &rect, nullptr, &tracked, 0xFFFFFFFF);
1074  tracked.y += 16;
1075  }
1076  else
1077  {
1078  tracked.y += 16 + dialogs[t]->height - 32 + 2 - 4 + 16;
1079  }
1080 
1081  tracked.x = floorlocation.x;
1082 
1083  if (dialogs[t]->actions)
1084  {
1085  // action bar left
1086  if (dialogs[t]->actionoffset == 0) // diabled
1087  {
1088  rect.left = 16;
1089  rect.right = 32;
1090  }
1091  else if (gui->cursoroverwindow == t && gui->ptCursor.x >= tracked.x && gui->ptCursor.x < (tracked.x + 16) &&
1092  gui->ptCursor.y >= tracked.y && gui->ptCursor.y < (tracked.y + 32))
1093  {
1094  // mouseover
1095  rect.left = 48;
1096  rect.right = 64;
1097  }
1098  else // available
1099  {
1100  rect.left = 32;
1101  rect.right = 48;
1102  }
1103  rect.top = 96;
1104  rect.bottom = 128;
1105  gui->g_pTextSprite->Draw(gui->m_pddsGUIParts, &rect, nullptr, &tracked, 0xFFFFFFFF);
1106  tracked.x += 16;
1107 
1108  // action bar background
1109  rect.left = 63;
1110  rect.top = 96;
1111  rect.right = 63 + dialogs[t]->width - 32;
1112  rect.bottom = 128;
1113  gui->g_pTextSprite->Draw(gui->m_pddsGUILateral, &rect, nullptr, &tracked, 0xFFFFFFFF);
1114  tracked.x += dialogs[t]->width - 32;
1115 
1116  // action bar right
1117  if (dialogs[t]->actionoffset >= (dialogs[t]->actions - dialogs[t]->actionsvisible)) // disabled
1118  {
1119  rect.left = 480;
1120  rect.right = 496;
1121  }
1122  else if (gui->cursoroverwindow == t && gui->ptCursor.x >= tracked.x && gui->ptCursor.x < (tracked.x + 16) &&
1123  gui->ptCursor.y >= tracked.y && gui->ptCursor.y < (tracked.y + 32))
1124  {
1125  // mouseover
1126  rect.left = 448;
1127  rect.right = 464;
1128  }
1129  else // available
1130  {
1131  rect.left = 464;
1132  rect.right = 480;
1133  }
1134  rect.top = 96;
1135  rect.bottom = 128;
1136  gui->g_pTextSprite->Draw(gui->m_pddsGUIParts, &rect, nullptr, &tracked, 0xFFFFFFFF);
1137 
1138  // actions
1139  tracked.x = floorlocation.x + 18 - 32 * fmodf(dialogs[t]->actionslider, 1.0f);
1140  short mouseover = -1;
1141  const short farthestrightvisibleaction = min(dialogs[t]->actionsvisible, dialogs[t]->actions);
1142  for (short r = 0; r < (farthestrightvisibleaction + 2); r++)
1143  {
1144  long leftadjust = 0, rightadjust = 0;
1145  if (tracked.x < (floorlocation.x + 18))
1146  {
1147  leftadjust = (static_cast<long>(floorlocation.x) + 18) - static_cast<long>(tracked.x);
1148  tracked.x += leftadjust;
1149  }
1150  if ((tracked.x + 16) > (static_cast<long>(floorlocation.x) + dialogs[t]->width - 34))
1151  rightadjust = (static_cast<long>(tracked.x) + 16) - (static_cast<long>(floorlocation.x) + dialogs[t]->width - 34);
1152 
1153  const short s = r + static_cast<short>(dialogs[t]->actionslider);
1154  if (gui->cursoroverwindow == t && s < dialogs[t]->actions && gui->ptCursor.x >= tracked.x && gui->ptCursor.x < (tracked.x + 32 - rightadjust) &&
1155  gui->ptCursor.y >= tracked.y && gui->ptCursor.y < (tracked.y + 32))
1156  {
1157  mouseover = s;
1159  }
1160  rect.left = 32 * dialogs[t]->action[s] + leftadjust;
1161  if (!dialogs[t]->actionenabled[s])
1162  {
1163  rect.top = 0;
1164  rect.bottom = 32;
1165  }
1166  else
1167  {
1168  if (mouseover != s) // active
1169  {
1170  rect.top = 32;
1171  rect.bottom = 64;
1172  }
1173  else // mouseover
1174  {
1175  rect.top = 64;
1176  rect.bottom = 96;
1177  }
1178  }
1179  rect.right = 32 * dialogs[t]->action[s] + 32 - rightadjust;
1180  if (rect.right > rect.left && s < dialogs[t]->actions)
1181  {
1182  gui->g_pTextSprite->Draw(gui->m_pddsGUIActions, &rect, nullptr, &tracked, 0xFFFFFFFF);
1183  if (dialogs[t]->actiontoggle[s])
1184  {
1185  RECT temprect;
1186  temprect.left = 64; temprect.right = 96;
1187  temprect.top = 96; temprect.bottom = 128;
1188  gui->g_pTextSprite->Draw(gui->m_pddsGUIParts, &temprect, nullptr, &tracked, 0xFFFFFFFF);
1189  }
1190  }
1191  tracked.x += 32 - leftadjust;
1192  }
1193 
1194  tracked.x = floorlocation.x;
1195  tracked.y += 32;
1196  }
1197 
1198  // footer confirmation and/or messages bar
1199  rect.left = 63;
1200  rect.top = 64;
1201  rect.right = rect.left + dialogs[t]->width - 32;
1202  rect.bottom = 80;
1203  if (dialogs[t]->msgbarcolor == 1) // green
1204  gui->g_pTextSprite->Draw(gui->m_pddsGUILateral, &rect, nullptr, &tracked, 0xFF00FF00);
1205  else if (dialogs[t]->msgbarcolor == 2) // amber
1206  gui->g_pTextSprite->Draw(gui->m_pddsGUILateral, &rect, nullptr, &tracked, 0xFFFFFF00);
1207  else if (dialogs[t]->msgbarcolor == 3) // red
1208  gui->g_pTextSprite->Draw(gui->m_pddsGUILateral, &rect, nullptr, &tracked, 0xFFFF0000);
1209  else
1210  gui->g_pTextSprite->Draw(gui->m_pddsGUILateral, &rect, nullptr, &tracked, 0xFF6F7F84);
1211 
1212  if (dialogs[t]->msgbartext[0])
1213  {
1214  rect.left = static_cast<long>(tracked.x) + 3;
1215  rect.top = static_cast<long>(tracked.y) + 3;
1216  rect.right = rect.left + dialogs[t]->width - 6;
1217  rect.bottom = rect.top + 16;
1218  if (dialogs[t]->msgbarcolor == 1) // green
1219  gui->g_pFont->DrawTextW(gui->g_pTextSprite, dialogs[t]->msgbartext, -1, &rect, 0, 0xFFFFFFFF);
1220  else if (dialogs[t]->msgbarcolor == 2) // amber
1221  gui->g_pFont->DrawTextW(gui->g_pTextSprite, dialogs[t]->msgbartext, -1, &rect, 0, 0xFF000000);
1222  else if (dialogs[t]->msgbarcolor == 3) // red
1223  gui->g_pFont->DrawTextW(gui->g_pTextSprite, dialogs[t]->msgbartext, -1, &rect, 0, 0xFFFFFFFF);
1224  else
1225  gui->g_pFont->DrawTextW(gui->g_pTextSprite, dialogs[t]->msgbartext, -1, &rect, 0, 0xFFA0A0A0);
1226  }
1227  tracked.x += dialogs[t]->width - 32;
1228 
1229  // icon
1230  rect = dialogs[t]->iconsource;
1231  rect.top += 32; rect.bottom += 32;
1232  gui->g_pTextSprite->Draw(gui->m_pddsGUIParts, &rect, nullptr, &tracked, 0xFFFFFFFF);
1233  if (dialogs[t]->allowresize && gui->cursoroverwindow == t && gui->ptCursor.x >= tracked.x && gui->ptCursor.x < (tracked.x + 32) &&
1234  gui->ptCursor.y >= tracked.y && gui->ptCursor.y < (tracked.y + 32))
1235  gui->grippy = true;
1236 
1237  tracked.x = floorlocation.x;
1238  tracked.y += 16;
1239 
1240  // footer left bottom bar
1241  rect.top = 80;
1242  rect.left = 62;
1243  rect.right = rect.left + dialogs[t]->width - 34 - 32;
1244  if (!dialogs[t]->allowresize)
1245  rect.right += 16;
1246  if (!dialogs[t]->allowclose)
1247  rect.right += 16;
1248  rect.bottom = 96;
1249  gui->g_pTextSprite->Draw(gui->m_pddsGUILateral, &rect, nullptr, &tracked, 0xFFFFFFFF);
1250 
1251  // window title
1252  rect.top = static_cast<long>(tracked.y) + 2;
1253  rect.left = static_cast<long>(tracked.x) + 3;
1254  rect.bottom = rect.right = -1;
1255  WCHAR uprmsg[HELP_SIZE];
1256  wcscpy_s(uprmsg, HELP_SIZE, gui->strings[dialogs[t]->text].c_str());
1257  _wcsupr_s(uprmsg, HELP_SIZE);
1258  gui->g_pFont->DrawTextW(gui->g_pTextSprite, uprmsg, -1, &rect, DT_NOCLIP, 0xFFFFFFFF);
1259  tracked.x += dialogs[t]->width - 34 - 32;
1260  if (!dialogs[t]->allowresize)
1261  tracked.x += 16;
1262  if (!dialogs[t]->allowclose)
1263  tracked.x += 16;
1264 
1265  // footer right
1266  rect.left = 0;
1267  rect.top = 80;
1268  rect.right = 2;
1269  rect.bottom = 96;
1270  gui->g_pTextSprite->Draw(gui->m_pddsGUILateral, &rect, nullptr, &tracked, 0xFFFFFFFF);
1271  tracked.x += 2;
1272 
1273  // minimize/maximize
1274  if (dialogs[t]->allowresize)
1275  {
1276  rect.left = 24;
1277  rect.right = 40;
1278  if (gui->cursoroverwindow == t &&
1279  gui->ptCursor.x >= tracked.x && gui->ptCursor.x < (tracked.x + 16) &&
1280  gui->ptCursor.y >= tracked.y && gui->ptCursor.y < (tracked.y + 16))
1281  {
1282  rect.top = 80;
1283  rect.bottom = 96;
1284  }
1285  else
1286  {
1287  rect.top = 64;
1288  rect.bottom = 80;
1289  }
1290  gui->g_pTextSprite->Draw(gui->m_pddsGUILateral, &rect, nullptr, &tracked, 0xFFFFFFFF);
1291  tracked.x += 16;
1292  }
1293 
1294  // close
1295  if (dialogs[t]->allowclose)
1296  {
1297  rect.left = 40;
1298  rect.right = 56;
1299  if (gui->cursoroverwindow == t && gui->ptCursor.x >= tracked.x && gui->ptCursor.x < (tracked.x + 16) &&
1300  gui->ptCursor.y >= tracked.y && gui->ptCursor.y < (tracked.y + 16))
1301  {
1302  rect.top = 80;
1303  rect.bottom = 96;
1304  }
1305  else
1306  {
1307  rect.top = 64;
1308  rect.bottom = 80;
1309  }
1310  gui->g_pTextSprite->Draw(gui->m_pddsGUILateral, &rect, nullptr, &tracked, 0xFFFFFFFF);
1311  }
1312 
1313  HRESULT hr;
1314  V(gui->g_pTextSprite->Flush());
1315  if (dialogs[t]->usesHUD)
1316  {
1317  V(dialogs[t]->HUD.OnRender(fElapsedTime));
1318  }
1319  }
1320  }
1321 }
1322 
1323 short DialogBase::CheckWidth(short dialogid)
1324 {
1325  logger->AddToCallStack("DialogBase::CheckWidth");
1326 
1327  short cursoradj = 0;
1328  short minimum = max(72 + (short)wcslen(gui->strings[dialogs[dialogid]->text].c_str()) * gui->FONT_WIDTH, dialogs[dialogid]->fields * 30 + 16);
1329  minimum = max(minimum, dialogs[dialogid]->tabs * (4 * gui->FONT_WIDTH + 13)); // 4 characters plus the 13 framing
1330  if (dialogs[dialogid]->width < minimum)
1331  {
1332  cursoradj = static_cast<short>(minimum - dialogs[dialogid]->width);
1333  gui->ptClick.x = gui->ptCursor.x + cursoradj;//minimum-dialog[t].width;
1334  dialogs[dialogid]->width = minimum;
1335  }
1336 
1338  {
1339  // actions
1340  if (dialogs[dialogid]->actions)
1341  {
1342  const short oldactionsvisible = dialogs[dialogid]->actionsvisible;
1343  dialogs[dialogid]->actionsvisible = (static_cast<short>(dialogs[dialogid]->width) - 32 - 2) / 32;
1344  if (dialogs[dialogid]->actionsvisible > oldactionsvisible && dialogs[dialogid]->actionoffset > 0)
1346  }
1347  }
1348 
1349  // tabs
1350  short extraspacereq = 0;
1351  for (short q = 0; q < dialogs[dialogid]->tabs; q++)
1352  {
1353  if (dialogs[dialogid]->tabusedefaultlang[q]) // default tab
1354  extraspacereq += max(0, (short)wcslen(gui->strings[dialogs[dialogid]->tabusedefaultlang[q]].c_str()) - 4);
1355  else if (dialogs[dialogid]->tabstr[q][0] == 0)
1356  extraspacereq += max(0, (short)wcslen(gui->strings[L_TAB_UNNAMED].c_str()) - 4);
1357  else
1358  extraspacereq += max(0, (short)wcslen(dialogs[dialogid]->tabstr[q]) - 4);
1359  }
1360  const float mag = (static_cast<float>(dialogs[dialogid]->width) - static_cast<float>(dialogs[dialogid]->tabs) * (4 * static_cast<float>(gui->FONT_WIDTH) + 13)) / (static_cast<float>(extraspacereq) * static_cast<float>(gui->FONT_WIDTH));
1361  for (short q = 0; q < dialogs[dialogid]->tabs; q++)
1362  {
1363  short addcharsreq;
1364  if (dialogs[dialogid]->tabusedefaultlang[q]) // default tab
1365  addcharsreq = max(0, (short)wcslen(gui->strings[dialogs[dialogid]->tabusedefaultlang[q]].c_str()) - 4);
1366  else if (dialogs[dialogid]->tabstr[q][0] == 0)
1367  addcharsreq = max(0, (short)wcslen(gui->strings[L_TAB_UNNAMED].c_str()) - 4);
1368  else
1369  addcharsreq = max(0, (short)wcslen(dialogs[dialogid]->tabstr[q]) - 4);
1370 
1371  dialogs[dialogid]->tabwidth[q] = 4 * gui->FONT_WIDTH + 13 + static_cast<short>(static_cast<float>(addcharsreq) * static_cast<float>(gui->FONT_WIDTH) * mag);
1372  if (dialogs[dialogid]->tabwidth[q] > (4 + addcharsreq) * gui->FONT_WIDTH + 13)
1373  dialogs[dialogid]->tabwidth[q] = (4 + addcharsreq) * gui->FONT_WIDTH + 13;
1374 
1375  if (dialogs[dialogid]->tabusedefaultlang[q]) // default tab
1376  wcscpy_s(dialogs[dialogid]->tabeffectivestr[q], MAX_TAB_CHARS, gui->strings[dialogs[dialogid]->tabusedefaultlang[q]].c_str());
1377  else if (dialogs[dialogid]->tabstr[q][0] == 0)
1378  wcscpy_s(dialogs[dialogid]->tabeffectivestr[q], MAX_TAB_CHARS, gui->strings[L_TAB_UNNAMED].c_str());
1379  else
1380  wcscpy_s(dialogs[dialogid]->tabeffectivestr[q], MAX_TAB_CHARS, dialogs[dialogid]->tabstr[q]);
1381  const auto chars = static_cast<short>(static_cast<float>(dialogs[dialogid]->tabwidth[q] - 13) / static_cast<float>(gui->FONT_WIDTH));
1382  if (static_cast<short>(wcslen(dialogs[dialogid]->tabeffectivestr[q])) > chars)
1383  {
1384  dialogs[dialogid]->tabeffectivestr[q][chars] = 0;
1385  dialogs[dialogid]->tabeffectivestr[q][chars - 1] = '.';
1386  dialogs[dialogid]->tabeffectivestr[q][chars - 2] = '.';
1387  dialogs[dialogid]->tabeffectivestr[q][chars - 3] = '.';
1388  }
1389  if (dialogs[dialogid]->edittab == q && dialogs[dialogid]->tabwidth[q] >= -20)
1390  dialogs[dialogid]->HUD.GetEditBox(IDC_TABEDIT)->SetSize(static_cast<int>(dialogs[dialogid]->tabwidth[q]) + 20, 32);
1391  }
1392 
1393  // fields
1394  long spaceavailable = dialogs[dialogid]->width - 16 - 3, spaceneeded = 0;
1395  for (short q = 0; q < dialogs[dialogid]->fields; q++)
1396  {
1397  if (dialogs[dialogid]->fieldtype[q] == FIELD_ICON ||
1399  dialogs[dialogid]->fieldtype[q] == FIELD_ALLIANCEICON) // fixed width icon
1400  spaceavailable -= dialogs[dialogid]->fieldwidth[q];
1401  else
1402  {
1403  spaceneeded += dialogs[dialogid]->fieldwidth[q];
1404  // if (q<(dialog[t].fields-1))
1405  spaceavailable -= 5; // spacer between text fields
1406  }
1407  }
1408 
1409  for (short q = 0; q < dialogs[dialogid]->fields; q++)
1410  {
1411  dialogs[dialogid]->fieldeffectivewidth[q] = static_cast<short>(static_cast<float>(spaceavailable) / static_cast<float>(spaceneeded) * static_cast<float>(dialogs[dialogid]->fieldwidth[q]));
1412 
1413  if (dialogs[dialogid]->showfields)
1414  {
1415  if (dialogs[dialogid]->sortfield == q)
1416  {
1417  // WCHAR str[HELP_SIZE];
1418  // wcscpy_s(str, HELP_SIZE, dialog[t].fieldeffectivetitle[q]);
1419  if (dialogs[dialogid]->sortdirection == 1) // down
1420  wcscpy_s(dialogs[dialogid]->fieldeffectivetitle[q], HELP_SIZE, L"â–¼ ");
1421  else // up
1422  wcscpy_s(dialogs[dialogid]->fieldeffectivetitle[q], HELP_SIZE, L"â–² ");
1423  }
1424  else
1425  dialogs[dialogid]->fieldeffectivetitle[q][0] = 0;
1426 
1429  }
1430 
1431  long effectivechars = static_cast<long>(floorf(static_cast<float>(dialogs[dialogid]->fieldeffectivewidth[q]) / static_cast<float>(gui->FONT_WIDTH)));
1432  if (effectivechars < 4)
1433  {
1434  effectivechars = 4;
1436  }
1437  else
1438  {
1440  }
1441 
1442  if (static_cast<long>(wcslen(dialogs[dialogid]->fieldeffectivetitle[q])) > effectivechars)
1443  {
1444  dialogs[dialogid]->fieldeffectivetitle[q][effectivechars - 3] = '.';
1445  dialogs[dialogid]->fieldeffectivetitle[q][effectivechars - 2] = '.';
1446  dialogs[dialogid]->fieldeffectivetitle[q][effectivechars - 1] = '.';
1447  dialogs[dialogid]->fieldeffectivetitle[q][effectivechars] = 0;
1448  }
1449 
1450  // do this for the list too?
1452  for (short r = 0; r < dialogs[dialogid]->linedsp; r++)
1453  {
1456  else
1457  dialogs[dialogid]->fieldeffectiveline[r][q][0] = 0;
1458  if (static_cast<long>(wcslen(dialogs[dialogid]->fieldeffectiveline[r][q])) > effectivechars)
1459  {
1460  dialogs[dialogid]->fieldeffectiveline[r][q][effectivechars - 3] = '.';
1461  dialogs[dialogid]->fieldeffectiveline[r][q][effectivechars - 2] = '.';
1462  dialogs[dialogid]->fieldeffectiveline[r][q][effectivechars - 1] = '.';
1463  dialogs[dialogid]->fieldeffectiveline[r][q][effectivechars] = 0;
1464  }
1465  }
1466 
1467  if (dialogs[dialogid]->fieldtype[q] == FIELD_ICON ||
1469  dialogs[dialogid]->fieldtype[q] == FIELD_ALLIANCEICON) // not fixed, must be variable
1471 
1473  {
1474  CDXUTEditBox* cdxut_edit_box = dialogs[dialogid]->HUD.GetEditBox(IDC_FIELDEDIT);
1475  if (cdxut_edit_box != nullptr)
1476  {
1477  const float topMargin = max(0.0f, (32.0f - 32.0f * gui->game->displayscale)) * 0.5f; // so min is 32 so if it is 10 then 22 ... 11 top and bottom
1478  cdxut_edit_box->SetSize(static_cast<int>((dialogs[dialogid]->fieldeffectivewidth[q] + 20) * gui->game->displayscale), 32);
1479  cdxut_edit_box->SetLocation(static_cast<int>(((dialogs[dialogid]->fieldx[q] - dialogs[dialogid]->windowlocation.x) - 5) * gui->game->displayscale),
1480  static_cast<int>(((dialogs[dialogid]->linecursel - dialogs[dialogid]->linetop) * 16 - 7) * gui->game->displayscale - topMargin));
1481  }
1482  }
1483  }
1484 
1485  if (dialogid == D_COMMUNICATIONS)
1486  {
1487  // if CONTENT changes we call UpdateCMMenu which in turn calls this function
1488  // if SIZE changes we call just this function
1489  // if SIZE changes we have to do a "refreshchat" as well
1490  if (dialogs[dialogid]->editfield != -1 && dialogs[dialogid]->width >= 32)
1491  dialogs[dialogid]->HUD.GetEditBox(IDC_TRANSMIT)->SetSize(static_cast<int>((dialogs[dialogid]->width - 32) * gui->game->displayscale), static_cast<int>(32 * gui->game->displayscale));
1492  }
1493 
1494  return cursoradj;
1495 }
1496 
1498 {
1499  logger->AddToCallStack("DialogBase::UpdateScrollBar");
1500  const float scrollheight = static_cast<float>(dialogs[t]->height) - 32; // 32 is for the two arrows
1501  if (dialogs[t]->linetot <= dialogs[t]->linedsp || dialogs[t]->linedsp < 2) // was linetot==0 not <=linedsp
1502  dialogs[t]->scrollbarheight = 0;
1503  else
1504  {
1505  dialogs[t]->scrollbarheight = static_cast<short>(static_cast<float>(dialogs[t]->linedsp) / static_cast<float>(dialogs[t]->linetot) * scrollheight);
1506  if (dialogs[t]->scrollbarheight < 5)
1507  dialogs[t]->scrollbarheight = 5;
1508  dialogs[t]->scrollbartop = static_cast<short>(scrollheight * (static_cast<float>(dialogs[t]->linetop) / static_cast<float>(dialogs[t]->linetot)));
1509  if ((dialogs[t]->scrollbartop + dialogs[t]->scrollbarheight) > scrollheight)
1510  {
1511  dialogs[t]->scrollbartop = static_cast<short>(scrollheight) - dialogs[t]->scrollbarheight;
1512  if (dialogs[t]->scrollbartop < 0)
1513  dialogs[t]->scrollbartop = 0;
1514  }
1515  }
1516 }
1517 
1519 {
1520  logger->AddToCallStack("DialogBase::CheckMoved");
1521 
1522  const auto x = static_cast<int>((dialogs[t]->windowlocation.x + 1.0f) * gui->game->displayscale);
1523  const auto y = static_cast<int>((dialogs[t]->windowlocation.y + (dialogs[t]->tabs ? 16 : 0) + 8 + (dialogs[t]->showfields ? 16 : 0)) *
1524  gui->game->displayscale);
1525  dialogs[t]->HUD.SetLocation(x, y);
1526 
1527  logger->AddToCallStack("DialogBase::CheckMoved DONE!");
1528 }
1529 
1531 {
1532  logger->AddToCallStack("DialogBase::BringToFront");
1533 
1534  if (dialogs[t]->layer != 0)
1535  {
1536  for (short q = 0; q < D_ENUMERATION; q++)
1537  {
1538  if (q == t) continue;
1539  if (dialogs[q]->layer == 0)
1540  dialogs[q]->ClearEdit();
1541  dialogs[q]->layer++;
1542  }
1543 
1544  dialogs[t]->layer = 0;
1545  if (dialogs[t]->dockedto != -1)
1546  dialogs[dialogs[t]->dockedto]->layer = 0;
1547 
1548  SortDialogs();
1549  }
1550 }
1551 
1552 bool DialogBase::DraggingItem(short t, short s)
1553 {
1554  logger->AddToCallStack("DialogBase::DraggingItem");
1555  //TODO : Contents of this method could be moved to thier respectable dialog classes
1556  bool isok;
1557  if (t == D_COMMUNICATIONS && gui->dragt == DD_COMMUNICATIONS) // invite
1558  {
1559  if (s != 0 && gui->chatchannel[s].owner == gui->ourplayerC && gui->chatchannel[dialogs[D_COMMUNICATIONS]->activetab].seqplayer[gui->dragline] != gui->ourplayerC) // player to chat tab
1560  {
1561  bool allow = true;
1562  for (short p = 0; p < gui->chatchannel[s].players; p++)
1563  {
1564  // make sure they aren't already in there (compare target tab players with the player we brought
1566  allow = false;
1567  }
1568  if (allow)
1569  {
1571  isok = true;
1572  }
1573  else
1574  {
1576  isok = false;
1577  }
1578  }
1579  else
1580  {
1581  if (s == 0)
1583  else if (gui->chatchannel[s].owner != gui->ourplayerC)
1585  else
1586  gui->helpboxlang = L_DROP_ALREADYINCHANNEL; // trying to drag ourselves
1587  isok = false;
1588  }
1589  }
1590  else if (gui->dragt == DD_COMMUNICATIONS && t == D_PEOPLEMANAGER)
1591  {
1593  isok = true;
1594  }
1595  else if (gui->dragt == D_PEOPLEMANAGER && t == D_PEOPLEMANAGER) // move one folder to another
1596  {
1597  if (s == dialogs[D_PEOPLEMANAGER]->activetab) // same folder
1598  {
1600  isok = false;
1601  }
1602  else
1603  {
1605  isok = true;
1606  }
1607  }
1608  else if (t == D_COMMUNICATIONS && gui->dragt == D_WAYPOINTMANAGER && gui->dragline != 0) // transmit waypoint
1609  {
1611  isok = true;
1612  }
1613  else if (t == D_WAYPOINTMANAGER && gui->dragt == D_COMMUNICATIONS) // receive waypoint
1614  {
1616  isok = true;
1617  }
1618  else
1619  {
1621  isok = false;
1622  }
1623  if (isok)
1624  {
1625  SetCursor(LoadCursor(nullptr, IDC_CROSS));
1626  gui->currentCursor = IDC_CROSS;
1627  }
1628  else
1629  {
1630  SetCursor(LoadCursor(nullptr, IDC_NO));
1631  gui->currentCursor = IDC_NO;
1632  }
1633 
1634  return isok;
1635 }
1636 
1638 {
1639  logger->AddToCallStack("DialogBase::PopUpDialog");
1640  if (!active)
1641  {
1642  active = true;
1644  windowseeklocation.z = -0.9f; // .9 sec before move
1646 
1647  if (dialogs[dialogid]->dockedto != -1)
1648  dialogs[dialogs[dialogid]->dockedto]->active = true;
1649  windowlocation = D3DXVECTOR3(designedWidthC * 0.5f - width * 0.5f, designedHeightC * 0.5f - (height + 80) * 0.5f, 0);
1650  if (dialogid == D_COMMUNICATIONS)
1651  {
1654  }
1655  dialogs[dialogid]->UpdateMenu(-1);
1656  }
1657 }
1658 
1660 {
1661  logger->AddToCallStack("DialogBase::ActionIconClick");
1662  if (actionenabled[icon_id])
1663  {
1664  if (action[icon_id] == (L_ACTION_ADD_FOLDER - L_ACTION_MARK) && tabs < MAX_TAB) // add folder
1665  {
1666  tabusedefaultlang[tabs] = 0; // user config
1667  tabstr[tabs][0] = 0; // unnamed
1668  tabs++;
1670  }
1671  if (action[icon_id] == (L_ACTION_REMOVE_FOLDER - L_ACTION_MARK) && tabs > 1) // remove folder
1672  {
1673  // ian wants it to go through and remove group associations for records and delete
1674  for (short s = activetab; s < (tabs - 1); s++)
1675  {
1676  tabflash[s] = tabflash[s + 1];
1677  wcscpy_s(tabstr[s], MAX_TAB_CHARS, tabstr[s + 1]);
1679  }
1680  tabs--;
1681  if (activetab >= tabs)
1682  activetab = tabs - 1;
1683  ActiveTab();
1684  }
1685  }
1686 }
1687 
1688 void DialogBase::Close(bool minimize)
1689 {
1690  active = false;
1691  minimized = minimize;
1692 }
1693 
1695 {
1696  if (!dialogs[t]->allowresize)
1697  return 0;
1698 
1699  logger->AddToCallStack("DialogBase::CheckHeight");
1700  short cursoradj = 0;
1701  if (dialogs[t]->height < (dialogs[t]->normalinterlace ? 32 : 48))
1702  {
1703  cursoradj += (dialogs[t]->normalinterlace ? 32 : 48) - static_cast<short>(dialogs[t]->height);
1704  dialogs[t]->height = (dialogs[t]->normalinterlace ? 32 : 48);
1705  }
1706  if (dialogs[t]->height > (MAX_LINES * (dialogs[t]->normalinterlace ? 16 : 12)))
1707  {
1708  cursoradj += (MAX_LINES * (dialogs[t]->normalinterlace ? 16 : 12)) - static_cast<short>(dialogs[t]->height);
1709  dialogs[t]->height = MAX_LINES * (dialogs[t]->normalinterlace ? 16 : 12);
1710  }
1711 
1712  const short oldlinedsp = dialogs[t]->linedsp;
1713  dialogs[t]->linedsp = static_cast<short>(dialogs[t]->height) / (dialogs[t]->normalinterlace ? 16 : 12);
1714  if (oldlinedsp != dialogs[t]->linedsp)
1715  {
1716  if (t == D_WAYPOINTMANAGER)
1718  else if (t == D_COMMUNICATIONS)
1719  {
1720  if (dialogs[t]->linetop == (dialogs[t]->linetot - oldlinedsp))
1721  dialogs[t]->linetop = 9999;
1723  }
1724  else if (t == DD_COMMUNICATIONS)
1726  else if (t == D_PEOPLEMANAGER)
1728  }
1729 
1730  if (dialogs[t]->allowscroll)
1731  UpdateScrollBar(t);
1732 
1733  gui->ptClick.y = gui->ptCursor.y + cursoradj;
1734 
1735  if (t == D_COMMUNICATIONS && dialogs[t]->editfield != -1)
1736  dialogs[t]->HUD.GetEditBox(IDC_TRANSMIT)->SetLocation(static_cast<int>(15 * gui->game->displayscale), static_cast<int>(dialogs[t]->height * gui->game->displayscale));
1737 
1738  return cursoradj;
1739 }
1740 
1742 {
1743  logger->AddToCallStack("DialogBase::SortDialogs");
1744  bool sortwindows = true;
1745  while (sortwindows)
1746  {
1747  sortwindows = false;
1748  for (short t = 0; t < (D_ENUMERATION - 1); t++)
1749  {
1750  if (dialogs[draworder[t]]->layer > dialogs[draworder[t + 1]]->layer)
1751  {
1752  sortwindows = true;
1753  // swap
1754  const short tempdraworder = draworder[t];
1755  draworder[t] = draworder[t + 1];
1756  draworder[t + 1] = tempdraworder;
1757  }
1758  }
1759  }
1760 }
1761 
1763 {
1764  logger->AddToCallStack("DialogBase::OnDeviceReset");
1765 
1766  for (short t = 0; t < D_ENUMERATION; t++)
1767  {
1768  CheckMoved(t);
1769  dialogs[t]->UpdateMenu(-1);
1770  dialogs[t]->ActiveTab(); // some use activetab as opportunity to apply scale, most use updatemenu
1771  }
1772 }
1773 
1775 {
1776  logger->AddToCallStack("DialogBase::OnEnter");
1777  if (g_bTextInput != 0) return false;
1778 
1780  if (dialogs[D_WAYPOINTMANAGER]->editline != -1)
1781  {
1782  dialogs[D_WAYPOINTMANAGER]->HUD.SendEvent(EVENT_EDITBOX_STRING, true, dialogs[D_WAYPOINTMANAGER]->HUD.GetEditBox(IDC_FIELDEDIT));
1783  return true;
1784  }
1785  if (dialogs[D_PEOPLEMANAGER]->editline != -1)
1786  {
1787  dialogs[D_PEOPLEMANAGER]->HUD.SendEvent(EVENT_EDITBOX_STRING, true, dialogs[D_PEOPLEMANAGER]->HUD.GetEditBox(IDC_FIELDEDIT));
1788  return true;
1789  }
1790  if (dialogs[D_PEOPLEMANAGER]->edittab != -1)
1791  {
1792  dialogs[D_PEOPLEMANAGER]->HUD.SendEvent(EVENT_EDITBOX_STRING, true, dialogs[D_PEOPLEMANAGER]->HUD.GetEditBox(IDC_TABEDIT));
1793  return true;
1794  }
1795  if (dialogs[D_COMMUNICATIONS]->edittab != -1)
1796  {
1797  dialogs[D_COMMUNICATIONS]->HUD.SendEvent(EVENT_EDITBOX_STRING, true, dialogs[D_COMMUNICATIONS]->HUD.GetEditBox(IDC_TABEDIT));
1798  return true;
1799  }
1800  if (dialogs[D_COMMUNICATIONS]->editfield == -1) // start a chat
1801  {
1804  else
1808  gui->Editing = true;
1809 
1810  dialogs[D_COMMUNICATIONS]->HUD.GetEditBox(IDC_TRANSMIT)->SetLocation(static_cast<int>(15.0f * gui->game->displayscale), static_cast<int>(dialogs[D_COMMUNICATIONS]->height * gui->game->displayscale));
1811  dialogs[D_COMMUNICATIONS]->HUD.GetEditBox(IDC_TRANSMIT)->SetSize(static_cast<int>((dialogs[D_COMMUNICATIONS]->width - 32.0f) * gui->game->displayscale), static_cast<int>(32.0f * gui->game->displayscale));
1812  dialogs[D_COMMUNICATIONS]->HUD.GetEditBox(IDC_TRANSMIT)->SetText(L"", false);
1813  dialogs[D_COMMUNICATIONS]->HUD.GetEditBox(IDC_TRANSMIT)->SetVisible(true);
1814 
1815  return true;
1816  }
1817  return false;
1818 }
1819 
1820 // The rest of these can be overridden
1821 void DialogBase::ActiveTab() // This method is called by derived classes
1822 {
1823  logger->AddToCallStack("DialogBase::ActiveTab");
1824 
1825  tabflash[activetab] = false;
1826  linecursel = -1;
1828 }
1829 
1830 void DialogBase::Draw(D3DXVECTOR3* tracked)
1831 {
1832 }
1833 
1835 {
1836 }
1837 
1839 {
1840 }
1841 
1843 {
1844 }
1845 
1846 void DialogBase::UpdateMenu(short tab)
1847 {
1848 }
1849 
1850 void DialogBase::DragDropItem(short destTab)
1851 {
1852 }
static void CheckMoved(short t)
short FONT_WIDTH
Definition: gui.h:713
LPDIRECT3DTEXTURE9 m_pddsGUIInterlace
Definition: gui.h:733
bool DismissHelp(int helpId, int nControlID=GUI_UNDERSTOOD)
long ResidesLocally(unsigned short serial) const
Definition: people.h:166
Sicons icon[(D_ENUMERATION+1)]
Definition: gui.h:751
#define designedHeightC
Definition: GameClass.h:23
static void InitializeDialog(short t)
Definition: DialogBase.cpp:82
bool minimized
Definition: DialogBase.h:103
static void ClickEditableField(short t, int field)
Definition: DialogBase.cpp:267
float actionslider
Definition: DialogBase.h:78
virtual void ActionIconClick(long icon_id)
short tabx[MAX_TAB]
Definition: DialogBase.h:89
virtual void UpdateMenu(short tab)
short helpboxlang
Definition: gui.h:713
static bool DraggingItem(short t, short s)
short actions
Definition: DialogBase.h:49
long editfield
Definition: DialogBase.h:79
static void SortDialogs()
LPDIRECT3DTEXTURE9 m_pddsGUIRanks
Definition: gui.h:740
RECT iconsource
Definition: DialogBase.h:53
Definition: Logger.h:9
short linedsp
Definition: DialogBase.h:72
#define designedWidthC
Definition: GameClass.h:22
WCHAR tabeffectivestr[MAX_TAB][MAX_TAB_CHARS]
Definition: DialogBase.h:90
GameClass * game
Definition: gui.h:857
LPDIRECT3DTEXTURE9 m_pddsGUIActions
Definition: gui.h:739
ID3DXFont * g_pFont
Definition: gui.h:727
D3DXVECTOR3 windowlocation
Definition: DialogBase.h:59
LPDIRECT3DTEXTURE9 m_pddsGUIInterlace2
Definition: gui.h:734
virtual void OnCreateDevice()
InformationDialog * informationDialog
Definition: gui.h:789
short fieldeffectivewidth[MAX_FIELDS]
Definition: DialogBase.h:93
long edittab
Definition: DialogBase.h:79
void SetLocale() const
Definition: gui.cpp:1449
short scrollbartop
Definition: DialogBase.h:74
bool actionenabled[MAX_ACTION]
Definition: DialogBase.h:77
static void Initialize(HMI *gui)
Definition: DialogBase.cpp:114
long layer
Definition: DialogBase.h:70
short players
Definition: chat.h:15
float displayHeight
Definition: GameClass.h:129
short fieldcontent[MAX_FIELDS]
Definition: DialogBase.h:48
LPWSTR currentCursor
Definition: gui.h:779
short scrollbarheight
Definition: DialogBase.h:74
short dialogid
Definition: DialogBase.h:101
virtual void Close(bool minimize)
short tabs
Definition: DialogBase.h:62
bool usesHUD
Definition: DialogBase.h:56
static void BringToFront(short t)
short actionoffset
Definition: DialogBase.h:76
bool enabled
Definition: DialogBase.h:71
float displayWidth
Definition: GameClass.h:129
short dragt
Definition: gui.h:716
static bool OnEnter()
unsigned char owner
Definition: chat.h:57
short defaultwidth
Definition: DialogBase.h:51
char g_bTextInput
Definition: globals.cpp:108
int linecursel
Definition: DialogBase.h:73
Logger * logger
Definition: GameClass.h:113
bool showfields
Definition: DialogBase.h:45
POINT ptClick
Definition: gui.h:724
short actionsvisible
Definition: DialogBase.h:75
short activetab
Definition: DialogBase.h:62
void PopUpDialog()
POINT ptCursor
Definition: gui.h:724
WCHAR fieldline[MAX_LINES][MAX_FIELDS][HELP_SIZE]
Definition: DialogBase.h:94
short text
Definition: DialogBase.h:69
char sortdirection
Definition: DialogBase.h:65
WCHAR fieldeffectiveline[MAX_LINES][MAX_FIELDS][HELP_SIZE]
Definition: DialogBase.h:95
bool g_bDragging
Definition: gui.h:714
static void CheckDialogMouse()
Definition: DialogBase.cpp:293
static DialogBase * dialogs[D_ENUMERATION]
Definition: DialogBase.h:39
short fieldwidth[MAX_FIELDS]
Definition: DialogBase.h:46
LPDIRECT3DTEXTURE9 m_pddsGUIParts
Definition: gui.h:731
short dialog
Definition: gui.h:393
float g_fDownCounterTime
Definition: gui.h:712
bool actiontoggle[MAX_ACTION]
Definition: DialogBase.h:77
unsigned char seqplayer[MAX_ONLINEPLAYERS]
Definition: chat.h:13
bool g_bDropped
Definition: gui.h:715
void RequestClose() const
Definition: GameClass.cpp:261
static void OnDeviceReset()
WCHAR msgbartext[HELP_SIZE]
Definition: DialogBase.h:82
unsigned char ourplayerC
Definition: gui.h:766
short dockedto
Definition: DialogBase.h:55
static short CheckHeight(short t)
short tabusedefaultlang[MAX_TAB]
Definition: DialogBase.h:50
bool g_bLeftClick
Definition: gui.h:714
char msgbarcolor
Definition: DialogBase.h:81
static Logger * logger
Definition: DialogBase.h:41
bool allowclose
Definition: DialogBase.h:45
SPlayerData player[MAX_ONLINEPLAYERS]
Definition: gui.h:765
#define MAX_FIELDS
Definition: gui.h:18
short defaultheight
Definition: DialogBase.h:51
LPDIRECT3DTEXTURE9 m_pddsGUILateral
Definition: gui.h:732
WCHAR fieldeffectivetitle[MAX_FIELDS][HELP_SIZE]
Definition: DialogBase.h:92
short width
Definition: DialogBase.h:60
int lineact
Definition: DialogBase.h:73
bool grippy
Definition: gui.h:781
bool Editing
Definition: gui.h:778
long dragline
Definition: gui.h:717
static void IconClick(short icon_id)
Definition: DialogBase.cpp:192
char EarliestFolder(unsigned short serial) const
Definition: people.h:178
static short CheckWidth(short dialogid)
int linetop
Definition: DialogBase.h:73
short action[MAX_ACTION]
Definition: DialogBase.h:49
WCHAR tabstr[MAX_TAB][MAX_TAB_CHARS]
Definition: DialogBase.h:63
Definition: gui.h:34
bool fieldsortable[MAX_FIELDS]
Definition: DialogBase.h:96
virtual void TabClick(short clicked_tab)
Definition: DialogBase.cpp:731
bool allowscroll
Definition: DialogBase.h:45
short fieldx[MAX_FIELDS]
Definition: DialogBase.h:93
virtual void DragDropItem(short s)
virtual void Update()
unsigned short clipboardrecord
Definition: DialogBase.h:84
bool g_bLeftDouble
Definition: gui.h:715
Sound * sound
Definition: gui.h:856
CHATCHANNEL chatchannel[MAX_TAB]
Definition: gui.h:768
bool active
Definition: DialogBase.h:71
void Log(const char *msg, Level level=Info, int errorCode=0)
Definition: Logger.cpp:11
short tabflash[MAX_TAB]
Definition: DialogBase.h:88
bool g_bTabLit
Definition: gui.h:715
CDXUTDialog HUD
Definition: DialogBase.h:98
short icon
Definition: DialogBase.h:53
static HMI * gui
Definition: DialogBase.h:40
Definition: gui.h:696
PEOPLE people
Definition: gui.h:769
bool allowresize
Definition: DialogBase.h:45
virtual void ClearEdit()
long editline
Definition: DialogBase.h:79
short sortfield
Definition: DialogBase.h:64
float Play(int soundEnum)
Definition: Sound.cpp:577
ID3DXSprite * g_pTextSprite
Definition: gui.h:726
static void UpdateScrollBar(short t)
short height
Definition: DialogBase.h:60
LPDIRECT3DTEXTURE9 m_pddsGUIScrollButton
Definition: gui.h:738
ID3DXFont * g_pChatFont
Definition: gui.h:728
DialogBase(short id)
Definition: DialogBase.cpp:17
bool g_bLeftDown
Definition: gui.h:714
short tabwidth[MAX_TAB]
Definition: DialogBase.h:89
#define HELP_SIZE
Definition: gui.h:17
float displayscale
Definition: GameClass.h:128
#define MAX_ACTION
Definition: gui.h:19
std::vector< Swaypoint > waypoint
Definition: Bus.h:391
static void UpdateAllActiveDialogs(float fElapsedTime)
Definition: DialogBase.cpp:121
D3DXVECTOR3 windowdefaultlocation
Definition: DialogBase.h:52
bool normalinterlace
Definition: DialogBase.h:54
LPDIRECT3DTEXTURE9 m_pddsGUIScroll
Definition: gui.h:736
bool allowmove
Definition: DialogBase.h:45
std::wstring strings[L_ENUMERATION]
Definition: gui.h:749
virtual void DoubleClickLine()
Definition: DialogBase.h:112
static short draworder[D_ENUMERATION]
Definition: DialogBase.h:105
void AddToCallStack(const char *msg)
Definition: Logger.cpp:86
Bus * bus
Definition: GameClass.h:112
virtual void ActiveTab()
static void DrawAllActiveDialogs(float fElapsedTime)
Definition: DialogBase.cpp:742
int linetot
Definition: DialogBase.h:73
short fieldtype[MAX_FIELDS]
Definition: DialogBase.h:47
short cursoroverwindow
Definition: gui.h:713
D3DXVECTOR3 windowseeklocation
Definition: DialogBase.h:68
short fields
Definition: DialogBase.h:44
#define MAX_LINES
Definition: gui.h:20
bool minimized
Definition: gui.h:782
virtual void Draw(D3DXVECTOR3 *tracked)