Skip to content

Commit

Permalink
v1.5.0!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubberduckycooly committed Jul 6, 2021
1 parent c025d63 commit db8f329
Show file tree
Hide file tree
Showing 25 changed files with 1,752 additions and 426 deletions.
2 changes: 1 addition & 1 deletion AnimationEditor/AboutWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<Separator/>
<TextBlock Text="Additional fixes by:"/>
<TextBlock Text="thesupersonic16"/>
<TextBlock Text="More Fixes and RSDKvRS and RSDKv1 Support by:" Width="298"/>
<TextBlock Text="More Fixes, RSDKv1 and RSDKv2 Support by:"/>
<TextBlock Text="Rubberduckycooly"/>
<TextBlock><Hyperlink NavigateUri="https://github.com/Rubberduckycooly/RSDK"><Run Text="https://github.com/Rubberduckycooly/RSDK"/></Hyperlink></TextBlock>
</StackPanel>
Expand Down
5 changes: 5 additions & 0 deletions AnimationEditor/AnimationEditor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
Expand All @@ -78,6 +81,7 @@
<Compile Include="AboutWindow.xaml.cs">
<DependentUpon>AboutWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Classes\Settings.cs" />
<Compile Include="Hitbox3Window.xaml.cs">
<DependentUpon>Hitbox3Window.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -146,6 +150,7 @@
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include=".editorconfig" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down
91 changes: 91 additions & 0 deletions AnimationEditor/Classes/Settings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using System.IO;

namespace AnimationEditor
{
public static class Settings
{
public static string GetAppDataPath()
{
if (!Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\RSDK Animation Editor")) Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\RSDK Animation Editor");
return Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\RSDK Animation Editor";
}

private static string FilePath { get => GetAppDataPath() + "\\appConfig.json"; }

public class Instance
{
public List<RecentFile> RecentFiles { get; set; } = new List<RecentFile>();

public bool exportFullJson = false;

public class RecentFile
{
public string FilePath { get; set; }
public int Format { get; set; }

public RecentFile(string filePath = "", int format = 5)
{
FilePath = filePath;
Format = format;
}
}
}

public static Instance Default { get; set; }

public static void Init()
{
Reload();
}
public static void Save()
{
try
{
string json = JsonConvert.SerializeObject(Default);
File.WriteAllText(FilePath, json);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
public static void Reload()
{
try
{
if (!File.Exists(FilePath)) File.Create(FilePath).Close();
string json = File.ReadAllText(FilePath);
try
{
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.ObjectCreationHandling = ObjectCreationHandling.Replace;
Instance result = JsonConvert.DeserializeObject<Instance>(json, settings);
if (result != null) Default = result;
else Default = new Instance();
}
catch
{
Default = new Instance();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Default = new Instance();
}

}
public static void Reset()
{
Default = new Instance();
Save();
Reload();
}
}
}
12 changes: 6 additions & 6 deletions AnimationEditor/Hitbox3Window.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
<ComboBox DockPanel.Dock="Top" Margin="0 0 0 5" SelectedIndex="{Binding SelectedHitboxIndex, Mode=TwoWay}">
<TextBlock Text="Floor (outer box)"/>
<TextBlock Text="Floor (inner box)"/>
<TextBlock Text="Ceiling (outer box)"/>
<TextBlock Text="Ceiling (inner box)"/>
<TextBlock Text="Wall left (outer box)"/>
<TextBlock Text="Wall left (inner box)"/>
<TextBlock Text="Wall right (outer box)"/>
<TextBlock Text="Wall right (inner box)"/>
<TextBlock Text="Roof (outer box)"/>
<TextBlock Text="Roof (inner box)"/>
<TextBlock Text="LWall (outer box)"/>
<TextBlock Text="LWall (inner box)"/>
<TextBlock Text="RWall (outer box)"/>
<TextBlock Text="RWall (inner box)"/>
</ComboBox>
<GroupBox DockPanel.Dock="Top" Header="Hitbox" Margin="0 0 0 5"
IsEnabled="{Binding IsHitboxSelected}">
Expand Down
Loading

0 comments on commit db8f329

Please sign in to comment.