#if TOOLS using Godot; using Microsoft.VisualBasic; using System; using System.Collections.Generic; using System.Linq; namespace TerraBrush; [Tool] public partial class Plugin : EditorPlugin { private const float UpdateDelay = 0.005f; private const int ToolInfoOffset = 20; private const string OverlayActionNameKey = "ActionName"; private Control _terrainDockContainer; private TerrainControlDock _terrainControlDock; private PackedScene _terrainControlDockPrefab; private PackedScene _toolsPieMenuPrefab; private PackedScene _customContentPieMenuPrefab; private BrushDecal _brushDecal; private TerraBrush _currentTerraBrushNode; private ToolInfo _toolInfo; private bool _isMousePressed; private Vector3 _mouseHitPosition; private float _updateTime = 0; private EditorUndoRedoManager _undoRedo; private bool _preventInitialDo = false; private Node _editorViewportsContainer = null; private Control[] _editorViewports = null; private Control _overlaySelector = null; private Button _updateTerrainSettingsButton = null; private CheckBox _autoAddZonesCheckbox = null; private void CreateCustomSetting(string name, Variant defaultValue, Variant.Type type, PropertyHint hint = PropertyHint.None, string hintString = null) { if (ProjectSettings.HasSetting(name)) { return; } var propertyInfo = new Godot.Collections.Dictionary() { {"name", name}, {"type", (int)type}, {"hint", (int)hint}, {"hint_string", hintString} }; ProjectSettings.SetSetting(name, defaultValue); ProjectSettings.AddPropertyInfo(propertyInfo); ProjectSettings.SetInitialValue(name, defaultValue); } public override void _EnterTree() { var keybindManager = new KeybindManager(); var script = GD.Load