diff --git a/Assets/Scripts/UI/MainMenuController.cs b/Assets/Scripts/UI/MainMenuController.cs index 4a0ffef..b2b4bf3 100644 --- a/Assets/Scripts/UI/MainMenuController.cs +++ b/Assets/Scripts/UI/MainMenuController.cs @@ -42,6 +42,7 @@ namespace KernelPanic.UI [SerializeField] private FeaturedUnitPanel featuredUnitPanel = new(); [SerializeField] private CollectionScreenController collectionScreen = new(); [SerializeField] private StarterSelectionController starterSelection = new(); + [SerializeField] private GachaScreenController gachaScreen = new(); private readonly List commandEntries = new(); private readonly List packageRows = new(); @@ -69,6 +70,20 @@ namespace KernelPanic.UI private Label bootIntroLogLabel; private Label motdBodyLabel; private VisualElement motdBlock; + private Button rootCreditsToEntropyButton; + private VisualElement rootCreditExchangeModal; + private Label rootCreditExchangeBalanceLabel; + private Label rootCreditExchangePreviewLabel; + private Label rootCreditExchangeMessageLabel; + private TextField rootCreditExchangeInput; + private Button rootCreditExchangeMinusHundredButton; + private Button rootCreditExchangeMinusOneButton; + private Button rootCreditExchangeNoneButton; + private Button rootCreditExchangePlusOneButton; + private Button rootCreditExchangePlusHundredButton; + private Button rootCreditExchangeMaxButton; + private Button rootCreditExchangeConfirmButton; + private Button rootCreditExchangeCancelButton; private Button collectionUnitsButton; private Button collectionLanguagesButton; private readonly ScreenFrameController runSetupFrame = new(); @@ -92,7 +107,12 @@ namespace KernelPanic.UI private bool cursorVisible; private bool suppressNextClick; private bool warnedUnresolvedSaveId; + private bool rootCreditExchangeOpen; private string bootIntroCopy; + private Action rootCreditExchangeMinusHundredClicked; + private Action rootCreditExchangeMinusOneClicked; + private Action rootCreditExchangePlusOneClicked; + private Action rootCreditExchangePlusHundredClicked; private IVisualElementScheduledItem blinkSchedule; private IVisualElementScheduledItem bootIntroSchedule; @@ -117,9 +137,10 @@ namespace KernelPanic.UI collectionScreen.Bind(root, monospaceFont, languageDeckDatabase, cardDatabase, playerCollection); BindScreenFrames(); starterSelection.Bind(root, distroDatabase, HandleStarterConfirmed); + gachaScreen.Bind(root, distroDatabase, monospaceFont, gachaService, playerCollection, wallet, HandleMetaStateChanged, OpenRootCreditExchange); LoadMetaState(); playerCollection.Changed += HandleMetaStateChanged; - gachaService.BannerPoolChanged += HandleMetaStateChanged; + gachaService.Changed += HandleMetaStateChanged; ApplyOptionalFont(); } @@ -133,6 +154,7 @@ namespace KernelPanic.UI RefreshEventBanner(); featuredUnitPanel.Refresh(playerCollection.OwnedUnits, playerCollection.FeaturedUnit); collectionScreen.RefreshUnits(playerCollection.OwnedUnits); + gachaScreen.Refresh(); SelectCommand(0); ShowMainMenu(); StartAmbientSchedules(); @@ -173,6 +195,25 @@ namespace KernelPanic.UI bootIntroLogLabel = root.Q