BG2WindowPane.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. namespace COM3D2.MeidoPhotoStudio.Plugin
  2. {
  3. public class BG2WindowPane : BaseMainWindowPane
  4. {
  5. private static readonly string[] tabNames = { "props", "myRoom", "mod" };
  6. private readonly MeidoManager meidoManager;
  7. private readonly PropManager propManager;
  8. private readonly AttachPropPane attachPropPane;
  9. private readonly PropManagerPane propManagerPane;
  10. private readonly SelectionGrid propTabs;
  11. private BasePane currentPropsPane;
  12. public BG2WindowPane(MeidoManager meidoManager, PropManager propManager)
  13. {
  14. this.meidoManager = meidoManager;
  15. this.propManager = propManager;
  16. this.propManager.DoguSelectChange += (s, a) => propTabs.SelectedItemIndex = 0;
  17. // should be added in this order
  18. AddPane(new PropsPane(propManager));
  19. AddPane(new MyRoomPropsPane(propManager));
  20. AddPane(new ModPropsPane(propManager));
  21. attachPropPane = AddPane(new AttachPropPane(this.meidoManager, propManager));
  22. propManagerPane = AddPane(new PropManagerPane(propManager));
  23. propTabs = new SelectionGrid(Translation.GetArray("propsPaneTabs", tabNames));
  24. propTabs.ControlEvent += (s, a) => currentPropsPane = Panes[propTabs.SelectedItemIndex];
  25. currentPropsPane = Panes[0];
  26. }
  27. protected override void ReloadTranslation()
  28. {
  29. propTabs.SetItems(Translation.GetArray("propsPaneTabs", tabNames));
  30. }
  31. public override void Draw()
  32. {
  33. tabsPane.Draw();
  34. propTabs.Draw();
  35. MpsGui.WhiteLine();
  36. currentPropsPane.Draw();
  37. if (propTabs.SelectedItemIndex == 0)
  38. {
  39. propManagerPane.Draw();
  40. attachPropPane.Draw();
  41. }
  42. }
  43. public override void UpdatePanes()
  44. {
  45. if (ActiveWindow) base.UpdatePanes();
  46. }
  47. }
  48. }