Exemplo n.º 1
0
 private void SetModState(ModInfoHolder modInfo, ModInfoHolder.ModState newState)
 {
     if (newState == modInfo.State)
     {
         return;
     }
     //if (modInfo.State == ModInfoHolder.ModState.Disabled)
     //{
     //    SetLocalModDisabled(ref modInfo.FilePath, false);
     //}
     modInfo.State = newState;
     ModListStoreLocal.SetValue(modInfo.TreeIter, (int)TreeColumnInfo.State, newState == ModInfoHolder.ModState.Enabled);
     //if (newState == ModInfoHolder.ModState.Disabled)
     //{
     //    SetLocalModDisabled(ref modInfo.FilePath, true);
     //    Log("Relocated " + modInfo.FancyName());
     //    return;
     //}
     modInfo.EditModJson("Enable", modInfo.State == ModInfoHolder.ModState.Enabled);
     if (newState == ModInfoHolder.ModState.Enabled)
     {
         Log("Activated " + modInfo.FancyName() + (EnableDependencies(modInfo) ? " and dependencies" : ""));
     }
     else if (newState == ModInfoHolder.ModState.Inactive)
     {
         Log("Deactivated " + modInfo.FancyName());
     }
 }
Exemplo n.º 2
0
    private void UpdateModInfoUI(ModInfoHolder modInfo)
    {
        labelModTitle.Markup = "<b>" + modInfo.FancyName() + "</b>";
        labelModLink.Text    = modInfo.Site;
        labelModDesc.Text    = modInfo.InlineDescription;
        if (TabPagerMods.CurrentPage == 0)
        {
            comboboxModState.Visible = true;
            buttonModDownload.Label  = "Update";
            buttonModRemove.Visible  = true;

            comboboxModState.Active = (int)modInfo.State;
        }
        else
        {
            comboboxModState.Visible = false;
            buttonModDownload.Label  = "Download";
            buttonModRemove.Visible  = false;
        }
    }