v1.0.8.19: Hotbar visibility moved to per-hotbar menus; remove Visibility Hotbars tab
Made-with: Cursor
This commit is contained in:
@@ -72,19 +72,9 @@ namespace HSUI.Interface.GeneralElements
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visibility for HSUI Action Bars is driven by Visibility → Hotbars (Hotbar 1–10), not the per-element config.
|
||||
/// Visibility for HSUI Action Bars is configured per hotbar in each Hotbar 1–10 menu.
|
||||
/// </summary>
|
||||
public VisibilityConfig VisibilityConfig => GetHotbarVisibilityConfig();
|
||||
|
||||
private VisibilityConfig GetHotbarVisibilityConfig()
|
||||
{
|
||||
var hotbars = ConfigurationManager.Instance?.GetConfigObject<HotbarsVisibilityConfig>();
|
||||
if (hotbars == null) return Config.VisibilityConfig;
|
||||
var list = hotbars.GetHotbarConfigs();
|
||||
int idx = Config.HotbarIndex - 1;
|
||||
if (idx < 0 || idx >= list.Count) return Config.VisibilityConfig;
|
||||
return list[idx];
|
||||
}
|
||||
public VisibilityConfig VisibilityConfig => Config.VisibilityConfig;
|
||||
|
||||
public IGameObject? Actor { get; set; }
|
||||
|
||||
|
||||
@@ -153,23 +153,9 @@ namespace HSUI.Interface.GeneralElements
|
||||
{
|
||||
if (bar == null) continue;
|
||||
bar.Enabled = true;
|
||||
bar.VisibilityConfig.CopyFrom(new VisibilityConfig());
|
||||
HotbarBarConfig.ApplyDefaults(bar, idx);
|
||||
}
|
||||
var vis = cfg.GetConfigObject<HotbarsVisibilityConfig>();
|
||||
if (vis != null)
|
||||
{
|
||||
var defaults = new VisibilityConfig();
|
||||
vis.HotbarConfig1.CopyFrom(defaults);
|
||||
vis.HotbarConfig2.CopyFrom(defaults);
|
||||
vis.HotbarConfig3.CopyFrom(defaults);
|
||||
vis.HotbarConfig4.CopyFrom(defaults);
|
||||
vis.HotbarConfig5.CopyFrom(defaults);
|
||||
vis.HotbarConfig6.CopyFrom(defaults);
|
||||
vis.HotbarConfig7.CopyFrom(defaults);
|
||||
vis.HotbarConfig8.CopyFrom(defaults);
|
||||
vis.HotbarConfig9.CopyFrom(defaults);
|
||||
vis.HotbarConfig10.CopyFrom(defaults);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
using HSUI.Config;
|
||||
using HSUI.Config.Attributes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HSUI.Interface.GeneralElements
|
||||
{
|
||||
[Disableable(false)]
|
||||
[Exportable(false)]
|
||||
[Section("Visibility")]
|
||||
[SubSection("Hotbars", 0)]
|
||||
public class HotbarsVisibilityConfig : PluginConfigObject
|
||||
{
|
||||
public new static HotbarsVisibilityConfig DefaultConfig() { return new HotbarsVisibilityConfig(); }
|
||||
|
||||
[NestedConfig("Hotbar 1", 50)]
|
||||
public VisibilityConfig HotbarConfig1 = new VisibilityConfig();
|
||||
|
||||
[NestedConfig("Hotbar 2", 51)]
|
||||
public VisibilityConfig HotbarConfig2 = new VisibilityConfig();
|
||||
|
||||
[NestedConfig("Hotbar 3", 52)]
|
||||
public VisibilityConfig HotbarConfig3 = new VisibilityConfig();
|
||||
|
||||
[NestedConfig("Hotbar 4", 53)]
|
||||
public VisibilityConfig HotbarConfig4 = new VisibilityConfig();
|
||||
|
||||
[NestedConfig("Hotbar 5", 54)]
|
||||
public VisibilityConfig HotbarConfig5 = new VisibilityConfig();
|
||||
|
||||
[NestedConfig("Hotbar 6", 55)]
|
||||
public VisibilityConfig HotbarConfig6 = new VisibilityConfig();
|
||||
|
||||
[NestedConfig("Hotbar 7", 56)]
|
||||
public VisibilityConfig HotbarConfig7 = new VisibilityConfig();
|
||||
|
||||
[NestedConfig("Hotbar 8", 57)]
|
||||
public VisibilityConfig HotbarConfig8 = new VisibilityConfig();
|
||||
|
||||
[NestedConfig("Hotbar 9", 58)]
|
||||
public VisibilityConfig HotbarConfig9 = new VisibilityConfig();
|
||||
|
||||
[NestedConfig("Hotbar 10", 59)]
|
||||
public VisibilityConfig HotbarConfig10 = new VisibilityConfig();
|
||||
|
||||
[NestedConfig("Cross Hotbar", 60)]
|
||||
public VisibilityConfig HotbarConfigCross = new VisibilityConfig();
|
||||
|
||||
private List<VisibilityConfig> _configs;
|
||||
public List<VisibilityConfig> GetHotbarConfigs() => _configs;
|
||||
|
||||
public HotbarsVisibilityConfig()
|
||||
{
|
||||
_configs = new List<VisibilityConfig>() {
|
||||
HotbarConfig1,
|
||||
HotbarConfig2,
|
||||
HotbarConfig3,
|
||||
HotbarConfig4,
|
||||
HotbarConfig5,
|
||||
HotbarConfig6,
|
||||
HotbarConfig7,
|
||||
HotbarConfig8,
|
||||
HotbarConfig9,
|
||||
HotbarConfig10
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user