From 34050b049af5575c448732ec538f4a6df92b669c Mon Sep 17 00:00:00 2001 From: Emerson Pinter Date: Sat, 3 Aug 2024 20:25:12 -0300 Subject: [PATCH] Update MapMenu runtime-data members Members updated in this commit are used in MapMenu.as and LocalMap.as. The BSTArray is the content of WorldMap.MarkerData, and changes depending on the function being called (CreateMarkers/RefreshMarkers). The cameraPickDirection seems to be 3 floats used to calculate the custom marker position based on cameraPickOrigin, updated when the custom marker is created but only when the map is moved. --- cmake/sourcelist.cmake | 1 + include/RE/L/LocalMapMenu.h | 33 +++++++++++--------- include/RE/M/MapMenu.h | 58 +++++++----------------------------- include/RE/M/MapMenuMarker.h | 25 ++++++++++++++++ include/RE/Skyrim.h | 1 + 5 files changed, 57 insertions(+), 61 deletions(-) create mode 100644 include/RE/M/MapMenuMarker.h diff --git a/cmake/sourcelist.cmake b/cmake/sourcelist.cmake index 7c223fea1..12ef48de0 100644 --- a/cmake/sourcelist.cmake +++ b/cmake/sourcelist.cmake @@ -1184,6 +1184,7 @@ set(SOURCES include/RE/M/MapInputHandler.h include/RE/M/MapLookHandler.h include/RE/M/MapMenu.h + include/RE/M/MapMenuMarker.h include/RE/M/MapMoveHandler.h include/RE/M/MapZoomHandler.h include/RE/M/MarkerUsedData.h diff --git a/include/RE/L/LocalMapMenu.h b/include/RE/L/LocalMapMenu.h index 8286120dc..a4feeb6f4 100644 --- a/include/RE/L/LocalMapMenu.h +++ b/include/RE/L/LocalMapMenu.h @@ -15,6 +15,7 @@ namespace RE { class BSShaderAccumulator; class NiNode; + struct MapMenuMarker; struct LocalMapMenu { @@ -111,12 +112,16 @@ namespace RE struct RUNTIME_DATA { - BSScaleformExternalTexture unk303A0; // 00 - GFxValue unk303B8; // 18 - GFxValue unk303D0; // 30 - void* unk303E8; // 48 - BSTSmartPointer unk303F0; // 50 - std::uint64_t unk303F8; // 58 + BSScaleformExternalTexture unk303A0; // 00 + GFxValue localMapMovie; // 18 + GFxValue mapMovie; // 30 + void* unk303E8; // 48 + BSTSmartPointer unk303F0; // 50 + std::int32_t selectedMarker; // 58 + bool showingMap; // 5C + bool dragging; // 5D + bool controlsReady; // 5E + std::uint8_t unk303FF; // 5F }; static_assert(sizeof(RUNTIME_DATA) == 0x60); @@ -131,14 +136,14 @@ namespace RE } // members - BSTArray unk00000; // 00000 - GFxValue unk00018; // 00018 - float unk00030; // 00030 - float unk00034; // 00034 - float unk00038; // 00038 - float unk0003C; // 0003C - LocalMapCullingProcess localCullingProcess; // 00040 - RUNTIME_DATA runtimeData; // 303A0, 30418 + BSTArray mapMarkers; // 00000 + GFxValue unk00018; // 00018 + float unk00030; // 00030 + float unk00034; // 00034 + float unk00038; // 00038 + float unk0003C; // 0003C + LocalMapCullingProcess localCullingProcess; // 00040 + RUNTIME_DATA runtimeData; // 303A0, 30418 #if !defined(ENABLE_SKYRIM_AE) && !defined(ENABLE_SKYRIM_SE) std::uint32_t unk30478; // 30478 std::uint32_t pad3047C; // 3047C diff --git a/include/RE/M/MapMenu.h b/include/RE/M/MapMenu.h index 3d6ed403a..c5ba9dc0c 100644 --- a/include/RE/M/MapMenu.h +++ b/include/RE/M/MapMenu.h @@ -19,6 +19,7 @@ namespace RE class MapZoomHandler; class MenuOpenCloseEvent; class TESWorldSpace; + struct MapMenuMarker; // menuDepth = 3 // flags = kPausesGame | kUsesCursor | kRendersOffscreenTargets | kCustomRendering @@ -40,45 +41,6 @@ namespace RE inline static constexpr auto RTTI = RTTI_MapMenu; constexpr static std::string_view MENU_NAME = "MapMenu"; - struct Unk30470Entry - { - TESFullName* unk00; - std::uint32_t unk08; - std::uint32_t unk0C; - TESForm* unk10; - std::uint32_t unk18; - std::uint32_t unk1C; - std::uint32_t unk20; - std::uint32_t unk24; - std::uint32_t unk28; - std::uint32_t unk2C; - std::uint32_t unk30; - std::uint32_t unk34; - }; - static_assert(sizeof(Unk30470Entry) == 0x38); - - struct Unk30488Entry - { - std::uint32_t unk00; - std::uint32_t unk04; - std::uint32_t unk08; - std::uint32_t unk0C; - const char* label; - std::uint32_t unk18; - std::uint32_t unk1C; - std::uint32_t unk20; - std::uint32_t unk24; - std::uint32_t unk28; - std::uint32_t unk2C; - std::uint32_t unk30; - std::uint32_t unk34; - std::uint32_t unk38; - std::uint32_t unk3C; - std::uint32_t unk40; - std::uint32_t unk44; - }; - static_assert(sizeof(Unk30488Entry) == 0x48); - struct RUNTIME_DATA { #define RUNTIME_DATA_CONTENT \ @@ -101,19 +63,21 @@ namespace RE #define RUNTIME_DATA2_CONTENT \ RefHandle unk30460; /* 000 */ \ NiPoint3 playerMarkerPosition; /* 004 */ \ - BSTArray unk30470; /* 010 */ \ - BSTArray unk30488; /* 028 */ \ + BSTArray mapMarkers; /* 010 */ \ + BSTArray markerData; /* 028 */ \ MapCamera camera; /* 040 */ \ std::uint64_t unk30530; /* 0D0 */ \ TESWorldSpace* worldSpace; /* 0D8 */ \ - GFxValue unk30540; /* 0E0 */ \ - std::uint64_t unk30558; /* 0F8 */ \ - std::uint64_t unk30560; /* 100 */ \ - std::uint64_t unk30568; /* 108 */ \ - std::uint32_t unk30570; /* 110 */ \ + GFxValue mapMovie; /* 0E0 */ \ + std::int32_t selectedMarker; /* 0F8 */ \ + NiPoint3 cameraPickOrigin; /* 0FC */ \ + NiPoint3 cameraPickDirection; /* 108 */ \ BSSoundHandle unk30574; /* 114 */ \ std::uint64_t unk30580; /* 120 */ \ - std::uint64_t unk30588; /* 128 */ \ + std::uint32_t unk30588; /* 128 */ \ + bool controlsReady; /* 12C */ \ + std::uint8_t unk3058D; /* 12D */ \ + std::uint16_t unk3058E; /* 12E */ \ std::uint64_t unk30590; /* 130 */ RUNTIME_DATA2_CONTENT }; diff --git a/include/RE/M/MapMenuMarker.h b/include/RE/M/MapMenuMarker.h new file mode 100644 index 000000000..273807586 --- /dev/null +++ b/include/RE/M/MapMenuMarker.h @@ -0,0 +1,25 @@ +#pragma once + +#include "RE/T/TESForm.h" +#include "RE/T/TESFullName.h" + +namespace RE +{ + struct MapMenuMarker + { + TESFullName* fullName; // 00 + RefHandle ref; // 08 + std::uint32_t pad0C; // 0C + const char* customMarker; // 10 + std::uint32_t type; // 18 + std::uint32_t door; // 1C + std::int32_t index; // 20 + std::uint32_t pad24; // 24 + TESForm* form; // 28 + std::uint8_t unk30; // 30 + std::uint8_t pad31; // 31 + std::uint16_t pad32; // 32 + std::uint32_t pad34; // 34 + }; + static_assert(sizeof(MapMenuMarker) == 0x38); +} diff --git a/include/RE/Skyrim.h b/include/RE/Skyrim.h index 6164acd68..8f57373e2 100644 --- a/include/RE/Skyrim.h +++ b/include/RE/Skyrim.h @@ -1186,6 +1186,7 @@ #include "RE/M/MapInputHandler.h" #include "RE/M/MapLookHandler.h" #include "RE/M/MapMenu.h" +#include "RE/M/MapMenuMarker.h" #include "RE/M/MapMoveHandler.h" #include "RE/M/MapZoomHandler.h" #include "RE/M/MarkerUsedData.h"