public GamePreset(GamePreset_Placement placementPreset) { A = new GamePresetPoint(); B = new GamePresetPoint(); C = new GamePresetPoint(); D = new GamePresetPoint(); One = new GamePresetPoint(); Two = new GamePresetPoint(); Three = new GamePresetPoint(); Four = new GamePresetPoint(); ActiveMarkers = new BitField8(); A.X = placementPreset.X.A; A.Y = placementPreset.Y.A; A.Z = placementPreset.Z.A; B.X = placementPreset.X.B; B.Y = placementPreset.Y.B; B.Z = placementPreset.Z.B; C.X = placementPreset.X.C; C.Y = placementPreset.Y.C; C.Z = placementPreset.Z.C; D.X = placementPreset.X.D; D.Y = placementPreset.Y.D; D.Z = placementPreset.Z.D; One.X = placementPreset.X.One; One.Y = placementPreset.Y.One; One.Z = placementPreset.Z.One; Two.X = placementPreset.X.Two; Two.Y = placementPreset.Y.Two; Two.Z = placementPreset.Z.Two; Three.X = placementPreset.X.Three; Three.Y = placementPreset.Y.Three; Three.Z = placementPreset.Z.Three; Four.X = placementPreset.X.Four; Four.Y = placementPreset.Y.Four; Four.Z = placementPreset.Z.Four; ActiveMarkers[0] = placementPreset.Active.A; ActiveMarkers[1] = placementPreset.Active.B; ActiveMarkers[2] = placementPreset.Active.C; ActiveMarkers[3] = placementPreset.Active.D; ActiveMarkers[4] = placementPreset.Active.One; ActiveMarkers[5] = placementPreset.Active.Two; ActiveMarkers[6] = placementPreset.Active.Three; ActiveMarkers[7] = placementPreset.Active.Four; _reserved = 0; ContentFinderConditionID = 0; UnixTime = (int)DateTimeOffset.UtcNow.ToUnixTimeSeconds(); }
private static void DirectPlacePreset(GamePreset preset) { if (IsSafeToDirectPlacePreset()) { GamePreset_Placement placementStruct = new GamePreset_Placement(preset); unsafe { mdDirectPlacePreset.Invoke(mpWaymarksObj, new IntPtr(&placementStruct)); } } }
public static bool GetCurrentWaymarksAsPresetData(ref GamePreset rPresetData) { if (mPluginInterface != null && FoundDirectSaveSigs()) { byte currentContentLinkType = mdGetCurrentContentFinderLinkType.Invoke(); if (currentContentLinkType >= 0 && currentContentLinkType < 4) // Same as the game check, but let it do overworld maps too. { GamePreset_Placement rawWaymarkData = new GamePreset_Placement(); unsafe { mdGetCurrentWaymarkData.Invoke(mpWaymarksObj, new IntPtr(&rawWaymarkData)); } rPresetData = new GamePreset(rawWaymarkData); rPresetData.ContentFinderConditionID = ZoneInfoHandler.GetContentFinderIDFromTerritoryTypeID(mPluginInterface.ClientState.TerritoryType); //*****TODO: How do we get this as a territory type for non-instanced zones? The return type might need to be changed, or pass in another ref paramter or something. ***** rPresetData.UnixTime = (Int32)DateTimeOffset.UtcNow.ToUnixTimeSeconds(); return(true); } } return(false); }