Skip to content

Commit

Permalink
2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubberduckycooly committed Jul 4, 2019
1 parent b62f01d commit 911b77f
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 15 deletions.
2 changes: 2 additions & 0 deletions AnimationEditor/AnimationEditor.csproj
Expand Up @@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -44,6 +45,7 @@
<Reference Include="PresentationFramework.Aero2" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
Expand Down
Binary file added AnimationEditor/Icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions AnimationEditor/MainWindow.xaml.cs
Expand Up @@ -34,6 +34,22 @@ public partial class MainWindow : Window
public static int ForcePlaybackDuration = 256;
public static int ForcePlaybackSpeed = 128;

public string WindowName
{
set
{
this.Title = value;
}
}

public string DefaultWindowName
{
get
{
return $"RSDK Animation Editor v{System.Reflection.Assembly.GetExecutingAssembly().GetName().Version}";
}
}

public MainWindow()
{
DefaultBorderBrush = (Brush)FindResource("ComboBoxBorder");
Expand All @@ -48,6 +64,7 @@ public MainWindow()
HitboxColorPicker.SelectedColorChanged += ColorPicker_SelectedColorChanged;
AxisColorPicker.SelectedColorChanged += ColorPicker_SelectedColorChanged;
BGColorPicker.SelectedColorChanged += ColorPicker_SelectedColorChanged;
WindowName = DefaultWindowName;
}

