Table of Contents

Class Main

Namespace
AshesOfVelsingrad
Assembly
Ashes of Velsingrad.dll

Main scene controller that initializes the game systems. Follows the Component-Based Architecture and event-driven communication.

[ScriptPath("res://scripts/Main.cs")]
public class Main : Node, IDisposable
Inheritance
GodotObject
Node
Main
Implements
Inherited Members
Node.NotificationEnterTree
Node.NotificationExitTree
Node.NotificationMovedInParent
Node.NotificationReady
Node.NotificationPaused
Node.NotificationUnpaused
Node.NotificationPhysicsProcess
Node.NotificationProcess
Node.NotificationParented
Node.NotificationUnparented
Node.NotificationSceneInstantiated
Node.NotificationDragBegin
Node.NotificationDragEnd
Node.NotificationPathRenamed
Node.NotificationChildOrderChanged
Node.NotificationInternalProcess
Node.NotificationInternalPhysicsProcess
Node.NotificationPostEnterTree
Node.NotificationDisabled
Node.NotificationEnabled
Node.NotificationResetPhysicsInterpolation
Node.NotificationEditorPreSave
Node.NotificationEditorPostSave
Node.NotificationWMMouseEnter
Node.NotificationWMMouseExit
Node.NotificationWMWindowFocusIn
Node.NotificationWMWindowFocusOut
Node.NotificationWMCloseRequest
Node.NotificationWMGoBackRequest
Node.NotificationWMSizeChanged
Node.NotificationWMDpiChange
Node.NotificationVpMouseEnter
Node.NotificationVpMouseExit
Node.NotificationWMPositionChanged
Node.NotificationOsMemoryWarning
Node.NotificationTranslationChanged
Node.NotificationWMAbout
Node.NotificationCrash
Node.NotificationOsImeUpdate
Node.NotificationApplicationResumed
Node.NotificationApplicationPaused
Node.NotificationApplicationFocusIn
Node.NotificationApplicationFocusOut
Node.NotificationTextServerChanged
Node.NotificationAccessibilityUpdate
Node.NotificationAccessibilityInvalidate
Node.GetNode<T>(NodePath)
Node.GetNodeOrNull<T>(NodePath)
Node.GetOwner<T>()
Node.GetOwnerOrNull<T>()
Node.GetParent<T>()
Node.GetParentOrNull<T>()
Node._EnterTree()
Node._ExitTree()
Node._GetAccessibilityConfigurationWarnings()
Node._GetConfigurationWarnings()
Node._GetFocusedAccessibilityElement()
Node._Input(InputEvent)
Node._ShortcutInput(InputEvent)
Node._UnhandledInput(InputEvent)
Node._UnhandledKeyInput(InputEvent)
Node.PrintOrphanNodes()
Node.GetOrphanNodeIds()
Node.RemoveChild(Node)
Node.HasNode(NodePath)
Node.GetNode(NodePath)
Node.GetNodeOrNull(NodePath)
Node.GetParent()
Node.HasNodeAndResource(NodePath)
Node.GetNodeAndResource(NodePath)
Node.IsInsideTree()
Node.IsPartOfEditedScene()
Node.IsAncestorOf(Node)
Node.IsGreaterThan(Node)
Node.GetPath()
Node.RemoveFromGroup(StringName)
Node.IsInGroup(StringName)
Node.GetGroups()
Node.PrintTree()
Node.PrintTreePretty()
Node.GetTreeString()
Node.GetTreeStringPretty()
Node.GetPhysicsProcessDeltaTime()
Node.IsPhysicsProcessing()
Node.GetProcessDeltaTime()
Node.IsProcessing()
Node.IsProcessingInput()
Node.IsProcessingShortcutInput()
Node.IsProcessingUnhandledInput()
Node.IsProcessingUnhandledKeyInput()
Node.CanProcess()
Node.QueueAccessibilityUpdate()
Node.GetAccessibilityElement()
Node.IsDisplayedFolded()
Node.IsProcessingInternal()
Node.IsPhysicsProcessingInternal()
Node.IsPhysicsInterpolated()
Node.IsPhysicsInterpolatedAndEnabled()
Node.ResetPhysicsInterpolation()
Node.CanAutoTranslate()
Node.SetTranslationDomainInherited()
Node.GetWindow()
Node.GetLastExclusiveWindow()
Node.GetTree()
Node.CreateTween()
Node.GetSceneInstanceLoadPlaceholder()
Node.IsEditableInstance(Node)
Node.GetViewport()
Node.QueueFree()
Node.RequestReady()
Node.IsNodeReady()
Node.GetMultiplayerAuthority()
Node.IsMultiplayerAuthority()
Node.RpcConfig(StringName, Variant)
Node.GetNodeRpcConfig()
Node.Rpc(StringName, params Variant[])
Node.UpdateConfigurationWarnings()
Node.CallDeferredThreadGroup(StringName, params Variant[])
Node.SetDeferredThreadGroup(StringName, Variant)
Node.CallThreadSafe(StringName, params Variant[])
Node.SetThreadSafe(StringName, Variant)
Node.EmitSignalReady()
Node.EmitSignalRenamed()
Node.EmitSignalTreeEntered()
Node.EmitSignalTreeExiting()
Node.EmitSignalTreeExited()
Node.EmitSignalChildEnteredTree(Node)
Node.EmitSignalChildExitingTree(Node)
Node.EmitSignalChildOrderChanged()
Node.EmitSignalReplacingBy(Node)
Node.EmitSignalEditorDescriptionChanged(Node)
Node.EmitSignalEditorStateChanged()
Node.InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Node.HasGodotClassMethod(in godot_string_name)
Node.HasGodotClassSignal(in godot_string_name)
Node.Name
Node.UniqueNameInOwner
Node.SceneFilePath
Node.Owner
Node.Multiplayer
Node.ProcessMode
Node.ProcessPriority
Node.ProcessPhysicsPriority
Node.ProcessThreadGroup
Node.ProcessThreadGroupOrder
Node.ProcessThreadMessages
Node.PhysicsInterpolationMode
Node.AutoTranslateMode
Node.EditorDescription
Node.Ready
Node.Renamed
Node.TreeEntered
Node.TreeExiting
Node.TreeExited
Node.ChildEnteredTree
Node.ChildExitingTree
Node.ChildOrderChanged
Node.ReplacingBy
Node.EditorDescriptionChanged
Node.EditorStateChanged
GodotObject.NotificationPostinitialize
GodotObject.NotificationPredelete
GodotObject.NotificationExtensionReloaded
GodotObject.IsInstanceValid(GodotObject)
GodotObject.WeakRef(GodotObject)
GodotObject.Dispose()
GodotObject.ToString()
GodotObject.ToSignal(GodotObject, StringName)
GodotObject._Get(StringName)
GodotObject._GetPropertyList()
GodotObject._IterGet(Variant)
GodotObject._IterInit(Array)
GodotObject._IterNext(Array)
GodotObject._PropertyCanRevert(StringName)
GodotObject._PropertyGetRevert(StringName)
GodotObject._Set(StringName, Variant)
GodotObject._ValidateProperty(Dictionary)
GodotObject.Free()
GodotObject.GetClass()
GodotObject.Set(StringName, Variant)
GodotObject.Get(StringName)
GodotObject.SetIndexed(NodePath, Variant)
GodotObject.GetIndexed(NodePath)
GodotObject.GetPropertyList()
GodotObject.GetMethodList()
GodotObject.PropertyCanRevert(StringName)
GodotObject.PropertyGetRevert(StringName)
GodotObject.GetInstanceId()
GodotObject.SetScript(Variant)
GodotObject.GetScript()
GodotObject.SetMeta(StringName, Variant)
GodotObject.RemoveMeta(StringName)
GodotObject.GetMeta(StringName, Variant)
GodotObject.HasMeta(StringName)
GodotObject.GetMetaList()
GodotObject.HasUserSignal(StringName)
GodotObject.RemoveUserSignal(StringName)
GodotObject.EmitSignal(StringName, params Variant[])
GodotObject.Call(StringName, params Variant[])
GodotObject.CallDeferred(StringName, params Variant[])
GodotObject.SetDeferred(StringName, Variant)
GodotObject.Callv(StringName, Array)
GodotObject.HasMethod(StringName)
GodotObject.GetMethodArgumentCount(StringName)
GodotObject.HasSignal(StringName)
GodotObject.GetSignalList()
GodotObject.GetSignalConnectionList(StringName)
GodotObject.GetIncomingConnections()
GodotObject.Disconnect(StringName, Callable)
GodotObject.IsConnected(StringName, Callable)
GodotObject.HasConnections(StringName)
GodotObject.IsBlockingSignals()
GodotObject.NotifyPropertyListChanged()
GodotObject.CanTranslateMessages()
GodotObject.Tr(StringName, StringName)
GodotObject.GetTranslationDomain()
GodotObject.SetTranslationDomain(StringName)
GodotObject.IsQueuedForDeletion()
GodotObject.CancelFree()
GodotObject.EmitSignalScriptChanged()
GodotObject.EmitSignalPropertyListChanged()
GodotObject.NativeInstance
GodotObject.ScriptChanged
GodotObject.PropertyListChanged

