Example #1
0
        public static void OptionsMenu(Rect rect)
        {
            var mod = LoadedModManager.GetMod <TwitchToolkit>();
            Listing_TwitchToolkit listingStandard = new Listing_TwitchToolkit();

            listingStandard.Begin(rect);
            listingStandard.CheckboxLabeled("Should buildings unable to be uninstalled be included in the item list? ", ref MinifiableBuildings, "Non-Minifiable Buildings?");
            listingStandard.CheckboxLabeled("Should viewers have unlimited coins? ", ref UnlimitedCoins, "Unlimited coins?");
            listingStandard.CheckboxLabeled("Should events have cooldowns? ", ref EventsHaveCooldowns, "Event cooldowns?");
            listingStandard.CheckboxLabeled("Should viewer names be repeated in raids/aid? ", ref RepeatViewerNames, "Repeat viewers?");
            listingStandard.CheckboxLabeled("Large voting window? ", ref LargeVotingWindow, "Large window?");
            listingStandard.Label("How many minutes in a cooldown period: " + EventCooldownInterval);
            EventCooldownInterval = listingStandard.Slider((float)EventCooldownInterval, 1, 120);
            listingStandard.Label("Seperate chatroom UUID:");
            ChatroomUUID = listingStandard.TextEntry(ChatroomUUID);
            listingStandard.Label("Seperate channel id:");
            ChannelID = listingStandard.TextEntry(ChannelID);
            if (listingStandard.ButtonText("Reset Options"))
            {
                MinifiableBuildings   = false;
                UnlimitedCoins        = false;
                EventsHaveCooldowns   = true;
                EventCooldownInterval = 15;
                mod.WriteSettings();
            }
            listingStandard.End();
        }
Example #2
0
        private static void CoinMenu(Rect rect)
        {
            var mod = LoadedModManager.GetMod <TwitchToolkit>();
            Listing_TwitchToolkit listingStandard = new Listing_TwitchToolkit();

            listingStandard.Begin(rect);
            listingStandard.CheckboxLabeled("Reward Coins: ", ref EarningCoins, "Should viewers earn coins while watching?");
            listingStandard.CheckboxLabeled("Store Open: ", ref StoreOpen, "Enable purchasing of events and items");
            listingStandard.CheckboxLabeled("Viewers can gift other viewers coins: ", ref GiftingCoins, "Enable gifting");
            listingStandard.Label("Coins Per Interval: " + CoinAmount);
            CoinAmount = listingStandard.Slider((float)CoinAmount, 1, 250);
            listingStandard.Label("Max Karma: " + KarmaCap);
            KarmaCap = listingStandard.Slider((float)KarmaCap, 100, 1000);
            listingStandard.Label("Minimum Purchase Price: " + MinimumPurchasePrice);
            MinimumPurchasePrice = listingStandard.Slider((float)MinimumPurchasePrice, 10, 500);
            listingStandard.Label("Minutes between coin reward: " + CoinInterval);
            CoinInterval = listingStandard.Slider((float)CoinInterval, 1, 60);
            listingStandard.Label("Starting balance: " + StartingBalance);
            StartingBalance = listingStandard.Slider((float)StartingBalance, 0, 1000);
            listingStandard.Label("Starting karma: " + StartingKarma);
            StartingKarma = listingStandard.Slider((float)StartingKarma, 10, Settings.KarmaCap);
            listingStandard.Label("Link to custom pricing sheet: (check steamworkshop description for instructions)");
            CustomPricingSheetLink = listingStandard.TextEntry(CustomPricingSheetLink);
            if (listingStandard.ButtonText("Disable Events"))
            {
                foreach (Product product in products)
                {
                    product.amount             = -10;
                    ProductAmounts[product.id] = -10;
                }
            }
            if (listingStandard.ButtonText("Enable Events"))
            {
                ResetProductData();
            }
            if (listingStandard.ButtonText("Reset Coin Settings"))
            {
                EarningCoins           = true;
                StoreOpen              = false;
                GiftingCoins           = false;
                CoinAmount             = 30;
                KarmaCap               = 140;
                MinimumPurchasePrice   = 60;
                CoinInterval           = 2;
                CustomPricingSheetLink = "https://bit.ly/2C7bls0";
                StartingBalance        = 150;
                StartingKarma          = 100;
                mod.WriteSettings();
            }
            listingStandard.End();
        }