private void PlaybackService_OnFrameChanged(PlaybackService obj)
Expand Down
4 changes: 2 additions & 2 deletions AnimationEditor/Properties/AssemblyInfo.cs
Expand Up @@ -10,9 +10,9 @@
[assembly: AssemblyTitle("RSDK Animation Editor")]
[assembly: AssemblyDescription("An animation editor for the animation files supported by the RSDK")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Xeeynamo/Rubberduckycooly/SuperSonic16")]
[assembly: AssemblyCompany("Xeeynamo/Rubberduckycooly/SuperSonic16/Carjem")]
[assembly: AssemblyProduct("RSDK Animation Editor")]
[assembly: AssemblyCopyright("Copyright © 2017-2019")]
[assembly: AssemblyCopyright("Copyright © 2017-2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
34 changes: 26 additions & 8 deletions AnimationEditor/Services/FileHandler.cs
Expand Up @@ -54,12 +54,25 @@ public void OpenFile(string file, EngineType type = EngineType.Invalid)
#endregion

#region Load File Methods

private static string GetFilenameAndFolder(string path)
{
string dir = "";
string pth = Path.GetFileName(path);
string tmp = path.Replace(pth, "");
DirectoryInfo di = new DirectoryInfo(tmp);
dir = di.Name;
string displayPath = dir + "/" + pth;
return displayPath;
}

public void LoadFile(string filepath, EngineType type = EngineType.Invalid)
{
try
{
Instance.ViewModel.LoadedAnimationFile = new Animation(Instance.AnimationType);
Instance.ViewModel.AnimationFilepath = filepath;
Instance.WindowName = Instance.DefaultWindowName + " - " + GetFilenameAndFolder(filepath);
Instance.ViewModel.LoadedAnimationFile.ImportFrom((type != EngineType.Invalid ? type : Instance.AnimationType), filepath);
LoadAnimationTextures(filepath);
}
Expand Down Expand Up @@ -89,9 +102,11 @@ public void LoadFile(OpenFileDialog fd)
Instance.AnimationType = EngineType.RSDKv5;
break;
case 1:
MessageBoxResult result = RSDKrU.MessageBox.ShowYesNo("Which version is this animation file for?", "Help Me!", "RSDKv2 (Sonic CD)", "RSDKvB (Sonic 1/2 2013)");
if (result == MessageBoxResult.Yes) Instance.AnimationType = EngineType.RSDKv2;
else Instance.AnimationType = EngineType.RSDKvB;
//vB and v2 are identical, no need to check, just pretend we know
//MessageBoxResult result = RSDKrU.MessageBox.ShowYesNo("Which version is this animation file for?", "Help Me!", "RSDKv2 (Sonic CD)", "RSDKvB (Sonic 1/2 2013)");
//if (result == MessageBoxResult.Yes)
Instance.AnimationType = EngineType.RSDKv2;
//else Instance.AnimationType = EngineType.RSDKvB;
break;
case 2:
Instance.AnimationType = EngineType.RSDKv1;
Expand Down Expand Up @@ -127,9 +142,11 @@ public void SaveFileAs()
Instance.AnimationType = EngineType.RSDKv5;
break;
case 1:
MessageBoxResult result = RSDKrU.MessageBox.ShowYesNo("Which version is this animation file for?", "Help Me!", "RSDKv2 (Sonic CD)", "RSDKvB (Sonic 1/2 2013)");
if (result == MessageBoxResult.Yes) Instance.AnimationType = EngineType.RSDKv2;
else Instance.AnimationType = EngineType.RSDKvB;
//v2 and vB are identical
//MessageBoxResult result = RSDKrU.MessageBox.ShowYesNo("Which version is this animation file for?", "Help Me!", "RSDKv2 (Sonic CD)", "RSDKvB (Sonic 1/2 2013)");
//if (result == MessageBoxResult.Yes)
Instance.AnimationType = EngineType.RSDKv2;
//else Instance.AnimationType = EngineType.RSDKvB;
break;
case 2:
Instance.AnimationType = EngineType.RSDKv1;
Expand All @@ -154,6 +171,7 @@ public void UnloadAnimationData()
InitlizeSpriteSheets();
Instance.ViewModel.NullSpriteSheetList.Clear();
Instance.IntilizePlayback(true);
Instance.WindowName = Instance.DefaultWindowName;
}

public string GetImagePath(string path, string parentDirectory)
Expand Down Expand Up @@ -443,13 +461,13 @@ private EngineType GetInputGestureTextEngineType(string gesture)

EngineType DetermineVersionManually()
{
MessageBoxResult result = RSDKrU.MessageBox.ShowYesNoCancel("Which version is this animation file for?", "Help Me!", "RSDKv2 (CD)", "RSDKvB (Sonic 1/2)", "RSDKvRS (Retro Sonic)");
MessageBoxResult result = RSDKrU.MessageBox.ShowYesNoCancel("Which version is this animation file for?", "Help Me!", "RSDKv2/RSDKvB (CD/1/1)", "RSDKv1 (Sonic Nexus)", "RSDKvRS (Retro Sonic)");
switch (result)
{
case MessageBoxResult.Yes:
return EngineType.RSDKv2;
case MessageBoxResult.No:
return EngineType.RSDKvB;
return EngineType.RSDKv1;
case MessageBoxResult.Cancel:
return EngineType.RSDKvRS;
default:
Expand Down
36 changes: 32 additions & 4 deletions AnimationEditor/ViewModels/MainViewModel.cs
Expand Up @@ -446,8 +446,23 @@ public short GetY()
}
public ushort GetID()
{
if (LoadedAnimationFile != null && SelectedAnimationIndex != -1 && SelectedFrameIndex != -1) return LoadedAnimationFile.Animations[SelectedAnimationIndex].Frames[SelectedFrameIndex].ID;
else return 0;
if (LoadedAnimationFile != null && SelectedAnimationIndex != -1 && SelectedFrameIndex != -1)
{
if (LoadedAnimationFile.engineType != EngineType.RSDKvRS)
{
return LoadedAnimationFile.Animations[SelectedAnimationIndex].Frames[SelectedFrameIndex].ID;

}
else
{
return LoadedAnimationFile.PlayerType;
}

}
else
{
return 0;
}
}
public short GetDelay()
{
Expand Down Expand Up @@ -493,8 +508,21 @@ public void SetY(short? value)
}
public void SetID(ushort? value)
{
if (LoadedAnimationFile != null && SelectedAnimationIndex != -1 && SelectedFrameIndex != -1 && value.HasValue) LoadedAnimationFile.Animations[SelectedAnimationIndex].Frames[SelectedFrameIndex].ID = value.Value;
else return;
if (LoadedAnimationFile != null && SelectedAnimationIndex != -1 && SelectedFrameIndex != -1 && value.HasValue)
{
if (LoadedAnimationFile.engineType == EngineType.RSDKvRS)
{
LoadedAnimationFile.PlayerType = (byte)value.Value;
}
else
{
LoadedAnimationFile.Animations[SelectedAnimationIndex].Frames[SelectedFrameIndex].ID = value.Value;
}
}
else
{
return;
}
}
public void SetDelay(short? value)
{
Expand Down
Binary file added AnimationEditor/discord-rpc.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion RSDK-Reverse
Submodule RSDK-Reverse updated 57 files
+0 −50 RSDK Reverse.sln
+0 −142 RSDKrU/WPF/DarkTheme.xaml
+2 −79 RSDKrU/WPF/LightTheme.xaml
+2 −2 RSDKrU/WPF/RSDK.AnimationEditor.Icons.xaml
+4 −4 RSDKrU/WPF/RSDK.ContextMenu.xaml
+123 −1,278 RSDKrU/WPF/RSDK.Skining.xaml
+5 −0 RSDKrU/WPF/RSDK.Toolbar.xaml
+1 −1 RSDKv1/BackgroundLayout.cs
+5 −5 RSDKv1/DataFile.cs
+6 −6 RSDKv1/GameConfig.cs
+1 −1 RSDKv1/GraphicsImage.cs
+2 −2 RSDKv1/Object.cs
+2 −2 RSDKv1/Scene.cs
+12 −0 RSDKv1/Script.cs
+50 −0 RSDKv1/Video.cs
+1 −1 RSDKv2/Animation.cs
+4 −4 RSDKv2/DataFile.cs
+6 −6 RSDKv2/GameConfig.cs
+1 −1 RSDKv2/GraphicsImage.cs
+3 −3 RSDKv2/Object.cs
+1 −1 RSDKv2/Palette.cs
+1 −0 RSDKv2/StageConfig.cs
+78 −264 RSDKv2/Video.cs
+0 −2 RSDKv5/AttributeInfo.cs
+6 −7 RSDKv5/GameConfig.cs
+7 −9 RSDKv5/RSDKConfig.cs
+0 −2 RSDKv5/RSDKv5.csproj
+0 −1 RSDKv5/Scene.cs
+2 −6 RSDKv5/SceneEntity.cs
+3 −32 RSDKv5/StageTiles.cs
+37 −8 RSDKv5/StaticObject.cs
+1 −1 RSDKvB/BitmapFont.cs
+3 −3 RSDKvB/Bytecode.cs
+2 −2 RSDKvB/DataFile.cs
+3 −3 RSDKvB/GameConfig.cs
+1 −1 RSDKvB/Model.cs
+1 −1 RSDKvB/Object.cs
+6 −6 RSDKvB/Scene.cs
+15 −33 RSDKvRS/Animation.cs
+6 −6 RSDKvRS/DataFile.cs
+1 −1 RSDKvRS/GraphicsImage.cs
+3 −3 RSDKvRS/Object.cs
+1 −1 RSDKvRS/Palette.cs
+0 −43 Retro-Sonic 02/Backgrounds.cs
+0 −42 Retro-Sonic 02/Object.cs
+0 −36 Retro-Sonic 02/Properties/AssemblyInfo.cs
+0 −58 Retro-Sonic 02/Retro-Sonic v2.csproj
+0 −46 Retro-Sonic 02/SaveFile.cs
+0 −135 Retro-Sonic 02/Scene.cs
+0 −24 Retro-Sonic 02/Tileconfig.cs
+0 −109 Retro-Sonic 02/ZoneDataFile.cs
+0 −8 Retro-Sonic 02/Zoneconfig.cs
+0 −45 Retro-Sonic 02/crv.cs
+0 −45 Retro-Sonic 02/mdf.cs
+0 −19 Retro-Sonic 02/tds.cs
+0 −26 Retro-Sonic 02/til.cs
+4 −28 Test/MainForm.cs

0 comments on commit 911b77f

Please sign in to comment.