BG2WindowPane.cs 2.0 KB

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