示例#1
0
        public static void Make(ExtUITabstrip tabStrip)
        {
            UIHelper panelHelper = tabStrip.AddTabPage("Logging");

            panelHelper.AddCheckbox(
                "Log asset loading times",
                ConfigUtil.Config.LogAssetLoadingTimes,
                val => {
                ConfigUtil.Config.LogAssetLoadingTimes = val;
                ConfigUtil.SaveConfig();
                logAssetLoadingTimesToggle_.isEnabled = val;
            });

            logAssetLoadingTimesToggle_ = panelHelper.AddCheckbox(
                "Per Mod",
                ConfigUtil.Config.LogPerModAssetLoadingTimes,
                val => {
                ConfigUtil.Config.LogPerModAssetLoadingTimes = val;
                ConfigUtil.SaveConfig();
            }) as UIComponent;
            Settings.Indent(logAssetLoadingTimesToggle_);

            logAssetLoadingTimesToggle_ = panelHelper.AddCheckbox(
                "Log per mod OnCreated() times",
                ConfigUtil.Config.LogPerModOnCreatedTimes,
                val => {
                ConfigUtil.Config.LogPerModOnCreatedTimes = val;
                ConfigUtil.SaveConfig();
            }) as UIComponent;
        }
示例#2
0
        public static void Make(ExtUITabstrip tabStrip)
        {
            UIHelper panelHelper = tabStrip.AddTabPage("Startup");

            panelHelper.AddLabel("restart required to take effect.", textColor: Color.yellow);
            panelHelper.AddSpace(10);

            panelHelper.AddButton("Reset load orders", OnResetLoadOrdersClicked);

            panelHelper.AddCheckbox(
                "remove ad panels",
                ConfigUtil.Config.TurnOffSteamPanels,
                val => {
                ConfigUtil.Config.TurnOffSteamPanels = val;
                ConfigUtil.SaveConfig();
            });

            var c2 = panelHelper.AddCheckbox(
                "Improve content manager",
                ConfigUtil.Config.FastContentManager,
                val => {
                ConfigUtil.Config.FastContentManager = val;
                ConfigUtil.SaveConfig();
            }) as UIComponent;

            c2.tooltip = "faster content manager";

            var c3 = panelHelper.AddCheckbox(
                "Add harmony resolver",
                ConfigUtil.Config.AddHarmonyResolver,
                val => {
                ConfigUtil.Config.AddHarmonyResolver = val;
                ConfigUtil.SaveConfig();
            }) as UICheckBox;

            var c4 = panelHelper.AddCheckbox(
                "Cache asset details for the tool.",
                ConfigUtil.Config.UGCCache,
                val => {
                ConfigUtil.Config.UGCCache = val;
                ConfigUtil.SaveConfig();
            }) as UICheckBox;

            var c5 = panelHelper.AddCheckbox(
                "Hide steam download errors (Ignorance is bliss!)",
                ConfigUtil.Config.IgnoranceIsBliss,
                val => {
                ConfigUtil.Config.IgnoranceIsBliss = val;
                ConfigUtil.SaveConfig();
            }) as UICheckBox;
        }
示例#3
0
        public static ExtUITabstrip Create(UIHelper helper) {
            UIComponent optionsContainer = helper.self as UIComponent;
            float orgOptsContainerWidth = optionsContainer.height;
            float orgOptsContainerHeight = optionsContainer.width;

            int paddingRight = 10; //Options container is Scrollable panel itself(reserves space for scroll - which we don't use)
            optionsContainer.size = new Vector2(orgOptsContainerWidth + paddingRight, orgOptsContainerHeight);

            ExtUITabstrip tabStrip = optionsContainer.AddUIComponent<ExtUITabstrip>();
            tabStrip.relativePosition = new Vector3(0, 0);
            tabStrip.size = new Vector2(orgOptsContainerWidth, TAB_STRIP_HEIGHT);

            UITabContainer tabContainer = optionsContainer.AddUIComponent<UITabContainer>();
            tabContainer.relativePosition = new Vector3(0, TAB_STRIP_HEIGHT);
            tabContainer.width = (orgOptsContainerWidth + paddingRight) - V_SCROLLBAR_WIDTH;
            tabContainer.height = optionsContainer.height - (tabStrip.relativePosition.y + tabContainer.relativePosition.y);
            tabStrip.tabPages = tabContainer;

            return tabStrip;
        }
