CallWindowPane.cs 1.6 KB

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