Skip to content

Commit

Permalink
Merge pull request #550 from maxrchung/Move-Command-Panel
Browse files Browse the repository at this point in the history
Move and resize CommandPanel
  • Loading branch information
Xenocidel authored Sep 3, 2021
2 parents a8616bc + 99eb8af commit 25d28cb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
5 changes: 3 additions & 2 deletions S2VX.Game/Editor/Containers/CommandPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class CommandPanel : S2VXOverlayContainer {

public static Vector2 InputSize { get; } = new Vector2(106, 30);
public static float InputBarHeight { get; } = 70;
private static Vector2 PanelSize { get; } = new Vector2(727, 1000);
private static Vector2 PanelSize { get; } = new Vector2(727, 800);
public CommandPanelInputBar AddInputBar { get; private set; }
private CommandPanelInputBar EditInputBar { get; set; }
private S2VXCommand EditCommandReference { get; set; }
Expand Down Expand Up @@ -58,7 +58,7 @@ private void LoadCommandsList() {
}
}
}
CommandsList.Add(new Container { Height = 1000 });
CommandsList.Add(new Container { Height = 350 });
}

private void AddEditBarToCommandsList() {
Expand Down Expand Up @@ -183,6 +183,7 @@ public void RemoveCommand(S2VXCommand command) {
private void Load() {
Anchor = Anchor.TopRight;
Origin = Anchor.TopRight;
Y = 125;
Size = PanelSize;

AddInputBar = CreateAddInputBar();
Expand Down
4 changes: 2 additions & 2 deletions S2VX.Game/Editor/UserInterface/CommandPanelInputBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

namespace S2VX.Game.Editor.UserInterface {
public class CommandPanelInputBar : FillFlowContainer {
public Dropdown<string> DropType { get; } = new BasicDropdown<string> { Width = 160 };
public Dropdown<string> DropType { get; } = new S2VXDropdown<string> { Width = 160 };
public CommandPanelValueInput StartTime { get; }
public CommandPanelValueInput EndTime { get; }
public CommandPanelValueInput StartValue { get; } = new();
public CommandPanelValueInput EndValue { get; } = new();
public Dropdown<string> DropEasing { get; } = new BasicDropdown<string> { Width = CommandPanel.InputSize.X };
public Dropdown<string> DropEasing { get; } = new S2VXDropdown<string> { Width = CommandPanel.InputSize.X };
public Button BtnSave { get; }

public static CommandPanelInputBar CreateAddInputBar(Action<ValueChangedEvent<string>> handleTypeSelect, Action handleAddClick,
Expand Down
12 changes: 12 additions & 0 deletions S2VX.Game/Editor/UserInterface/S2VXDropdown.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using osu.Framework.Graphics.UserInterface;

namespace S2VX.Game.Editor.UserInterface {
public class S2VXDropdown<T> : BasicDropdown<T> {

protected override DropdownMenu CreateMenu() => new S2VXDropdownMenu();

protected class S2VXDropdownMenu : BasicDropdownMenu {
public S2VXDropdownMenu() => MaxHeight = 300;
}
}
}

0 comments on commit 25d28cb

Please sign in to comment.