Rise
The Vieneo Province
CommunicationsDialog.cpp
Go to the documentation of this file.
1 #include "CommunicationsDialog.h"
2 
3 
4 #include "InformationDialog.h"
5 #include "../Viewscreen/Viewscreen.h"
6 #include "../MathUtilities.h"
7 #include "../StringUtilities.h"
8 
10 {
11  logger->AddToCallStack("CommunicationsDialog::ctor");
12  usesHUD = true;
13  HUD.Init(&gui->g_DialogResourceManager, true, L"Textures\\GUI\\dxutcontrols.png");
14  HUD.SetFont(0, L"DejaVu Sans Mono", static_cast<long>(12.0f * gui->game->displayscale), FW_THIN);
15  HUD.SetCallback(&CommunicationsDialog::DialogCallback, this);
16 
17  active = false;
18  HUD.AddEditBox(IDC_TRANSMIT, L"", 1, 1, 1, 1, true);
19  HUD.GetEditBox(IDC_TRANSMIT)->SetVisible(false);
20  HUD.AddEditBox(IDC_TABEDIT, L"", 1, 1, 1, 1, false);
21  HUD.GetEditBox(IDC_TABEDIT)->SetVisible(false);
22  normalinterlace = true;
23  windowdefaultlocation = D3DXVECTOR3(304, 0, 0);
24  defaultwidth = 943 - (13 * gui->FONT_WIDTH + 16) - 6;
25  defaultheight = 5 * 16;
26  tabs = 1;
27  tabusedefaultlang[0] = 0; // this is updated by UpdateCMMenu
28  tabstr[0][0] = 0;
29 
30  showfields = false;
31  fields = 2;
33  fieldwidth[0] = gui->FONT_WIDTH * 12; // handle
34  fieldcontent[0] = 0;
36  fieldwidth[1] = gui->FONT_WIDTH * 64;
37 
39  actions = 8;
48  actionenabled[0] = true;
49  actionenabled[1] = false;
50  actionenabled[2] = true;
51  actionenabled[3] = false;
52  actionenabled[4] = true;
53  actionenabled[5] = true;
54  actionenabled[6] = false;
55  actionenabled[7] = true;
56  icon = 19;
58 
59  ZeroMemory(&msgbarchannel, sizeof CHATCHANNEL);
60 }
61 
63 {
64  logger->AddToCallStack("CommunicationsDialog::Update");
65 
66  // keep docked window attached!
72 
73  if (gui->g_bLeftClick && editline != -1)
74  {
75  if (!HUD.GetEditBox(IDC_TRANSMIT)->m_bHasFocus)
76  ClearEdit();
77  }
78  else if (editfield != -1)
79  HUD.RequestFocus(HUD.GetEditBox(IDC_TRANSMIT));
80 
81  if (gui->g_bLeftClick && edittab != -1)
82  {
83  if (!HUD.GetEditBox(IDC_TABEDIT)->m_bHasFocus)
84  ClearEdit();
85  }
86 
87  logger->AddToCallStack("CommunicationsDialog::Update END");
88 }
89 
90 void CALLBACK CommunicationsDialog::DialogCallback(UINT nEvent, int nControlID, CDXUTControl* pControl, void* pUserContext)
91 {
92  logger->AddToCallStack("CommunicationsDialog::DialogCallback");
93 
94  CommunicationsDialog* cmd = static_cast<CommunicationsDialog*>(pUserContext);
95 
96  switch (nControlID)
97  {
98  case IDC_TRANSMIT:
99  {
100  if ((((CDXUTEditBox*)pControl)->GetTextLength()) >= TRANSMIT_CHAT_SIZE)
101  {
102  WCHAR str[TRANSMIT_CHAT_SIZE];
103  swprintf_s(str, TRANSMIT_CHAT_SIZE, L"%.*s", TRANSMIT_CHAT_SIZE - 1, ((CDXUTEditBox*)pControl)->GetText());
104  ((CDXUTEditBox*)pControl)->SetText(str, false);
105  }
106 
107  switch (nEvent)
108  {
109  case EVENT_EDITBOX_STRING:
110  {
111  WCHAR msg[TRANSMIT_CHAT_SIZE];
112  wcscpy_s(msg, TRANSMIT_CHAT_SIZE, ((CDXUTEditBox*)pControl)->GetText());
113  cmd->ClearEdit();
114  logger->Log("CommunicationsDialog::DialogCallback - We are sending a chat message!");
115  if (!IsNullOrWhitespace(msg)) // don't bother if it is blank or whitespace
116  {
117  // replace tabs?
118  //for (UINT i = 0; i < wcslen(msg); i++)
119  //{
120  // if (msg[i] == '\t')
121  // msg[i] = ' ';
122  //}
123 
124  gui->flood += wcslen(msg) / 78; // old chat line size
125 
126  // fix leading spaces
127  if (msg[0] == L' ')
128  {
129  for (unsigned short q = 1; q < wcslen(msg); q++)
130  {
131  if (msg[q] != L' ') // find first non-space
132  {
133  wcscpy_s(msg, TRANSMIT_CHAT_SIZE, &msg[q]);
134  break;
135  }
136  }
137  }
138 
139  if (_wcsicmp(msg, L"000DESTRUCT0") == 0)
140  {
141  if (!playerships[0].simulator)
142  {
143  // Only refuel if tank is empty
144  if (fuel <= 0.0f)
145  {
146  const float totop = Clamp(ourcockpit.fuelmax - fuel, 0.0f, ourcockpit.fuelmax - deathfuel);
147  deathfuel += totop;
148  fuel += totop;
149  }
150 
151  deathinhibit = 15.0f;
152  dead = 5; // autodestruct
153 
154  SClientPacket outpacket;
155  outpacket.type = 15; // Death report
156  outpacket.f_x = 0.0f; // NULL
157  outpacket.f_y = 0.0f; // NULL
158  outpacket.f_z = 0.0f; // NULL
159  outpacket.f_w = 5.0f; // Autodestruct
160  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
161 
163  gui->sound->GlobalAttenuate(0.5f, 1.5f, 6.0f, SOUND_EXPLODERING, 0.5f, 1.5f, 6.0f);
164  gui->sound->PlayEx(SOUND_EXPLODERING, true, 0.0f);
165  }
166  }
167  else if (_wcsicmp(msg, L"000COMMANDSIM0") == 0 && gui->IsAdmin)
168  {
171  SClientPacket outpacket;
172  outpacket.type = 33; // AdministrativeAction
173  outpacket.f_x = 0.0f; // SIM
174  outpacket.f_y = playerships[0].simulator ? 1.0f : 0.0f;
175  outpacket.f_z = 0.0f; // NULL
176  outpacket.f_w = 0.0f; // NULL
177  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
178  }
179  else if (_wcsicmp(msg, L"000COMMANDBOLT") == 0 && gui->IsAdmin)
180  {
181  gui->game->viewscreen->TriggerBCLLightning(0.5f, 0.5f);
182  SClientPacket outpacket;
183  outpacket.type = 33; // AdministrativeAction
184  outpacket.f_x = 1.0f; // BOLT
185  outpacket.f_y = 0.0f;
186  outpacket.f_z = 0.0f; // NULL
187  outpacket.f_w = 0.0f; // NULL
188  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
189  }
190  else if (_wcsicmp(msg, L"000COMMANDRADIO") == 0 && gui->IsAdmin)
191  {
193  SClientPacket outpacket;
194  outpacket.type = 33; // AdministrativeAction
195  outpacket.f_x = 2.0f; // RADIO
196  outpacket.f_y = ourcockpit.radioEquipped ? 1.0f : 0.0f;
197  outpacket.f_z = 0.0f; // NULL
198  outpacket.f_w = 0.0f; // NULL
199  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
200 
201  if (playerships[0].reference != REF_BUILDING && playerships[0].reference != REF_SIMBAY)
202  {
204  {
205  for (short t = 0; t < MAX_AVIOPERSHIP; t++)
206  {
207  if (ourcockpit.vdat.avionictype[t] == 0)
208  {
209  ourcockpit.vdat.avionictype[t] = 3;
211  break;
212  }
213  }
214  }
215  else
216  {
217  for (short t = 0; t < MAX_AVIOPERSHIP; t++)
218  {
219  if (ourcockpit.vdat.avionictype[t] == 3)
220  {
221  ourcockpit.vdat.avionictype[t] = 0;
222  break;
223  }
224  }
225  }
226  }
227  }
228  else if (_wcsicmp(msg, L"000COMMANDSUN-1") == 0 && gui->IsAdmin)
229  {
231  SClientPacket outpacket;
232  outpacket.type = 33; // AdministrativeAction
233  outpacket.f_x = 3.0f; // SUN
234  outpacket.f_y = gui->game->viewscreen->ptrWeather->daylightOverride;
235  outpacket.f_z = 0.0f; // NULL
236  outpacket.f_w = 0.0f; // NULL
237  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
238  }
239  else if (_wcsicmp(msg, L"000COMMANDSUN0") == 0 && gui->IsAdmin)
240  {
242  SClientPacket outpacket;
243  outpacket.type = 33; // AdministrativeAction
244  outpacket.f_x = 3.0f; // SUN
245  outpacket.f_y = gui->game->viewscreen->ptrWeather->daylightOverride;
246  outpacket.f_z = 0.0f; // NULL
247  outpacket.f_w = 0.0f; // NULL
248  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
249  }
250  else if (_wcsicmp(msg, L"000COMMANDSUN1") == 0 && gui->IsAdmin)
251  {
253  SClientPacket outpacket;
254  outpacket.type = 33; // AdministrativeAction
255  outpacket.f_x = 3.0f; // SUN
256  outpacket.f_y = gui->game->viewscreen->ptrWeather->daylightOverride;
257  outpacket.f_z = 0.0f; // NULL
258  outpacket.f_w = 0.0f; // NULL
259  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
260  }
261  else if (_wcsicmp(msg, L"000COMMANDALPHA-1") == 0 && gui->IsAdmin)
262  {
264  SClientPacket outpacket;
265  outpacket.type = 33; // AdministrativeAction
266  outpacket.f_x = 4.0f; // ALPHA
267  outpacket.f_y = gui->game->viewscreen->ptrWeather->alphascreenOverride;
268  outpacket.f_z = 0.0f; // NULL
269  outpacket.f_w = 0.0f; // NULL
270  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
271  }
272  else if (_wcsicmp(msg, L"000COMMANDALPHA0") == 0 && gui->IsAdmin)
273  {
275  SClientPacket outpacket;
276  outpacket.type = 33; // AdministrativeAction
277  outpacket.f_x = 4.0f; // ALPHA
278  outpacket.f_y = gui->game->viewscreen->ptrWeather->alphascreenOverride;
279  outpacket.f_z = 0.0f; // NULL
280  outpacket.f_w = 0.0f; // NULL
281  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
282  }
283  else if (_wcsicmp(msg, L"000COMMANDALPHA1") == 0 && gui->IsAdmin)
284  {
286  SClientPacket outpacket;
287  outpacket.type = 33; // AdministrativeAction
288  outpacket.f_x = 4.0f; // ALPHA
289  outpacket.f_y = gui->game->viewscreen->ptrWeather->alphascreenOverride;
290  outpacket.f_z = 0.0f; // NULL
291  outpacket.f_w = 0.0f; // NULL
292  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
293  }
294  else if (_wcsicmp(msg, L"000COMMANDGAMMA-1") == 0 && gui->IsAdmin)
295  {
297  SClientPacket outpacket;
298  outpacket.type = 33; // AdministrativeAction
299  outpacket.f_x = 5.0f; // GAMMA
300  outpacket.f_y = gui->game->viewscreen->ptrWeather->gammascreenOverride;
301  outpacket.f_z = 0.0f; // NULL
302  outpacket.f_w = 0.0f; // NULL
303  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
304  }
305  else if (_wcsicmp(msg, L"000COMMANDGAMMA0") == 0 && gui->IsAdmin)
306  {
308  SClientPacket outpacket;
309  outpacket.type = 33; // AdministrativeAction
310  outpacket.f_x = 5.0f; // GAMMA
311  outpacket.f_y = gui->game->viewscreen->ptrWeather->gammascreenOverride;
312  outpacket.f_z = 0.0f; // NULL
313  outpacket.f_w = 0.0f; // NULL
314  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
315  }
316  else if (_wcsicmp(msg, L"000COMMANDGAMMA1") == 0 && gui->IsAdmin)
317  {
319  SClientPacket outpacket;
320  outpacket.type = 33; // AdministrativeAction
321  outpacket.f_x = 5.0f; // GAMMA
322  outpacket.f_y = gui->game->viewscreen->ptrWeather->gammascreenOverride;
323  outpacket.f_z = 0.0f; // NULL
324  outpacket.f_w = 0.0f; // NULL
325  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
326  }
327  else if (_wcsicmp(msg, L"000COMMANDELMO0") == 0 && gui->IsAdmin)
328  {
330  SClientPacket outpacket;
331  outpacket.type = 33; // AdministrativeAction
332  outpacket.f_x = 6.0f; // ELMO
333  outpacket.f_y = gui->game->viewscreen->ptrWeather->elmoOverride ? 1.0f : 0.0f;
334  outpacket.f_z = 0.0f; // NULL
335  outpacket.f_w = 0.0f; // NULL
336  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
337  }
338  else if (_wcsicmp(msg, L"000COMMANDELMO1") == 0 && gui->IsAdmin)
339  {
341  SClientPacket outpacket;
342  outpacket.type = 33; // AdministrativeAction
343  outpacket.f_x = 6.0f; // ELMO
344  outpacket.f_y = gui->game->viewscreen->ptrWeather->elmoOverride ? 1.0f : 0.0f;
345  outpacket.f_z = 0.0f; // NULL
346  outpacket.f_w = 0.0f; // NULL
347  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
348  }
349  else if (_wcsicmp(msg, L"000COMMANDACL0") == 0 && gui->IsAdmin)
350  {
351  D3DXVECTOR3 norm;
352  D3DXVec3Normalize(&norm, &playerships[0].position);
353  D3DXVec3Scale(&playerships[0].position, &norm, radiusC + 14.0f);
354  playerships[0].precisionx = static_cast<double>(playerships[0].position.x);
355  playerships[0].precisiony = static_cast<double>(playerships[0].position.y);
356  playerships[0].precisionz = static_cast<double>(playerships[0].position.z);
357  playerships[0].reference = REF_ACLMODE;
358  SClientPacket outpacket;
359  outpacket.type = 33; // AdministrativeAction
360  outpacket.f_x = 7.0f; // ACL
361  outpacket.f_y = 0.0f;
362  outpacket.f_z = 0.0f; // NULL
363  outpacket.f_w = 0.0f; // NULL
364  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
365  }
366  else if (_wcsicmp(msg, L"000COMMANDW0") == 0 && gui->IsAdmin)
367  {
368  if (gui->game->bus->WPtargetC < 0 || gui->game->bus->WPtargetC >= static_cast<long>(gui->game->bus->waypoint.size()))
369  {
370  char msg[199];
371  sprintf_s(msg, 199, "Trying to reposition to a waypoint that doesn't exist in collection: %i (%i)", gui->game->bus->WPtargetC, gui->game->bus->waypoint.size());
372  logger->Log(msg, Logger::Level::Error);
373  gui->game->bus->WPtargetC = 0;
374  }
375 
376  D3DXVECTOR3 location = gui->game->bus->waypoint.at(gui->game->bus->WPtargetC).location;
377  if (location == D3DXVECTOR3(0, 0, 0))
378  break;
379 
380  playerships[0].position = location;
381  playerships[0].precisionx = static_cast<double>(playerships[0].position.x);
382  playerships[0].precisiony = static_cast<double>(playerships[0].position.y);
383  playerships[0].precisionz = static_cast<double>(playerships[0].position.z);
384  playerships[0].reference = REF_ONGROUND;
385 
386  D3DXVECTOR3 gthrust;
387  float radius;
388  playerships[0].velocity = playerships[0].barycentric = Viewscreen::CalculateBarycentric(&playerships[0].position, &gthrust, &radius);
389 
391 
392  SClientPacket outpacket;
393  outpacket.type = 33; // AdministrativeAction
394  outpacket.f_x = 8.0f; // REPOSITION
395  outpacket.f_y = static_cast<float>(gui->game->bus->waypoint.at(gui->game->bus->WPtargetC).id);
396  outpacket.f_z = 0.0f; // NULL
397  outpacket.f_w = 0.0f; // NULL
398  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
399  }
400  else if (_wcsicmp(msg, L"000COMMANDO0") == 0 && gui->IsAdmin && ourcockpit.spaceCapable)
401  {
402  // Keep multiple thousands of deaths from occurring
403  D3DXVec3Normalize(&playerships[0].position, &playerships[0].position);
404  D3DXVec3Scale(&playerships[0].position, &playerships[0].position, radiusC + 2000.0f);
405  playerships[0].precisionx = static_cast<double>(playerships[0].position.x);
406  playerships[0].precisiony = static_cast<double>(playerships[0].position.y);
407  playerships[0].precisionz = static_cast<double>(playerships[0].position.z);
408  playerships[0].velocity.x = playerships[0].velocity.y = playerships[0].velocity.z = 0.0f;
409  playerships[0].pitch = playerships[0].yaw = playerships[0].roll = 0.0f;
410  playerships[0].reference = REF_ACLMODE;
411  SClientPacket outpacket;
412  outpacket.type = 33; // AdministrativeAction
413  outpacket.f_x = 9.0f; // ORBIT
414  outpacket.f_y = 0.0f;
415  outpacket.f_z = 0.0f; // NULL
416  outpacket.f_w = 0.0f; // NULL
417  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
418  }
419  else if (_wcsicmp(msg, L"000COMMANDD0") == 0 && gui->IsAdmin && gui->game->bus->targetC < -1 && ourcockpit.spaceCapable)
420  {
421  // Keep multiple thousands of deaths from occurring
422  playerships[0].dockoffset.x = RandomFloat() - 0.5f;
423  playerships[0].dockoffset.y = RandomFloat() - 0.5f;
424  playerships[0].dockoffset.z = RandomFloat() - 0.5f;
425  playerships[0].precisionx = static_cast<double>(playerships[0].position.x);
426  playerships[0].precisiony = static_cast<double>(playerships[0].position.y);
427  playerships[0].precisionz = static_cast<double>(playerships[0].position.z);
429  playerships[0].pitch = playerships[0].yaw = playerships[0].roll = 0.0f;
430  // 8 is CPOC, 9 is TAC, 10 is YSP
431  playerships[0].reference = static_cast<char>(REF_DOCKCPOC - gui->game->bus->targetC - 2);
432  D3DXQuaternionIdentity(&playerships[0].orientation);
433  playerships[0].orientation.x = 0.28f;
434  SClientPacket outpacket;
435  outpacket.type = 33; // AdministrativeAction
436  outpacket.f_x = 10.0f; // DOCK
437  outpacket.f_y = static_cast<float>(gui->game->bus->targetC);
438  outpacket.f_z = 0.0f; // NULL
439  outpacket.f_w = 0.0f; // NULL
440  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
441  }
442  else
443  {
444  // garble based on blackout
446  WCHAR garbled[TRANSMIT_CHAT_SIZE];
447  wcscpy_s(garbled, TRANSMIT_CHAT_SIZE, msg);
448  gui->GarbleChat(garbled);
449 
450  // send it
451  gui->networking->SendChatMessage(static_cast<unsigned char>(gui->chatchannel[cmd->activetab].channel), static_cast<unsigned char>(gui->ourplayerC), garbled);
452  }
453 
454  if (!msg[0])
455  {
456  logger->Log("CommunicationsDialog::DialogCallback - Message was empty after processing, skipped!");
457  break;
458  }
459 
460  gui->chatchannel[cmd->activetab].chatline.emplace_back(msg);
461  gui->chatchannel[cmd->activetab].chatlineplayer.emplace_back(gui->player[gui->ourplayerC].callsign);
462 
463  char str[299]; // TRANSMIT_CHAT_SIZE + a buffer for callsign, brackets, colon, space
464  sprintf_s(str, 299, "[%s]: %S", gui->player[gui->ourplayerC].callsign, msg);
465  logger->Log(str);
466 
467  cmd->UpdateMenu(cmd->activetab);
468  }
469  else
470  {
471  logger->Log("CommunicationsDialog::DialogCallback - Message was empty, skipped!");
472  }
473  }
474  break;
475  }
476  }
477  break;
478  case IDC_TABEDIT:
479  {
480  if ((((CDXUTEditBox*)pControl)->GetTextLength()) >= (MAX_TAB_CHARS - 5 - 1))
481  {
482  WCHAR str[MAX_TAB_CHARS - 5];
483  swprintf_s(str, MAX_TAB_CHARS - 5, L"%.*s", MAX_TAB_CHARS - 5 - 1, ((CDXUTEditBox*)pControl)->GetText());
484  ((CDXUTEditBox*)pControl)->SetText(str, false);
485  }
486  if (nEvent == EVENT_EDITBOX_STRING)
487  {
488  short t = D_COMMUNICATIONS;
489  wcscpy_s(gui->chatchannel[cmd->edittab].title, MAX_TAB_CHARS - 5, ((CDXUTEditBox*)pControl)->GetText());
490  _wcsupr_s(gui->chatchannel[cmd->edittab].title, MAX_TAB_CHARS - 5);
491  gui->chatchannel[cmd->edittab].title[MAX_TAB_CHARS - 5 - 1] = 0; // truncate
492 
493  SPacketBig outpacket;
494  outpacket.type = 22;
495  outpacket.array = gui->chatchannel[cmd->edittab].channel;
496  sprintf_s(outpacket.msg, MAX_TAB_CHARS - 5, "%S", gui->chatchannel[cmd->edittab].title);
497  gui->networking->SendToServer(&outpacket, sizeof(SPacketBig), true);
498 
499  cmd->ClearEdit();
500  cmd->UpdateMenu(-1); // content changed
501  }
502  }
503  break;
504  }
505 
506  logger->AddToCallStack("CommunicationsDialog::DialogCallback END");
507 }
508 
510 {
511  logger->AddToCallStack("CommunicationsDialog::UpdateMenu");
512 
513  if (!active)
514  return;
515 
517 
518  if (tabs > MAX_TAB)
519  {
520  logger->Log("tabs is higher than MAX_TAB", Logger::Level::Error);
521  tabs = MAX_TAB;
522  }
523 
524  // always update tabs
525  for (short t = 0; t < tabs; t++)
526  {
527  if (t == 0)
528  swprintf_s(tabstr[t], MAX_TAB_CHARS, L"%s (%i)", gui->strings[L_TAB_GLOBAL].c_str(), gui->chatchannel[t].players);
529  else if (gui->chatchannel[t].title[0] == 0)
530  swprintf_s(tabstr[t], MAX_TAB_CHARS, L"%s (%i)", gui->strings[L_TAB_UNNAMED].c_str(), gui->chatchannel[t].players);
531  else
532  swprintf_s(tabstr[t], MAX_TAB_CHARS, L"%s (%i)", gui->chatchannel[t].title, gui->chatchannel[t].players);
533  }
534 
535  if (tab == -1)
536  tab = activetab; // determine channel from activetab
537  else if (tab != activetab) // if not the one we are in right now
538  return;
539 
540  bool keepatbottom = false;
542  keepatbottom = true;
543 
544  // This is pretty ridiculous, should have been an "erase" but throws exceptions with std::wstring?
545  while (gui->chatchannel[tab].chatline.size() > FORMAT_LINES)
546  {
547  for (size_t i = 0; i < gui->chatchannel[tab].chatline.size() - 1; i++)
548  {
549  gui->chatchannel[tab].chatline[i] = gui->chatchannel[tab].chatline[i + 1];
551  }
552  gui->chatchannel[tab].chatline.pop_back();
553  gui->chatchannel[tab].chatlineplayer.pop_back();
554  }
555 
556  if (fieldeffectivewidth[1])
557  {
558  logger->AddToCallStack("CHATCHANNEL::RefreshChat");
560  logger->AddToCallStack("CHATCHANNEL::RefreshChat DONE!");
561  }
562  linetot = gui->chatchannel[tab].formatchatline.size();
563 
564  if (keepatbottom)
565  linetop = 9999;
566 
567  if ((linetot - linetop) < linedsp) // 8-3 is 5 OK, 8-4 is 4 NO, needs to be 5
568  linetop = linetot - linedsp;
569  if (linetop < 0)
570  linetop = 0;
571 
572  if (lineact > linetot)
573  lineact = 0;
574 
575  if (tabs < MAX_TAB) // room to create one
576  {
577  bool allow = gui->isInjected;
578  for (short s = 1; s < tabs; s++)
579  {
580  if (gui->chatchannel[s].owner == gui->ourplayerC && gui->chatchannel[s].players == 1)
581  allow = false;
582  }
583  actionenabled[0] = allow; // create
584  }
585  else
586  actionenabled[0] = false; // create
587 
588  actionenabled[1] = false; // DND
589 
590  actionenabled[2] = tab != 0; // close channel only when not on global
591 
592  actionenabled[3] = msgbarchannel.channel; // accept invite
593 
594  actionenabled[4] = !gui->chatchannel[tab].chatline.empty(); // shred if there is a backlog
595 
596  actionenabled[5] = true; // transmit
597 
598  actionenabled[6] = linecursel != -1;
599 
600  actiontoggle[0] = false;
601  actiontoggle[1] = gui->chatchannel[tab].dnd;
602  actiontoggle[2] = false;
603  actiontoggle[3] = false;
604  actiontoggle[4] = false;
605  actiontoggle[5] = false;
606  actiontoggle[6] = false;
607 
608 
609  if (linedsp > MAX_LINES)
610  {
611  logger->Log("linedsp is higher than MAX_LINES", Logger::Level::Error);
612  linedsp = MAX_LINES;
613  }
614 
615  for (long t = 0; t < linedsp; t++)
616  {
617  const long visibleline = linetop + t;
618  if (visibleline >= linetot)
619  {
620  fieldline[t][0][0] = 0;
621  fieldline[t][1][0] = 32767;
622  }
623  else
624  {
625  if (gui->chatchannel[tab].formatchatline.at(visibleline).c_str()[0] != 32767)
626  swprintf_s(fieldline[t][0], HELP_SIZE, L"%S", gui->chatchannel[tab].formatchatlineplayer.at(visibleline).c_str());
627  else
628  fieldline[t][0][0] = 0;
629 
630  wcscpy_s(fieldline[t][1], HELP_SIZE, gui->chatchannel[tab].formatchatline.at(visibleline).c_str());
631  }
632  }
633 
634  CheckWidth(dialogid); // if content changes (tabs, received text) we have to adjust fit
636 
638 
639  logger->AddToCallStack("CommunicationsDialog::UpdateMenu DONE");
640 }
641 
642 void CommunicationsDialog::TabClick(short clicked_tab)
643 {
644  logger->AddToCallStack("CommunicationsDialog::TabClick");
645 
646  if (clicked_tab != activetab) // if tab wasn't the active one, make it active
647  {
648  activetab = clicked_tab;
649  // clearedit=true;
650  ActiveTab();
651  }
652  else // otherwise it was already the active tab, edit it
653  {
654  if (clicked_tab != 0 && gui->chatchannel[clicked_tab].owner == gui->ourplayerC && edittab == -1 && editline == -1)
655  {
656  edittab = clicked_tab;
657  HUD.GetEditBox(IDC_TABEDIT)->SetLocation(static_cast<int>((tabx[clicked_tab] - windowlocation.x - 8.0f) * gui->game->displayscale), static_cast<int>(-30.0f * gui->game->displayscale));
658  HUD.GetEditBox(IDC_TABEDIT)->SetSize(static_cast<int>((tabwidth[clicked_tab] + 20.0f) * gui->game->displayscale), static_cast<int>(32.0f * gui->game->displayscale));
659  HUD.GetEditBox(IDC_TABEDIT)->SetText(gui->chatchannel[clicked_tab].title, false);
660  HUD.GetEditBox(IDC_TABEDIT)->SetVisible(true);
661  HUD.GetEditBox(IDC_TABEDIT)->HandleMouse(WM_LBUTTONDOWN, gui->ptClick, 0, 0);
662  gui->Editing = true;
663  }
664  }
665 
666  logger->AddToCallStack("CommunicationsDialog::TabClick END");
667 }
668 
670 {
671  logger->AddToCallStack("CommunicationsDialog::ActiveTab");
672 
674 
675  linetop = 9999; // make sure it is at the bottom
678 
679  logger->AddToCallStack("CommunicationsDialog::ActiveTab END");
680 }
681 
683 {
684  char msg[99];
685  sprintf_s(msg, sizeof msg, "CommunicationsDialog::ActionIconClick (%i)", icon_id);
686  logger->AddToCallStack(msg);
687 
688  if (actionenabled[icon_id])
689  {
690  if (action[icon_id] == (L_ACTION_ADD_FOLDER - L_ACTION_MARK) && tabs < MAX_TAB) // add folder
691  {
692  logger->AddToCallStack("CommunicationsDialog::ActionIconClick L_ACTION_ADD_FOLDER");
693 
694  tabusedefaultlang[tabs] = 0; // user config
695  tabstr[tabs][0] = 0; // unnamed
696  tabs++;
698  }
699  else if (action[icon_id] == (L_ACTION_REMOVE_FOLDER - L_ACTION_MARK) && tabs > 1) // remove folder
700  {
701  logger->AddToCallStack("CommunicationsDialog::ActionIconClick L_ACTION_REMOVE_FOLDER");
702 
703  // ian wants it to go through and remove group associations for records and delete
704  for (short s = activetab; s < (tabs - 1); s++)
705  {
706  tabflash[s] = tabflash[s + 1];
707  wcscpy_s(tabstr[s], MAX_TAB_CHARS, tabstr[s + 1]);
709  }
710  tabs--;
711  if (activetab >= tabs)
712  activetab = tabs - 1;
713  ActiveTab();
714  }
715  else if (action[icon_id] == (L_ACTION_ACCEPT_INVITE - L_ACTION_MARK)) // accept invitation
716  {
717  logger->AddToCallStack("CommunicationsDialog::ActionIconClick L_ACTION_ACCEPT_INVITE");
718 
719  actionenabled[icon_id] = false;
720 
721  if (tabs < MAX_TAB)
722  {
723  // join
724  msgbartext[0] = 0;
725  msgbarcolor = 0; // normal
726 
727  // add tab
728  tabusedefaultlang[tabs] = 0; // user config
729  activetab = tabs;
730  tabs++;
732 
733  // copy temp channel data
735  ZeroMemory(&msgbarchannel, sizeof CHATCHANNEL);
736 
737  // add ourselves to the list
739  ActiveTab();
740 
741  // send join request to server
742  SClientPacket outpacket;
743  outpacket.type = 29; // channel control
744  outpacket.f_x = (float)activetab;
745  outpacket.f_y = (float)gui->chatchannel[activetab].channel;
746  outpacket.f_z = 3.0f; // join
747  outpacket.f_w = 0.0f; // NULL
748  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
749  }
750  else
751  {
752  // sorry
754  msgbarcolor = 2; // amber
755  }
756  }
757  else if (action[icon_id] == (L_ACTION_DISCORD - L_ACTION_MARK)) // join discord
758  {
759  logger->AddToCallStack("CommunicationsDialog::ActionIconClick L_ACTION_DISCORD");
760  ShellExecuteW(nullptr, nullptr, L"https://discord.gg/BH6zvaw", nullptr, nullptr, SW_SHOW);
761  }
762  if (editline == -1)
763  {
764  if (action[icon_id] == (L_ACTION_TRANSMIT - L_ACTION_MARK) && width >= 32)
765  {
766  logger->AddToCallStack("CommunicationsDialog::ActionIconClick L_ACTION_TRANSMIT");
767 
769  editline = editfield = 1;
770  gui->Editing = true;
771 
772  HUD.GetEditBox(IDC_TRANSMIT)->SetLocation(static_cast<int>(15.0f * gui->game->displayscale), static_cast<int>(height * gui->game->displayscale));
773  HUD.GetEditBox(IDC_TRANSMIT)->SetSize(static_cast<int>(static_cast<float>(width - 32) * gui->game->displayscale), static_cast<int>(32.0f * gui->game->displayscale));
774  HUD.GetEditBox(IDC_TRANSMIT)->SetText(L"", false);
775  HUD.GetEditBox(IDC_TRANSMIT)->SetVisible(true);
776  HUD.GetEditBox(IDC_TRANSMIT)->HandleMouse(WM_LBUTTONDOWN, gui->ptClick, 0, 0);
777  }
778  else if (action[icon_id] == (L_ACTION_CLEAR_BACKLOG - L_ACTION_MARK))
779  {
780  logger->AddToCallStack("CommunicationsDialog::ActionIconClick L_ACTION_CLEAR_BACKLOG");
781 
782  gui->chatchannel[activetab].chatline.clear();
784  linecursel = -1;
786  }
787  else if (action[icon_id] == (L_ACTION_NEW_CHANNEL - L_ACTION_MARK))
788  {
789  logger->AddToCallStack("CommunicationsDialog::ActionIconClick L_ACTION_NEW_CHANNEL");
790 
791  tabusedefaultlang[tabs] = 0; // user config
792  activetab = tabs;
793  tabs++;
795  // add ourselves to the list
799  gui->chatchannel[activetab].chatline.clear();
801  gui->chatchannel[activetab].dnd = false;
802  gui->chatchannel[activetab].title[0] = 0; // UNNAMED
803  ActiveTab();
804  // we have to transmit the new channel and get the actual channel #
805  // 29=channelctrl, x=tab, y=channel, z=(0=closereq 1=addreq 2=invite 3=joinreq 4=plyrleft 5=newowner), w=ownerslot, array=tempplayer
806  SClientPacket outpacket;
807  outpacket.type = 29;
808  outpacket.f_x = (float)activetab; // tab
809  outpacket.f_y = 0.0f; // waiting for this information
810  outpacket.f_z = 1.0f; // add/new
811  outpacket.f_w = (float)gui->ourplayerC;
812  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
813  UpdateMenu(-1);
814  char msg[99];
815  sprintf_s(msg, 99, "Requesting new channel for tab %i", activetab);
816  logger->Log(msg);
817  }
818  else if (action[icon_id] == (L_ACTION_CLOSE_CHANNEL - L_ACTION_MARK))
819  {
820  logger->AddToCallStack("CommunicationsDialog::ActionIconClick L_ACTION_CLOSE_CHANNEL");
821 
822  // transmit that we left the channel
823  SClientPacket outpacket;
824  outpacket.type = 29;
825  outpacket.f_x = static_cast<float>(activetab); // tab
826  outpacket.f_y = static_cast<float>(gui->chatchannel[activetab].channel);
827  outpacket.f_z = 0.0f; // close/leave
828  outpacket.f_w = static_cast<float>(gui->chatchannel[activetab].owner);
829  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
830 
831  gui->chatchannel[activetab].chatline.clear();
835 
836  for (short s = activetab; s < (tabs - 1); s++)
837  {
838  wcscpy_s(tabstr[s], MAX_TAB_CHARS, tabstr[s + 1]);
840  gui->chatchannel[s] = gui->chatchannel[s + 1];
841  }
842  tabs--;
844  activetab--;
845  ActiveTab();
846  }
847  else if (action[icon_id] == (L_ACTION_OFF_HOOK - L_ACTION_MARK))
848  {
849  logger->AddToCallStack("CommunicationsDialog::ActionIconClick L_ACTION_OFF_HOOK");
850 
853  }
854  else if (action[icon_id] == (L_ACTION_COPY - L_ACTION_MARK))
855  {
856  logger->AddToCallStack("CommunicationsDialog::ActionIconClick L_ACTION_COPY");
857 
858  if (linecursel < 0 || linecursel >= static_cast<int>(gui->chatchannel[dialogs[D_COMMUNICATIONS]->activetab].formatchatline.size()))
859  {
860  sprintf_s(msg, 199, "Ha! This is where we were crapping out on linecursel: %i", linecursel);
861  logger->Log(msg, Logger::Level::Error);
862  }
863  else
864  {
865  const wchar_t* str = gui->chatchannel[dialogs[D_COMMUNICATIONS]->activetab].formatchatline.at(linecursel).c_str();
866 
867  const HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, wcslen(str) * 2 + 2);
868  memcpy(GlobalLock(hMem), str, wcslen(str) * 2 + 2);
869  GlobalUnlock(hMem);
870 
871  OpenClipboard(nullptr);
872  EmptyClipboard();
873  SetClipboardData(CF_UNICODETEXT, hMem);
874  CloseClipboard();
875  }
876 
877  linecursel = -1;
878  actionenabled[6] = false;
880  }
881  }
882  }
883 
884  logger->AddToCallStack("CommunicationsDialog::ActionIconClick END");
885 }
886 
887 void CommunicationsDialog::ChannelInvite(char* msg, unsigned char whoinvited, unsigned char channel, unsigned char players)
888 {
889  logger->AddToCallStack("CommunicationsDialog::ChannelInvite");
890 
891  msgbarchannel.channel = channel;
892  msgbarchannel.chatline.clear();
895  msgbarchannel.dnd = false;
896  msgbarchannel.owner = whoinvited;
897  swprintf_s(msgbarchannel.title, MAX_TAB_CHARS - 5, L"%S", msg);
898  if (msgbarchannel.title[0] == 0)
899  swprintf_s(msgbartext, HELP_SIZE, gui->strings[L_MESSAGE_CHANNELINVITE].c_str(), gui->player[whoinvited].callsign, gui->strings[L_TAB_UNNAMED].c_str(), players);
900  else
901  swprintf_s(msgbartext, HELP_SIZE, gui->strings[L_MESSAGE_CHANNELINVITE].c_str(), gui->player[whoinvited].callsign, msgbarchannel.title, players);
902 
903  actionenabled[3] = true;
904 
905  logger->AddToCallStack("CommunicationsDialog::ChannelInvite END");
906 }
907 
909 {
910  logger->AddToCallStack("CommunicationsDialog::DragDropItem");
911 
912  if (gui->dragt == DD_COMMUNICATIONS) // from player to a chat channel s (tab)
913  {
914  // use f_x to receive the target player
915  SClientPacket outpacket;
916  outpacket.type = 29;
917  outpacket.f_x = (float)gui->chatchannel[activetab].seqplayer[gui->dragline]; // used for target player
918  outpacket.f_y = (float)gui->chatchannel[s].channel;
919  outpacket.f_z = 2.0f; // invite
920  outpacket.f_w = (float)gui->chatchannel[s].players;
921  gui->networking->SendToServer(&outpacket, sizeof(SClientPacket), true);
924  msgbarcolor = 0; // nominal
925  }
926  else if (gui->dragt == D_WAYPOINTMANAGER) // from waypoints
927  {
928  // tokenized waypoint transmission
929  if (gui->dragline < 0 || gui->dragline >= (long)gui->game->bus->waypoint.size())
930  {
931  char msg[99];
932  sprintf_s(msg, sizeof msg, "Trying to drag a waypoint that doesn't exist in collection: %i", gui->dragline);
933  logger->Log(msg, Logger::Level::Fatal);
934  }
935 
936  Swaypoint tempwaypoint = gui->game->bus->waypoint.at(gui->dragline);
937 
938  // serialize!
939  WCHAR csv[TRANSMIT_CHAT_SIZE];
940  swprintf_s(csv, TRANSMIT_CHAT_SIZE, L"TC_WAYPOINT,%i,%f,%f,%f,%S",
941  tempwaypoint.uniqueid, tempwaypoint.location.x, tempwaypoint.location.y, tempwaypoint.location.z, tempwaypoint.text);
943 
944  gui->chatchannel[activetab].chatline.emplace_back(csv);
945  gui->chatchannel[activetab].chatlineplayer.emplace_back(gui->player[gui->ourplayerC].callsign);
946 
948  }
949 
950  logger->AddToCallStack("CommunicationsDialog::DragDropItem END");
951 }
952 
954 {
955  logger->AddToCallStack("CommunicationsDialog::ClearEdit");
956 
957  if (editfield != -1 || editline != -1)
958  {
959  editfield = editline = -1;
960  HUD.GetEditBox(IDC_TRANSMIT)->SetVisible(false);
961  gui->Editing = false;
962  actionoffset = 0;
963  }
964  if (edittab != -1)
965  {
966  edittab = -1;
967  HUD.GetEditBox(IDC_TABEDIT)->SetVisible(false);
968  gui->Editing = false;
969  }
970 
971  logger->AddToCallStack("CommunicationsDialog::ClearEdit END");
972 }
973 
974 void CommunicationsDialog::Close(bool minimize)
975 {
976  active = false;
977  minimized = minimize;
978  dialogs[DD_COMMUNICATIONS]->active = false;
979  dialogs[DD_COMMUNICATIONS]->minimized = minimize;
981 }
static void CheckMoved(short t)
bool elmoOverride
Definition: weather.h:86
#define radiusC
Definition: globals.h:88
short FONT_WIDTH
Definition: gui.h:713
std::vector< std::wstring > formatchatline
Definition: chat.h:55
Scockpit ourcockpit
Definition: globals.cpp:176
bool minimized
Definition: DialogBase.h:103
D3DXVECTOR3 dockingvel
Definition: globals.h:540
short tabx[MAX_TAB]
Definition: DialogBase.h:89
virtual void UpdateMenu(short tab)
float fuel
Definition: globals.cpp:143
Networking * networking
Definition: gui.h:855
short actions
Definition: DialogBase.h:49
long editfield
Definition: DialogBase.h:79
float daylightOverride
Definition: weather.h:83
D3DXVECTOR3 position
Definition: globals.h:549
D3DXQUATERNION orientation
Definition: globals.h:558
void SendToServer(void *pData, DWORD dwSize, bool bGuaranteed, PacketOrdering order=ORDERING_NONE) const
Definition: Networking.cpp:59
short linedsp
Definition: DialogBase.h:72
std::vector< std::wstring > chatline
Definition: chat.h:47
GameClass * game
Definition: gui.h:857
D3DXVECTOR3 windowlocation
Definition: DialogBase.h:59
bool radioEquipped
Definition: globals.h:644
InformationDialog * informationDialog
Definition: gui.h:789
short fieldeffectivewidth[MAX_FIELDS]
Definition: DialogBase.h:93
long edittab
Definition: DialogBase.h:79
double precisiony
Definition: globals.h:550
s_network_objects playerships[MAX_SCAN]
Definition: globals.cpp:174
bool actionenabled[MAX_ACTION]
Definition: DialogBase.h:77
float alphascreenOverride
Definition: weather.h:84
void ActionIconClick(long icon_id)
short players
Definition: chat.h:15
short fieldcontent[MAX_FIELDS]
Definition: DialogBase.h:48
#define FORMAT_LINES
Definition: chat.h:8
short dialogid
Definition: DialogBase.h:101
float deathfuel
Definition: globals.cpp:144
short tabs
Definition: DialogBase.h:62
bool usesHUD
Definition: DialogBase.h:56
std::vector< std::string > formatchatlineplayer
Definition: chat.h:56
short actionoffset
Definition: DialogBase.h:76
float gammascreenOverride
Definition: weather.h:85
weather * ptrWeather
Definition: Viewscreen.h:287
short dragt
Definition: gui.h:716
unsigned char channel
Definition: chat.h:57
unsigned char owner
Definition: chat.h:57
short defaultwidth
Definition: DialogBase.h:51
int linecursel
Definition: DialogBase.h:73
bool showfields
Definition: DialogBase.h:45
POINT ptClick
Definition: gui.h:724
short activetab
Definition: DialogBase.h:62
CDXUTDialogResourceManager g_DialogResourceManager
Definition: gui.h:752
std::vector< std::string > chatlineplayer
Definition: chat.h:48
void TabClick(short clicked_tab)
WCHAR fieldline[MAX_LINES][MAX_FIELDS][HELP_SIZE]
Definition: DialogBase.h:94
short text
Definition: DialogBase.h:69
float fuelmax
Definition: globals.h:637
static DialogBase * dialogs[D_ENUMERATION]
Definition: DialogBase.h:39
short fieldwidth[MAX_FIELDS]
Definition: DialogBase.h:46
void AddPlayer(unsigned char tempplayer)
Definition: chat.h:17
bool actiontoggle[MAX_ACTION]
Definition: DialogBase.h:77
unsigned char seqplayer[MAX_ONLINEPLAYERS]
Definition: chat.h:13
bool isInjected
Definition: gui.h:777
bool IsAdmin
Definition: gui.h:777
void Close(bool minimize)
WCHAR msgbartext[HELP_SIZE]
Definition: DialogBase.h:82
Viewscreen * viewscreen
Definition: GameClass.h:111
void TriggerBCLLightning(float distanceScalar, float intensityScalar) const
unsigned char ourplayerC
Definition: gui.h:766
void InitializeSmoothValues()
Definition: weather.cpp:897
short dockedto
Definition: DialogBase.h:55
bool PopUpHelp(short helpId, bool allowDismiss=true, bool isLearnMore=false)
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
double precisionx
Definition: globals.h:550
SPlayerData player[MAX_ONLINEPLAYERS]
Definition: gui.h:765
float Clamp(float val, float min, float max)
Definition: MathUtilities.h:3
short defaultheight
Definition: DialogBase.h:51
short width
Definition: DialogBase.h:60
int lineact
Definition: DialogBase.h:73
bool Editing
Definition: gui.h:778
long dragline
Definition: gui.h:717
static short CheckWidth(short dialogid)
int linetop
Definition: DialogBase.h:73
short action[MAX_ACTION]
Definition: DialogBase.h:49
bool spaceCapable
Definition: globals.h:605
WCHAR tabstr[MAX_TAB][MAX_TAB_CHARS]
Definition: DialogBase.h:63
short targetC
Definition: Bus.h:378
bool IsNullOrWhitespace(const WCHAR *string)
void ChannelInvite(char *msg, unsigned char whoinvited, unsigned char channel, unsigned char tab)
D3DXVECTOR3 velocity
Definition: globals.h:540
Sound * sound
Definition: gui.h:856
static D3DXVECTOR3 CalculateBarycentric(D3DXVECTOR3 *position, D3DXVECTOR3 *gthrust, float *radius)
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
CDXUTDialog HUD
Definition: DialogBase.h:98
void GlobalAttenuate(float prmGaTimeToFadeOut, float prmGaTimeToHold, float prmGaTimeToFadeIn, int soundEnum, float prmExTimeToFadeIn, float prmExTimeToHold, float prmExTimeToFadeOut, float volumeAdj=1.0f)
Definition: Sound.cpp:489
short icon
Definition: DialogBase.h:53
static HMI * gui
Definition: DialogBase.h:40
WCHAR title[MAX_TAB_CHARS - 5]
Definition: chat.h:59
virtual void ClearEdit()
float deathinhibit
Definition: globals.cpp:51
long editline
Definition: DialogBase.h:79
float Play(int soundEnum)
Definition: Sound.cpp:577
static void UpdateScrollBar(short t)
short height
Definition: DialogBase.h:60
void SetProjectionMatrices()
void RefreshChat(long columnWidth, int fontWidth)
Definition: chat.h:61
static void CALLBACK DialogCallback(UINT nEvent, int nControlID, CDXUTControl *pControl, void *pUserContext)
bool dnd
Definition: chat.h:58
void SendChatMessage(unsigned char channel, unsigned char player, const WCHAR *message) const
Definition: Networking.cpp:179
short tabwidth[MAX_TAB]
Definition: DialogBase.h:89
char dead
Definition: globals.cpp:49
#define HELP_SIZE
Definition: gui.h:17
float displayscale
Definition: GameClass.h:128
std::vector< Swaypoint > waypoint
Definition: Bus.h:391
D3DXVECTOR3 barycentric
Definition: globals.h:540
D3DXVECTOR3 windowdefaultlocation
Definition: DialogBase.h:52
bool normalinterlace
Definition: DialogBase.h:54
std::wstring strings[L_ENUMERATION]
Definition: gui.h:749
void PlayEx(int soundEnum, bool loop, float volume=1.0f, float frequencyMod=1.0f, float pan=0.0f, bool restart=true)
Definition: Sound.cpp:606
int WPtargetC
Definition: Bus.h:390
void AddToCallStack(const char *msg)
Definition: Logger.cpp:86
Bus * bus
Definition: GameClass.h:112
float flood
Definition: gui.h:767
virtual void ActiveTab()
int linetot
Definition: DialogBase.h:73
short fieldtype[MAX_FIELDS]
Definition: DialogBase.h:47
float RandomFloat()
Definition: MathUtilities.h:98
double precisionz
Definition: globals.h:550
short cursoroverwindow
Definition: gui.h:713
D3DXVECTOR3 windowseeklocation
Definition: DialogBase.h:68
D3DXVECTOR3 dockoffset
Definition: globals.h:549
short fields
Definition: DialogBase.h:44
#define MAX_LINES
Definition: gui.h:20
SVesselDC vdat
Definition: globals.h:669
void GarbleChat(wchar_t *str) const
Definition: gui.cpp:2750