Use ScrollingListNode where applicable
This commit is contained in:
@@ -37,8 +37,6 @@ public class AddonConfigurationWindow : NativeAddon
|
||||
{
|
||||
Position = ContentStartPosition with { Y = tabContentY },
|
||||
Size = ContentSize with { Y = tabContentHeight },
|
||||
ContentHeight = 400,
|
||||
ScrollSpeed = 25,
|
||||
IsVisible = true,
|
||||
};
|
||||
_generalScrollingAreaNode.AttachNode(this);
|
||||
@@ -47,8 +45,6 @@ public class AddonConfigurationWindow : NativeAddon
|
||||
{
|
||||
Position = ContentStartPosition with { Y = tabContentY },
|
||||
Size = ContentSize with { Y = tabContentHeight },
|
||||
ContentHeight = 400,
|
||||
ScrollSpeed = 25,
|
||||
IsVisible = false,
|
||||
};
|
||||
_categoryScrollingAreaNode.AttachNode(this);
|
||||
@@ -57,8 +53,6 @@ public class AddonConfigurationWindow : NativeAddon
|
||||
{
|
||||
Position = ContentStartPosition with { Y = tabContentY },
|
||||
Size = ContentSize with { Y = tabContentHeight },
|
||||
ContentHeight = 400,
|
||||
ScrollSpeed = 25,
|
||||
IsVisible = false,
|
||||
};
|
||||
_currencyScrollingAreaNode.AttachNode(this);
|
||||
|
||||
@@ -7,19 +7,18 @@ namespace AetherBags.Nodes.Configuration.Category;
|
||||
|
||||
public class CategoryConfigurationNode : ConfigNode<CategoryWrapper>
|
||||
{
|
||||
private readonly ScrollingAreaNode<VerticalListNode> _categoryList;
|
||||
private readonly ScrollingListNode _categoryList;
|
||||
private CategoryDefinitionConfigurationNode? _activeNode;
|
||||
|
||||
public Action? OnCategoryChanged { get; set; }
|
||||
|
||||
public CategoryConfigurationNode()
|
||||
{
|
||||
_categoryList = new ScrollingAreaNode<VerticalListNode>
|
||||
_categoryList = new ScrollingListNode
|
||||
{
|
||||
ContentHeight = 100.0f,
|
||||
AutoHideScrollBar = true,
|
||||
AutoHideScrollbar = true,
|
||||
};
|
||||
_categoryList.ContentNode.FitContents = true;
|
||||
_categoryList.FitContents = true;
|
||||
_categoryList.AttachNode(this);
|
||||
}
|
||||
|
||||
@@ -37,11 +36,11 @@ public class CategoryConfigurationNode : ConfigNode<CategoryWrapper>
|
||||
{
|
||||
_activeNode = new CategoryDefinitionConfigurationNode(option.CategoryDefinition)
|
||||
{
|
||||
Size = _categoryList.ContentNode.Size,
|
||||
Size = _categoryList.Size,
|
||||
OnLayoutChanged = UpdateScrollHeight,
|
||||
OnCategoryPropertyChanged = OnCategoryChanged,
|
||||
};
|
||||
_categoryList.ContentNode.AddNode(_activeNode);
|
||||
_categoryList.AddNode(_activeNode);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -53,17 +52,17 @@ public class CategoryConfigurationNode : ConfigNode<CategoryWrapper>
|
||||
|
||||
private void UpdateScrollHeight()
|
||||
{
|
||||
_categoryList.ContentNode.RecalculateLayout();
|
||||
_categoryList.ContentHeight = _categoryList.ContentNode.Height;
|
||||
_categoryList.RecalculateLayout();
|
||||
//_categoryList.ContentHeight = _categoryList.Height;
|
||||
}
|
||||
|
||||
protected override void OnSizeChanged()
|
||||
{
|
||||
base.OnSizeChanged();
|
||||
_categoryList.Size = Size;
|
||||
_categoryList.ContentNode.Width = Width;
|
||||
_categoryList.Width = Width;
|
||||
|
||||
foreach (var node in _categoryList.ContentNode.GetNodes<CategoryDefinitionConfigurationNode>())
|
||||
foreach (var node in _categoryList.GetNodes<CategoryDefinitionConfigurationNode>())
|
||||
{
|
||||
node.Width = Width;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ using KamiToolKit.Nodes;
|
||||
|
||||
namespace AetherBags.Nodes.Configuration.Category;
|
||||
|
||||
public sealed class CategoryScrollingAreaNode : ScrollingAreaNode<VerticalListNode>
|
||||
public sealed class CategoryScrollingAreaNode : ScrollingListNode
|
||||
{
|
||||
private AddonCategoryConfigurationWindow? _categoryConfigurationAddon;
|
||||
private readonly TextButtonNode _categoryConfigurationButtonNode;
|
||||
@@ -13,7 +13,7 @@ public sealed class CategoryScrollingAreaNode : ScrollingAreaNode<VerticalListNo
|
||||
{
|
||||
InitializeCategoryAddon();
|
||||
|
||||
ContentNode.AddNode(new CategoryGeneralConfigurationNode());
|
||||
AddNode(new CategoryGeneralConfigurationNode());
|
||||
|
||||
_categoryConfigurationButtonNode = new TextButtonNode
|
||||
{
|
||||
@@ -21,7 +21,7 @@ public sealed class CategoryScrollingAreaNode : ScrollingAreaNode<VerticalListNo
|
||||
String = "Configure Categories",
|
||||
OnClick = () => _categoryConfigurationAddon?.Toggle(),
|
||||
};
|
||||
ContentNode.AddNode(_categoryConfigurationButtonNode);
|
||||
AddNode(_categoryConfigurationButtonNode);
|
||||
}
|
||||
|
||||
private void InitializeCategoryAddon() {
|
||||
|
||||
@@ -2,11 +2,11 @@ using KamiToolKit.Nodes;
|
||||
|
||||
namespace AetherBags.Nodes.Configuration.Currency;
|
||||
|
||||
public sealed class CurrencyScrollingAreaNode : ScrollingAreaNode<VerticalListNode>
|
||||
public sealed class CurrencyScrollingAreaNode : ScrollingListNode
|
||||
{
|
||||
public CurrencyScrollingAreaNode()
|
||||
{
|
||||
ContentNode.AddNode(new CurrencyGeneralConfigurationNode
|
||||
AddNode(new CurrencyGeneralConfigurationNode
|
||||
{
|
||||
Size = Size
|
||||
});
|
||||
|
||||
@@ -5,7 +5,7 @@ using KamiToolKit.Nodes;
|
||||
|
||||
namespace AetherBags.Nodes.Configuration.General;
|
||||
|
||||
public sealed class GeneralScrollingAreaNode : ScrollingAreaNode<VerticalListNode>
|
||||
public sealed class GeneralScrollingAreaNode : ScrollingListNode
|
||||
{
|
||||
private readonly CheckboxNode _debugCheckboxNode = null!;
|
||||
|
||||
@@ -13,11 +13,11 @@ public sealed class GeneralScrollingAreaNode : ScrollingAreaNode<VerticalListNod
|
||||
{
|
||||
GeneralSettings config = System.Config.General;
|
||||
|
||||
ContentNode.ItemSpacing = 32;
|
||||
ItemSpacing = 32;
|
||||
|
||||
ContentNode.AddNode(new FunctionalConfigurationNode());
|
||||
AddNode(new FunctionalConfigurationNode());
|
||||
|
||||
ContentNode.AddNode(new LayoutConfigurationNode());
|
||||
AddNode(new LayoutConfigurationNode());
|
||||
|
||||
_debugCheckboxNode = new CheckboxNode
|
||||
{
|
||||
@@ -27,6 +27,6 @@ public sealed class GeneralScrollingAreaNode : ScrollingAreaNode<VerticalListNod
|
||||
IsChecked = config.DebugEnabled,
|
||||
OnClick = isChecked => { config.DebugEnabled = isChecked; }
|
||||
};
|
||||
ContentNode.AddNode(_debugCheckboxNode);
|
||||
AddNode(_debugCheckboxNode);
|
||||
}
|
||||
}
|
||||
+1
-1
Submodule KamiToolKit updated: ac0f8116f6...21b3f2b44c
Reference in New Issue
Block a user