PropInfo.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System.IO;
  2. namespace MeidoPhotoStudio.Plugin;
  3. public class PropInfo
  4. {
  5. public PropInfo(PropType type) =>
  6. Type = type;
  7. public enum PropType
  8. {
  9. Mod,
  10. MyRoom,
  11. Bg,
  12. Odogu,
  13. }
  14. public PropType Type { get; }
  15. public string IconFile { get; set; }
  16. public string Filename { get; set; }
  17. public string SubFilename { get; set; }
  18. public int MyRoomID { get; set; }
  19. public static PropInfo FromModItem(ModItem modItem) =>
  20. new(PropType.Mod)
  21. {
  22. Filename = modItem.IsOfficialMod ? Path.GetFileName(modItem.MenuFile) : modItem.MenuFile,
  23. SubFilename = modItem.BaseMenuFile,
  24. };
  25. public static PropInfo FromMyRoom(MyRoomItem myRoomItem) =>
  26. new(PropType.MyRoom)
  27. {
  28. MyRoomID = myRoomItem.ID,
  29. Filename = myRoomItem.PrefabName,
  30. };
  31. public static PropInfo FromBg(string name) =>
  32. new(PropType.Bg) { Filename = name };
  33. public static PropInfo FromGameProp(string name) =>
  34. new(PropType.Odogu) { Filename = name };
  35. }