Example #3
0
        public static void CommandMenu(Rect rect)
        {
            var mod = LoadedModManager.GetMod <TwitchToolkit>();
            Listing_TwitchToolkit listingStandard = new Listing_TwitchToolkit();

            listingStandard.Begin(rect);
            listingStandard.CheckboxLabeled($"Commands can be whispered to {Username}: ", ref WhisperCmdsAllowed, "Allow whispers");
            listingStandard.CheckboxLabeled($"Commands must be whispered to {Username}: ", ref WhisperCmdsOnly, "Require whispers");
            listingStandard.CheckboxLabeled("Should purchases be confirmed in chat: ", ref PurchaseConfirmations, "Purchase confirmations");
            listingStandard.Label("Check your coin balance");
            BalanceCmd = listingStandard.TextEntry(BalanceCmd);
            listingStandard.Label("Buy an event");
            BuyeventCmd = listingStandard.TextEntry(BuyeventCmd);
            listingStandard.Label("Buy an item");
            BuyitemCmd = listingStandard.TextEntry(BuyitemCmd);
            listingStandard.Label("Instructions");
            InstructionsCmd = listingStandard.TextEntry(InstructionsCmd);
            listingStandard.Label("Purchase list");
            PurchaselistCmd = listingStandard.TextEntry(PurchaselistCmd);
            listingStandard.Label("Mod info");
            ModinfoCmd = listingStandard.TextEntry(ModinfoCmd);
            listingStandard.Label("Mod settings");
            ModsettingsCmd = listingStandard.TextEntry(ModsettingsCmd);
            listingStandard.Label("Karma explanation");
            KarmaCmd = listingStandard.TextEntry(KarmaCmd);
            listingStandard.Label("Gift coins");
            GiftCmd = listingStandard.TextEntry(GiftCmd);
            listingStandard.Label("All toolkit commands");
            CommandHelpCmd = listingStandard.TextEntry(CommandHelpCmd);
            if (listingStandard.ButtonText("Reset Commands"))
            {
                WhisperCmdsAllowed    = true;
                WhisperCmdsOnly       = false;
                PurchaseConfirmations = true;

                BalanceCmd      = "TwitchToolkitBalCmd".Translate();
                BuyeventCmd     = "TwitchToolkitBuyEventCmd".Translate();
                BuyitemCmd      = "TwitchTookitBuyItemCmd".Translate();
                InstructionsCmd = "TwitchToolkitInstructionsCmd".Translate();
                PurchaselistCmd = "TwitchToolkitPurchaseListCmd".Translate();
                ModinfoCmd      = "TwitchToolkitModInfoCmd".Translate();
                ModsettingsCmd  = "TwitchToolkitModSettingsCmd".Translate();
                KarmaCmd        = "TwitchToolkitKarmaCmd".Translate();
                GiftCmd         = "TwitchToolkitGiftCmd".Translate();
                CommandHelpCmd  = "TwitchToolkitCmdHelpCmd".Translate();
                mod.WriteSettings();
            }
            listingStandard.End();
        }
Example #4
0
        private static void StreamElementsMenu(Rect rect)
        {
            Listing_TwitchToolkit listingStandard = new Listing_TwitchToolkit();

            listingStandard.Begin(rect);
            JWTToken  = listingStandard.TextEntry(JWTToken, 3);
            AccountID = listingStandard.TextEntry(AccountID);

            var inputRect = new Rect(_padding + 140f, _padding + _height * 3, rect.width - (_padding * 2) - 140f, 20f);

            if (Widgets.ButtonText(inputRect, "Import Points"))
            {
                StreamElements element = new StreamElements(AccountID, JWTToken);
                element.ImportPoints();
            }

            listingStandard.End();
        }