public override void ExposeData()
        {
            Scribe_Values.Look(ref FirstTimeInstallation, "FirstTimeInstallation", true);

            Scribe_Values.Look(ref Channel, "Channel", "");
            Scribe_Values.Look(ref Username, "Username", "");
            Scribe_Values.Look(ref OAuth, "OAuth", "");
            Scribe_Values.Look(ref AutoConnect, "AutoConnect", true);

            Scribe_Values.Look(ref UseSeparateChatRoom, "UseSeparateChatRoom", false);
            Scribe_Values.Look(ref AllowBothChatRooms, "AllowBothChatRooms", false);
            Scribe_Values.Look(ref WhispersGoToChatRoom, "WhispersGoToChatRoom", true);
            Scribe_Values.Look(ref ChannelID, "ChannelID", "");
            Scribe_Values.Look(ref ChatroomUUID, "ChatroomUUID", "");

            Scribe_Values.Look(ref VoteTime, "VoteTime", 2);
            Scribe_Values.Look(ref VoteOptions, "VoteOptions", 3);
            Scribe_Values.Look(ref TimedStorytelling, "TimedStorytelling", false);
            Scribe_Values.Look(ref TimeBetweenStorytellingEvents, "TimeBetweenStorytellingEvents", 10);
            Scribe_Values.Look(ref VotingChatMsgs, "VotingChatMsgs", false);
            Scribe_Values.Look(ref VotingWindow, "VotingWindow", true);
            Scribe_Values.Look(ref VotingWindowx, "VotingWindowx", -1);
            Scribe_Values.Look(ref VotingWindowy, "VotingWindowy", -1);
            Scribe_Values.Look(ref LargeVotingWindow, "LargeVotingWindow", true);

            Scribe_Values.Look(ref StartingBalance, "StartingBalance", 150);
            Scribe_Values.Look(ref CoinInterval, "CoinInterval", 2);
            Scribe_Values.Look(ref CoinAmount, "CoinAmount", 30);
            Scribe_Values.Look(ref MinimumPurchasePrice, "MinimumPurchasePrice", 60);
            Scribe_Values.Look(ref UnlimitedCoins, "UnlimitedCoins", false);

            Scribe_Values.Look(ref EarningCoins, "EarningCoins", true);
            Scribe_Values.Look(ref CustomPricingSheetLink, "CustomPricingSheetLink", "bit.ly/toolkit-list");

            Scribe_Values.Look(ref WhisperCmdsAllowed, "WhisperCmdsAllowed", true);
            Scribe_Values.Look(ref WhisperCmdsOnly, "WhisperCmdsOnly", false);
            Scribe_Values.Look(ref PurchaseConfirmations, "PurchaseConfirmations", true);
            Scribe_Values.Look(ref RepeatViewerNames, "RepeatViewerNames", false);
            Scribe_Values.Look(ref MinifiableBuildings, "MinifiableBuildings", false);

            Scribe_Values.Look(ref SyncStreamElements, "SyncStreamElements", false);
            Scribe_Values.Look(ref AccountID, "AccountID", "");
            Scribe_Values.Look(ref JWTToken, "JWTToken", "");

            Scribe_Values.Look(ref SyncStreamLabs, "SyncStreamLabs", false);

            Scribe_Values.Look(ref StartingKarma, "StartingKarma", 100);
            Scribe_Values.Look(ref KarmaCap, "KarmaCap", 140);
            Scribe_Values.Look(ref BanViewersWhoPurchaseAlwaysBad, "BanViewersWhoPurchaseAlwaysBad", true);
            Scribe_Values.Look(ref KarmaReqsForGifting, "KarmaReqsForGifting", false);
            Scribe_Values.Look(ref MinimumKarmaToRecieveGifts, "MinimumKarmaToRecieveGifts", 33);
            Scribe_Values.Look(ref MinimumKarmaToSendGifts, "MinimumKarmaToSendGifts", 100);
            Scribe_Values.Look(ref KarmaMinimum, "KarmaMinimum", 10);

            Scribe_Values.Look(ref TierOneGoodBonus, "TierOneGoodBonus", 16, true);
            Scribe_Values.Look(ref TierOneNeutralBonus, "TierOneNeutralBonus", 36, true);
            Scribe_Values.Look(ref TierOneBadBonus, "TierOneBadBonus", 24, true);

            Scribe_Values.Look(ref TierTwoGoodBonus, "TierTwoGoodBonus", 10, true);
            Scribe_Values.Look(ref TierTwoNeutralBonus, "TierTwoNeutralBonus", 30, true);
            Scribe_Values.Look(ref TierTwoBadBonus, "TierTwoBadBonus", 20, true);

            Scribe_Values.Look(ref TierThreeGoodBonus, "TierThreeGoodBonus", 10, true);
            Scribe_Values.Look(ref TierThreeNeutralBonus, "TierThreeNeutralBonus", 24, true);
            Scribe_Values.Look(ref TierThreeBadBonus, "TierThreeBadBonus", 18, true);

            Scribe_Values.Look(ref TierFourGoodBonus, "TierFourGoodBonus", 6, true);
            Scribe_Values.Look(ref TierFourNeutralBonus, "TierFourNeutralBonus", 18, true);
            Scribe_Values.Look(ref TierFourBadBonus, "TierFourBadBonus", 12, true);

            Scribe_Values.Look(ref DoomBonus, "DoomBonus", 67, true);

            Scribe_Values.Look(ref ChatReqsForCoins, "ChatReqsForCoins", true);
            Scribe_Values.Look(ref TimeBeforeHalfCoins, "TimeBeforeHalfCoins", 30);
            Scribe_Values.Look(ref TimeBeforeNoCoins, "TimeBeforeNoCoins", 60);

            Scribe_Values.Look(ref KarmaDecay, "KarmaDecay", false);
            Scribe_Values.Look(ref KarmaDecayPeriod, "KarmaDecayPeriod", 5);
            Scribe_Values.Look(ref MaxBadEventsBeforeDecay, "MaxBadEventsBeforeDecay", 0);
            Scribe_Values.Look(ref MaxGoodEventsBeforeDecay, "MaxGoodEventsBeforeDecay", 0);
            Scribe_Values.Look(ref MaxNeutralEventsBeforeDecay, "MaxNeutralEventsBeforeDecay", 0);

            Scribe_Values.Look(ref MaxEvents, "MaxEvents", false);
            Scribe_Values.Look(ref MaxEventsPeriod, "MaxEventsPeriod", 5);
            Scribe_Values.Look(ref MaxBadEventsPerInterval, "MaxBadEventsPerInterval", 3);
            Scribe_Values.Look(ref MaxGoodEventsPerInterval, "MaxGoodEventsPerInterval", 10);
            Scribe_Values.Look(ref MaxNeutralEventsPerInterval, "MaxNeutralEventsPerInterval", 10);
            Scribe_Values.Look(ref MaxCarePackagesPerInterval, "MaxCarePackagesPerInterval", 10);

            Scribe_Values.Look(ref EventsHaveCooldowns, "EventsHaveCooldowns", true);
            Scribe_Values.Look(ref EventCooldownInterval, "EventCooldownInterval", 15);

            Scribe_Collections.Look(ref ViewerColorCodes, "ViewerColorCodes", LookMode.Value, LookMode.Value);
            Scribe_Collections.Look(ref ViewerModerators, "ViewerModerators", LookMode.Value, LookMode.Value);
            Scribe_Collections.Look(ref BannedViewers, "BannedViewers", LookMode.Value);

            Scribe_Values.Look(ref EnableViewerQueue, "EnableViewerQueue", true);
            Scribe_Values.Look(ref ViewerNamedColonistQueue, "ViewerNamedColonistQueue", true);
            Scribe_Values.Look(ref ChargeViewersForQueue, "ChargeViewersForQueue", false);
            Scribe_Values.Look(ref CostToJoinQueue, "CostToJoinQueue", 0);

            Scribe_Values.Look(ref SubscriberExtraCoins, "SubscriberExtraCoins", 10);
            Scribe_Values.Look(ref SubscriberCoinMultiplier, "SubscriberCoinMultiplier", 1.25f);
            Scribe_Values.Look(ref SubscriberExtraVotes, "SubscriberExtraVotes", 1);

            Scribe_Values.Look(ref VIPExtraCoins, "VIPExtraCoins", 5);
            Scribe_Values.Look(ref VIPCoinMultiplier, "VIPCoinMultiplier", 1.15f);
            Scribe_Values.Look(ref VIPExtraVotes, "VIPExtraVotes", 0);

            Scribe_Values.Look(ref ModExtraCoins, "ModExtraCoins", 3);
            Scribe_Values.Look(ref ModCoinMultiplier, "ModCoinMultiplier", 1.15f);
            Scribe_Values.Look(ref ModExtraVotes, "ModExtraVotes", 0);

            Scribe_Collections.Look(ref VoteWeights, "VoteWeights", LookMode.Value, LookMode.Value);

            Helper.Log("exposing vote weights");

            Scribe_Values.Look(ref ToryTalkerEnabled, "ToryTalkerEnabled", false);
            Scribe_Values.Look(ref ToryTalkerMTBDays, "ToryTalkerMTBDays", 2);

            Scribe_Values.Look(ref HodlBotEnabled, "HodlBotEnabled", true);
            Scribe_Values.Look(ref HodlBotMTBDays, "HodlBotMTBDays", 1);

            Scribe_Collections.Look(ref VoteTypeWeights, "VoteTypeWeights", LookMode.Value, LookMode.Value);
            Scribe_Collections.Look(ref VoteCategoryWeights, "VoteCategoryWeights", LookMode.Value, LookMode.Value);

            Scribe_Values.Look(ref UristBotEnabled, "UristBotEnabled", false);
            Scribe_Values.Look(ref UristBotMTBDays, "UristBotMTBDays", 6);

            Scribe_Values.Look(ref MilasandraEnabled, "MilasandraEnabled", false);

            Scribe_Values.Look(ref MercuriusEnabled, "MercuriusEnabled", false);

            Scribe_Values.Look(ref CommandsModsEnabled, "CommandsModsEnabled", true);

            Scribe_Collections.Look(ref CustomCommandDefs, "CustomCommandDefs", LookMode.Value);

            List <StoreIncidentVariables> variableIncidents = DefDatabase <StoreIncidentVariables> .AllDefs.Where(s => s.customSettings).ToList();

            foreach (StoreIncidentVariables incident in variableIncidents)
            {
                incident.RegisterCustomSettings();
                incident.settings.ExposeData();
            }

            if (BannedViewers == null || BannedViewers.Count < 1)
            {
                BannedViewers = new List <string>(PubliclyKnownBots);
            }

            if (AutoConnect)
            {
                if (Toolkit.client == null)
                {
                    ToolkitIRC.NewInstance();
                }
            }

            if (VoteWeights == null || VoteWeights.Count < 1)
            {
                ToolkitSettings.VoteWeights = new Dictionary <string, int>();

                foreach (VotingIncident vote in DefDatabase <VotingIncident> .AllDefs)
                {
                    ToolkitSettings.VoteWeights.Add(vote.defName, 100);
                }
            }
            else
            {
                Settings_VoteWeights.Load_Votewieghts();
            }
        }
