BG2WindowPane.cs 1.8 KB

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