7 #include "../Networking.h" 8 #include "../GameClass.h" 9 #include "../Viewscreen/Viewscreen.h" 25 windowdefaultlocation = D3DXVECTOR3(static_cast<float>(rand() % 200), static_cast<float>(rand() % 200), 0);
29 for (
short s = 0; s < MAX_TAB; s++)
71 for (
short s = 0; s < MAX_TAB; s++)
166 if (D3DXVec3Length(&diff) < 1.0f)
180 float speed = 4.0f * fElapsedTime;
195 const short t = icon_id;
280 const auto topMargin =
static_cast<int>(max(0.0f, (32.0f - 32.0f *
gui->
game->
displayscale)) * 0.5f);
300 #pragma region Actual windows (dialogs) 338 SetCursor(LoadCursor(
nullptr, IDC_ARROW));
447 oldlinecursel != -1 &&
490 SetCursor(LoadCursor(
nullptr, IDC_ARROW));
548 const float scrollheight =
static_cast<float>(
dialogs[t]->
height) - 32;
687 sprintf_s(msg, 999,
"Dialog %i was ptClick.y %i ptCursor.y %i scrollbartop %i linetop %i",
698 const float scrollheight =
static_cast<float>(
dialogs[t]->
height) - 32;
712 sprintf_s(msg, 999,
"Dialog %i now ptClick.y %i ptCursor.y %i scrollbartop %i linetop %i",
755 D3DXVECTOR3 floorlocation;
760 D3DXVECTOR3 tracked = floorlocation;
763 DWORD temptextcolor, tempcolor;
767 long fonty =
static_cast<long>(tracked.y) + 2;
777 temptextcolor = 0xFF000000;
783 temptextcolor = 0xFF778589;
785 tempcolor = 0xFFC0E8FF;
792 temptextcolor = 0xFFC0C0C0;
793 tempcolor = 0xFFBCE6FF;
798 rect.left =
static_cast<long>(tracked.x) + 2;
800 rect.right = rect.bottom = -1;
802 dialogs[t]->
tabx[q] =
static_cast<short>(tracked.x);
805 tracked.x = floorlocation.x;
840 rect.top =
static_cast<long>(tracked.y) + 2;
841 rect.left =
static_cast<long>(tracked.x) + 5;
842 rect.right = rect.bottom = -1;
849 tracked.x = floorlocation.x;
855 rect.left = rect.top = 0;
870 temprect.top = 16; temprect.left = 63; temprect.right = temprect.left +
dialogs[t]->
width - 16; temprect.bottom = 32;
882 rect.top =
static_cast<long>(tracked.y) + 2 + 16 * pn;
883 rect.left =
static_cast<long>(tracked.x) + 5;
884 rect.right = rect.bottom = -1;
908 rect.top =
static_cast<long>(tracked.y) + 16 * pn;
909 rect.left =
static_cast<long>(tracked.x) + 5;
911 rect.bottom =
static_cast<long>(floorlocation.y) + 16 + 8 +
dialogs[t]->
height;
928 textrect.top =
static_cast<long>(tracked.y) + 16 * pn;
929 textrect.left =
static_cast<long>(tracked.x) + 5 + 16 + 5;
931 textrect.bottom =
static_cast<long>(floorlocation.y) + 16 + 8 +
dialogs[t]->
height;
935 tempvec.x = tracked.x + 5;
936 tempvec.y = tracked.y + 1 + 16 * pn;
940 Swaypoint tempwaypoint;
941 WCHAR waypointName[80];
942 setlocale(LC_ALL,
"English");
943 swscanf_s(
dialogs[t]->
fieldline[pn][q], L
"TC_WAYPOINT,%i,%f,%f,%f,%[^\n]", &tempwaypoint.uniqueid, &tempwaypoint.location.x, &tempwaypoint.location.y, &tempwaypoint.location.z, &waypointName,
sizeof waypointName);
945 wcscpy_s(str, 99, waypointName);
947 rect.left = 225; rect.right = 239;
948 rect.top = 97; rect.bottom = 111;
951 rect.top += 16; rect.bottom += 16;
982 rect.right = rect.left + 16;
983 D3DXVECTOR3 tempvec = D3DXVECTOR3(tracked.x + 7, tracked.y + 16 * pn, tracked.z);
999 rect.bottom = rect.top + 16;
1006 rect.right = rect.left + 32;
1007 D3DXVECTOR3 tempvec = D3DXVECTOR3(tracked.x + 7, tracked.y + 16 * pn, tracked.z);
1081 tracked.x = floorlocation.x;
1140 short mouseover = -1;
1142 for (
short r = 0; r < (farthestrightvisibleaction + 2); r++)
1144 long leftadjust = 0, rightadjust = 0;
1145 if (tracked.x < (floorlocation.x + 18))
1147 leftadjust = (
static_cast<long>(floorlocation.x) + 18) -
static_cast<long>(tracked.x);
1148 tracked.x += leftadjust;
1150 if ((tracked.x + 16) > (
static_cast<long>(floorlocation.x) +
dialogs[t]->
width - 34))
1151 rightadjust = (static_cast<long>(tracked.x) + 16) - (static_cast<long>(floorlocation.x) +
dialogs[t]->
width - 34);
1186 temprect.left = 64; temprect.right = 96;
1187 temprect.top = 96; temprect.bottom = 128;
1191 tracked.x += 32 - leftadjust;
1194 tracked.x = floorlocation.x;
1214 rect.left =
static_cast<long>(tracked.x) + 3;
1215 rect.top =
static_cast<long>(tracked.y) + 3;
1217 rect.bottom = rect.top + 16;
1231 rect.top += 32; rect.bottom += 32;
1237 tracked.x = floorlocation.x;
1252 rect.top =
static_cast<long>(tracked.y) + 2;
1253 rect.left =
static_cast<long>(tracked.x) + 3;
1254 rect.bottom = rect.right = -1;
1327 short cursoradj = 0;
1350 short extraspacereq = 0;
1405 spaceavailable -= 5;
1432 if (effectivechars < 4)
1475 if (cdxut_edit_box !=
nullptr)
1500 const float scrollheight =
static_cast<float>(
dialogs[t]->
height) - 32;
1538 if (q == t)
continue;
1625 SetCursor(LoadCursor(
nullptr, IDC_CROSS));
1630 SetCursor(LoadCursor(
nullptr, IDC_NO));
1700 short cursoradj = 0;
1744 bool sortwindows =
true;
1747 sortwindows =
false;
1754 const short tempdraworder =
draworder[t];
static void CheckMoved(short t)
LPDIRECT3DTEXTURE9 m_pddsGUIInterlace
long ResidesLocally(unsigned short serial) const
Sicons icon[(D_ENUMERATION+1)]
static void InitializeDialog(short t)
static void ClickEditableField(short t, int field)
virtual void ActionIconClick(long icon_id)
virtual void UpdateMenu(short tab)
static bool DraggingItem(short t, short s)
static void SortDialogs()
LPDIRECT3DTEXTURE9 m_pddsGUIRanks
WCHAR tabeffectivestr[MAX_TAB][MAX_TAB_CHARS]
LPDIRECT3DTEXTURE9 m_pddsGUIActions
D3DXVECTOR3 windowlocation
LPDIRECT3DTEXTURE9 m_pddsGUIInterlace2
virtual void OnCreateDevice()
InformationDialog * informationDialog
short fieldeffectivewidth[MAX_FIELDS]
bool actionenabled[MAX_ACTION]
static void Initialize(HMI *gui)
short fieldcontent[MAX_FIELDS]
virtual void Close(bool minimize)
static void BringToFront(short t)
WCHAR fieldline[MAX_LINES][MAX_FIELDS][HELP_SIZE]
WCHAR fieldeffectiveline[MAX_LINES][MAX_FIELDS][HELP_SIZE]
static void CheckDialogMouse()
static DialogBase * dialogs[D_ENUMERATION]
short fieldwidth[MAX_FIELDS]
LPDIRECT3DTEXTURE9 m_pddsGUIParts
bool actiontoggle[MAX_ACTION]
unsigned char seqplayer[MAX_ONLINEPLAYERS]
void RequestClose() const
static void OnDeviceReset()
WCHAR msgbartext[HELP_SIZE]
static short CheckHeight(short t)
short tabusedefaultlang[MAX_TAB]
SPlayerData player[MAX_ONLINEPLAYERS]
LPDIRECT3DTEXTURE9 m_pddsGUILateral
WCHAR fieldeffectivetitle[MAX_FIELDS][HELP_SIZE]
static void IconClick(short icon_id)
char EarliestFolder(unsigned short serial) const
static short CheckWidth(short dialogid)
WCHAR tabstr[MAX_TAB][MAX_TAB_CHARS]
bool fieldsortable[MAX_FIELDS]
virtual void TabClick(short clicked_tab)
virtual void DragDropItem(short s)
unsigned short clipboardrecord
CHATCHANNEL chatchannel[MAX_TAB]
void Log(const char *msg, Level level=Info, int errorCode=0)
float Play(int soundEnum)
ID3DXSprite * g_pTextSprite
static void UpdateScrollBar(short t)
LPDIRECT3DTEXTURE9 m_pddsGUIScrollButton
std::vector< Swaypoint > waypoint
static void UpdateAllActiveDialogs(float fElapsedTime)
D3DXVECTOR3 windowdefaultlocation
LPDIRECT3DTEXTURE9 m_pddsGUIScroll
std::wstring strings[L_ENUMERATION]
virtual void DoubleClickLine()
static short draworder[D_ENUMERATION]
void AddToCallStack(const char *msg)
static void DrawAllActiveDialogs(float fElapsedTime)
short fieldtype[MAX_FIELDS]
D3DXVECTOR3 windowseeklocation
virtual void Draw(D3DXVECTOR3 *tracked)