Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
cadon committed Feb 4, 2023
2 parents 025d62b + 04e8bb5 commit e37a9c3
Show file tree
Hide file tree
Showing 14 changed files with 785 additions and 609 deletions.
5 changes: 3 additions & 2 deletions ARKBreedingStats/ARKBreedingStats.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
<Compile Include="Pedigree\PedigreeCreatureCompact.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="uiControls\LibraryInfo.cs" />
<Compile Include="uiControls\StatSelector.cs">
<SubType>UserControl</SubType>
</Compile>
Expand Down Expand Up @@ -954,10 +955,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentFTP">
<Version>37.0.3</Version>
<Version>44.0.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers">
<Version>3.3.3</Version>
<Version>3.3.4</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
3 changes: 3 additions & 0 deletions ARKBreedingStats/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,9 @@
<setting name="LibraryGroupBySpecies" serializeAs="String">
<value>True</value>
</setting>
<setting name="LibraryColorInfoUseFilter" serializeAs="String">
<value>False</value>
</setting>
</ARKBreedingStats.Properties.Settings>
</userSettings>
</configuration>
976 changes: 509 additions & 467 deletions ARKBreedingStats/Form1.Designer.cs

Large diffs are not rendered by default.

22 changes: 20 additions & 2 deletions ARKBreedingStats/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ private void Form1_Load(object sender, EventArgs e)

LoadListViewSettings(tribesControl1.ListViewPlayers, "PlayerListColumnWidths", "PlayerListColumnDisplayIndices", "PlayerListSortColumn", "PlayerListSortAsc");

CbLibraryInfoUseFilter.Checked = Properties.Settings.Default.LibraryColorInfoUseFilter;

// load stat weights
double[][] custWd = Properties.Settings.Default.customStatWeights;
string[] custWs = Properties.Settings.Default.customStatWeightNames;
Expand Down Expand Up @@ -674,6 +676,10 @@ private void SpeciesSelector1OnSpeciesSelected(bool speciesChanged)
if (Properties.Settings.Default.ApplyGlobalSpeciesToLibrary)
listBoxSpeciesLib.SelectedItem = species;
}
else if (tabControlMain.SelectedTab == tabPageLibraryInfo)
{
LibraryInfo.SetColorInfo(speciesSelector1.SelectedSpecies, CbLibraryInfoUseFilter.Checked ? (IList<Creature>)ApplyLibraryFilterSettings(_creatureCollection.creatures).ToArray() : _creatureCollection.creatures, CbLibraryInfoUseFilter.Checked, tlpLibraryInfo);
}
else if (tabControlMain.SelectedTab == tabPagePedigree)
{
pedigree1.SetSpecies(species);
Expand Down Expand Up @@ -920,6 +926,7 @@ private void UpdateCreatureListings(Species species = null, bool keepCurrentlySe
breedingPlan1.BreedingPlanNeedsUpdate = true;
pedigree1.SetSpecies(forceUpdate: true);
raisingControl1.RecreateList();
LibraryInfo.ClearInfo();
}

/// <summary>
Expand Down Expand Up @@ -1292,6 +1299,7 @@ private void Form1_FormClosed(object sender, FormClosedEventArgs e)
Properties.Settings.Default.DisabledVariants = speciesSelector1.VariantSelector?.DisabledVariants?.ToArray();

Properties.Settings.Default.RaisingFoodLastSelected = raisingControl1.LastSelectedFood;
Properties.Settings.Default.LibraryColorInfoUseFilter = CbLibraryInfoUseFilter.Checked;

/////// save settings for next session
Properties.Settings.Default.Save();
Expand Down Expand Up @@ -1519,6 +1527,10 @@ private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
else if (_libraryNeedsUpdate)
FilterLibRecalculate();
}
else if (tabControlMain.SelectedTab == tabPageLibraryInfo)
{
LibraryInfo.SetColorInfo(speciesSelector1.SelectedSpecies, CbLibraryInfoUseFilter.Checked ? (IList<Creature>)ApplyLibraryFilterSettings(_creatureCollection.creatures).ToArray() : _creatureCollection.creatures, CbLibraryInfoUseFilter.Checked, tlpLibraryInfo);
}
else if (tabControlMain.SelectedTab == tabPagePedigree)
{
pedigree1.SetSpeciesIfNotSet(speciesSelector1.SelectedSpecies);
Expand Down Expand Up @@ -3630,11 +3642,17 @@ private void colorDefinitionsToClipboardToolStripMenuItem_Click(object sender, E
Clipboard.SetText(string.Join("\n", Values.V.Colors.ColorsList.Select(c => $"{c.Id,3}: {c}")));
}

private void copyColorInformationToClipboardToolStripMenuItem_Click(object sender, EventArgs e)
private void BtCopyLibraryColorToClipboard_Click(object sender, EventArgs e)
{
var colorInfo = _creatureCollection.GetColorInfo(speciesSelector1.SelectedSpecies);
LibraryInfo.SetColorInfo(speciesSelector1.SelectedSpecies, CbLibraryInfoUseFilter.Checked ? (IList<Creature>)ApplyLibraryFilterSettings(_creatureCollection.creatures).ToArray() : _creatureCollection.creatures, CbLibraryInfoUseFilter.Checked);
var colorInfo = LibraryInfo.GetSpeciesInfo();
Clipboard.SetText(string.IsNullOrEmpty(colorInfo) ? $"no color info available for species {speciesSelector1.SelectedSpecies}" : colorInfo);
SetMessageLabelText($"Color information about {speciesSelector1.SelectedSpecies} has been copied to the clipboard, you can paste it in a text editor to view it.", MessageBoxIcon.Information);
}

private void CbLibraryInfoUseFilter_CheckedChanged(object sender, EventArgs e)
{
LibraryInfo.SetColorInfo(speciesSelector1.SelectedSpecies, CbLibraryInfoUseFilter.Checked ? (IList<Creature>)ApplyLibraryFilterSettings(_creatureCollection.creatures).ToArray() : _creatureCollection.creatures, CbLibraryInfoUseFilter.Checked, tlpLibraryInfo);
}
}
}
11 changes: 6 additions & 5 deletions ARKBreedingStats/Form1.importSave.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using System.Threading.Tasks;
using System.Windows.Forms;
using ARKBreedingStats.utils;
using FluentFTP.Exceptions;

