23#include <KnownFolders.h>
39 std::array<bool, DialogLayout::Count> defaultLayoutPending{};
41 short DefaultMinimumWidth(
const DialogBase& dialog)
48 void ApplyDefaultDialogLayout(
bool animate)
50 if (std::none_of(defaultLayoutPending.begin(), defaultLayoutPending.end(), [](
bool value) { return value; }))
53 if (game->displayscale <= 0.0f)
61 sizes[i].height =
static_cast<float>(dialog.
defaultheight + (dialog.
tabs ? 16 : 0) +
65 game->displayHeight / game->displayscale, sizes,
73 if (!defaultLayoutPending[i])
75 dialog.
width =
static_cast<short>(layout[i].width);
78 if (!animate || !dialog.
active)
86 if (!defaultLayoutPending[i])
91 defaultLayoutPending.fill(
false);
95 void QueueDefaultDialogLayout(
short dialogId)
106 if (layoutDialogs[i] == dialogId)
107 defaultLayoutPending[i] =
true;
119 sprintf_s(msg,
sizeof(msg),
"m_pddsAvatar[%i]", t);
145 case 1: wcscpy_s(hullfile, 199, L
"textures\\People\\Male\\BODY1.dds");
157 case 7: wcscpy_s(hullfile, 199, L
"textures\\People\\Male\\ears1.dds");
159 case 8: wcscpy_s(hullfile, 199, L
"textures\\People\\Male\\straight1.dds");
161 case 9: wcscpy_s(hullfile, 199, L
"textures\\People\\Male\\HEAD1.dds");
163 case 10: wcscpy_s(hullfile, 199, L
"textures\\People\\Male\\noses1.dds");
165 case 11: wcscpy_s(hullfile, 199, L
"textures\\People\\Male\\HEAD2.dds");
167 case 12: wcscpy_s(hullfile, 199, L
"textures\\People\\Male\\HEAD3.dds");
169 case 13: wcscpy_s(hullfile, 199, L
"textures\\People\\Male\\flattop1.dds");
171 case 14: wcscpy_s(hullfile, 199, L
"textures\\People\\Male\\HAMMONDS1.dds");
178 sprintf_s(msg,
sizeof(msg),
"m_pddsAvatar[%i]", t);
202 else if (newsex == 2)
223 case 1: wcscpy_s(hullfile, 199, L
"textures\\People\\Female\\BODY1.dds");
225 case 2: wcscpy_s(hullfile, 199, L
"textures\\People\\Female\\ears1.dds");
227 case 3: wcscpy_s(hullfile, 199, L
"textures\\People\\Female\\HEAD2.dds");
229 case 4: wcscpy_s(hullfile, 199, L
"textures\\People\\Female\\HEAD1.dds");
231 case 5: wcscpy_s(hullfile, 199, L
"textures\\People\\Female\\noses1.dds");
233 case 6: wcscpy_s(hullfile, 199, L
"textures\\People\\Female\\head3.dds");
235 case 7: wcscpy_s(hullfile, 199, L
"textures\\People\\Female\\HAIR3-Chantal.dds");
237 case 8: wcscpy_s(hullfile, 199, L
"textures\\People\\Female\\HAIR1-MARYMOORE.dds");
239 case 9: wcscpy_s(hullfile, 199, L
"textures\\People\\Female\\HAIR2-Suzette.dds");
241 case 10: wcscpy_s(hullfile, 199, L
"textures\\People\\Male\\HAMMONDS1.dds");
248 sprintf_s(msg,
sizeof(msg),
"m_pddsAvatar[%i]", t);
296 if (randomizeHeightWeight)
315 else if (newsex == 2)
339#pragma region STATUS_CREATE
376 const int val = _wtoi(str);
377 const int newval = weightRange.Clamp(val);
378 swprintf_s(str, 4, L
"%i", newval);
390 const int val = _wtoi(str);
393 swprintf_s(str, 4, L
"%i", newval);
406 const int val = _wtoi(str);
409 swprintf_s(str, 4, L
"%i", newval);
411 age = (
static_cast<float>(newval) - 18.0f) / 62.0f;
415#pragma region Set Access
826#pragma region Validators
842 datapacket.
type = 24;
844 datapacket.
array = 0;
845 if (datapacket.msg[0])
856 datapacket.
type = 24;
858 datapacket.
array = 1;
859 if (datapacket.msg[0])
872 datapacket.
type = 24;
874 datapacket.
array = 2;
875 if (datapacket.msg[0])
890#pragma region STATUS_LOADING
894 logger->
Log(
"Special OnFrameMove(STATUS_LOADING) called!");
901#pragma region STATUS_GAME
943 ApplyDefaultDialogLayout(
false);
963 m_fSlide += powf((27.0f -
m_fSlide) / 27.0f + 1.0f, 4.0f) * fElapsedTime * 20.0f;
984 if (!
icon[t].mouseover)
1021 SetCursor(LoadCursor(
nullptr, IDC_SIZENWSE));
1055 sprintf_s(msg,
sizeof(msg),
"HMI::OnResetDevice() @ displaystage=%i",
game->
displaystage);
1066 logger->
Log(
"HMI::OnResetDevice() g_DialogResourceManager");
1074 logger->
Log(
"HMI::OnResetDevice() g_pFont");
1081 logger->
Log(
"HMI::OnResetDevice() g_pChatFont");
1088 logger->
Log(
"HMI::OnResetDevice() g_pSubtitleFont");
1096 logger->
Log(
"HMI::OnResetDevice() OnDeviceReset");
1101 logger->
Log(
"HMI::OnResetDevice() done!");
1109 const bool traceEnter = HudDiagnostics::IsEnterMessage(uMsg, wParam);
1130 HudDiagnostics::LogChatInput(*
this,
"offered to dialog HUD", t);
1136 HudDiagnostics::LogChatInput(*
this,
"consumed by dialog HUD", t);
1147 if (uMsg == WM_CHAR)
1154 HudDiagnostics::LogChatInput(*
this,
"handled by global OnEnter");
1159 HudDiagnostics::LogChatInput(*
this,
"global OnEnter declined");
1169 case WM_LBUTTONDBLCLK:
1172 case WM_LBUTTONDOWN:
1243 OUT_TT_ONLY_PRECIS, ANTIALIASED_QUALITY, FIXED_PITCH | FF_DONTCARE,
1244 L
"DejaVu Sans Mono", &
g_pFont));
1248 OUT_TT_ONLY_PRECIS, ANTIALIASED_QUALITY, FIXED_PITCH | FF_DONTCARE,
1253 OUT_TT_ONLY_PRECIS, ANTIALIASED_QUALITY, FIXED_PITCH | FF_DONTCARE,
1266 constexpr short preloadedTextureStages = 20;
1267 for (
short i = 0; i < preloadedTextureStages; i++)
1314 size_t startOfLine = 0;
1315 size_t lastGoodSpaceIndex = 0;
1316 for (
size_t i = 0; i < wcslen(message) - startOfLine; i++)
1318 size_t i1 = wcslen(message) - startOfLine - 1;
1321 wcscpy_s(tempStr, 510, &message[startOfLine]);
1335 if (rect.right < 147 && i != i1)
1337 if (tempStr[i] == L
' ' || tempStr[i] == L
'\xff01' || tempStr[i] == L
'\x3002' || tempStr[i] == L
'\xff0c')
1338 lastGoodSpaceIndex = i;
1343 if (lastGoodSpaceIndex != 0 && i != i1)
1345 if (tempStr[lastGoodSpaceIndex] == L
' ')
1346 tempStr[lastGoodSpaceIndex] = 0;
1348 tempStr[lastGoodSpaceIndex + 1] = 0;
1350 newToast.
text.emplace_back(tempStr);
1353 if (lastGoodSpaceIndex != 0)
1354 startOfLine += lastGoodSpaceIndex + 1;
1356 startOfLine += wcslen(tempStr) + 1;
1358 lastGoodSpaceIndex = 0;
1363 newToast.
y = (5 - newToast.
text.size()) * 6;
1364 newToast.
time = 10.0f;
1365 newToast.
id = activeHelp;
1366 switch (newToast.
id)
1382 command.
name =
"AuralCargoBay";
1543 toasts.emplace_back(newToast);
1821 case 1: setlocale(LC_ALL,
"Chinese_China.936");
break;
1822 case 2: setlocale(LC_ALL,
"Dutch_Netherlands.1252");
break;
1823 case 3: setlocale(LC_ALL,
"French_France.1252");
break;
1824 case 4: setlocale(LC_ALL,
"German_Germany.1252");
break;
1825 case 5: setlocale(LC_ALL,
"Greek_Greece.1253");
break;
1826 case 6: setlocale(LC_ALL,
"Italian_Italy.1252");
break;
1827 case 7: setlocale(LC_ALL,
"Japanese_Japan.932");
break;
1828 case 8: setlocale(LC_ALL,
"Korean_Korea.949");
break;
1829 case 9: setlocale(LC_ALL,
"Portuguese_Brazil.1252");
break;
1830 case 10: setlocale(LC_ALL,
"Russian_Russia.1251");
break;
1831 case 11: setlocale(LC_ALL,
"Spanish_Spain.1252");
break;
1832 default: setlocale(LC_ALL,
"English_United States.1252");
break;
1843 std::wstringstream ss(str);
1846 while (std::getline(ss, s, L
' '))
1848 swprintf_s(msg, 99, L
"%s", s.c_str());
1855 for (
unsigned i = 0; i < str.length(); i++)
1857 swprintf_s(msg, 99, L
"%c", str.c_str()[i]);
1892 char steamLanguage[99];
1893 strcpy_s(steamLanguage, 99,
SteamApps()->GetCurrentGameLanguage());
1915 sprintf_s(msg,
sizeof(msg),
"LoadLanguage() language %i (Steam override '%s')",
game->
config.
language, steamLanguage);
1925 case 0: fopen_s(&file,
"Languages\\english.txt",
"rt, ccs=UTF-8");
1927 case 1: fopen_s(&file,
"Languages\\chinese.txt",
"rt, ccs=UNICODE");
FONT_WIDTH = 14;
prosody = 0.2f;
1929 case 2: fopen_s(&file,
"Languages\\dutch.txt",
"rt, ccs=UTF-8");
1931 case 3: fopen_s(&file,
"Languages\\french.txt",
"rt, ccs=UTF-8");
1933 case 4: fopen_s(&file,
"Languages\\german.txt",
"rt, ccs=UTF-8");
1935 case 5: fopen_s(&file,
"Languages\\greek.txt",
"rt, ccs=UTF-8");
1937 case 6: fopen_s(&file,
"Languages\\italian.txt",
"rt, ccs=UTF-8");
1939 case 7: fopen_s(&file,
"Languages\\japanese.txt",
"rt, ccs=UNICODE");
FONT_WIDTH = 14;
prosody = 0.2f;
1941 case 8: fopen_s(&file,
"Languages\\korean.txt",
"rt, ccs=UNICODE");
FONT_WIDTH = 12;
1943 case 9: fopen_s(&file,
"Languages\\portuguese.txt",
"rt, ccs=UTF-8");
1945 case 10: fopen_s(&file,
"Languages\\russian.txt",
"rt, ccs=UTF-8");
1947 case 11: fopen_s(&file,
"Languages\\spanish.txt",
"rt, ccs=UTF-8");
1950 file =
nullptr;
break;
1954 sprintf_s(msg,
sizeof(msg),
"Could not open language file %i!",
game->
config.
language);
1959 fwscanf_s(file, L
"%[^\n]\n", str, 512);
1965 sprintf_s(msg,
sizeof(msg),
"Reached EOF prematurely on language file %i (%i)!",
game->
config.
language, t);
1970 fwscanf_s(file, L
"%[^\n]\n", str, 512);
1973 sprintf_s(msg,
sizeof(msg),
"Reached EOL prematurely on language file %i (%i)!",
game->
config.
language, t);
1977 const auto wcslen1 =
static_cast<short>(wcslen(str));
1978 for (
short q = 1; q < wcslen1; q++)
1980 if (str[q] ==
'/' && (q + 1) < wcslen1 && str[q + 1] ==
'/')
1982 if (q > 0 && str[q - 1] ==
' ')
1987 else if (str[q] ==
'\\' && (q + 1) < wcslen1 && str[q + 1] ==
'n')
1992 else if (str[q] ==
'\\' && (q + 1) < wcslen1 && str[q + 1] ==
't')
2008 sprintf_s(msg,
sizeof(msg),
"Error in language file %i at L_TAB_GLOBAL",
game->
config.
language);
2013 sprintf_s(msg,
sizeof(msg),
"Error in language file %i at L_TAB_UNNAMED",
game->
config.
language);
2029 logger->
Log(
"LoadLanguage() successful!");
2038 const long bubblewidth =
FONT_WIDTH *
static_cast<long>(wcslen(msg)) + 1;
2040 rect.left =
ptCursor.x - bubblewidth;
2054 rect.right = rect.left + bubblewidth;
2055 rect.bottom = rect.top + 12;
2059 tempvec.x =
static_cast<float>(rect.left) - 1;
2060 tempvec.y =
static_cast<float>(rect.top) - 4;
2064 rect2.right = rect2.left + bubblewidth + 3;
2065 rect2.top = 0; rect2.bottom = 16;
2067 tempvec.x =
static_cast<float>(rect.right);
2068 tempvec.y =
static_cast<float>(rect.top) - 4;
2070 rect2.left = 59; rect2.right = 61;
2071 rect2.top = 0; rect2.bottom = 16;
2075 rect.top = rect.top - 2;
2088 static_assert(_countof(toolbarDialogs) ==
D_ENUMERATION + 1);
2104 defaultLayoutPending.fill(
false);
2106 _sopen_s(&menudat,
"Save\\gui.cfg", _O_BINARY | _O_RDONLY, _SH_DENYNO, _S_IWRITE);
2110 logger->
Log(R
"(File not yet created: "Save\gui.cfg")");
2113 QueueDefaultDialogLayout(t);
2119 logger->
Log(R
"(Loading file: "Save\gui.cfg")");
2121 int version, unused;
2122 _read(menudat, &version, 4);
2124 _read(menudat, &unused, 4);
2131 QueueDefaultDialogLayout(
static_cast<short>(t));
2134 _lseek(menudat, (t + 1L) * 512L, SEEK_SET);
2143 _lseek(menudat, 4, SEEK_CUR);
2154 _lseek(menudat, 1, SEEK_CUR);
2156 _lseek(menudat, (t + 1L) * 512L + 256L, SEEK_SET);
2163 _lseek(menudat, (t + 1L) * 512L + 32L, SEEK_SET);
2165 _read(menudat, saved.data(),
static_cast<unsigned>(saved.size()));
2183 _sopen_s(&menudat,
"Save\\gui.cfg", _O_BINARY | _O_CREAT | _O_WRONLY, _SH_DENYNO, _S_IWRITE);
2187 logger->
Log(R
"(Saving file: "Save\gui.cfg")");
2189 int version = 2, unused = 0;
2190 _write(menudat, &version, 4);
2191 _write(menudat, &unused, 4);
2195 _lseek(menudat, (t + 1L) * 512L, SEEK_SET);
2205 _lseek(menudat, (t + 1L) * 512L + 256L, SEEK_SET);
2210 _lseek(menudat, (t + 1L) * 512L + 32L, SEEK_SET);
2212 _write(menudat, saved.data(),
static_cast<unsigned>(saved.size()));
2222 constexpr auto buildType = L
"Debug";
2224 constexpr auto buildType = L
"Release";
2232 defaultLayoutPending.fill(
true);
2233 ApplyDefaultDialogLayout(
true);
2319 vtxs->
tu = 1; vtxs->
tv = 0;
2321 vtxs->
x = 0.0f; vtxs->
y = 0.0f; vtxs->
z = 1.0f; vtxs->
w = 2.0f;
2322 vtxs->
tu = 0; vtxs->
tv = 0;
2325 vtxs->
tu = 1; vtxs->
tv = 1;
2328 vtxs->
tu = 0; vtxs->
tv = 1;
2370#pragma region STATUS_SPLASH
2425 rect.left = 245; rect.top = 219; rect.right = rect.bottom = -1;
2459 if (f_temp >= 100.0f)
2494 outpacket.
type = 30;
2498 sprintf_s(outpacket.msg,
sizeof(outpacket.msg),
"%s,%i,%i,%i,%i,%llu",
game->
config.
patchdate,
major,
minor,
build,
revision, steamId);
2507 outpacket.
type = 29;
2508 sprintf_s(outpacket.msg,
sizeof(outpacket.msg),
"%s,%i,%i,%i,%i",
game->
config.
patchdate,
major,
minor,
build,
revision);
2523 logger->
Log(
"Validating installation...");
2531 rect.left = 10; rect.top = 480; rect.right = rect.bottom = 0;
2544#pragma region STATUS_LOGIN
2547 const float adjfade =
RiseMath::Max(
fade - 0.4f, 0.0f) * 1.6666666666666666666666666666667f;
2574 rect.left =
static_cast<long>(
cloudmotion); rect.top = 512 - 500 / 2; rect.right = 700 +
static_cast<long>(
cloudmotion); rect.bottom = 512 + 500 / 2;
2589 matTemp = matTemp * matTemp2;
2604 logger->
Log(
"m_pddsGUIScroll (Logo.png) was null trying to render the STATUS_LOGIN page (it is loaded on STATUS_SPLASH)",
Logger::Level::Debug);
2616 for (
size_t i = 0; i <
motd.size(); i++)
2618 rect.left = 19; rect.top = 417 + 12 * i; rect.right = rect.bottom = 0;
2685 rect.left = 275; rect.top = 291 + 37; rect.right = 275 + 152; rect.bottom = 291 + 37 + 20;
2692 const float width = 100.0f;
2694 if (percent < 0 || _isnan(percent) || isinf(percent))
2696 sprintf_s(msg,
sizeof msg,
"Found it... musicdone percent was %f", percent);
2701 rect.left = 62; rect.top = 32; rect.right = 62 +
static_cast<long>(width * percent); rect.bottom = 40;
2704 rect.left = 62; rect.top = 40; rect.right = 62 +
static_cast<long>(width * (1.0f - percent)); rect.bottom = 48;
2705 bill =
RiseMath::Vector3(300.0f +
static_cast<long>(width * percent), 315.0f, 0.0f);
2707 rect.left = 299; rect.top = 300; rect.right = 300 +
static_cast<long>(width); rect.bottom = 325;
2722#pragma region STATUS_LOADING
2744 matTemp = matTemp * matTemp2;
2762 rect.left =
static_cast<long>(
cloudmotion); rect.top = 512 - 500 / 2; rect.right = 700 +
static_cast<long>(
cloudmotion); rect.bottom = 512 + 500 / 2;
2807 sprintf_s(msg,
sizeof msg,
"g_pTextSprite %p",
g_pTextSprite);
2820#pragma region STATUS_GAME
2838 source.bottom = 128;
2845 const wchar_t* dialogHelp =
nullptr;
2850 tempcolor = 0xFFFFFFFF;
2852 tempcolor = 0xFFA0A0A0;
2861 rect.top -= 32; rect.bottom -= 32;
2870 rect.top += 32; rect.bottom += 32;
2875 if (
icon[t].mouseover)
2877 if (
icon[t].dialog == -1)
2884 else if (
icon[t].dialog == -2)
2901 for (
size_t j = 0; j <
toasts.size(); j++)
2903 toasts.at(j).time -= fElapsedTime;
2904 if (
toasts.at(j).time <= 0.0f)
2920 rect.top = 0; rect.bottom = 98;
2929 rect.top = 0; rect.bottom = 32;
2930 rect.left = toast.
icon * 32;
2931 rect.right = rect.left + 32;
2935 for (
size_t i = 0; i < toast.
text.size(); i++)
2938 rect.top =
static_cast<LONG
>(
designedHeightC) - 98 * (j + 1) + 8 + toast.
y + i * 12;
2939 rect.right = rect.bottom = 0;
2948 rect.right = rect.bottom = 0;
2950 swprintf_s(verbiage, 99, L
"Toast ID: %i", -toast.
id);
2975 const int index = L_BIND_ENGINE1_CYCLE + static_cast<int>(function) * 2;
2976 return Keychart::Label{strings[index], strings[index + 1]};
3002 for (
size_t i = 0; i <
subtitles.size(); i++)
3010 rect.left =
static_cast<long>((
designedWidthC / 133.33f * 13.33f));
3015 rect2.bottom -= rect.top;
3017 rect2.right -= rect.left;
3035 logger->AddToCallStack(
"HMI::OnRender DONE");
3109 g->
logger->
Log(
"In HMI constructor...");
3116 time_t now = time(
nullptr);
3117 _localtime64_s(&
tm_time, &now);
3173 for (
short t = 0; t <
MAX_TAB; t++)
3192 swprintf_s(temp, 16, L
"[VERBIAGE_%i]", t);
3200 const HRESULT hr = SHGetKnownFolderPath(FOLDERID_ProgramData, KF_FLAG_DEFAULT,
nullptr, &str);
3204 char programDataPath[MAX_PATH];
3205 sprintf_s(programDataPath, MAX_PATH,
"%S", str);
3206 const std::string programDataFolder = programDataPath;
3207 char currentWorkingPath[MAX_PATH];
3208 if (!_getcwd(currentWorkingPath, MAX_PATH))
3211 std::string currentWorkingFolder = currentWorkingPath;
3212 isLocal = currentWorkingFolder.find(
"\\Rise\\CustomUI") == 2;
3213 const bool isSteamDeck =
false;
3214 isSteam = (isSteamDeck || currentWorkingFolder.find(programDataFolder) != 0) && !
isLocal;
3223 logger->
Log(
"Working directory is a Steam Library folder but was not launched from Steam... restarting...",
Logger::Fatal);
3231 logger->
Log(
"The Steam Edition of Rise: The Vieneo Province must be launched from the Steam Client!",
Logger::Fatal);
3239 ABData.cbSize =
sizeof ABData;
3240 autoHideChits = !(SHAppBarMessage(ABM_GETSTATE, &ABData) & ABS_AUTOHIDE);
3278 HMI* gui =
static_cast<HMI*
>(pUserContext);
3281 sprintf_s(msg,
sizeof(msg),
"HMI::OnGUIEvent(%i) @ displaystage=%i", nControlID, gui->game->displaystage);
3282 gui->logger->Log(msg);
3286 switch (gui->game->displaystage)
3294 if (!gui->g_HUD.GetButton(
IDC_LOGIN)->GetEnabled())
3299 if (gui->sound->g_pSoundIntro)
3302 const QWORD bytesLeft = BASS_ChannelGetPosition(gui->sound->g_pSoundIntro, BASS_POS_BYTE);
3303 if (bytesLeft == -1)
3305 sprintf_s(msg,
sizeof(msg),
"BASS_ChannelGetPosition: %i", BASS_ErrorGetCode());
3311 gui->sound->musicleft = 48.074f -
static_cast<float>(BASS_ChannelBytes2Seconds(gui->sound->g_pSoundIntro, bytesLeft));
3313 float secondsLeft =
static_cast<float>(BASS_ChannelBytes2Seconds(gui->sound->g_pSoundIntro, bytesLeft));
3314 if (secondsLeft > 50.054f)
3315 gui->sound->musicleft = 0.0f;
3316 else if (secondsLeft > 33.366f)
3317 gui->sound->musicleft = 50.054f - secondsLeft;
3319 gui->sound->musicleft = 33.366f - secondsLeft;
3322 gui->sound->musicdone = 0.0f;
3325 gui->g_HUD.GetButton(
IDC_LOGIN)->SetVisible(
false);
3326 gui->g_HUD.GetEditBox(
IDC_CALLSIGN)->SetEnabled(
false);
3327 gui->g_HUD.GetEditBox(
IDC_PASSWORD)->SetEnabled(
false);
3332 strcpy_s(outpacket.login.handle,
sizeof(outpacket.login.handle), gui->game->config.defaultuser);
3333 strcpy_s(outpacket.login.password,
sizeof(outpacket.login.password), gui->game->config.defaultpass);
3334 outpacket.login.unused1 = 0;
3335 outpacket.login.unused2 = 0;
3336 outpacket.login.unused3 = 0;
3337 outpacket.login.unused4 = 0;
3338 gui->networking->SendToServer(&outpacket,
sizeof(
SPacketHuge),
true);
3340 sprintf_s(msg,
sizeof(msg),
"Login packet transmitted: %s", gui->game->config.defaultuser);
3341 gui->logger->Log(msg);
3346 gui->loginstr[0] = 0;
3347 gui->ProcessCallsignBox();
3348 gui->UpdateLoginCreateButtons();
3353 gui->loginstr[0] = 0;
3354 gui->ProcessPasswordBox();
3355 gui->UpdateLoginCreateButtons();
3360 gui->game->config.defaultpass[0] = 0;
3362 gui->showerrors = 0;
3363 gui->createRoute =
true;
3364 gui->DisplayImmigration(
false);
3365 gui->game->sound->loopintro =
true;
3370 system(
"start eula.txt");
3371 gui->g_HUD.GetButton(
IDC_EULA)->OnMouseLeave();
3383 const unsigned char oldlang = gui->game->config.language;
3384 gui->game->config.language =
static_cast<unsigned char>(gui->g_HUD.GetComboBox(
IDC_LANGUAGE)->GetSelectedIndex());
3386 if (!gui->eastasian)
3388 if (gui->game->config.language >= 1)
3389 gui->game->config.language++;
3390 if (gui->game->config.language >= 7)
3391 gui->game->config.language += 2;
3394 if (oldlang != gui->game->config.language)
3396 gui->LoadLanguage();
3397 gui->game->config.Save();
3398 gui->networking->RequestVerbiage(0);
3399 gui->DisplayImmigration(
true);
3406 int voice = gui->g_HUD.GetComboBox(
IDC_VOICE)->GetSelectedIndex();
3411 outpacket.
type = 43;
3412 if (gui->g_HUD.GetRadioButton(
IDC_MALE)->GetChecked())
3413 outpacket.
f_x =
static_cast<float>(voice);
3414 else if (gui->g_HUD.GetRadioButton(
IDC_FEMALE)->GetChecked())
3415 outpacket.
f_x =
static_cast<float>(voice) + 100.0f;
3418 outpacket.
f_y = 0.0f;
3419 outpacket.
f_z = 0.0f;
3420 outpacket.
f_w = 0.0f;
3421 gui->networking->SendToServer(&outpacket,
sizeof(
SClientPacket),
true);
3423 gui->changedVoice =
true;
3430 swprintf_s(str, 16, L
"%.15s", gui->g_HUD.GetEditBox(nControlID)->GetText());
3431 gui->g_HUD.GetEditBox(nControlID)->SetText(str);
3439 gui->game->AddTrackedResource(
"pBuffer");
3443 rect.left =
static_cast<LONG
>(49.0f * gui->game->displayscale);
3444 rect.top =
static_cast<LONG
>(271.0f * gui->game->displayscale);
3445 rect.right =
static_cast<LONG
>(177.0f * gui->game->displayscale);
3446 rect.bottom =
static_cast<LONG
>(399.0f * gui->game->displayscale);
3453 gui->game->UpdateTrackedResource(
"pBuffer", 3);
3467 gui->haircolor = gui->GetHairColorAtIndex(gui->g_HUD.GetComboBox(
IDC_HAIRCOLOR)->GetSelectedIndex() + 1);
3470 gui->eyecolor = gui->GetEyeColorAtIndex(gui->g_HUD.GetComboBox(
IDC_EYECOLOR)->GetSelectedIndex() + 1);
3475 swprintf_s(str, 20, L
"%.19s", gui->g_HUD.GetEditBox(
IDC_CHARNAME)->GetText());
3487 swprintf_s(str, 20, L
"%.19s", gui->g_HUD.GetEditBox(
IDC_SIGNATURE)->GetText());
3498 swprintf_s(str, 13, L
"%.12s", gui->g_HUD.GetEditBox(
IDC_HANDLE)->GetText());
3502 gui->g_HUD.GetEditBox(
IDC_HANDLE)->SetText(str);
3507 gui->emailValidation.Edit(gui->g_HUD.GetEditBox(
IDC_EMAILADDRESS)->GetText());
3512 swprintf_s(str, 13, L
"%.12s", gui->g_HUD.GetEditBox(
IDC_REFERRAL)->GetText());
3518 gui->referralValid = 2;
3524 swprintf_s(str, 3, L
"%.2s", gui->g_HUD.GetEditBox(
IDC_AGE)->GetText());
3525 if (str[0] && str[1])
3527 int val = _wtoi(str);
3530 gui->age = (
static_cast<float>(val) - 18.0f) / 62.0f;
3531 gui->g_HUD.GetEditBox(
IDC_AGE)->SetText(str);
3539 swprintf_s(str, 4, L
"%.3s", gui->g_HUD.GetEditBox(nControlID)->GetText());
3540 gui->g_HUD.GetEditBox(nControlID)->SetText(str);
3546 gui->stubbleFreckle =
static_cast<float>(val) * 0.01f;
3558 gui->sound->ChangeVolume(&gui->game->config.soundConfigLegacy, 1.0f);
3561 gui->game->loadstage = 0;
3563 gui->logger->Log(
"Reversed to STATUS_LOGIN");
3564 gui->game->discord->UpdatePresence(
"Login Screen",
"Waiting for credentials...",
"login");
3566 SAFE_RELEASE(gui->game->graphics->m_pddsCloudBaseMapAndNetwork);
3567 gui->game->UpdateTrackedResource(
"m_pddsCloudBaseMapAndNetwork", 3);
3568 SAFE_RELEASE(gui->game->graphics->m_pddsLightningAndBackground[2]);
3569 gui->game->UpdateTrackedResource(
"m_pddsLightningAndBackground[2]", 3);
3571 gui->game->UpdateTrackedResource(
"m_pddsGUILateral", 3);
3573 gui->game->UpdateTrackedResource(
"m_pddsGUIInterlace", 3);
3578 sprintf_s(msg,
sizeof msg,
"Error in GetWindowRect: %d", GetLastError());
3583 const int loginHeight =
static_cast<int>(500.0f * gui->game->displayscale);
3584 const int loginY = (rect.top + rect.bottom - loginHeight) / 2;
3585 if (!MoveWindow(
Rendering::ClientWindow(), rect.left, loginY,
static_cast<int>(700.0f * gui->game->displayscale), loginHeight,
true))
3587 sprintf_s(msg,
sizeof msg,
"Error in MoveWindow: %d", GetLastError());
3593 gui->g_HUD.RemoveAllControls();
3594 gui->makehud =
true;
3596 gui->game->loadstage = 0;
3597 gui->handleValid = 2;
3598 gui->referralValid = 2;
3599 gui->charnameValid = 2;
3600 gui->emailValidation.Reset(L
"");
3608 if (gui->g_HUD.GetRadioButton(
IDC_MALE)->GetChecked())
3609 outpacket.
f_x = 1.0f;
3610 else if (gui->g_HUD.GetRadioButton(
IDC_FEMALE)->GetChecked())
3611 outpacket.
f_x = 2.0f;
3613 outpacket.
f_x = 0.0f;
3614 outpacket.
f_y = 1.0f;
3615 outpacket.
f_z = 0.0f;
3616 outpacket.
f_w = 0.0f;
3617 gui->networking->SendToServer(&outpacket,
sizeof(
SClientPacket),
true);
3620 gui->g_HUD.GetButton(
IDC_SUGGEST)->SetEnabled(
false);
3622 gui->g_HUD.GetSlider(
IDC_SKINCOLOR)->SetValue(rand() % 255 + 1);
3623 gui->g_HUD.GetSlider(
IDC_SKINTONE)->SetValue(rand() % 255 + 1);
3624 const int randomVision = rand() % 3 + 1;
3625 gui->g_HUD.GetRadioButton(
IDC_NORMAL)->SetChecked(randomVision == 1);
3626 gui->g_HUD.GetRadioButton(
IDC_IMPLANTS)->SetChecked(randomVision == 2);
3627 gui->g_HUD.GetRadioButton(
IDC_FRAMES)->SetChecked(randomVision == 3);
3628 gui->g_HUD.GetSlider(
IDC_HEAD)->SetValue(rand() % 5 + 150);
3629 gui->g_HUD.GetSlider(
IDC_FRAMETYPE)->SetVisible(randomVision == 3);
3630 gui->g_HUD.GetSlider(
IDC_JAWLINE)->SetValue(rand() % 5 + 676);
3631 gui->g_HUD.GetSlider(
IDC_NOSE)->SetValue(rand() % 4 + 101);
3632 gui->g_HUD.GetSlider(
IDC_EARS)->SetValue(rand() % 5 + 226);
3633 gui->g_HUD.GetSlider(
IDC_HAIRSTYLE)->SetValue(rand() % 5 + 175);
3634 gui->g_HUD.GetSlider(
IDC_FEATURE)->SetValue(rand() % 3 + 125);
3635 const int randomStubble = rand() % 101;
3636 gui->stubbleFreckle =
static_cast<float>(randomStubble) * 0.01f;
3641 swprintf_s(str, 16, L
"%.0f", gui->age * 62.0f + 18.0f);
3642 gui->g_HUD.GetEditBox(
IDC_AGE)->SetText(str);
3645 gui->game->UpdateTrackedResource(
"pBuffer", 3);
3650 if (gui->emailValidation.PendingSave())
break;
3651 gui->RequestEmailValidation();
3652 gui->showerrors = 1;
3653 gui->DrawErrorBoxes(
false);
3659 if (gui->g_HUD.GetRadioButton(
IDC_MALE)->GetChecked())
3661 else if (gui->g_HUD.GetRadioButton(
IDC_FEMALE)->GetChecked())
3666 gui->game->config.g_bAutoLogin =
true;
3672 sprintf_s(outpacket.subscribe.handle,
sizeof(outpacket.subscribe.handle),
"%.12S", gui->g_HUD.GetEditBox(
IDC_HANDLE)->GetText());
3673 strcpy_s(gui->game->config.defaultuser,
sizeof(gui->game->config.defaultuser), outpacket.subscribe.handle);
3674 sprintf_s(outpacket.subscribe.password,
sizeof(outpacket.subscribe.password),
"%.15S", gui->g_HUD.GetEditBox(
IDC_PASSWORD)->GetText());
3675 strcpy_s(gui->game->config.defaultpass,
sizeof(gui->game->config.defaultpass), outpacket.subscribe.password);
3676 sprintf_s(outpacket.subscribe.referrer,
sizeof(outpacket.subscribe.referrer),
"%.12S", gui->g_HUD.GetEditBox(
IDC_REFERRAL)->GetText());
3677 sprintf_s(outpacket.subscribe.characterName,
sizeof(outpacket.subscribe.characterName),
"%.29S", gui->g_HUD.GetEditBox(
IDC_CHARNAME)->GetText());
3678 if (!gui->GetImmigrationEmail(outpacket.subscribe.email))
break;
3680 outpacket.subscribe.age =
static_cast<unsigned char>(_wtoi(gui->g_HUD.GetEditBox(
IDC_AGE)->GetText()));
3681 outpacket.subscribe.context = 0;
3682 outpacket.subscribe.eargroup =
static_cast<short>(gui->g_HUD.GetSlider(
IDC_EARS)->GetValue());
3683 outpacket.subscribe.eyecolor =
static_cast<unsigned char>(gui->g_HUD.GetComboBox(
IDC_EYECOLOR)->GetSelectedIndex()) + 1;
3684 outpacket.subscribe.facialhair =
static_cast<short>(gui->g_HUD.GetSlider(
IDC_FEATURE)->GetValue());
3685 outpacket.subscribe.framegroup =
static_cast<short>(gui->g_HUD.GetSlider(
IDC_FRAMETYPE)->GetValue());
3686 outpacket.subscribe.haircolor =
static_cast<unsigned char>(gui->g_HUD.GetComboBox(
IDC_HAIRCOLOR)->GetSelectedIndex()) + 1;
3687 outpacket.subscribe.hairgroup =
static_cast<short>(gui->g_HUD.GetSlider(
IDC_HAIRSTYLE)->GetValue());
3688 outpacket.subscribe.headgroup =
static_cast<short>(gui->g_HUD.GetSlider(
IDC_HEAD)->GetValue());
3689 outpacket.subscribe.heightCm =
static_cast<unsigned char>(_wtoi(gui->g_HUD.GetEditBox(
IDC_HEIGHT)->GetText()));
3690 outpacket.subscribe.jawline =
static_cast<short>(gui->g_HUD.GetSlider(
IDC_JAWLINE)->GetValue());
3691 outpacket.subscribe.nosegroup =
static_cast<short>(gui->g_HUD.GetSlider(
IDC_NOSE)->GetValue());
3692 outpacket.subscribe.sex = sex;
3693 outpacket.subscribe.skincolor =
static_cast<unsigned char>(gui->g_HUD.GetSlider(
IDC_SKINCOLOR)->GetValue());
3694 outpacket.subscribe.skintone =
static_cast<unsigned char>(gui->g_HUD.GetSlider(
IDC_SKINTONE)->GetValue());
3695 outpacket.subscribe.stubbleFreckle =
static_cast<unsigned char>(gui->g_HUD.GetSlider(
IDC_STUBBLEFRECKLE)->GetValue());
3696 if (gui->g_HUD.GetRadioButton(
IDC_NORMAL)->GetChecked())
3697 outpacket.subscribe.vision = 1;
3698 else if (gui->g_HUD.GetRadioButton(
IDC_IMPLANTS)->GetChecked())
3699 outpacket.subscribe.vision = 2;
3701 outpacket.subscribe.vision = 3;
3702 outpacket.subscribe.weight =
static_cast<unsigned char>(_wtoi(gui->g_HUD.GetEditBox(
IDC_WEIGHT)->GetText()));
3704 outpacket.subscribe.voice =
static_cast<unsigned char>(gui->g_HUD.GetComboBox(
IDC_VOICE)->GetSelectedIndex());
3706 outpacket.subscribe.voice =
static_cast<unsigned char>(gui->g_HUD.GetComboBox(
IDC_VOICE)->GetSelectedIndex()) + 100;
3709 if (!outpacket.subscribe.handle[0])
3711 gui->logger->Log(
"User got here trying to submit a form with a blank handle!?",
Logger::Level::Error);
3714 if (!outpacket.subscribe.email[0])
3716 gui->logger->Log(
"User got here trying to submit a form with a blank email!?",
Logger::Level::Error);
3721 if (!gui->emailValidation.BeginSave())
break;
3723 gui->g_HUD.GetComboBox(
IDC_LANGUAGE)->SetEnabled(
false);
3724 gui->g_HUD.GetButton(
IDC_CONFIRM)->SetEnabled(
false);
3725 gui->g_HUD.GetButton(
IDC_BACK)->SetEnabled(
false);
3726 gui->g_HUD.GetButton(
IDC_SUGGEST)->SetEnabled(
false);
3729 if (gui->player[gui->ourplayerC].serial)
3730 outpacket.subscribe.addrequest =
false;
3733 outpacket.subscribe.addrequest =
true;
3734 gui->game->config.Save();
3737 gui->networking->SendToServer(&outpacket,
sizeof(
SPacketHuge),
true);
3756 gui->rejoinCountdown.Reset();
3764 gui->game->bus->flapSettingTE = 0;
3767 gui->game->bus->GroundSpoilerPositionScalar = 0.0f;
3768 gui->game->bus->FlightSpoilerPositionScalar = 0.0f;
3777 gui->game->RepairVehicle();
3794 gui->game->viewscreen->counteri = gui->game->viewscreen->counterj = gui->game->viewscreen->counterk = 0.0f;
3813 switch (displaystage)
3899 logger->
Log(
"Loading GUI Textures (Managed)");
3990 if (
player[arrayindex].online)
3993 swprintf_s(str, 199, L
"Player logged off %S",
player[arrayindex].extraText);
4069 sprintf_s(msg,
sizeof(msg),
"Got new owner %i for tab %i channel %i", playerindex, tab,
chatchannel[tab].channel);
4080 constexpr WCHAR codexPrefix[] = L
"[codex]: ";
4081 constexpr size_t codexPrefixLength = _countof(codexPrefix) - 1;
4082 const bool fromCodex = wcsncmp(wmsg, codexPrefix, codexPrefixLength) == 0;
4102 for (
size_t i = 0; i < wcslen(msg); i++)
4110 sprintf_s(callsign, 13,
"%.*S",
static_cast<int>((std::min)(i,
sizeof(callsign) - 1)), msg);
4131 for (
short t = 0; t <
MAX_TAB; t++)
4145 logger->
Log(
"AddChatMessage was disallowed due to DND");
4159 logger->
Log(
"AddChatMessage was non-tokenized");
4166 tokenchatline[0] = msg[0];
4167 tokenchatline[1] = msg[1];
4171 logger->
Log(
"AddChatMessage was tokenized");
4173 if (playerindex == 254)
4175 else if (playerindex == 255)
4184 sprintf_s(charmsg, 999,
"%S", msg);
4206 int sex, serial, rank, context, joined;
4207 const int count = sscanf_s(msg,
"%d,%[^,],%d,%d,%d,%d,%[^\n,],%[^\n]",
4209 player[playerindex].callsign,
static_cast<unsigned>(
sizeof(
player[playerindex].callsign)),
4214 player[playerindex].characterName,
static_cast<unsigned>(
sizeof(
player[playerindex].characterName)),
4215 player[playerindex].extraText,
static_cast<unsigned>(
sizeof player[playerindex].extraText));
4219 player[playerindex].
sex =
static_cast<char>(sex);
4221 player[playerindex].
rank =
static_cast<char>(rank);
4223 player[playerindex].
serial =
static_cast<unsigned short>(serial);
4227 if (!
player[playerindex].online)
4230 swprintf_s(str, 199, L
"Player logged on %S",
player[playerindex].extraText);
4259 int i_temp1, i_temp2, i_temp3, i_temp4, i_temp5, i_temp6;
4260 sscanf_s(msg,
"%[^,],%d,%d,%d,%d,%d,%d",
4261 player[playerindex].allianceName,
static_cast<unsigned>(
sizeof player[playerindex].allianceName), &i_temp1, &i_temp2, &i_temp3, &i_temp4, &i_temp5, &i_temp6);
4263 if (!
player[playerindex].allianceHeadId)
4302 sprintf_s(msg,
sizeof(msg),
"Got new title for channel %i: %s", channelId, title);
4304 for (
short t = 1; t <
MAX_TAB; t++)
4308 sprintf_s(msg,
sizeof(msg),
"Found tab %i for channel %i title change!", t, channelId);
4319void HMI::ChannelInvite(
char* title,
unsigned char whoinvited,
unsigned char channel,
unsigned char players)
const
4322 sprintf_s(msg,
sizeof(msg),
"Got new invite for channel %i player %i: %s", channel, whoinvited, title);
4371 std::wstring editedEmail;
4376 WCHAR savedEmail[32];
4377 swprintf_s(savedEmail, 32, L
"%S", d.
email);
4378 editedEmail = savedEmail;
4382 std::wstring editedWeight;
4411 logger->
Log(
"Leaving DisplayImmigration(): complete profile");
4417 logger->
Log(
"Advancing displaystage: STATUS_CREATE");
4533 for (
int i = 0; i < 24; i++)
4558 for (
int i = 0; i < 6; i++)
4571 const int randomVision = rand() % 3 + 1;
4614 const int randomStubble = rand() % 101;
4656 _localtime64_s(&
tm_time, <ime);
4657 swprintf_s(str, 99, L
"%02i/%02i/%04i",
tm_time.tm_mon + 1,
tm_time.tm_mday,
tm_time.tm_year + 1900 + 225);
4681 sprintf_s(msg,
sizeof msg,
"Error in GetWindowRect: %d", GetLastError());
4689 const int y = (rect.top + rect.bottom - windowHeight) / 2;
4693 sprintf_s(msg,
sizeof msg,
"Error in MoveWindow: %d", GetLastError());
4703 swprintf_s(str, 99, L
"%i", d.
age);
4705 age = (
static_cast<float>(d.
age) - 18.0f) / 62.0f;
4709 swprintf_s(str, 99, L
"%i", d.
heightCm);
4714 swprintf_s(str, 99, L
"%i", d.
weightKg);
4767 logger->
Log(
"DisplayImmigration() exit!");
4792 BOOL substituted = FALSE;
4793 const bool utf8 = GetACP() == CP_UTF8;
4795 const int size = WideCharToMultiByte(CP_ACP, utf8 ? WC_ERR_INVALID_CHARS : WC_NO_BEST_FIT_CHARS, value.c_str(), -1,
4796 email, 32,
nullptr, utf8 ?
nullptr : &substituted);
4797 if (!size || substituted || !email[0])
4816 strcpy_s(packet.msg,
sizeof(packet.msg), email);
4843 L
"Email validation is temporarily unavailable. Please try again.");
4858 DWORD tempcolor = 0;
4862 tempcolor = 0xFFFF9A9C;
4864 tempcolor = 0xFFFDFB43;
4867 if (draw && tempcolor)
4869 rect.left = 194; rect.top = 144; rect.right = 298; rect.bottom = 175;
4876 char playername[30];
4881 tempcolor = 0xFF9B9A9C;
4885 tempcolor = 0xFFFF9A9C;
4887 tempcolor = 0xFFFDFB43;
4891 if (draw && tempcolor)
4893 rect.left = 299; rect.top = 144; rect.right = 672; rect.bottom = 175;
4905 if (emailValid == 1)
4906 tempcolor = 0xFF9B9A9C;
4910 tempcolor = 0xFFFF9A9C;
4912 tempcolor = 0xFFFDFB43;
4916 if (draw && tempcolor)
4918 rect.left = 194; rect.top = 208; rect.right = 542; rect.bottom = 239;
4930 tempcolor = 0xFF9B9A9C;
4934 tempcolor = 0xFFFF9A9C;
4936 tempcolor = 0xFFFDFB43;
4940 if (draw && tempcolor)
4942 rect.left = 194; rect.top = 176; rect.right = 349; rect.bottom = 207;
4954 tempcolor = 0xFFFF9A9C;
4956 tempcolor = 0xFFFDFB43;
4959 if (draw && tempcolor)
4961 rect.left = 350; rect.top = 176; rect.right = 509; rect.bottom = 207;
4970 if (_strcmpi(password, confirm) != 0 || !confirm[0])
4973 tempcolor = 0xFFFF9A9C;
4976 if (draw && tempcolor)
4978 rect.left = 510; rect.top = 176; rect.right = 672; rect.bottom = 207;
4988 tempcolor = 0xFFFF9A9C;
4990 tempcolor = 0xFFFDFB43;
4993 if (draw && tempcolor)
4995 rect.left = 33; rect.top = 255; rect.right = 193; rect.bottom = 415;
5001 char referredby[13];
5006 if (referredby[0] && _strcmpi(callsign, referredby) == 0)
5016 tempcolor = 0xFF9B9A9C;
5020 tempcolor = 0xFFFF9A9C;
5022 tempcolor = 0xFFFDFB43;
5026 if (draw && tempcolor)
5028 rect.left = 194; rect.top = 433; rect.right = 349; rect.bottom = 464;
5042 if (_wtoi(wcdefault) < 18 || _wtoi(wcdefault) > 80)
5045 tempcolor = 0xFFFF9A9C;
5047 tempcolor = 0xFFFDFB43;
5050 if (draw && tempcolor)
5052 rect.left = 543; rect.top = 208; rect.right = 606; rect.bottom = 239;
5063 if (!
minWeight || !weightRange.Contains(_wtoi(wcdefault)))
5066 tempcolor = 0xFFFF9A9C;
5068 tempcolor = 0xFFFDFB43;
5071 if (draw && tempcolor)
5073 rect.left = 607; rect.top = 208; rect.right = 672; rect.bottom = 239;
5084 tempcolor = 0xFFFF9A9C;
5086 tempcolor = 0xFFFDFB43;
5089 if (draw && tempcolor)
5091 rect.left = 194; rect.top = 240; rect.right = 257; rect.bottom = 271;
5103 tempcolor = 0xFFFF9A9C;
5105 tempcolor = 0xFFFDFB43;
5108 if (draw && tempcolor)
5110 rect.left = 194; rect.top = 176 + 128; rect.right = 349 + 83; rect.bottom = 207 + 128;
5116 WCHAR wcdefault3[99], wcdefault4[99];
5120 if (wcscmp(wcdefault3, wcdefault4) != 0 || !wcdefault3[0] || !wcdefault4[0])
5123 tempcolor = 0xFFFF9A9C;
5125 tempcolor = 0xFFFDFB43;
5128 if (draw && tempcolor)
5130 rect.left = 33; rect.top = 656; rect.right = 672; rect.bottom = 689;
5146 if (voiceIndex == 0)
5149 tempcolor = 0xFFFF9A9C;
5151 tempcolor = 0xFFFDFB43;
5155 if (draw && tempcolor)
5157 rect.left = 33; rect.top = 176; rect.right = 193; rect.bottom = 207;
5173 _sopen_s(&skinColorFile,
"Textures\\People\\skincolors.bmp", _O_RDONLY | O_BINARY, _SH_DENYWR, _S_IWRITE);
5174 if (skinColorFile == -1)
5176 unsigned char uch_tempR, uch_tempG, uch_tempB;
5177 unsigned long bpr = 256L * 3L;
5178 unsigned long k = 54L + melanin * 3L + (256L - hemoglobin - 1L) * bpr;
5179 _lseek(skinColorFile, k, SEEK_SET);
5180 _read(skinColorFile, &uch_tempB, 1);
5181 _read(skinColorFile, &uch_tempG, 1);
5182 _read(skinColorFile, &uch_tempR, 1);
5183 _close(skinColorFile);
5187 swprintf_s(str, 99, L
"%.2f", hemoglobin / 255.0f * 0.32f);
5188 rect.left = 211; rect.top = 285;
5191 rect.left = 211; rect.top = 349;
5194 rect.left = 211; rect.top = 381;
5197 rect.left = 211; rect.top = 413;
5200 swprintf_s(str, 99, L
"%.2f", melanin / 255.0f * 0.5f);
5201 rect.left = 449; rect.top = 285;
5206 swprintf_s(str, 99, L
"%03i", 450);
5207 rect.left = 449; rect.top = 317;
5210 rect.left = 449; rect.top = 349;
5213 rect.left = 449; rect.top = 381;
5216 rect.left = 449; rect.top = 413;
5219 rect.left = 449; rect.top = 445;
5230 index = rand() % 24 + 1;
5235 case 1: tempcolor = 0xFF090806;
break;
5236 case 2: tempcolor = 0xFF2C222B;
break;
5237 case 3: tempcolor = 0xFF3B3024;
break;
5238 case 4: tempcolor = 0xFF4E433F;
break;
5239 case 5: tempcolor = 0xFF504444;
break;
5240 case 6: tempcolor = 0xFF6A4E42;
break;
5241 case 7: tempcolor = 0xFF554838;
break;
5242 case 8: tempcolor = 0xFFA7856A;
break;
5243 case 9: tempcolor = 0xFFB89778;
break;
5244 case 10: tempcolor = 0xFFDCD0BA;
break;
5245 case 11: tempcolor = 0xFFDEBC99;
break;
5246 case 12: tempcolor = 0xFF977961;
break;
5247 case 13: tempcolor = 0xFFE6CEA8;
break;
5248 case 14: tempcolor = 0xFFE5C8A8;
break;
5249 case 15: tempcolor = 0xFFA56B46;
break;
5250 case 16: tempcolor = 0xFF91553D;
break;
5251 case 17: tempcolor = 0xFF533D32;
break;
5252 case 18: tempcolor = 0xFF71635A;
break;
5253 case 19: tempcolor = 0xFFB7A69E;
break;
5254 case 20: tempcolor = 0xFFD6C4C2;
break;
5255 case 21: tempcolor = 0xFFFFF5E1;
break;
5256 case 22: tempcolor = 0xFFCABFB1;
break;
5257 case 23: tempcolor = 0xFF8D4A43;
break;
5258 case 24: tempcolor = 0xFFB55239;
break;
5269 index = rand() % 6 + 1;
5275 case 1: tempcolor = 0xFFB98A32;
break;
5276 case 2: tempcolor = 0xFF9E6C37;
break;
5277 case 3: tempcolor = 0xFFD0B42C;
break;
5278 case 4: tempcolor = 0xFF5C932D;
break;
5279 case 5: tempcolor = 0xFF4C5596;
break;
5280 case 6: tempcolor = 0xFF908293;
break;
5291 fade += fElapsedTime / 6.0f;
5334 else if ((rand() % 500) == 0)
5383 else if (rand() % 5 == 0)
@ ReloadAddedMunitionsContainer
@ BattleRoyaleYouAreWinner
@ DisturbanceInTheCargoBay
@ BonusesPlayerContributed
@ AbilitiesAssessmentIntelligence
@ BattleRoyalePlayerEliminated
@ ColonyInventoryInstalled
@ RentalPickupLocationApron
@ VehicleRemovedFromGarage
@ BattleRoyaleWinnerDeclared
@ VehicleRegistrationCompleted
@ VehicleTitleTransferred
@ DisturbanceInTheCrewCabin
@ PlotRegistrationSuccess
@ CasinoSlotMachineWinner
@ VehicleSerialTowCleared
@ PlotRegistrationTransferred
@ BankWireTransferSuccess
@ RentalReturnedContainer
@ RentalPickupGroundVehicle
#define V_RETURN(expression)
#define SAFE_RELEASE(value)
#define SAFE_DELETE(value)
HRESULT(WINAPI *CUniBuffer::_ScriptApplyDigitSubstitution)(const SCRIPT_DIGITSUBSTITUTE *
SCRIPT_CONTROL SCRIPT_STATE const void SCRIPT_CONTROL SCRIPT_STATE const int SCRIPT_TABDEF const BYTE SCRIPT_STRING_ANALYSIS BOOL
SCRIPT_CONTROL SCRIPT_STATE const void DWORD
#define EVENT_COMBOBOX_SELECTION_CHANGED
float Lerp(float val1, float val2, float lerp)
constexpr auto Clamp(T1 val, T2 min, T3 max)
#define MAX_ONLINEPLAYERS
const RiseMath::Vector3 centerC
float RollAttitudeRadians
float PitchAttitudeRadians
float IndicatedAirspeedKms
std::vector< Command > commandStream
void RemovePlayer(short tempplayer)
std::vector< std::string > chatlineplayer
std::vector< std::wstring > chatline
void AddPlayer(unsigned char tempplayer)
uint64 ConvertToUint64() const
CommunicationsDialog(short id)
SoundConfig soundConfigLegacy
std::vector< KeyBinding > keyBindings
InputConfig inputConfigLookLateral
InputConfig inputConfigLookVertical
InputConfig inputConfigWalkVertical
bool g_bCheckSteamLanguage
ConfigurationDialog(short id)
static void Initialize(HMI *gui)
static void DrawAllActiveDialogs(float fElapsedTime)
RiseMath::Vector3 windowseeklocation
static short draworder[D_ENUMERATION]
static void CheckDialogMouse()
static DialogBase * dialogs[D_ENUMERATION]
static void OnDeviceReset()
static void UpdateScrollBar(short t)
virtual const wchar_t * Title() const
static void IconClick(short icon_id)
static short CheckHeight(short t)
RiseMath::Vector3 windowdefaultlocation
RiseMath::Vector3 windowlocation
static void UpdateAllActiveDialogs(float fElapsedTime)
static short CheckWidth(short dialogid)
static void InitializeDialog(short t)
virtual void UpdateMenu(short tab)
void UpdatePresence(const char *prmDetails, const char *prmState, const char *prmLargeImageKey)
DockedCommunicationDialog(short id)
ExternalCameraDialog(short id)
HRESULT OnCreateDevice(Rendering::RenderDevice *device)
void Draw(Rendering::RenderSprite *sprite, const ExternalCamera::Readout &data, float left, float top, float scale)
void LoadTexture(Rendering::RenderTexture **resource, const std::string &pointerName, const WCHAR *file, Rendering::ImageFormat format=Rendering::ImageFormat::BGRA8)
std::unique_ptr< Bus > bus
void GetProgramVersion(int &major, int &minor, int &build, int &revision) const
std::unique_ptr< HMI > GUI
std::unique_ptr< Sound > sound
void AddTrackedResource(const char *name, Rendering::ResourcePool pool=Rendering::ResourcePool::Managed)
void UpdateTrackedResource(const char *name, int status)
std::unique_ptr< DiscordIntegration > discord
std::unique_ptr< Viewscreen > viewscreen
std::unique_ptr< Graphics > graphics
std::unique_ptr< Logger > logger
Rendering::RenderTexture * m_pddsCloudBaseMapAndNetwork
Rendering::RenderMaterial * g_pEffect
Rendering::RenderTexture * m_pddsAvatar[humantextureC]
Rendering::RenderTexture * m_pddsLightningAndBackground[3]
WaypointDialog * waypointDialog
Rendering::RenderFont * g_pSubtitleFont
void AddLanguageOptions(UIControlIds controlId, RiseDialog *HUD) const
bool GetImmigrationEmail(char(&email)[32])
std::vector< Toast > toasts
HRESULT OnCreateDevice(Rendering::RenderDevice *pd3dDevice)
void ChangePlayerProperties(SSubscribeData *prop)
RejoinCountdown rejoinCountdown
SPlayerData player[MAX_ONLINEPLAYERS]
LIGHTNINGABOVEGUI lightningabove[ACLlightningguiC]
Rendering::RenderTexture * m_pddsGUIRanks
Rendering::RenderFont * g_pChatFont
void TriggerWelcomeApt2() const
Rendering::RenderTexture * m_pddsGUIInterlace
void AddDiscordChatMessage(const WCHAR *msg)
void ChannelInvite(char *title, unsigned char whoinvited, unsigned char channel, unsigned char players) const
s_polygon_object tempobject
Rendering::RenderTexture * m_pddsGUIActions
float g_fMouseLastMoveTime
bool MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
void LightningCalculations(float fElapsedTime)
ExternalCameraOverlay externalCameraOverlay
void AddSubtitles(std::wstring const &msg) const
void LoadPeopleSounds() const
std::wstring strings[L_ENUMERATION]
Rendering::RenderTexture * m_pddsEasydockAd
void OnFrameMove(float fElapsedTime)
RiseMath::Color GetEyeColorAtIndex(int index)
void GetVersionText(WCHAR *, int size) const
InformationDialog * informationDialog
void PlayerJoinedChannel(short tab, unsigned char playerindex)
void RenderExternalCameraOverlay(const RiseMath::Vector3 &position)
Rendering::RenderTexture * m_pddsGUIInterlace2
Rendering::RenderTexture * m_pddsGUIScrollButton
const char * adUnmeasuredUi
void SaveConfiguration() const
void ReceiveEmailValidation(float token, bool passed, float reason)
void LoadConfiguration() const
std::vector< std::wstring > pendingSubtitles
static void CALLBACK OnGUIEvent(UINT nEvent, int nControlID, RiseControl *pControl, void *pUserContext)
void SexChangeOperation(char newsex, bool randomizeHeightWeight)
void DisplaySnow(Rendering::RenderDevice *pd3dDevice, float fade, float fElapsed)
Rendering::RenderTexture * m_pddsToastIcons
HMI(GameClass *g, Networking *n, Sound *s)
void FadeIn(float f, float fElapsedTime)
void DrawErrorBoxes(bool draw=true)
void SetPlayerAlignment(char *msg, unsigned char playerindex)
void ProcessPasswordBox()
void AddSupportChatMessage(const WCHAR *wmsg)
void RequestEmailValidation()
ImmigrationEmail::State emailValidation
Rendering::RenderTexture * m_pddsGUILateral
RiseMath::Color GetHairColorAtIndex(int index)
Rendering::RenderTexture * m_pddsGUIScroll
RiseMath::Color haircolor
void DrawRXTXLights(Rendering::RenderTexture **tex) const
void AddPlayer(char *msg, unsigned char playerindex)
void ChangeChannelOwner(short tab, unsigned char playerindex)
KeyboardChart keyboardChart
void UpdateLoginCreateButtons()
void PlayerLeftChannel(short tab, unsigned char playerindex)
void ChangeChannelName(unsigned char channelId, char *title)
Rendering::ImageBuffer * pBuffer
static void RestoreDefaults()
LoadingEyeReveal eyeReveal
void OnRender(float fElapsedTime, Rendering::RenderDevice *pd3dDevice)
Rendering::RenderFont * g_pFont
void GarbleChat(wchar_t *str) const
void ProcessCallsignBox()
void PlayerOffline(unsigned char arrayindex)
void DisplayImmigration(bool refresh)
std::vector< std::wstring > subtitles
Rendering::RenderTexture * m_pddsBindings
RiseDialogResourceManager g_DialogResourceManager
std::vector< std::wstring > motd
void AddChatMessage(WCHAR *msg, unsigned char playerindex, unsigned char channel)
CHATCHANNEL chatchannel[MAX_TAB]
Rendering::RenderTexture * m_pddsGUIParts
void AddVoiceOptions(UIControlIds controlId, RiseDialog *HUD) const
void LoadTextures(GameState displaystage, short loadstage)
void ShowHelpBubble(const WCHAR *msg) const
Sicons icon[D_ENUMERATION+1]
void AddSubtitle(const WCHAR *msg) const
Rendering::RenderTexture * m_pddsToast
Rendering::RenderSprite * g_pTextSprite
void AddToast(const WCHAR *message, ActiveHelp activeHelp)
virtual CSteamID GetSteamID()=0
bool CanEdit(bool annual) const
bool Expire(std::uint64_t now)
const std::wstring & Value() const
void Reset(const std::wstring &saved)
void Edit(const std::wstring &text)
int BeginCheck(std::uint64_t now)
Reply Receive(float token, bool passed, bool unavailable)
void Draw(Rendering::RenderSprite *sprite, const Keychart::Labels &labels, const std::wstring &title, int displayWidth, int displayHeight)
void Update(bool visible, float elapsedSeconds)
HRESULT OnCreateDevice(Rendering::RenderDevice *device)
float Progress(double now)
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
SPlayerData LoadPerson(long temprecord) const
void SavePerson(long temprecord, SPlayerData tempperson) const
long ResidesLocally(unsigned short serial) const
PeopleManagerDialog(short id)
void LoadDIX(const char *prmFilename)
s_polygon_object LoadDAW(const char *filename) const
void Update(bool realDeath, double now)
HRESULT Lock(UINT offset, UINT bytes, void **output, DWORD flags)
HRESULT DrawPrimitive(Primitive type, UINT first, UINT count)
HRESULT SetStreamSource(UINT stream, RenderBuffer *buffer, UINT offset, UINT stride)
HRESULT SetRenderState(DWORD state, DWORD value)
HRESULT SetFVF(DWORD value)
HRESULT CreateVertexBuffer(UINT bytes, DWORD usage, DWORD format, ResourcePool pool, RenderBuffer **result, void *shared)
HRESULT GetBackBuffer(UINT chain, UINT buffer, UINT type, RenderSurface **result)
HRESULT SetSamplerState(DWORD sampler, DWORD state, DWORD value)
INT DrawTextW(RenderSprite *sprite, const wchar_t *text, INT count, RECT *rectangle, DWORD flags, PackedColor color)
HRESULT SetVector(const char *name, const RiseMath::Vector4 *value)
HRESULT Begin(UINT *count, DWORD flags)
HRESULT BeginPass(UINT pass)
HRESULT Begin(DWORD flags)
HRESULT SetTransform(const RiseMath::Matrix *value)
HRESULT Draw(RenderTexture *image, const RECT *rectangle, const RiseMath::Vector3 *center, const RiseMath::Vector3 *position, PackedColor color)
virtual void SetTextColor(Rendering::PackedColor Color, Rendering::PackedColor DisabledColor=Rendering::ColorARGB(200, 128, 128, 128))
HRESULT SetSelectedByIndex(UINT index)
void SetScrollBarWidth(int nWidth)
HRESULT AddItem(const WCHAR *strText, void *pData)
void SetDropHeight(UINT nHeight, UINT fHeight)
int GetSelectedIndex() const
RiseElement * GetElement(UINT iElement)
virtual bool GetEnabled()
virtual void SetVisible(bool bVisible)
virtual void SetEnabled(bool bEnabled)
virtual void SetTextColor(Rendering::PackedColor Color)
RiseEditBox * GetEditBox(int ID)
void Init(RiseDialogResourceManager *pManager, bool bRegisterDialog=true)
HRESULT AddComboBox(int ID, int x, int y, int width, int height, UINT nHotKey=0, bool bIsDefault=false, RiseComboBox **ppCreated=NULL)
RiseComboBox * GetComboBox(int ID)
void EnableKeyboardInput(bool bEnable)
RiseRadioButton * GetRadioButton(int ID)
RiseControl * GetControl(int ID)
HRESULT AddStatic(int ID, LPCWSTR strText, int x, int y, int width, int height, bool bIsDefault=false, RiseStatic **ppCreated=NULL, bool bShadow=true)
RiseStatic * GetStatic(int ID)
HRESULT OnRender(float fElapsedTime)
HRESULT AddEditBox(int ID, LPCWSTR strText, int x, int y, int width, int height, bool bIsDefault=false, bool bIsPassword=false, RiseEditBox **ppCreated=NULL)
void RequestFocus(RiseControl *pControl)
HRESULT AddRadioButton(int ID, UINT nButtonGroup, LPCWSTR strText, int x, int y, int width, int height, bool bChecked=false, UINT nHotkey=0, bool bIsDefault=false, RiseRadioButton **ppCreated=NULL)
void SetScale(float scale)
RiseButton * GetButton(int ID)
RiseSlider * GetSlider(int ID)
HRESULT SetFont(UINT index, LPCWSTR strFaceName, LONG height, LONG weight)
void SetCallback(UICallback pCallback, void *pUserContext=NULL)
HRESULT AddButton(int ID, LPCWSTR strText, int x, int y, int width, int height, UINT nHotkey=0, bool bIsDefault=false, RiseButton **ppCreated=NULL)
HRESULT AddSlider(int ID, int x, int y, int width, int height, int min=0, int max=100, int value=50, bool bIsDefault=false, RiseSlider **ppCreated=NULL)
HRESULT OnCreateDevice(Rendering::RenderDevice *pd3dDevice)
void SetText(LPCWSTR wszText, bool bSelected=false)
virtual void SetTextColor(Rendering::PackedColor Color)
HRESULT GetTextCopy(__out_ecount(bufferCount) LPWSTR strDest, UINT bufferCount)
void SetFont(UINT prmFont, Rendering::PackedColor defaultFontColor=Rendering::ColorARGB(255, 255, 255, 255), DWORD prmTextFormat=DT_CENTER|DT_VCENTER)
void SetValue(int nValue)
void SetRange(int nMin, int nMax)
HRESULT SetText(LPCWSTR strText)
void PlayCabinAnnouncement(SOUNDS sound_enum)
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 LoadCockpitSound(SOUNDS soundEnum, const char *path, bool force, SoundConfig *device=nullptr)
std::vector< std::wstring > text
std::unique_ptr< grid > ptrGrid
RiseMath::Matrix matrixProj
WaypointProtocol::FolderOrder folderOrder
void InvalidateWaypoints()
std::array< unsigned char, 4+MAX_TAB > SavedState
bool Load(const SavedState &saved)
Sscan Get(USHORT vehicleId) const
s_network_objects playerships[MAX_SCAN]
#define RISE_FVF_INSTRUMENT
@ L_CONFIG_PROFILEAIRSPACE
@ L_IMMIGRATION_SKINCOLOR
@ L_IMMIGRATION_EYECOLOR1
@ L_IMMIGRATION_STATEMENTTEXT
@ L_IMMIGRATION_FEATUREFRECKLE
@ L_IMMIGRATION_HAIRSTYLE
@ L_IMMIGRATION_DEPARTMENT
@ L_IMMIGRATION_DISCLAIMER
@ L_IMMIGRATION_FEATURESTUBBLE
@ L_CONFIG_PROFILEINTERIOR
@ L_IMMIGRATION_FEATUREUNUSED
@ L_IMMIGRATION_STATEMENT
@ L_BUTTON_RESTOREDEFAULTS
@ L_SPLASH_VALIDATINGINSTALL
@ L_IMMIGRATION_FEATUREBEARD
@ L_IMMIGRATION_HAIRCOLOR
@ L_IMMIGRATION_HAIRCOLOR1
@ L_SPLASH_CHECKINGFORUPDATES
#define subtitleCharLimitC
Layout Defaults(float width, float height, Layout panels, float minimumChatWidth)
std::array< Panel, Count > Layout
float HorizontalFov(float projectionX, float zoom)
WeightRange GetWeightRange(int minimum, int maximum, int savedKg, bool revisit)
Labels BuildLabels(const std::vector< KeyBinding > &bindings, char profile, bool admin, Translate translate)
void Garble(wchar_t *text, float blackout, Random random)
constexpr uint32_t SRCCOLOR
constexpr uint32_t INVSRCCOLOR
constexpr uint32_t WRITEONLY
constexpr uint32_t DISCARD
constexpr uint32_t SRCBLEND
constexpr uint32_t CULLMODE
constexpr uint32_t ALPHABLENDENABLE
constexpr uint32_t DESTBLEND
constexpr uint32_t ADDRESSU
constexpr uint32_t ADDRESSV
constexpr DWORD AlphaBlend
HRESULT SaveSurfaceToMemory(ImageBuffer **result, ImageFile format, RenderSurface *surface, const void *, const RECT *crop)
HRESULT CreateFontW(RenderDevice *owner, INT height, UINT width, UINT weight, UINT mipLevels, BOOL italic, DWORD charset, DWORD precision, DWORD quality, DWORD pitch, const wchar_t *face, RenderFont **result)
HRESULT CreateSprite(RenderDevice *owner, RenderSprite **result)
double ClientAbsoluteTime()
RenderDevice * ClientRenderer()
constexpr PackedColor ColorARGB(unsigned a, unsigned r, unsigned g, unsigned b)
constexpr auto Min(A first, B second)
Quaternion * QuaternionMultiply(Quaternion *out, const Quaternion *a, const Quaternion *b)
Quaternion * QuaternionRotationYawPitchRoll(Quaternion *out, float yaw, float pitch, float roll)
Matrix * MatrixScaling(Matrix *out, float x, float y, float z)
Matrix * MatrixRotationZ(Matrix *out, float value)
constexpr auto Max(A first, B second)
Matrix * MatrixTranslation(Matrix *out, float x, float y, float z)
S_API bool S_CALLTYPE SteamAPI_RestartAppIfNecessary(uint32 unOwnAppID)
S_API void S_CALLTYPE SteamAPI_Shutdown()
S_API void S_CALLTYPE SteamAPI_RunCallbacks()
unsigned long long uint64
float pitchAttitudeRadians
float rollAttitudeRadians
float indicatedAirspeedKms
unsigned short allianceHeadId
RiseMath::Vector3 iconlocation
void Init(Rendering::PackedColor defaultColor, Rendering::PackedColor disabledColor=Rendering::ColorARGB(200, 128, 128, 128), Rendering::PackedColor hiddenColor=0)
Rendering::RenderBuffer * VB