BG2WindowPane.cs 2.2 KB

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