示例#4
0
        public static void Make(ExtUITabstrip tabStrip)
        {
            UIHelper panelHelper = tabStrip.AddTabPage("Developer");

            panelHelper.AddCheckbox(
                "Soft assembly dependency",
                ConfigUtil.Config.SoftDLLDependancy,
                val => {
                ConfigUtil.Config.SoftDLLDependancy = val;
                ConfigUtil.SaveConfig();
            });
            panelHelper.AddButton("Ensure All", CheckSubsUtil.EnsureAll);
            //g.AddButton("RequestItemDetails", OnRequestItemDetailsClicked);
            //g.AddButton("QueryItems", OnQueryItemsClicked);
            panelHelper.AddButton("RunCallbacks", OnRunCallbacksClicked);

            var bufferedToggle = panelHelper.AddCheckbox("Buffered Log", Log.Buffered, (val) => Log.Buffered = val) as UICheckBox;

            bufferedToggle.eventVisibilityChanged += new PropertyChangedEventHandler <bool>((_, ___) => bufferedToggle.isChecked = Log.Buffered);
        }
示例#5
0
        public static void Make(ExtUITabstrip tabStrip)
        {
            UIHelper panelHelper = tabStrip.AddTabPage("Subscriptions");

            UIButton   button;
            UICheckBox checkBox;

            //g.AddButton("Perform All", OnPerformAllClicked);

            button         = panelHelper.AddButton("Refresh workshop items (checks for bad items)", RequestItemDetails) as UIButton;
            button.tooltip = "checks for missing/partially downloaded/outdated items";

            button         = panelHelper.AddButton("unsubscribe from deprecated workshop items [EXPERIMENTAL] ", () => CheckSubsUtil.Instance.UnsubDepricated()) as UIButton;
            button.tooltip = "if steam does not return item path, i assume its deprecated.";

            button           = panelHelper.AddButton("Resubscribe to all broken downloads (exits game) [EXPERIMENTAL]", CheckSubsUtil.ResubcribeExternally) as UIButton;
            button.tooltip   = "less steam can hide problems. if you use less steam please click 'Refresh workshop items' to get all broken downloads";
            button.isVisible = false; //hide for now.

            checkBox = panelHelper.AddCheckbox(
                "Delete unsubscribed items on startup",
                Config.DeleteUnsubscribedItemsOnLoad,
                val => {
                ConfigUtil.Config.DeleteUnsubscribedItemsOnLoad = val;
                ConfigUtil.SaveConfig();
            }) as UICheckBox;

            button = panelHelper.AddButton("Delete Now", () => CheckSubsUtil.Instance.DeleteUnsubbed()) as UIButton;
            Settings.Pairup(checkBox, button);

            {
                var g = panelHelper.AddGroup("Broken downloads") as UIHelper;

                tfSteamPath_ = g.AddTextfield(
                    text: "Steam Path: ",
                    defaultContent: ConfigUtil.Config.SteamPath ?? "",
                    eventChangedCallback: _ => { },
                    eventSubmittedCallback : delegate(string text) {
                    if (CheckSteamPath(text))
                    {
                        ConfigUtil.Config.SteamPath = text;
                        ConfigUtil.SaveConfig();
                    }
                }) as UITextField;
                tfSteamPath_.width   = 650;
                tfSteamPath_.tooltip = "Path to steam.exe";
                g.AddButton("Redownload broken downloads [EXPERIMENTAL]", delegate() {
                    try {
                        var path = tfSteamPath_.text;
                        if (CheckSteamPath(path))
                        {
                            CheckSubsUtil.ReDownload(path);
                            Prompt.Warning("Exit",
                                           "Please exit to desktop, wait for steam download to finish, and then start Cities skylines again.\n" +
                                           "Should this not work the first time, please try again.");
                        }
                    } catch (Exception ex) {
                        ex.Log();
                    }
                });
            }

            //b = g.AddButton("delete duplicates", OnPerformAllClicked) as UIButton;
            //b.tooltip = "when excluded mod is updated, and included duplicate of it is created";
        }