Just playing around with yoga and unity to see if we could build a ui with it
This commit is contained in:
1 parent
15d5b17fd2
commit
6ad1cd7aa8
60 files changed
+3930
-3
No files matched your search
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using Vocaluxe.UI.AbstractElements;
|
||||
using Vocaluxe.UI.BasicElements.Button;
|
||||
|
||||
namespace Vocaluxe.UI.Screens.ScreenMain
|
||||
{
|
||||
public class CControllerScreenMain: CController
|
||||
{
|
||||
private CControllerElementButton _BtnSingController;
|
||||
private CControllerElementButton _BtnPartyController;
|
||||
private CControllerElementButton _BtnOptionsController;
|
||||
private CControllerElementButton _BtnProfilesController;
|
||||
private CControllerElementButton _BtnExitController;
|
||||
|
||||
public override void RegisterChild(CController child, string id)
|
||||
{
|
||||
Enum.TryParse(id, true, out EScreenMainComponents parsedId);
|
||||
|
||||
switch (parsedId)
|
||||
{
|
||||
case EScreenMainComponents.BtnSing:
|
||||
_BtnSingController = child as CControllerElementButton ?? throw new ArgumentException("BtnSing must be a button element");
|
||||
_BtnSingController.Clicked += BtnSingClicked;
|
||||
break;
|
||||
case EScreenMainComponents.BtnParty:
|
||||
_BtnPartyController = child as CControllerElementButton ?? throw new ArgumentException("BtnParty must be a button element");
|
||||
_BtnPartyController.Clicked += BtnPartyClicked;
|
||||
break;
|
||||
case EScreenMainComponents.BtnOptions:
|
||||
_BtnOptionsController = child as CControllerElementButton ?? throw new ArgumentException("BtnOptions must be a button element");
|
||||
_BtnOptionsController.Clicked += BtnOptionsClicked;
|
||||
break;
|
||||
case EScreenMainComponents.BtnProfiles:
|
||||
_BtnProfilesController = child as CControllerElementButton ?? throw new ArgumentException("BtnProfiles must be a button element");
|
||||
_BtnProfilesController.Clicked += BtnProfilesClicked;
|
||||
break;
|
||||
case EScreenMainComponents.BtnExit:
|
||||
_BtnExitController = child as CControllerElementButton ?? throw new ArgumentException("BtnExit must be a button element");
|
||||
_BtnExitController.Clicked += BtnExitClicked;
|
||||
break;
|
||||
case EScreenMainComponents.Unknown:
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
}
|
||||
|
||||
public event EventHandler BtnSingClicked;
|
||||
public event EventHandler BtnPartyClicked;
|
||||
public event EventHandler BtnOptionsClicked;
|
||||
public event EventHandler BtnProfilesClicked;
|
||||
public event EventHandler BtnExitClicked;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System.Collections.Generic;
|
||||
using Vocaluxe.UI.AbstractElements;
|
||||
|
||||
namespace Vocaluxe.UI.Screens.ScreenMain
|
||||
{
|
||||
public class CUiScreenMain:CUiScreen
|
||||
{
|
||||
public CControllerScreenMain Controller => new CControllerScreenMain();
|
||||
public override CController BasicController => Controller;
|
||||
|
||||
public static CUiScreen CreateInstance(Dictionary<string, string> properties, IEnumerable<(CUiElement uiElement, string bindingId)> children)
|
||||
{
|
||||
return CUiElement.CreateInstance<CUiScreenMain>(properties, children);
|
||||
}
|
||||
|
||||
public override EUiScreenType ScreenType => EUiScreenType.ScreenMain;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
namespace Vocaluxe.UI.Screens.ScreenMain
|
||||
{
|
||||
public enum EScreenMainComponents
|
||||
{
|
||||
Unknown,
|
||||
BtnSing,
|
||||
BtnParty,
|
||||
BtnOptions,
|
||||
BtnProfiles,
|
||||
BtnExit
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user