示例#1
0
 internal ModLocalization(SemiLoader.ModInfo owner, string path, ID target_lang, StringTable target_table, bool allow_overwrite = false, FormatType format = FormatType.Gungeon)
 {
     TargetLanguageID  = Registry.Languages.ValidateExisting(target_lang);
     TargetStringTable = target_table;
     Path          = path;
     Owner         = owner;
     OverwriteMode = allow_overwrite;
     Format        = format;
 }
示例#2
0
        internal static dfScrollPanel CreateModOptionsPage(SemiLoader.ModInfo mod)
        {
            var tab = (Patches.dfScrollPanel)CreateScrollPanel();

            Patches.FullOptionsMenuController.Instance.ModSpecificTabs.Add(tab);

            string str = "";

            if (mod.Config.Name != null)
            {
                str = mod.Config.Name;
            }
            else
            {
                str = mod.Config.ID;
            }

            if (mod.Config.Version != null)
            {
                str += $" {mod.Config.Version}";
            }
            if (mod.Config.Author != null)
            {
                str += $" by {mod.Config.Author}";
            }

            CreateMenuButton(tab, str, false, true);
            if (mod.Config.Description != null)
            {
                CreateMenuButton(tab, mod.Config.Description, false, true);
            }
            var namespace_str = string.Format(I18N.GetString(I18N.StringTable.UI, "#semi:REGISTERED_UNDER"), mod.Config.ID);

            CreateMenuButton(tab, namespace_str, false, true).LanguageChanged += (obj) => {
                ((dfButton)obj).Text = string.Format(I18N.GetString(I18N.StringTable.UI, "#semi:REGISTERED_UNDER"), mod.Config.ID);
            };

            if (mod.Instance.MenuOptions.Count == 0)
            {
                CreateMenuButton(tab, "#semi:NO_MOD_OPTIONS", true, true);
            }

            var button = CreateMenuButton(Patches.FullOptionsMenuController.Instance.TabMods, mod.Config.Name ?? mod.Config.ID, false);

            button.Click += (control, mouseEvent) => {
                Patches.FullOptionsMenuController.Instance.ToggleToPanel(tab);
            };

            return(tab);
        }