90 HudDiagnostics::LogChatInput(*
gui,
"chat cleared by left click without transmit focus");
100 reportedFocusFailure =
false;
101 else if (!reportedFocusFailure)
103 reportedFocusFailure =
true;
104 HudDiagnostics::LogChatInput(*
gui,
"chat update failed to acquire transmit focus");
114 HudDiagnostics::LogChatInput(*
gui,
"tab edit cleared by left click without focus");
132 sprintf_s(event,
sizeof event,
"communications callback event=%u control=%d", nEvent, nControlID);
133 HudDiagnostics::LogChatInput(*
gui, event);
155 logger->
Log(
"CommunicationsDialog::DialogCallback - We are sending a chat message!");
170 for (
unsigned short q = 1; q < wcslen(msg); q++)
180 if (_wcsicmp(msg,L
"000COMMANDADVIEW1")==0 || _wcsicmp(msg,L
"000COMMANDADVIEW2")==0 || _wcsicmp(msg,L
"000COMMANDADVIEW0")==0 || _wcsicmp(msg,L
"000COMMANDADVIEWRESET")==0)
183 if (_wcsicmp(msg,L
"000COMMANDADVIEWRESET")==0)diagnostic.
SetEnabled(
false);
184 diagnostic.SetEnabled(_wcsicmp(msg,L
"000COMMANDADVIEW0")!=0);
185 diagnostic.SetOverlayVisible(_wcsicmp(msg,L
"000COMMANDADVIEW2")!=0);
186 if (_wcsicmp(msg,L
"000COMMANDADVIEW1")==0 && !
gui->
minimized)
191 else if (_wcsicmp(msg, L
"000DESTRUCT0") == 0)
200 outpacket.
f_x = 0.0f;
201 outpacket.
f_y = 0.0f;
202 outpacket.
f_z = 0.0f;
203 outpacket.
f_w = 5.0f;
211 else if (_wcsicmp(msg, L
"000COMMANDSIM0") == 0 &&
gui->
IsAdmin)
227 outpacket.
f_x = 0.0f;
229 outpacket.
f_z = 0.0f;
230 outpacket.
f_w = 0.0f;
233 else if (_wcsicmp(msg,L
"000COMMANDCLOUDBOLT1")==0 || _wcsicmp(msg,L
"000COMMANDCLOUDBOLT0")==0)
236 const bool start=_wcsicmp(msg,L
"000COMMANDCLOUDBOLT1")==0;
240 view->cloudVolume.SetLightningDiagnostic(
false);
241 logger->
Log(
"CLOUDBOLT: local cloud-flash test stopped.");
243 else if(
playerships[0].isSimulator || !view->VolumeCloudsEnabled()
245 logger->
Log(
"CLOUDBOLT: test requires real flight above the highest cloud layer.");
246 else if(view->cloudVolume.SetLightningDiagnostic(
true))
247 logger->
Log(
"CLOUDBOLT: 30 real-second local test, 2 chained cloud events/sec within 100 km beneath ship; live cloud shape, forced storm-strength events. CLOUDBOLT0 stops.");
248 else logger->
Log(
"CLOUDBOLT: waiting for the cloud renderer and global weather map.");
251 else if (_wcsicmp(msg, L
"000COMMANDBOLT") == 0 &&
gui->
IsAdmin)
257 outpacket.
f_x = 1.0f;
258 outpacket.
f_y = 0.0f;
259 outpacket.
f_z = 0.0f;
260 outpacket.
f_w = 0.0f;
263 else if (_wcsicmp(msg, L
"000COMMANDRADIO") == 0 &&
gui->
IsAdmin)
268 outpacket.
f_x = 2.0f;
270 outpacket.
f_z = 0.0f;
271 outpacket.
f_w = 0.0f;
301 else if (_wcsicmp(msg, L
"000COMMANDNVG") == 0 &&
gui->
IsAdmin)
314 else if (
gui->
IsAdmin && _wcsnicmp(msg, L
"000COMMANDSUN", 13) == 0)
322 outpacket.
f_x = 3.0f;
323 outpacket.
f_y = value;
328 logger->
Log(
"SUN: use 000COMMANDSUN0..1 (0 below, 0.5 horizon, 1 overhead), or 000COMMANDSUN-1 to restore the orbit.");
332 else if (
gui->
IsAdmin && _wcsnicmp(msg, L
"000COMMANDVIS", 13) == 0)
339 L
"Use 000COMMANDVIS0.010..168.64 (km), or 000COMMANDVIS-1 to restore live weather.");
341 else if (
gui->
IsAdmin && (_wcsnicmp(msg, L
"000COMMANDRAIN", 14) == 0
342 || _wcsnicmp(msg, L
"000COMMANDBCL", 13) == 0))
344 const bool rain = _wcsnicmp(msg, L
"000COMMANDRAIN", 14) == 0;
350 ? L
"Use 000COMMANDRAIN2..16 (decimals allowed), or 000COMMANDRAIN-1 to reset."
351 : L
"Use 000COMMANDBCL0..10 (km above ground, decimals allowed), or 000COMMANDBCL-1 to reset.");
358 outpacket.
f_x = 11.0f;
359 outpacket.
f_y = value;
360 outpacket.
f_z = 0.0f;
361 outpacket.
f_w = 0.0f;
367 else if (_wcsicmp(msg, L
"000COMMANDALPHA-1") == 0 &&
gui->
IsAdmin)
372 outpacket.
f_x = 4.0f;
374 outpacket.
f_z = 0.0f;
375 outpacket.
f_w = 0.0f;
378 else if (_wcsicmp(msg, L
"000COMMANDALPHA0") == 0 &&
gui->
IsAdmin)
383 outpacket.
f_x = 4.0f;
385 outpacket.
f_z = 0.0f;
386 outpacket.
f_w = 0.0f;
389 else if (_wcsicmp(msg, L
"000COMMANDALPHA1") == 0 &&
gui->
IsAdmin)
394 outpacket.
f_x = 4.0f;
396 outpacket.
f_z = 0.0f;
397 outpacket.
f_w = 0.0f;
400 else if (
gui->
IsAdmin && _wcsnicmp(msg, L
"000COMMANDGAMMA", 15) == 0)
426 outpacket.
f_x = 5.0f;
427 outpacket.
f_y = value;
428 outpacket.
f_z = 0.0f;
429 outpacket.
f_w = 0.0f;
433 else if (_wcsicmp(msg, L
"000COMMANDELMO0") == 0 &&
gui->
IsAdmin)
438 outpacket.
f_x = 6.0f;
440 outpacket.
f_z = 0.0f;
441 outpacket.
f_w = 0.0f;
444 else if (_wcsicmp(msg, L
"000COMMANDELMO1") == 0 &&
gui->
IsAdmin)
449 outpacket.
f_x = 6.0f;
451 outpacket.
f_z = 0.0f;
452 outpacket.
f_w = 0.0f;
455 else if (_wcsicmp(msg, L
"000COMMANDACL0") == 0 &&
gui->
IsAdmin)
467 outpacket.
f_x = 7.0f;
468 outpacket.
f_y = 0.0f;
469 outpacket.
f_z = 0.0f;
470 outpacket.
f_w = 0.0f;
474 else if (_wcsicmp(msg, L
"000COMMANDW0") == 0 &&
gui->
IsAdmin)
513 outpacket.
f_x = 8.0f;
515 outpacket.
f_z = 0.0f;
516 outpacket.
f_w = 0.0f;
565 outpacket.
f_x = 9.0f;
566 outpacket.
f_y = 0.0f;
567 outpacket.
f_z = 0.0f;
568 outpacket.
f_w = 0.0f;
599 outpacket.
f_x = 10.0f;
601 outpacket.
f_z = 0.0f;
602 outpacket.
f_w = 0.0f;
608 if (swscanf_s(msg, L
"000WEIGHT%i", &percent)!=1)
639 logger->
Log(
"CommunicationsDialog::DialogCallback - Message was empty after processing, skipped!");
654 logger->
Log(
"CommunicationsDialog::DialogCallback - Message was empty, skipped!");
708 for (
short t = 0; t <
tabs; t++)
723 bool keepatbottom =
false;
761 for (
short s = 1; s <
tabs; s++)
798 for (
long t = 0; t <
linedsp; t++)
800 const long visibleline =
linetop + t;
870 sprintf_s(msg,
sizeof msg,
"CommunicationsDialog::ActionIconClick (%i)", icon_id);
931 outpacket.
f_z = 3.0f;
932 outpacket.
f_w = 0.0f;
945 ShellExecuteW(
nullptr,
nullptr, L
"https://discord.gg/BH6zvaw",
nullptr,
nullptr, SW_SHOW);
994 outpacket.
f_y = 0.0f;
995 outpacket.
f_z = 1.0f;
1000 sprintf_s(msg,
sizeof msg,
"Requesting new channel for tab %i",
activetab);
1009 outpacket.
type = 29;
1012 outpacket.
f_z = 0.0f;
1045 sprintf_s(msg,
sizeof msg,
"Ha! This is where we were crapping out on linecursel: %i",
linecursel);
1052 const size_t strLen = wcslen(str);
1053 const HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, (strLen + 1) *
sizeof(
wchar_t));
1054 if (hMem !=
nullptr)
1056 memcpy(GlobalLock(hMem), str, (strLen + 1) *
sizeof(
wchar_t));
1059 OpenClipboard(
nullptr);
1061 SetClipboardData(CF_UNICODETEXT, hMem);
1105 outpacket.
type = 29;
1108 outpacket.
f_z = 2.0f;
1121 sprintf_s(msg,
sizeof msg,
"Trying to drag a waypoint that doesn't exist in collection: %i",
gui->
dragline);
1146 reportedFocusFailure =
false;
1148 HudDiagnostics::LogChatInput(*
gui,
"communications ClearEdit");
1171 HudDiagnostics::LogChatInput(*
gui, minimize ?
"communications minimized" :
"communications closed");
HRESULT(WINAPI *CUniBuffer::_ScriptApplyDigitSubstitution)(const SCRIPT_DIGITSUBSTITUTE *
#define EVENT_EDITBOX_STRING
#define EVENT_EDITBOX_CANCEL
#define TRANSMIT_CHAT_SIZE
bool IsNullOrWhitespace(const WCHAR *string)
float StaticAirPressureMb
double SimulatorTimeOffset
std::vector< Swaypoint > waypoint
std::vector< std::wstring > formatchatline
std::vector< std::string > chatlineplayer
unsigned char seqplayer[MAX_ONLINEPLAYERS]
std::vector< std::string > formatchatlineplayer
std::vector< std::wstring > chatline
void RefreshChat(long columnWidth, int fontWidth)
WCHAR title[MAX_TAB_CHARS - 5]
void AddPlayer(unsigned char tempplayer)
void UpdateMenu(short tab) override
static void CALLBACK DialogCallback(UINT nEvent, int nControlID, RiseControl *pControl, void *pUserContext)
CHATCHANNEL msgbarchannel
void ActiveTab() override
void TabClick(short clicked_tab) override
void ClearEdit() override
CommunicationsDialog(short id)
void ChannelInvite(char *msg, unsigned char whoinvited, unsigned char channel, unsigned char tab)
void Close(bool minimize) override
void DragDropItem(short s) override
void ActionIconClick(long icon_id) override
short fieldcontent[MAX_FIELDS]
bool actiontoggle[MAX_ACTION]
RiseMath::Vector3 windowseeklocation
short fieldtype[MAX_FIELDS]
short fieldeffectivewidth[MAX_FIELDS]
static DialogBase * dialogs[D_ENUMERATION]
static void UpdateScrollBar(short t)
WCHAR fieldline[MAX_LINES][MAX_FIELDS][HELP_SIZE]
WCHAR tabstr[MAX_TAB][MAX_TAB_CHARS]
static void IconClick(short icon_id)
bool actionenabled[MAX_ACTION]
static void CheckMoved(short t)
WCHAR msgbartext[HELP_SIZE]
short tabusedefaultlang[MAX_TAB]
RiseMath::Vector3 windowdefaultlocation
RiseMath::Vector3 windowlocation
static short CheckWidth(short dialogid)
virtual void UpdateMenu(short tab)
short fieldwidth[MAX_FIELDS]
std::unique_ptr< Bus > bus
void UseOrDisuseInventoryItemType(int itemtype, int itemsubtype, int itemId, int vehicleId) const
std::unique_ptr< Viewscreen > viewscreen
WaypointDialog * waypointDialog
SPlayerData player[MAX_ONLINEPLAYERS]
std::wstring strings[L_ENUMERATION]
InformationDialog * informationDialog
void GarbleChat(wchar_t *str) const
RiseDialogResourceManager g_DialogResourceManager
CHATCHANNEL chatchannel[MAX_TAB]
Sicons icon[D_ENUMERATION+1]
void Log(const char *msg, Level level=Info, int errorCode=0)
void AddToCallStack(const char *msg)
void SendToServer(void *pData, DWORD dwSize, bool bGuaranteed, PacketOrdering order=ORDERING_NONE) const
void SendChatMessage(unsigned char channel, unsigned char player, const WCHAR *message) const
void SetEnabled(bool value)
void RecordChat(const wchar_t *message, unsigned channel)
static FrameProfiler11 & Get()
void SetLocation(int x, int y)
void SetSize(int width, int height)
virtual void SetVisible(bool bVisible)
RiseEditBox * GetEditBox(int ID)
void Init(RiseDialogResourceManager *pManager, bool bRegisterDialog=true)
void EnableKeyboardInput(bool bEnable)
void RequestFocus(RiseControl *pControl)
HRESULT SetFont(UINT index, LPCWSTR strFaceName, LONG height, LONG weight)
void SetCallback(UICallback pCallback, void *pUserContext=NULL)
virtual bool HandleMouse(UINT uMsg, POINT pt, WPARAM wParam, LPARAM lParam)
void SetText(LPCWSTR wszText, bool bSelected=false)
float Play(SOUNDS soundEnum, float volume=1.0f)
void PlayEx(SOUNDS soundEnum, bool loop, float volume=1.0f, float frequencyMod=1.0f, float pan=0.0f, bool restart=true, bool fromOutside=false, bool partOfHull=false)
void GlobalAttenuate(float prmGaTimeToFadeOut, float prmGaTimeToHold, float prmGaTimeToFadeIn, SOUNDS soundEnum, float prmExTimeToFadeIn, float prmExTimeToHold, float prmExTimeToFadeOut, float volumeAdj=1.0f)
ReentryEnvelope::State reentryState
std::unique_ptr< propulsion > ptrPropulsion
RiseMath::Vector3 reentryWindward
std::unique_ptr< weather > ptrWeather
std::unique_ptr< grid > ptrGrid
void SetProjectionMatrices()
Rendering::AdDiagnostics11 adDiagnostics
static RiseMath::Vector3 CalculateBarycentric(RiseMath::Vector3 *position, RiseMath::Vector3 *gthrust, float *radius)
void ResetHeadAccelerationEffects(const char *reason, bool waitForTerrain=false)
std::vector< Swaypoint > filteredWaypoints
void PrepareForReposition()
void SendTelemetryUpstream(float fElapsedTime)
float alphascreenOverride
void QueuePlotWeatherReset()
void SetCloudCeilingOverrideKm(float value)
bool TriggerForwardLightning()
void SetPrecipOverride(float value)
void SetVisibilityOverrideKm(float value)
float gammascreenOverride
s_network_objects playerships[MAX_SCAN]
s_universe_object allobjects[maxstarC]
#define SeaLevelPressureMb
@ L_MESSAGE_INVITATIONSENT
@ L_DIALOG_COMMUNICATIONS
@ L_MESSAGE_CHANNELINVITE
@ L_MESSAGE_NOFREECHANNELS
constexpr float MaxTopRiseKm
HRESULT AddEditBox(RiseDialog &hud, int dialogId, int controlId, bool isDefault, Logger &logger)
float UpdateBlackout(float thermalLoad, float &gammaOverride, bool simulator)
float Vec3Length(const Vector3 *a)
Vector3 * Vec3Cross(Vector3 *out, const Vector3 *a, const Vector3 *b)
Vector3 * Vec3TransformNormal(Vector3 *out, const Vector3 *a, const Matrix *m)
Quaternion * QuaternionIdentity(Quaternion *out)
Matrix * MatrixRotationAxis(Matrix *out, const Vector3 *axis, float angle)
float Vec3Dot(const Vector3 *a, const Vector3 *b)
Vector3 * Vec3Normalize(Vector3 *out, const Vector3 *a)
Vector3 * Vec3Scale(Vector3 *out, const Vector3 *a, float scale)
constexpr auto Max(A first, B second)
bool ParseValue(const wchar_t *text, float minimum, float maximum, float &value)
char avionictype[MAX_AVIOPERSHIP]
int inventoryItemInUseSubType
int inventoryItemInUseType
RiseMath::Vector3 location
RiseMath::Vector3 barycentric
RiseMath::Quaternion orientation
RiseMath::Vector3 dockingvel
RiseMath::Vector3 position
RiseMath::Vector3 dockoffset
RiseMath::Vector3 velocity
RiseMath::Vector3 velocity
RiseMath::Vector3 position