/// <inheritdoc/> protected override void PrepareOptions(ISettingStore store) { base.PrepareOptions(store); this.settingCanPickPlops = store.Fetch <bool>("CanPickPlops", true); this.settingInteractWithActiveSystemOnly = store.Fetch <bool>("InteractWithActiveSystemOnly", true); }
/// <inheritdoc/> protected override void PrepareOptions(ISettingStore store) { base.PrepareOptions(store); this.settingFillRatePercentage = store.Fetch <int>("FillRatePercentage", 50, filter: value => Mathf.Clamp(value, 0, 100) ); this.settingRandomizeRotation = store.Fetch <bool>("RandomizeRotation", false); }
private static void PrepareSettings_Misc(ISettingStore store) { ControlContent.TrailingTipsVisibleChanged += () => { RotorzWindow.RepaintIfShown <DesignerWindow>(); }; DisableCustomCursors = store.Fetch <bool>( "DisableCustomCursors", false ); AlwaysCenterUtilityWindows = store.Fetch <bool>( "AlwaysCenterUtilityWindows", false ); }
/// <inheritdoc/> protected override void PrepareOptions(ISettingStore store) { base.PrepareOptions(store); this.settingMaximumFillCount = store.Fetch <int>("MaximumFillCount", 300, filter: value => Mathf.Clamp(value, 1, 10000) ); }
private static void PrepareSettings_Painting(ISettingStore store) { EraseEmptyChunksPreference = store.Fetch <EraseEmptyChunksPreference>( "EraseEmptyChunksPreference", Editor.EraseEmptyChunksPreference.Yes ); EraseEmptyChunksPreference.ValueChanged += (args) => { EditorInternalUtility.Instance.eraseEmptyChunks = (int)args.NewValue; }; ToolPreferredNozzleIndicator = store.Fetch <NozzleIndicator>( "ToolPreferredNozzleIndicator", NozzleIndicator.Automatic ); ToolWireframeColor = store.Fetch <Color>( "ToolWireframeColor", new Color(1f, 0f, 0f, 0.55f) ); ToolShadedColor = store.Fetch <Color>( "ToolShadedColor", new Color(1f, 0f, 0f, 0.07f) ); ToolImmediatePreviews = store.Fetch <bool>( "ToolImmediatePreviews", true ); ToolImmediatePreviewsTintColor = store.Fetch <Color>( "ToolImmediatePreviewsTintColor", new Color(1f, 0.33f, 0.33f, 0.7f) ); ToolImmediatePreviewsSeeThrough = store.Fetch <bool>( "ToolImmediatePreviewsSeeThrough", false ); }
private static void PrepareSettings_Grid(ISettingStore store) { BackgroundGridColor = store.Fetch <Color>( "BackgroundGridColor", new Color32(0, 0, 0, 15) ); MajorGridColor = store.Fetch <Color>( "MajorGridColor", new Color32(255, 255, 255, 15) ); MinorGridColor = store.Fetch <Color>( "MinorGridColor", new Color32(255, 255, 255, 5) ); ChunkGridColor = store.Fetch <Color>( "ChunkGridColor", new Color32(70, 192, 255, 30) ); ShowActiveTileSystem = store.Fetch <bool>( "ShowActiveTileSystem", true ); ShowGrid = store.Fetch <bool>( "ShowGrid", true ); ShowChunks = store.Fetch <bool>( "ShowChunks", true ); }
private static void PrepareSettings(ISettingStore store) { s_SharedBrushListModel = store.Fetch <BrushListModel>("SharedBrushListModel", null, filter: (value) => { if (value == null) { value = new BrushListModel(); } value.HideAliasBrushes = false; return(value); } ); s_setting_ActiveTileSystemInstanceID = store.Fetch <int>("ActiveTileSystemInstanceID", 0); s_setting_Rotation = store.Fetch <int>("Rotation", 0, filter: (value) => Mathf.Clamp(value, 0, 3) ); s_setting_RandomizeVariations = store.Fetch <bool>("RandomizeVariations", true); s_setting_RandomizeVariations.ValueChanged += (args) => { if (ToolManager.Instance.CurrentTool != null) { SceneView.RepaintAll(); } }; s_setting_BrushNozzle = store.Fetch <BrushNozzle>("BrushNozzle", BrushNozzle.Round); s_setting_FillCenter = store.Fetch <bool>("FillCenter", true); s_setting_PaintAroundExistingTiles = store.Fetch <bool>("PaintAroundExistingTiles", false); }
/// <inheritdoc/> protected override void PrepareOptions(ISettingStore store) { base.PrepareOptions(store); this.settingNozzleSizeOption = store.Fetch <int>("NozzleSize", this.DefaultNozzleSize, filter: value => Mathf.Clamp(value, 1, 19) ); this.settingNozzleSizeOption.ValueChanged += (args) => ToolUtility.RepaintToolPalette(); }
private static void PrepareSettings_Tools(ISettingStore store) { AutoShowToolPalette = store.Fetch <bool>("AutoShowToolPalette", false); AutoShowToolPalette.ValueChanged += (args) => { // Immediately show tool palette if a tool is activated! if (args.NewValue && ToolManager.Instance.CurrentTool != null) { ToolUtility.ShowToolPalette(false); } }; }
/// <inheritdoc/> protected override void PrepareOptions(ISettingStore store) { base.PrepareOptions(store); this.settingSnapAxisX = store.Fetch <SnapAxis>("SnapAxisX", null, filter: (value) => value ?? new SnapAxis() ); this.settingSnapAxisY = store.Fetch <SnapAxis>("SnapAxisY", null, filter: (value) => value ?? new SnapAxis() ); this.settingLinkSnapAxis = store.Fetch <bool>("LinkSnapAxis", true); this.settingPlopLocation = store.Fetch <Location>("PlopLocation", Location.GroupInsideTileSystem); this.settingPlopGroupName = store.Fetch <string>("PlopGroupName", "Plops"); this.settingDisableCycleFunction = store.Fetch <bool>("DisableCycleFunction", false); this.settingInteractWithActiveSystemOnly = store.Fetch <bool>("InteractWithActiveSystemOnly", true); this.settingHideWireframeOutline = store.Fetch <bool>("HideWireframeOutline", false); }
/// <summary> /// Fetch setting from store with the specified signature. /// </summary> /// <remarks> /// <para>Returns existing setting instance if setting has already been /// fetched from store; though an <c>InvalidOperationException</c> is /// thrown if attempting to fetch the same setting with a different /// signature. Consider using <see cref="ISettingGroup.Lookup{T}"/> instead.</para> /// </remarks> /// <typeparam name="T">Type of value which setting holds.</typeparam> /// <param name="store">Setting store.</param> /// <param name="key">Unique key for setting.</param> /// <param name="defaultValue">Default value of setting.</param> /// <returns> /// The <see cref="Setting{T}"/> instance. /// </returns> /// <exception cref="System.InvalidOperationException"> /// <para>Thrown if any of the following conditions are met:</para> /// <list type="bullet"> /// <item>No further settings can be defined.</item> /// <item>Setting has already been defined with a different default value.</item> /// <item>Setting has already been defined with a different filter.</item> /// </list> /// </exception> public static Setting <T> Fetch <T>(this ISettingStore store, string key, T defaultValue) { return(store.Fetch <T>(key, defaultValue, null)); }