mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-11 07:30:40 +01:00
Add api (#5)
* Add API * Added API * Updated version * Updated RNUI * Added checks for null paths * BelongsToPath menu item now toggles on/off depending if any paths exist
This commit is contained in:
parent
d118513185
commit
56a770b718
10 changed files with 63 additions and 22 deletions
|
|
@ -61,7 +61,7 @@ namespace SceneManager.Menus
|
|||
//setBarrierTrafficLight.Index = 3;
|
||||
}
|
||||
Menu.AddItem(BelongsToPath);
|
||||
BelongsToPath.Enabled = PathManager.Paths.Count() > 0 ? true : false;
|
||||
BelongsToPath.Enabled = PathManager.Paths.Any(x => x != null);
|
||||
BelongsToPath.Checked = false;
|
||||
|
||||
AddToPath = new UIMenuListScrollerItem<string>("Path", "The path the barrier will be saved with when the path is exported.", PathManager.Paths.Where(x => x != null).Select(x => x.Name));
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ namespace SceneManager
|
|||
if (checkboxItem == DisablePath)
|
||||
{
|
||||
//var currentPath = PathManager.Paths[PathMainMenu.EditPath.Index];
|
||||
var currentPath = PathManager.Paths.FirstOrDefault(x => x.Name == PathMainMenu.EditPath.OptionText);
|
||||
var currentPath = PathManager.Paths.FirstOrDefault(x => x != null && x.Name == PathMainMenu.EditPath.OptionText);
|
||||
if(currentPath == null)
|
||||
{
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace SceneManager.Menus
|
|||
var checkedItems = checkboxItems.Where(x => x.Checked);
|
||||
foreach(UIMenuCheckboxItem checkedItem in checkedItems)
|
||||
{
|
||||
var pathToExport = PathManager.Paths.First(x => x.Name == checkedItem.Text);
|
||||
var pathToExport = PathManager.Paths.First(x => x != null && x.Name == checkedItem.Text);
|
||||
ExportPaths.Add(pathToExport);
|
||||
}
|
||||
|
||||
|
|
@ -97,7 +97,7 @@ namespace SceneManager.Menus
|
|||
{
|
||||
foreach (UIMenuCheckboxItem menuItem in checkedItems)
|
||||
{
|
||||
var pathToExport = PathManager.Paths.First(x => x.Name == menuItem.Text);
|
||||
var pathToExport = PathManager.Paths.First(x => x != null && x.Name == menuItem.Text);
|
||||
ExportAsIndividualFile(pathToExport);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue