Changeset - d036e3a47323
[Not reviewed]
Merge default
0 5 0
Tess Snider (Malkyne) - 3 years ago 2021-07-24 10:27:30
this@malkyne.org
Merge
5 files changed with 51 insertions and 13 deletions:
0 comments (0 inline, 0 general)
.hgtags
Show inline comments
...
 
@@ -2,3 +2,4 @@ f419334a476f33b0b93cbd02eba7a44f08f89733
 
99f3d61e20d74cac591cb81f69afc7be0eae0a59 R_T10_1.1
 
d7b40cfbe0f3d20f25a52944cf8c0f1ecdc81471 R_T10_1.2
 
6919080271d55f3f138660bb37dccd116249d13e R_T10_1.3
 
e7cc8ddcbf589086578134ec292ad8b7c739237c R_T10_1.4
DesertPaintCodex.csproj
Show inline comments
...
 
@@ -6,6 +6,7 @@
 
    <ApplicationIcon>Assets\desert_paint_codex_icon.ico</ApplicationIcon>
 
    <StartupObject>DesertPaintCodex.Program</StartupObject>
 
    <Platforms>AnyCPU;x64</Platforms>
 
    <Version>1.4.0</Version>
 
  </PropertyGroup>
 
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
 
    <PlatformTarget>x64</PlatformTarget>
Models/PlayerProfile.cs
Show inline comments
...
 
@@ -129,36 +129,69 @@ namespace DesertPaintCodex.Models
 
        {
 
            using StreamReader reader = new(ppFile);
 
            using StreamWriter writer = new(dpFile, false);
 
            string?            line;
 
            string? line;
 
            while ((line = reader.ReadLine()) != null)
 
            {
 
                string[] tokens = line.Split('|');
 
                //if ((tokens.Length > 0) && (tokens [0] != "//"))
 
                if ((tokens.Length == 5) && (tokens[0].Trim() != "//"))
 
                {
 
                    string reagent1  = tokens[0].Trim();
 
                    string reagent2  = tokens[1].Trim();
 
                    string reagent1Name  = tokens[0].Trim();
 
                    string reagent2Name  = tokens[1].Trim();
 
                    string colorCode = tokens[2].Trim();
 
                    string change1   = tokens[3].Trim();
 
                    string change2   = tokens[4].Trim();
 

	
 
                    Reagent reagent1 = ReagentService.GetReagent(reagent1Name);
 
                    Reagent reagent2 = ReagentService.GetReagent(reagent2Name);
 

	
 
                    if (reagent1 == null || reagent2 == null) continue;
 

	
 
                    bool hasChange1 = int.TryParse(change1, out _);
 
                    bool hasChange2 = int.TryParse(change2, out _);
 

	
 
                    // Write reaction.
 
                    switch (colorCode)
 
                    {
 
                        case "W":
 
                            WriteReaction(writer, reagent1, reagent2, change1, change1, change1);
 
                            WriteReaction(writer, reagent2, reagent1, change2, change2, change2);
 
                            if (hasChange1)
 
                            {
 
                                WriteReaction(writer, reagent1Name, reagent2Name, change1, change1, change1);
 
                            }
 
                            if (hasChange2)
 
                            {
 
                                WriteReaction(writer, reagent2Name, reagent1Name, change2, change2, change2);
 
                            }
 
                            break;
 
                        case "R":
 
                            WriteReaction(writer, reagent1, reagent2, change1, "0", "0");
 
                            WriteReaction(writer, reagent2, reagent1, change2, "0", "0");
 
                            if (hasChange1)
 
                            {
 
                                WriteReaction(writer, reagent1Name, reagent2Name, change1, "0", "0");
 
                            }
 
                            if (hasChange2)
 
                            {
 
                                WriteReaction(writer, reagent2Name, reagent1Name, change2, "0", "0");
 
                            }
 
                            break;
 
                        case "G":
 
                            WriteReaction(writer, reagent1, reagent2, "0", change1, "0");
 
                            WriteReaction(writer, reagent2, reagent1, "0", change2, "0");
 
                            if (hasChange1)
 
                            {
 
                                WriteReaction(writer, reagent1Name, reagent2Name, "0", change1, "0");
 
                            }
 
                            if (hasChange2)
 
                            {
 
                                WriteReaction(writer, reagent2Name, reagent1Name, "0", change2, "0");
 
                            }
 
                            break;
 
                        case "B":
 
                            WriteReaction(writer, reagent1, reagent2, "0", "0", change1);
 
                            WriteReaction(writer, reagent2, reagent1, "0", "0", change2);
 
                            if (hasChange1)
 
                            {
 
                                WriteReaction(writer, reagent1Name, reagent2Name, "0", "0", change1);
 
                            }
 
                            if (hasChange2)
 
                            {
 
                                WriteReaction(writer, reagent2Name, reagent1Name, "0", "0", change2);
 
                            }
 
                            break;
 
                    }
 
                }
Properties/PublishProfiles/Win64 Self-Contained.pubxml
Show inline comments
...
 
@@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=
 
  <PropertyGroup>
 
    <Configuration>Release</Configuration>
 
    <Platform>x64</Platform>
 
    <PublishDir>publish\win-x64</PublishDir>
 
    <PublishDir>publish\win-x64\DesertPaintCodex</PublishDir>
 
    <PublishProtocol>FileSystem</PublishProtocol>
 
    <TargetFramework>net5.0</TargetFramework>
 
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
ViewModels/ExperimentLogViewModel.cs
Show inline comments
...
 
@@ -135,7 +135,10 @@ namespace DesertPaintCodex.ViewModels
 
        {
 
            int oldPos = list.IndexOf(test);
 

	
 
            if (((oldPos > 0) || (test.CompareTo(list[oldPos - 1]) > 0))
 
            // If the item is first in the list or the previous item is valued < the test
 
            // And either the item is last in the list or the next item in the list is valued > than the item
 
            // Don't move it
 
            if (((oldPos == 0) || (test.CompareTo(list[oldPos - 1]) > 0))
 
                && ((oldPos == list.Count - 1) || (test.CompareTo(list[oldPos + 1]) < 0))) return oldPos; // No need to move.
 

	
 
            list.RemoveAt(oldPos);
0 comments (0 inline, 0 general)