Exemple #2
0
        public void DoWindowContents(Rect rect)
        {
            Listing_Standard options      = new Listing_Standard();
            Color            defaultColor = new Color(100, 65, 164);

            options.Begin(rect);

            Text.Font   = GameFont.Medium;
            Text.Anchor = TextAnchor.MiddleCenter;
            GUI.color   = Color.magenta;
            options.Label("TwitchToolkitSettingsTitle".Translate());
            GUI.color   = defaultColor;
            Text.Font   = GameFont.Small;
            Text.Anchor = TextAnchor.UpperLeft;
            options.GapLine();
            options.Gap();

            options.ColumnWidth = rect.width / 3;

            // Left column
            if (options.ButtonText("TwitchToolkitChat".Translate()))
            {
                currentTab = SettingsTab.Chat;
            }

            if (options.ButtonText("TwitchToolkitCoins".Translate()))
            {
                currentTab = SettingsTab.Coins;
            }

            if (options.ButtonText("Storyteller"))
            {
                currentTab = SettingsTab.Storyteller;
            }

            if (options.ButtonText("Patches"))
            {
                currentTab = SettingsTab.Patches;
            }

            // Middle column
            options.NewColumn();
            options.Gap(53f);

            if (options.ButtonText("TwitchToolkitStore".Translate()))
            {
                currentTab = SettingsTab.Store;
            }

            if (options.ButtonText("TwitchToolkitKarma".Translate()))
            {
                currentTab = SettingsTab.Karma;
            }

            if (options.ButtonText("TwitchToolkitCommands".Translate()))
            {
                currentTab = SettingsTab.Commands;
            }

            if (options.ButtonText("TwitchToolkitCooldowns".Translate()))
            {
                currentTab = SettingsTab.Cooldowns;
            }

            // Right Column
            options.NewColumn();
            options.Gap(53f);

            if (options.ButtonText("TwitchToolkitOptions".Translate()))
            {
                currentTab = SettingsTab.Options;
            }

            if (options.ButtonText("TwitchToolkitViewers".Translate()))
            {
                currentTab = SettingsTab.Viewers;
            }

            if (options.ButtonText("TwitchToolkitIntegrations".Translate()))
            {
                currentTab = SettingsTab.Integrations;
            }

            if (options.ButtonText("Votes"))
            {
                currentTab = SettingsTab.Votes;
            }

            options.End();

            Listing_Standard gapline   = new Listing_Standard();
            Rect             gapliRect = new Rect(rect.x, rect.y, rect.width, rect.height);

            gapline.Begin(gapliRect);
            gapline.Gap();
            gapline.End();

            Rect optionsRect = rect;

            optionsRect.y      = 145;
            optionsRect.height = 620f;
            optionsRect.yMax   = 765f;

            Rect scrollViewer = new Rect(optionsRect);

            scrollViewer.height -= 145f;
            scrollViewer.yMax   -= 145f;

            Rect viewRect = new Rect(0, 0, rect.width - 100f, 430f);

            viewRect.width -= 25f;

            if (currentTab == SettingsTab.Karma)
            {
                viewRect.height += 250f;
            }
            if (currentTab == SettingsTab.Votes)
            {
                viewRect.height = (DefDatabase <VotingIncident> .AllDefs.Count() * 30f) + 35f;
            }

            Listing_Standard optionsListing = new Listing_Standard();

            optionsListing.Begin(optionsRect);
            optionsListing.BeginScrollView(scrollViewer, ref scrollVector2, ref viewRect);

            switch (currentTab)
            {
            case SettingsTab.Coins:
                Settings_Coins.DoWindowContents(viewRect, optionsListing);
                break;

            case SettingsTab.Storyteller:
                Settings_Storyteller.DoWindowContents(viewRect, optionsListing);
                break;

            case SettingsTab.Patches:
                Settings_Patches.DoWindowContents(viewRect, optionsListing);
                break;

            case SettingsTab.Store:
                Settings_Store.DoWindowContents(viewRect, optionsListing);
                break;

            case SettingsTab.Karma:
                Settings_Karma.DoWindowContents(viewRect, optionsListing);
                break;

            case SettingsTab.Commands:
                Settings_Commands.DoWindowContents(viewRect, optionsListing);
                break;

            case SettingsTab.Cooldowns:
                Settings_Cooldowns.DoWindowContents(viewRect, optionsListing);
                break;

            case SettingsTab.Options:
                Settings_Options.DoWindowContents(viewRect, optionsListing);
                break;

            case SettingsTab.Viewers:
                Settings_Viewers.DoWindowContents(viewRect, optionsListing);
                break;

            case SettingsTab.Integrations:
                Settings_Integrations.DoWindowContents(viewRect, optionsListing);
                break;

            case SettingsTab.Votes:
                Settings_VoteWeights.DoWindowContents(viewRect, optionsListing);
                break;

            default:
                Settings_Chat.DoWindowContents(viewRect, optionsListing);
                break;
            }

            optionsListing.EndScrollView(ref viewRect);
            optionsListing.End();
        }