Fields

_mainMenuScene

[Export(PropertyHint.None, "")]
protected PackedScene? _mainMenuScene

Field Value

PackedScene

_menuContainer

[Export(PropertyHint.None, "")]
protected Control? _menuContainer

Field Value

Control

_optionsMenuScene

[Export(PropertyHint.None, "")]
protected PackedScene? _optionsMenuScene

Field Value

PackedScene

Methods

CreateMenus()

Create menu instances - virtual for testing overrides. Default implementation instantiates from PackedScenes. Checks for null references and logs appropriately. Can be overridden in tests to provide mock or test-specific menus.

protected virtual (Node mainMenu, Node optionsMenu) CreateMenus()

Returns

(Node mainMenu, Node optionsMenu)

Tuple of (mainMenu, optionsMenu) nodes.

InitializeMenus()

Initialise the menus and register them with the MenuManager. Ensures that the SettingsManager and MenuManager singletons are available. Uses deferred calls to avoid Godot lifecycle issues. Catches and logs exceptions during initialization. Also checks that the menu container and scenes are valid before proceeding. This method can be overridden in tests to provide mock menus.

protected virtual void InitializeMenus()

_Ready()

Called when the node is "ready", i.e. when both the node and its children have entered the scene tree. If the node has children, their Godot.Node._Ready() callbacks get triggered first, and the parent node will receive the ready notification afterwards.

Corresponds to the Godot.Node.NotificationReady notification in _Notification(int). See also the @onready annotation for variables.

Usually used for initialization. For even earlier initialization, Godot.GodotObject.GodotObject() may be used. See also Godot.Node._EnterTree().

Note: This method may be called only once for each node. After removing a node from the scene tree and adding it again, Godot.Node._Ready() will not be called a second time. This can be bypassed by requesting another call with Godot.Node.RequestReady(), which may be called anywhere before adding the node again.

public override void _Ready()