-
-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added an Image to Pixel-art Editor Plugin. (#1910)
* Added an Image to Pixel-art Editor Plugin. * Added an Image to Pixel-art Editor Plugin. * Added an Image to Pixel-art Editor Plugin.
- Loading branch information
Showing
14 changed files
with
34,497 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using TEdit.ViewModel; | ||
using System.Windows; | ||
|
||
namespace TEdit.Editor.Plugins | ||
{ | ||
public class ImageToPixelartEditor : BasePlugin | ||
{ | ||
// Private field to keep a reference to the ImageToPixelartEditorView window. | ||
private ImageToPixelartEditorView _view; | ||
|
||
// Constructor for ImageToPixelartEditor. | ||
public ImageToPixelartEditor(WorldViewModel worldViewModel) : base(worldViewModel) | ||
{ | ||
Name = "Image To Pixelart Editor"; | ||
} | ||
|
||
// Method to execute the plugin functionality. | ||
public override void Execute() | ||
{ | ||
// No need to wait for world load due to the nature of this plugin. | ||
// if (_wvm.CurrentWorld == null) return; | ||
|
||
// Initialize and show the ImageToPixelartEditorView window as a non-modal window. | ||
_view = new ImageToPixelartEditorView(_wvm); // Pass down "_wvm" instance to the new window. | ||
_view.Show(); // Open as non-modal window. | ||
|
||
// Subscribe to the main window's Closed event. | ||
Application.Current.MainWindow.Closed += MainWindow_Closed; | ||
} | ||
|
||
// Event handler for the main window's Closed event. | ||
private void MainWindow_Closed(object sender, System.EventArgs e) | ||
{ | ||
// Close the ImageToPixelartEditorView window if it is open. | ||
_view?.Close(); | ||
} | ||
} | ||
} |
220 changes: 220 additions & 0 deletions
220
src/TEdit/Editor/Plugins/ImageToPixelartEditorView.xaml
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.