Class GameTargetExtensions
- Namespace
- SkyrimForge.Game
- Assembly
- SkyrimForge.Game.dll
Provides extension members for GameTarget.
public static class GameTargetExtensions
- Inheritance
-
GameTargetExtensions
- Inherited Members
Methods
CenterOnCell(GameTarget, string)
Moves the player to the cell whose editor ID is editorId, as Papyrus's Debug.CenterOnCell does.
public static bool CenterOnCell(this GameTarget gameTarget, string editorId)
Parameters
gameTargetGameTargeteditorIdstring
Returns
- bool
Whether the game found the cell.
Remarks
Call on the game's thread.
Exceptions
- ArgumentNullException
editorIdisnull.- ArgumentException
editorIdis empty, where Papyrus logs an error and moves nothing.
QuitGame(GameTarget)
Sets the flag the game's main loop tests to exit, as quitting to the desktop does.
public static void QuitGame(this GameTarget gameTarget)
Parameters
gameTargetGameTarget
ShakeCamera(GameTarget, IObjectReference?, float, float)
Shakes the camera, as Papyrus's Game.ShakeCamera does.
public static void ShakeCamera(this GameTarget gameTarget, IObjectReference? source = null, float strength = 0.5, float duration = 0)
Parameters
gameTargetGameTargetsourceIObjectReferenceThe reference at whose position the shake originates, or
nullfor the player's position.strengthfloatThe strength, from 0 to 1. A value outside that range is clamped to it.
durationfloatThe duration in seconds.
Remarks
Call on the game's thread.
get_CrosshairRef(GameTarget)
The reference under the crosshair. Null where the crosshair is over none.
public static ObjectReference? get_CrosshairRef(GameTarget gameTarget)
Parameters
gameTargetGameTarget
Returns
Remarks
The game builds its CrosshairPickData after a plugin starts and before the main menu opens. Call on the game's thread.
Exceptions
- InvalidOperationException
The game has not built its CrosshairPickData yet.