namespace ARKBreedingStats
{
Expand Down Expand Up @@ -176,7 +177,7 @@ await ImportSavegame.ImportCollectionFromSavegame(_creatureCollection, workingCo
}
}
}
var client = new FtpClient(ftpUri.Host, ftpUri.Port, credentials.Username, credentials.Password);
var client = new AsyncFtpClient(ftpUri.Host, credentials.Username, credentials.Password, ftpUri.Port);
string ftpPath = null;

try
Expand All @@ -193,7 +194,7 @@ await ImportSavegame.ImportCollectionFromSavegame(_creatureCollection, workingCo
// TaskCanceledException
// on cancelling it throws
// Cannot access a disposed object. Object name: 'System.Net.Sockets.Socket'.
await client.ConnectAsync(token: cancellationTokenSource.Token);
await client.Connect(token: cancellationTokenSource.Token);

progressDialog.StatusText = "Finding most recent file";
await Task.Yield();
Expand All @@ -219,7 +220,7 @@ await ImportSavegame.ImportCollectionFromSavegame(_creatureCollection, workingCo
await Task.Yield();

var filePath = Path.Combine(workingCopyFolder, Path.GetFileName(ftpPath));
await client.DownloadFileAsync(filePath, ftpPath, FtpLocalExists.Overwrite, FtpVerify.Retry, progressDialog, token: cancellationTokenSource.Token);
await client.DownloadFile(filePath, ftpPath, FtpLocalExists.Overwrite, FtpVerify.Retry, progressDialog, token: cancellationTokenSource.Token);
await Task.Delay(500, cancellationTokenSource.Token);

if (filePath.EndsWith(".gz"))
Expand Down Expand Up @@ -302,10 +303,10 @@ private async Task<string> DecompressGZippedFileAsync(string filePath, Cancellat
return newFileName;
}

public async Task<FtpListItem> GetLastModifiedFileAsync(FtpClient client, Uri ftpUri, string fileRegex, CancellationToken cancellationToken)
public async Task<FtpListItem> GetLastModifiedFileAsync(AsyncFtpClient client, Uri ftpUri, string fileRegex, CancellationToken cancellationToken)
{
var folderUri = new Uri(ftpUri, ".");
var listItems = await client.GetListingAsync(folderUri.AbsolutePath, cancellationToken);
var listItems = await client.GetListing(folderUri.AbsolutePath, cancellationToken);

Regex fileNameRegex;
if (!fileRegex.Contains("(?<"))
Expand Down
2 changes: 1 addition & 1 deletion ARKBreedingStats/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("0.50.9.0")]
[assembly: AssemblyFileVersion("0.50.10.0")]
[assembly: NeutralResourcesLanguage("en")]

14 changes: 13 additions & 1 deletion ARKBreedingStats/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions ARKBreedingStats/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -536,5 +536,8 @@
<Setting Name="LibraryGroupBySpecies" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="LibraryColorInfoUseFilter" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>
2 changes: 1 addition & 1 deletion ARKBreedingStats/_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"ARK Smart Breeding": {
"Id": "ARK Smart Breeding",
"Category": "main",
"version": "0.50.9.0"
"version": "0.50.10.0"
},
"SpeciesColorImages": {
"Id": "SpeciesColorImages",
Expand Down
26 changes: 13 additions & 13 deletions ARKBreedingStats/json/values/_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"mod": { "id": "1083349027", "tag": "SpeedyFlyers", "title": "Najs Speedy Flyers" }
},
"1090809604-Pyria.json": {
"version": "351.6.1667005010",
"version": "356.5.1671741134.1",
"mod": { "id": "1090809604", "tag": "Pyria", "title": "Pyria: Mythos Evolved" }
},
"1092784125-Gryphons.json": {
Expand All @@ -23,7 +23,7 @@
}
},
"1125442531-Gaia.json": {
"version": "340.3.1630493486.1",
"version": "356.5.1630493486",
"mod": { "id": "1125442531", "tag": "Gaia", "title": "Gaia" }
},
"1136390783-PhoenixBreeding.json": {
Expand All @@ -35,7 +35,7 @@
"mod": { "id": "1139775728", "tag": "Confuciusornis", "title": "Confuciusornis" }
},
"1169020368-Trex.json": {
"version": "356.4.1675003923",
"version": "356.5.1675401434",
"mod": { "id": "1169020368", "tag": "Trex", "title": "Ark Creature Rebalance (AG Reborn)" }
},
"1178308359-ShadDragon.json": {
Expand Down Expand Up @@ -72,7 +72,7 @@
"mod": { "id": "1356703358", "tag": "Primal_Fear_Noxious_Creatures", "title": "Primal Fear Noxious Creatures" }
},
"1373744537-AC2.json": {
"version": "355.16.1674258851",
"version": "356.5.1675373582",
"mod": { "id": "1373744537", "tag": "AC2", "title": "Additional Creatures 2: Wild Ark" }
},
"1405944717-Project_Evolution.json": {
Expand Down Expand Up @@ -104,11 +104,11 @@
"mod": { "id": "1523045986", "tag": "Paranoia", "title": "Additional Creatures 2: Paranoia!" }
},
"1565015734-BetterDinosTest.json": {
"version": "348.7.1659637030",
"version": "356.5.1659982227",
"mod": { "id": "1565015734", "tag": "BetterDinosTest", "title": "Better Dinos" }
},
"1576299694-ElementalDinos.json": {
"version": "355.3.1667827331",
"version": "356.5.1667827331",
"mod": { "id": "1576299694", "tag": "ElementalDinos", "title": "Elemental Ark" }
},
"1587391872-FasterFlyers.json": {
Expand All @@ -129,7 +129,7 @@
"mod": { "id": "1633860796", "tag": "DE_Breedable_RockDrakes", "title": "Dark Edges Breedable Rock Drakes" }
},
"1652120435-AtlasPort.json": {
"version": "354.4.1669849853",
"version": "356.5.1672480004",
"mod": { "id": "1652120435", "tag": "AtlasPort", "title": "Shad's Atlas Imports" }
},
"1654255131-AtlasImports.json": {
Expand Down Expand Up @@ -166,7 +166,7 @@
"mod": { "id": "1729512589", "tag": "Brachiosaurus", "title": "ARK Additions: Brachiosaurus!" }
},
"1734595558-Pyria2.json": {
"version": "354.4.1669482607",
"version": "356.5.1669482607",
"mod": { "id": "1734595558", "tag": "Pyria2", "title": "Pyria: The Second Chapter" }
},
"1768499278-BalancedJPE.json": {
Expand Down Expand Up @@ -235,7 +235,7 @@
"mod": { "id": "2000326197", "tag": "ExtraResources", "title": "Event Assets" }
},
"2003934830-Beasts.json": {
"version": "355.16.1674245153",
"version": "356.5.1674614859",
"mod": { "id": "2003934830", "tag": "Beasts", "title": "Prehistoric Beasts" }
},
"2019846325-ApexMod.json": {
Expand All @@ -259,7 +259,7 @@
"mod": { "id": "2117881804", "tag": "FiresFixes", "title": "Fire's Fixes" }
},
"2135314513-CI_Dinos.json": {
"version": "340.3.1623948861",
"version": "356.5.1623948861",
"mod": { "id": "2135314513", "tag": "CI_Dinos", "title": "Crystal Isles Dino Addition" }
},
"2447186973-ArkOmega.json": {
Expand All @@ -279,15 +279,15 @@
"mod": { "id": "814833973", "tag": "Wyvern_Mating", "title": "Wyvern Mating" }
},
"839162288-Primal_Fear.json": {
"version": "345.19.1651177976",
"version": "356.5.1651177976",
"mod": { "id": "839162288", "tag": "Primal_Fear", "title": "Primal Fear" }
},
"883957187-WyvernWorld.json": {
"version": "342.13.1638248815",
"mod": { "id": "883957187", "tag": "WyvernWorld", "title": "Wyvern World" }
},
"893735676-AE.json": {
"version": "355.12.1672955615",
"version": "356.5.1672955615.1",
"mod": { "id": "893735676", "tag": "AE", "title": "Ark Eternal" }
},
"895711211-ClassicFlyers.json": {
Expand Down Expand Up @@ -317,7 +317,7 @@
}
},
"values.json": {
"version": "355.3.10136424"
"version": "356.5.10438696"
}
}
}
Loading

0 comments on commit e37a9c3

Please sign in to comment.