mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-22 18:02:16 +00:00
storydev.list command
This commit is contained in:
parent
c6e3d0e905
commit
0ca2fffe7a
1 changed files with 30 additions and 0 deletions
|
@ -2,12 +2,14 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using ShiftOS.Engine;
|
||||
using ShiftOS.Objects;
|
||||
using ShiftOS.Objects.ShiftFS;
|
||||
using ShiftOS.WinForms.Applications;
|
||||
using static ShiftOS.Objects.ShiftFS.Utils;
|
||||
|
||||
|
@ -674,6 +676,34 @@ namespace ShiftOS.WinForms
|
|||
return true;
|
||||
}
|
||||
|
||||
[Command("list", description ="Lists all story IDs.")]
|
||||
public static bool ListIds()
|
||||
{
|
||||
foreach(var exec in System.IO.Directory.GetFiles(Environment.CurrentDirectory))
|
||||
{
|
||||
if(exec.ToLower().EndsWith(".exe") || exec.ToLower().EndsWith(".dll"))
|
||||
{
|
||||
try
|
||||
{
|
||||
var asm = Assembly.LoadFile(exec);
|
||||
{
|
||||
foreach(var type in asm.GetTypes())
|
||||
{
|
||||
foreach(var method in type.GetMethods(BindingFlags.Public | BindingFlags.Static))
|
||||
{
|
||||
var attr = method.GetCustomAttributes(false).FirstOrDefault(x => x is StoryAttribute);
|
||||
if (attr != null)
|
||||
Console.WriteLine(" - " + (attr as StoryAttribute).StoryID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
[Command("unexperience", description = "Marks a story plot as not-experienced yet.", usage ="id:string")]
|
||||
[RemoteLock]
|
||||
[RequiresArgument("id")]
|
||||
|
|
Loading…
Reference in a new issue