102 sprintf_s(msg,
sizeof msg,
"Editing waypoint that doesn't exist in collection: %i (%zu) %i", wpd->
linecursel, wpd->
filteredWaypoints.size(), field);
131 sprintf_s(input, 99,
"%S",
dynamic_cast<RiseEditBox*
>(pControl)->GetText());
132 int count = sscanf_s(input,
"%[NnSs ]%f%[EeWw ]%f", ns, 3, &nsdeg, ew, 4, &ewdeg);
137 bool letfailed =
true;
138 if (ns[0] ==
'N' || ns[0] ==
'n')
143 else if (ns[0] ==
'S' || ns[0] ==
's')
151 if (ew[0] ==
'E' || ew[0] ==
'e')
155 else if (ew[0] ==
'W' || ew[0] ==
'w')
161 if (fabsf(nsdeg) > 90.0f || fabsf(ewdeg) > 180.0f)
167 result.y = cosf(-lngtemp) * cosf(lattemp);
168 result.x = sinf(-lngtemp) * cosf(lattemp);
169 result.z = sinf(lattemp);
187 if (strlen(input) > 3 && (input[2] ==
'n' || input[2] ==
'N')) index = 3;
188 if (strlen(input) > 4 && input[3] ==
' ') index = 4;
189 count = sscanf_s(&input[index],
"%4d%4d", &tcpu, &tcpv);
261 lineact =
static_cast<long>(i);
307 for (
auto i = 5; i < 11; i++)
315 for (
auto i = 5; i < 11; i++)
317 const unsigned char actionLevel = i - 5;
323 actionenabled[i] = (actionLevel >= waypointLevel - 1) && actionLevel != waypointLevel && type == 0;
350 for (
int i = 5; i < 11; i++)
364 for (
long t = 0; t <
linedsp; t++)
377 throw std::exception(
"Trying to update menu with a waypoint that doesn't exist in collection!");
381 swprintf_s(
fieldline[t][1],
HELP_SIZE, L
"Unsaved waypoint, click here to rename and save!");
437 WCHAR northsouth, eastwest;
448 if (f_temp > 10000.0f)
494 if (field == 2 &&
linecursel != 0)
return false;
535 sprintf_s(msg,
sizeof msg,
"Found the problem going to set WPtargetC (%i) and lineact (%i) to linecursel (%i) actionenabled %i",
558 sprintf_s(msg,
sizeof msg,
"Found the problem WPtargetC %i because of lineact and linecursel!",
ptrBus->
WPtargetC);
588 throw std::exception(
"Trying to ActionIconClick a waypoint that doesn't exist in collection!");
631 outpacket.
f_x = 3.0f;
633 outpacket.
f_z = 0.0f;
634 outpacket.
f_w = 0.0f;
647 outpacket.
f_x = 3.0f;
649 outpacket.
f_z = 1.0f;
650 outpacket.
f_w = 0.0f;
663 outpacket.
f_x = 3.0f;
665 outpacket.
f_z = 2.0f;
666 outpacket.
f_w = 0.0f;
679 outpacket.
f_x = 3.0f;
681 outpacket.
f_z = 3.0f;
682 outpacket.
f_w = 0.0f;
695 outpacket.
f_x = 3.0f;
697 outpacket.
f_z = 4.0f;
698 outpacket.
f_w = 0.0f;
711 outpacket.
f_x = 3.0f;
713 outpacket.
f_z = 5.0f;
714 outpacket.
f_w = 0.0f;
802 if (thisdist > nextdist)
807 if (thisdist < nextdist)
833 sprintf_s(msg,
sizeof msg,
"WaypointDialog::DragDropItem(%i): %i", destTab,
gui->
dragt);
840 sprintf_s(msg,
sizeof msg,
"Ha! This is where we were crapping out on dragline: %i",
gui->
dragline);
847 if (wcsncmp(c_str, L
"TC_WAYPOINT,", 12) != 0)
return;
850 WCHAR waypointName[64] = {};
852 float locationx, locationy, locationz;
853 setlocale(LC_ALL,
"English_United States.1252");
854 const int fieldsRead = swscanf_s(c_str, L
"TC_WAYPOINT,%d,%f,%f,%f,%63[^\n]", &uniqueId, &locationx, &locationy, &locationz, waypointName,
static_cast<unsigned>(_countof(waypointName)));
856 if (fieldsRead != 5)
return;
865 tempwaypoint.
type = 0;
882 filtered_waypoint.group =
static_cast<unsigned char>(
folderOrder.
Group(destTab));
#define EVENT_EDITBOX_STRING
#define EVENT_EDITBOX_CANCEL
RiseMath::Vector2 CalculateLatLng(RiseMath::Vector3 position)
float GetArcDist(RiseMath::Vector3 from, RiseMath::Vector3 to, bool includeAltDiff)
const RiseMath::Vector3 centerC
bool streetViewConfigured
RiseMath::Vector3 lastWaypointLocation
std::vector< Swaypoint > waypoint
std::vector< std::wstring > chatline
short fieldcontent[MAX_FIELDS]
bool actiontoggle[MAX_ACTION]
short fieldtype[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]
bool actionenabled[MAX_ACTION]
virtual void ActionIconClick(long icon_id)
short tabusedefaultlang[MAX_TAB]
RiseMath::Vector3 windowdefaultlocation
RiseMath::Vector3 windowlocation
static short CheckWidth(short dialogid)
bool fieldsortable[MAX_FIELDS]
short fieldwidth[MAX_FIELDS]
std::unique_ptr< Bus > bus
std::unique_ptr< Networking > networking
std::unique_ptr< Viewscreen > viewscreen
std::wstring strings[L_ENUMERATION]
InformationDialog * informationDialog
RiseDialogResourceManager g_DialogResourceManager
CHATCHANNEL chatchannel[MAX_TAB]
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 SendEvent(EventType eventType, float extent=0.0f) const
void SetLocation(int x, int y)
virtual bool GetVisible()
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)
HRESULT AddEditBox(int ID, LPCWSTR strText, int x, int y, int width, int height, bool bIsDefault=false, bool bIsPassword=false, RiseEditBox **ppCreated=NULL)
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)
std::unique_ptr< waypoints > ptrWaypoints
RiseMath::Vector3 CalculatePlanar(short u, short v)
std::vector< Swaypoint > filteredWaypoints
bool canEditField(int field) override
void ActionIconClick(long icon_id) override
void DoubleClickLine() override
WaypointProtocol::FolderOrder folderOrder
void TabClick(short clicked_tab)
Viewscreen * ptrViewscreen
void UpdateMenu(short tab) override
void ClearEdit() override
void InvalidateWaypoints()
static void CALLBACK DialogCallback(UINT nEvent, int nControlID, RiseControl *pControl, void *pUserContext)
short TabForGroup(unsigned char group) const
void DragDropItem(short destTab) override
bool CanRemoveFolder() const
bool Remove(short tab, short count, const std::vector< Swaypoint > &waypoints)
short Tab(unsigned char group) const
bool CanRemove(short tab, short count, const std::vector< Swaypoint > &waypoints) const
int Group(short tab) const
void CancelPendingSelection()
void Upload(Swaypoint swaypoint) const
std::vector< Swaypoint > GetGroup(short group) const
void UpdateMaster(Swaypoint waypoint) const
s_network_objects playerships[MAX_SCAN]
@ L_DIALOG_WAYPOINTMANAGER
float Vec3Length(const Vector3 *a)
Quaternion * QuaternionIdentity(Quaternion *out)
Vector3 * Vec3Normalize(Vector3 *out, const Vector3 *a)
Vector3 * Vec3Scale(Vector3 *out, const Vector3 *a, float scale)
void SetText(Swaypoint &waypoint, const WCHAR *text)
SClientPacket Select(int waypointId, bool streetViewConfigured)
RiseMath::Vector3 velocity
RiseMath::Quaternion orientation
RiseMath::Vector3 location
unsigned char protectionLevel
RiseMath::Quaternion orientation
RiseMath::Vector3 position
RiseMath::Vector3 velocity