CallWindowPane.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using UnityEngine;
  2. namespace COM3D2.MeidoPhotoStudio.Plugin
  3. {
  4. internal class CallWindowPane : BaseMainWindowPane
  5. {
  6. private MeidoManager meidoManager;
  7. private MaidSelectorPane maidSelectorPane;
  8. private Dropdown placementDropdown;
  9. private Button placementOKButton;
  10. public CallWindowPane(MeidoManager meidoManager)
  11. {
  12. this.meidoManager = meidoManager;
  13. placementDropdown = new Dropdown(
  14. Translation.GetArray("placementDropdown", MaidPlacementUtility.placementTypes)
  15. );
  16. Controls.Add(placementDropdown);
  17. placementOKButton = new Button(Translation.Get("maidCallWindow", "okButton"));
  18. placementOKButton.ControlEvent += (o, a) =>
  19. {
  20. meidoManager.PlaceMeidos(MaidPlacementUtility.placementTypes[placementDropdown.SelectedItemIndex]);
  21. };
  22. Controls.Add(placementOKButton);
  23. maidSelectorPane = AddPane(new MaidSelectorPane(meidoManager));
  24. }
  25. protected override void ReloadTranslation()
  26. {
  27. placementDropdown.SetDropdownItems(
  28. Translation.GetArray("placementDropdown", MaidPlacementUtility.placementTypes)
  29. );
  30. placementOKButton.Label = Translation.Get("maidCallWindow", "okButton");
  31. }
  32. public override void UpdatePanes()
  33. {
  34. base.UpdatePanes();
  35. }
  36. public override void Draw()
  37. {
  38. this.tabsPane.Draw();
  39. GUILayout.BeginHorizontal();
  40. placementDropdown.Draw(GUILayout.Width(150));
  41. placementOKButton.Draw();
  42. GUILayout.EndHorizontal();
  43. maidSelectorPane.Draw();
  44. }
  45. }
  46. }