Skip to content
This repository has been archived by the owner on Mar 2, 2024. It is now read-only.

Commit

Permalink
Add fancy naming to TTMM
Browse files Browse the repository at this point in the history
Also to register update to TTQMM
  • Loading branch information
Aceba1 committed May 21, 2019
1 parent d4a6909 commit d608daa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
Binary file modified Executable/TerraTech Mod Manager.exe
Binary file not shown.
22 changes: 18 additions & 4 deletions TerraTech Mod Manager/NewMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ private void listView1_SelectedIndexChanged(object sender, EventArgs e)
if (listViewCompactMods.SelectedItems.Count != 0)
{
var modInfo = GetModInfoFromIndex(listViewCompactMods.SelectedItems[0].Index);
labelModName.Text = modInfo.Name;
labelModName.Text = modInfo.FancyName();
labelModIDesc.Text = modInfo.InlineDescription;

buttonDownloadMod.Visible = modInfo.Site != null && modInfo.Site.Length > 1;
Expand Down Expand Up @@ -880,7 +880,7 @@ private bool AddModDownload(ModInfo ModBeingDownloaded, ListViewItem itemToRemov
{
if (GithubMods.TryGetValue(modname, out ModInfo modInfo))
{
var response = MessageBox.Show(modInfo.Name + " is needed for this mod to work.\nDownload as well?", "Download Mod", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
var response = MessageBox.Show(modInfo.FancyName() + " is needed for this mod to work.\nDownload as well?", "Download Mod", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
if (response == DialogResult.Yes)
{
neededmods.Add(modInfo);
Expand Down Expand Up @@ -1107,6 +1107,20 @@ public ModInfo()

}

public string FancyName()
{
string result = Name.Substring(Name.StartsWith("TTQMM-") ? 6 : 0).Replace("-", "").Replace("_", "");
for (int i = 1; i < result.Length; i++)
{
if (char.IsUpper(result[i]) && char.IsLower(result[i - 1]))
{
result = result.Insert(i, " ");
i++;
}
}
return result;
}

public ModInfo(TerraTechModManager.Downloader.GetRepos.GithubRepoItem repo)
{
State = ModState.Server;
Expand Down Expand Up @@ -1173,7 +1187,7 @@ public ModInfo(TerraTechModManager.Downloader.GetRepos.GithubRepoItem repo)

public ListViewItem GetListViewItem(ListViewGroup Group, bool IsLocal) => new ListViewItem(new string[] {
"",
Name,
FancyName(),
InlineDescription,
Author,
IsLocal ? Name : CloudName
Expand All @@ -1185,7 +1199,7 @@ public ModInfo(TerraTechModManager.Downloader.GetRepos.GithubRepoItem repo)

public ListViewItem GetListViewItem(ListViewGroup Group, bool IsLocal, bool Checked) => new ListViewItem(new string[] {
"",
Name,
FancyName(),
InlineDescription,
Author,
IsLocal ? Name : CloudName
Expand Down
2 changes: 1 addition & 1 deletion TerraTech Mod Manager/Start.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace TerraTechModManager
public partial class Start : Form
{
#warning Change Version_Number with every update!
public const string Version_Number = "1.4.1";
public const string Version_Number = "1.4.2";

bool finished = false;
/// <summary>
Expand Down

0 comments on commit d608daa

Please sign in to comment.