diff --git a/PCK-Studio/Extensions/ImageExtensions.cs b/PCK-Studio/Extensions/ImageExtensions.cs index a1d2fd84..88bbf778 100644 --- a/PCK-Studio/Extensions/ImageExtensions.cs +++ b/PCK-Studio/Extensions/ImageExtensions.cs @@ -1,3 +1,20 @@ +/* Copyright (c) 2023-present miku-666 + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1.The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. +**/ using System; using System.Drawing; using System.Diagnostics; diff --git a/PCK-Studio/Features/CemuPanel.cs b/PCK-Studio/Features/CemuPanel.cs index e4e7d215..3dcf5117 100644 --- a/PCK-Studio/Features/CemuPanel.cs +++ b/PCK-Studio/Features/CemuPanel.cs @@ -1,11 +1,27 @@ -using System; +/* Copyright (c) 2023-present miku-666 + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1.The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. +**/ +using System; using System.Xml; using System.IO; using System.Linq; using System.Windows.Forms; using PckStudio.Extensions; using PckStudio.Classes.Misc; -using System.Xml.Serialization; using System.Diagnostics; namespace PckStudio.Features diff --git a/PCK-Studio/Features/PckManager.cs b/PCK-Studio/Features/PckManager.cs index 41f72ac8..6e6cacb8 100644 --- a/PCK-Studio/Features/PckManager.cs +++ b/PCK-Studio/Features/PckManager.cs @@ -1,4 +1,4 @@ -/* Copyright (c) 2022-present miku-666 +/* Copyright (c) 2023-present miku-666 * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. diff --git a/PCK-Studio/Forms/Editor/AnimationPictureBox.cs b/PCK-Studio/Forms/Editor/AnimationPictureBox.cs index 4985525f..d5fa6cfd 100644 --- a/PCK-Studio/Forms/Editor/AnimationPictureBox.cs +++ b/PCK-Studio/Forms/Editor/AnimationPictureBox.cs @@ -1,4 +1,21 @@ -using System; +/* Copyright (c) 2023-present miku-666 + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1.The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. +**/ +using System; using System.Threading; using System.Diagnostics; using System.Windows.Forms; @@ -14,6 +31,14 @@ namespace PckStudio.Forms.Editor { public bool IsPlaying => _isPlaying; + private const int TickInMillisecond = 50; // 1 InGame tick + + private bool _isPlaying = false; + private int currentAnimationFrameIndex = 0; + private Animation.Frame currentFrame; + private Animation _animation; + private CancellationTokenSource cts = new CancellationTokenSource(); + public void Start(Animation animation) { _animation = animation; @@ -36,14 +61,6 @@ namespace PckStudio.Forms.Editor currentFrame = SetAnimationFrame(index); } - private const int TickInMillisecond = 50; // 1 InGame tick - - private bool _isPlaying = false; - private int currentAnimationFrameIndex = 0; - private Animation.Frame currentFrame; - private Animation _animation; - private CancellationTokenSource cts = new CancellationTokenSource(); - protected override void OnPaint(PaintEventArgs pe) { pe.Graphics.InterpolationMode = InterpolationMode.NearestNeighbor; diff --git a/PCK-Studio/Forms/Editor/GameRuleFileEditor.cs b/PCK-Studio/Forms/Editor/GameRuleFileEditor.cs index 28136324..5e1e7872 100644 --- a/PCK-Studio/Forms/Editor/GameRuleFileEditor.cs +++ b/PCK-Studio/Forms/Editor/GameRuleFileEditor.cs @@ -1,4 +1,21 @@ -using System; +/* Copyright (c) 2023-present miku-666 + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1.The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. +**/ +using System; using System.Collections.Generic; using System.Drawing; using System.IO; @@ -11,7 +28,6 @@ using OMI.Workers.GameRule; using System.Diagnostics; using OMI.Formats.Pck; using PckStudio.Forms.Additional_Popups; -using PckStudio.Models; using PckStudio.Properties; namespace PckStudio.Forms.Editor @@ -54,12 +70,9 @@ namespace PckStudio.Forms.Editor public GameRuleFileEditor(PckFile.FileData file) : this() { _pckfile = file; - if (file.Size > 0) + using (var stream = new MemoryStream(file.Data)) { - using (var stream = new MemoryStream(file.Data)) - { - _file = OpenGameRuleFile(stream); - } + _file = OpenGameRuleFile(stream); } } diff --git a/PCK-Studio/Internal/Profiler.cs b/PCK-Studio/Internal/Profiler.cs index 922f05af..1c503d26 100644 --- a/PCK-Studio/Internal/Profiler.cs +++ b/PCK-Studio/Internal/Profiler.cs @@ -1,4 +1,21 @@ -using System; +/* Copyright (c) 2023-present miku-666 + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1.The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. +**/ +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; diff --git a/PCK-Studio/Internal/SettingsManager.cs b/PCK-Studio/Internal/SettingsManager.cs index a8e611b2..e0a7640c 100644 --- a/PCK-Studio/Internal/SettingsManager.cs +++ b/PCK-Studio/Internal/SettingsManager.cs @@ -1,11 +1,24 @@ -using System; +/* Copyright (c) 2023-present miku-666 + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1.The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. +**/ +using System; using System.Collections.Generic; using System.ComponentModel; using System.Configuration; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using PckStudio.Properties; namespace PckStudio.Internal