├── .gitattributes
├── .github
└── issue_template.md
├── .gitignore
├── Documentation
├── Images
│ ├── Desktop_01.png
│ ├── FAQ_Issues_01.png
│ ├── FAQ_Issues_02.png
│ ├── SEToolbox_Logo.jpg
│ ├── Update_01.png
│ ├── Update_02.png
│ ├── Update_03.png
│ └── Update_04.png
└── Shader Effects BuildTask and Templates.zip
├── License.rtf
├── Readme.md
├── SEToolbox.Image.Library
├── DxtUtil.cs
├── DxtUtilTexture.cs
├── Effects
│ ├── AlphaPixelEffect.cs
│ ├── DesaturatePixelEffect.cs
│ ├── EmissivePixelEffect.cs
│ ├── IPixelEffect.cs
│ ├── MaskPixelEffect.cs
│ └── PixelEffect.cs
├── ImageHelper.cs
├── ImageTextureUtil.cs
├── OctreeQuantizer.cs
├── PaletteQuantizer.cs
├── PaletteReplacerQuantizer.cs
├── Quantizer.cs
├── SEToolbox.ImageLibrary.csproj
└── Support
│ └── ReflectionUtil.cs
├── SEToolbox.Image.Shaders
├── EffectFiles
│ ├── DesaturateEffect.cs
│ └── GreyscaleEffect.cs
├── EffectLibrary.cs
├── SEToolbox.ImageShaders.csproj
└── ShaderSource
│ ├── Desaturate.fx
│ ├── Desaturate.ps
│ ├── Greyscale.fx
│ └── Greyscale.ps
├── SEToolbox.sln
├── SEToolbox.snk
├── SEToolbox
├── App.xaml
├── App.xaml.cs
├── Controls
│ ├── BusyIndicator.cs
│ ├── MyDataGrid.cs
│ ├── MyWebClient.cs
│ ├── SortableGridViewColumn.cs
│ └── SortableListView.cs
├── Converters
│ ├── BooleanConverter.cs
│ ├── BusyMouseConverter.cs
│ ├── CountToVisibilityConverter.cs
│ ├── DDSConverter.cs
│ ├── DistanceConverter.cs
│ ├── EnumToResouceConverter.cs
│ ├── I18NFormatterConverter.cs
│ ├── InverseBooleanConverter.cs
│ ├── MainColorToBackgroundConverter.cs
│ ├── NullImageConverter.cs
│ ├── RangeRuleD.cs
│ ├── RangeRuleDec.cs
│ ├── RangeRuleI.cs
│ ├── ResouceToImageConverter.cs
│ └── StringFormatMultiValueConverter.cs
├── CoreToolbox.cs
├── Interfaces
│ ├── IColorDialog.cs
│ ├── IDialogService.cs
│ ├── IDialogServiceContract.cs
│ ├── IFileDialog.cs
│ ├── IFolderBrowserDialog.cs
│ ├── IMainView.cs
│ ├── IOpenFileDialog.cs
│ ├── ISaveFileDialog.cs
│ ├── IStructureBase.cs
│ └── IStructureViewBase.cs
├── Interop
│ ├── Asteroids
│ │ ├── MyVoxelBuilder.cs
│ │ ├── MyVoxelBuilderArgs.cs
│ │ ├── MyVoxelMap.cs
│ │ ├── MyVoxelRayTracer.cs
│ │ ├── MyVoxelRayTracerConsts.cs
│ │ └── MyVoxelTaskWorker.cs
│ ├── BlueprintRequirement.cs
│ ├── ClassType.cs
│ ├── ContentDataPath.cs
│ ├── CubeType.cs
│ ├── Models
│ │ ├── MyModel.cs
│ │ └── MyModelConverter.cs
│ ├── MySessionReplacement.cs
│ ├── NativeMethods.cs
│ ├── QuaternionD.cs
│ ├── SpaceEngineersApi.cs
│ ├── SpaceEngineersConsts.cs
│ ├── SpaceEngineersCore.cs
│ ├── SpaceEngineersExtensions.cs
│ ├── SpaceEngineersRepair.cs
│ ├── SpaceEngineersResources.cs
│ ├── SpaceEngineersTypes.cs
│ ├── SpaceEngineersWorkshop.cs
│ ├── SubtypeId.cs
│ ├── SubtypeId.tt
│ ├── ToolboxPlatform.cs
│ ├── UserDataPath.cs
│ └── VoxelMapLoader.cs
├── Models
│ ├── Asteroids
│ │ ├── AsteroidByteFillProperties.cs
│ │ ├── AsteroidByteFiller.cs
│ │ ├── AsteroidFiller.cs
│ │ ├── AsteroidSeedFillProperties.cs
│ │ ├── AsteroidSeedFiller.cs
│ │ ├── IMyVoxelFillProperties.cs
│ │ └── IMyVoxelFiller.cs
│ ├── BaseModel.cs
│ ├── BindablePoint3DIModel.cs
│ ├── BindablePoint3DModel.cs
│ ├── BindableSize3DIModel.cs
│ ├── BindableSize3DModel.cs
│ ├── BindableSizeModel.cs
│ ├── BindableVector3DModel.cs
│ ├── BlueprintDialogModel.cs
│ ├── ChangeOwnerModel.cs
│ ├── ComponentItemModel.cs
│ ├── ComponentListModel.cs
│ ├── CubeAssetModel.cs
│ ├── CubeItemModel.cs
│ ├── ErrorDialogModel.cs
│ ├── ExplorerModel.cs
│ ├── FindApplicationModel.cs
│ ├── FrameworkBuildModel.cs
│ ├── GenerateFloatingObjectModel.cs
│ ├── GenerateVoxelDetailModel.cs
│ ├── GenerateVoxelFieldModel.cs
│ ├── GroupMoveItemModel.cs
│ ├── GroupMoveModel.cs
│ ├── Import3DAsteroidModel.cs
│ ├── Import3dModelModel.cs
│ ├── ImportImageModel.cs
│ ├── ImportVoxelModel.cs
│ ├── InventoryEditorModel.cs
│ ├── InventoryModel.cs
│ ├── LanguageModel.cs
│ ├── MaterialSelectionModel.cs
│ ├── MergeVoxelModel.cs
│ ├── OreAssetModel.cs
│ ├── OwnerModel.cs
│ ├── ProgressCancelModel.cs
│ ├── RegeneratePlanetModel.cs
│ ├── ResourceReportModel.cs
│ ├── SelectCubeModel.cs
│ ├── SelectWorldModel.cs
│ ├── SettingsModel.cs
│ ├── StructureBaseModel.cs
│ ├── StructureCharacterModel.cs
│ ├── StructureCubeGridModel.cs
│ ├── StructureFloatingObjectModel.cs
│ ├── StructureInventoryBagModel.cs
│ ├── StructureMeteorModel.cs
│ ├── StructurePlanetModel.cs
│ ├── StructureUnknownModel.cs
│ ├── StructureVoxelModel.cs
│ ├── VoxelMaterialAssetModel.cs
│ └── WorldResource.cs
├── Properties
│ ├── MyTexts.resx
│ ├── Resources.Designer.cs
│ ├── Resources.de.resx
│ ├── Resources.resx
│ └── Resources.zh-cn.resx
├── Resources
│ ├── Asteroid.png
│ ├── Asteroid_model.png
│ ├── SECubes16.png
│ ├── SEToolbox_splash_en.png
│ ├── SEToolbox_splash_zh-cn.png
│ ├── SpaceEngineers16x16.png
│ ├── Toolbox_logo.jpg
│ ├── about.png
│ ├── add2.png
│ ├── battery.png
│ ├── book_open2.png
│ ├── check24.png
│ ├── colors.png
│ ├── components.png
│ ├── copy.png
│ ├── cube_molecule.png
│ ├── delete2.png
│ ├── disk_blue.png
│ ├── document.png
│ ├── document_pulse.png
│ ├── document_view.png
│ ├── earth.png
│ ├── error24.png
│ ├── export1.png
│ ├── find.png
│ ├── first_aid.png
│ ├── fit_to_size.png
│ ├── flag_brazil.png
│ ├── flag_catalonia.png
│ ├── flag_china.png
│ ├── flag_croatia.png
│ ├── flag_czech_republic.png
│ ├── flag_denmark.png
│ ├── flag_estonia.png
│ ├── flag_finland.png
│ ├── flag_france.png
│ ├── flag_germany.png
│ ├── flag_great_britain.png
│ ├── flag_hungary.png
│ ├── flag_iceland.png
│ ├── flag_italy.png
│ ├── flag_lithuania.png
│ ├── flag_mexico.png
│ ├── flag_netherlands.png
│ ├── flag_norway.png
│ ├── flag_poland.png
│ ├── flag_romania.png
│ ├── flag_russia.png
│ ├── flag_slovakia.png
│ ├── flag_spain.png
│ ├── flag_sweden.png
│ ├── flag_turkey.png
│ ├── flag_ukraine.png
│ ├── flag_usa.png
│ ├── folder.png
│ ├── form_green_view16.png
│ ├── hammer.png
│ ├── help.png
│ ├── icecube.png
│ ├── import1.png
│ ├── media_stop.png
│ ├── medical_bag.png
│ ├── message_edit.png
│ ├── navigate_cross.png
│ ├── navigate_left2.png
│ ├── navigate_right2.png
│ ├── package_add.png
│ ├── photo_scenery.png
│ ├── refresh.png
│ ├── replace2.png
│ ├── screwdriver.png
│ ├── selection.png
│ ├── selection_replace.png
│ ├── server_to_client.png
│ ├── shield.png
│ ├── sort_descending.png
│ ├── spedometer 16x16.png
│ ├── target.png
│ ├── transform.png
│ ├── users_back.png
│ ├── warning.png
│ ├── workshop16.png
│ └── wrench.png
├── SEToolbox.csproj
├── Services
│ ├── BrowserBehavior.cs
│ ├── BubbleScrollBehavior.cs
│ ├── ButtonDropDownMenuBehavior.cs
│ ├── ColorDialog.cs
│ ├── ColorDialogViewModel.cs
│ ├── CommandAction.cs
│ ├── CommandReference.cs
│ ├── DelegateCommand.cs
│ ├── DialogCloser.cs
│ ├── DialogExtensions.cs
│ ├── DialogService.cs
│ ├── DispatcherHelper.cs
│ ├── FileDialogViewModel.cs
│ ├── FolderBrowserDialog.cs
│ ├── FolderBrowserDialogViewModel.cs
│ ├── IDragable.cs
│ ├── IDropable.cs
│ ├── ListBoxAdornerManager.cs
│ ├── ListBoxDropAdorner.cs
│ ├── ListBoxDropBehavior.cs
│ ├── ListBoxItemDragBehavior.cs
│ ├── MessageListener.cs
│ ├── ObservableViewModelCollection.cs
│ ├── OpenFileDialog.cs
│ ├── OpenFileDialogViewModel.cs
│ ├── SaveFileDialog.cs
│ ├── SaveFileDialogViewModel.cs
│ ├── ServiceLocator.cs
│ ├── SupplementaryInteraction.cs
│ ├── SynchronizeSelectedItems.cs
│ ├── ViewModelCollection.cs
│ ├── WeakEventHandler.cs
│ └── WindowWrapper.cs
├── Support
│ ├── AppConstants.cs
│ ├── ArrayHelper.cs
│ ├── CodeRepositoryReleases.cs
│ ├── DiagnosticsLogging.cs
│ ├── DiagnosticsLogging4Net.cs
│ ├── ExceptionState.cs
│ ├── FrameworkExtension.cs
│ ├── GlobalSettings.cs
│ ├── HtmlExtensions.cs
│ ├── MeshHelper.cs
│ ├── Modelling.cs
│ ├── RandomUtil.cs
│ ├── Splasher.cs
│ ├── TempfileUtil.cs
│ ├── ToolboxExtensions.cs
│ ├── ToolboxUpdater.cs
│ ├── XmlExtension.cs
│ └── ZipTools.cs
├── Themes
│ └── Generic.xaml
├── ViewModels
│ ├── AboutViewModel.cs
│ ├── BaseViewModel.cs
│ ├── BlueprintDialogViewModel.cs
│ ├── ChangeOwnerViewModel.cs
│ ├── ComponentListViewModel.cs
│ ├── CubeItemViewModel.cs
│ ├── DataBaseViewModel.cs
│ ├── ErrorDialogViewModel.cs
│ ├── ExplorerViewModel.cs
│ ├── FindApplicationViewModel.cs
│ ├── FrameworkBuildViewModel.cs
│ ├── GenerateFloatingObjectViewModel.cs
│ ├── GenerateVoxelFieldViewModel.cs
│ ├── GroupMoveViewModel.cs
│ ├── Import3DModelViewModel.cs
│ ├── Import3dAsteroidViewModel.cs
│ ├── ImportImageViewModel.cs
│ ├── ImportVoxelViewModel.cs
│ ├── InventoryEditorViewModel.cs
│ ├── MergeVoxelViewModel.cs
│ ├── ProgressCancelViewModel.cs
│ ├── RegeneratePlanetViewModel.cs
│ ├── ResourceReportViewModel.cs
│ ├── SelectCubeViewModel.cs
│ ├── SelectWorldViewModel.cs
│ ├── SettingsViewModel.cs
│ ├── StructureBaseViewModel.cs
│ ├── StructureCharacterViewModel.cs
│ ├── StructureCubeGridViewModel.cs
│ ├── StructureFloatingObjectViewModel.cs
│ ├── StructureInventoryBagViewModel.cs
│ ├── StructureMeteorViewModel.cs
│ ├── StructurePlanetViewModel.cs
│ ├── StructureUnknownViewModel.cs
│ └── StructureVoxelViewModel.cs
├── Views
│ ├── ControlBaseState.xaml
│ ├── ControlBaseState.xaml.cs
│ ├── ControlCharacter.xaml
│ ├── ControlCharacter.xaml.cs
│ ├── ControlCubeGrid.xaml
│ ├── ControlCubeGrid.xaml.cs
│ ├── ControlFloatingObject.xaml
│ ├── ControlFloatingObject.xaml.cs
│ ├── ControlInventory.xaml
│ ├── ControlInventory.xaml.cs
│ ├── ControlInventoryBag.xaml
│ ├── ControlInventoryBag.xaml.cs
│ ├── ControlMeteor.xaml
│ ├── ControlMeteor.xaml.cs
│ ├── ControlMultiple.xaml
│ ├── ControlMultiple.xaml.cs
│ ├── ControlPlanet.xaml
│ ├── ControlPlanet.xaml.cs
│ ├── ControlPosition.xaml
│ ├── ControlPosition.xaml.cs
│ ├── ControlSaveState.xaml
│ ├── ControlSaveState.xaml.cs
│ ├── ControlUnknown.xaml
│ ├── ControlUnknown.xaml.cs
│ ├── ControlVoxel.xaml
│ ├── ControlVoxel.xaml.cs
│ ├── WindowAbout.xaml
│ ├── WindowAbout.xaml.cs
│ ├── WindowBlueprintDialog.xaml
│ ├── WindowBlueprintDialog.xaml.cs
│ ├── WindowChangeOwner.xaml
│ ├── WindowChangeOwner.xaml.cs
│ ├── WindowComponentList.xaml
│ ├── WindowComponentList.xaml.cs
│ ├── WindowErrorDialog.xaml
│ ├── WindowErrorDialog.xaml.cs
│ ├── WindowExplorer.xaml
│ ├── WindowExplorer.xaml.cs
│ ├── WindowFindApplication.xaml
│ ├── WindowFindApplication.xaml.cs
│ ├── WindowFrameworkBuild.xaml
│ ├── WindowFrameworkBuild.xaml.cs
│ ├── WindowGenerateFloatingObject.xaml
│ ├── WindowGenerateFloatingObject.xaml.cs
│ ├── WindowGenerateVoxelField.xaml
│ ├── WindowGenerateVoxelField.xaml.cs
│ ├── WindowGroupMove.xaml
│ ├── WindowGroupMove.xaml.cs
│ ├── WindowImportAsteroidModel.xaml
│ ├── WindowImportAsteroidModel.xaml.cs
│ ├── WindowImportImage.xaml
│ ├── WindowImportImage.xaml.cs
│ ├── WindowImportModel.xaml
│ ├── WindowImportModel.xaml.cs
│ ├── WindowImportVoxel.xaml
│ ├── WindowImportVoxel.xaml.cs
│ ├── WindowLoad.xaml
│ ├── WindowLoad.xaml.cs
│ ├── WindowProgressCancel.xaml
│ ├── WindowProgressCancel.xaml.cs
│ ├── WindowRegeneratePlanet.xaml
│ ├── WindowRegeneratePlanet.xaml.cs
│ ├── WindowResourceReport.xaml
│ ├── WindowResourceReport.xaml.cs
│ ├── WindowSelectCube.xaml
│ ├── WindowSelectCube.xaml.cs
│ ├── WindowSettings.xaml
│ ├── WindowSettings.xaml.cs
│ ├── WindowSplashScreen.xaml
│ ├── WindowSplashScreen.xaml.cs
│ ├── WindowVoxelMerge.xaml
│ └── WindowVoxelMerge.xaml.cs
├── app.config
├── app.ico
└── steam_appid.txt
├── SEToolboxUpdate
├── Program.cs
├── Properties
│ ├── Resources.Designer.cs
│ ├── Resources.de.resx
│ └── Resources.resx
├── SEToolboxUpdate.csproj
├── app.ico
└── app.manifest
├── TestSettings1.runsettings
├── ToolboxTest
├── App.config
├── InteropTests.cs
├── ModelTests.cs
├── TestAssets
│ ├── 7242630_orig.jpg
│ ├── 7242630_scale432.png
│ ├── Arabian_Border_7.vx2
│ ├── AsteroidV1Format.vx2
│ ├── AsteroidV2Format.vx2
│ ├── AsteroidV3Format.vx2
│ ├── DeformedSphereWithHoles_64x128x64.vx2
│ ├── LibertyStatue.obj
│ ├── SANDBOX_0_0_0_.Proto.sbsB1
│ ├── SANDBOX_0_0_0_.XML.sbs
│ ├── SANDBOX_0_0_0_.sbs
│ ├── Sample World.sbw
│ ├── Sphere_Gold.3ds
│ ├── TwoSpheres.3ds
│ ├── algos.obj
│ ├── asteroid0moon4.vox
│ ├── asteroid0moon4.vx2
│ ├── buddha-fixed-bottom.stl
│ ├── cornell_box.mtl
│ ├── cornell_box.obj
│ ├── cube_52x52x52.vx2
│ ├── small2_asteroids.vx2
│ ├── t25.obj
│ ├── test.mtl
│ ├── test.obj
│ ├── test.xml
│ ├── test_cube2x2x2.vx2
│ └── test_cube_mixed_2x2x2.vx2
├── TestOutput
│ └── _placeholder.txt
├── TextureTests.cs
├── ToolboxTest.csproj
├── UnitTest1.cs
├── VolumentricTests.cs
├── VoxelTests.cs
├── VoxelVolumeTests.cs
└── unittesting.txt
├── global.targets
└── plansandtasks.txt
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/.github/issue_template.md:
--------------------------------------------------------------------------------
1 | - [ ] Ensure you are using the latest version of SEToolbox. You can get it from [here.](https://github.com/mmusu3/SEToolbox/releases/latest)
2 | - [ ] Ensure that the issue is reproducible, that you can make it occur more than once.
3 | - [ ] If the issue involves a world / blueprint, please provide the relevant files if possible.
4 | - [ ] In the case of a crash find the log.txt file in the application folder.
5 |
6 | Please provide the relevant version numbers.
7 | **SEToolbox Version:** `1.xxx.xxx.x`
8 | **SE Version:** `1.xxx.xxx`
9 |
10 | ### Issue Description
11 | What is the issue and what were you doing with SEToolbox when it occurred?
12 |
13 | ### Steps to Reproduce
14 | 1. How did this issue get triggered?
15 | 2. Write all of the steps here.
16 |
17 | ### SEToolbox Log File
18 | ```
19 | Paste the contents of your log file here or upload the file if it is large.
20 | ```
--------------------------------------------------------------------------------
/Documentation/Images/Desktop_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/Documentation/Images/Desktop_01.png
--------------------------------------------------------------------------------
/Documentation/Images/FAQ_Issues_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/Documentation/Images/FAQ_Issues_01.png
--------------------------------------------------------------------------------
/Documentation/Images/FAQ_Issues_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/Documentation/Images/FAQ_Issues_02.png
--------------------------------------------------------------------------------
/Documentation/Images/SEToolbox_Logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/Documentation/Images/SEToolbox_Logo.jpg
--------------------------------------------------------------------------------
/Documentation/Images/Update_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/Documentation/Images/Update_01.png
--------------------------------------------------------------------------------
/Documentation/Images/Update_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/Documentation/Images/Update_02.png
--------------------------------------------------------------------------------
/Documentation/Images/Update_03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/Documentation/Images/Update_03.png
--------------------------------------------------------------------------------
/Documentation/Images/Update_04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/Documentation/Images/Update_04.png
--------------------------------------------------------------------------------
/Documentation/Shader Effects BuildTask and Templates.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/Documentation/Shader Effects BuildTask and Templates.zip
--------------------------------------------------------------------------------
/Readme.md:
--------------------------------------------------------------------------------
1 | ## Space Engineers Toolbox
2 | SE Toolbox is a application for importing and modifying user content for the game Space Engineers.
3 | It can convert images and 3D models into grids or 3D models into asteroids.
4 |
5 | Originally created by Mid-Space productions. Est. 1993
6 |
7 | 
8 |
9 | Download the [latest release here](https://github.com/mmusu3/SEToolbox/releases/latest).
10 |
11 | Check the [wiki](https://github.com/midspace/SEToolbox/wiki) for help using the application.
12 |
13 | #### This project is a fork of the original with fixes and changes for newer versions of Space Engineers.
14 |
15 | I lack the time for active development of SE Toolbox and so I am only providing compatibilty fixes for game updates as they are needed.
16 |
17 | The original author [midspace](https://github.com/midspace) has retired from working on [the original SE Toolbox](https://github.com/midspace/SEToolbox) as of 2019-08-23 and put it into maintainance mode as described [here](https://forum.keenswh.com/threads/7402115/).
18 |
19 | ---
20 |
21 | **[Space Engineers](http://www.spaceengineersgame.com/)** is copyright of Keen Software House.
22 | For more details on the game, please visit the following links.
23 | * [www.spaceengineersgame.com](http://www.spaceengineersgame.com/)
24 | * [Steam store page](http://store.steampowered.com/app/244850/)
25 | * [Keen Software House](http://www.keenswh.com/about.html)
26 |
27 | ---
28 |
29 | #### License
30 |
31 | This application contains code expressly licenced to it, and should not be used in any other application without the permission of Keen Software House.
32 |
33 | The Space Engineers logo was sourced from spaceengineerswiki.com under creative commons.
34 |
--------------------------------------------------------------------------------
/SEToolbox.Image.Library/Effects/AlphaPixelEffect.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.ImageLibrary.Effects
2 | {
3 | ///
4 | /// Summary description for AlphaEffect.
5 | ///
6 | public unsafe class AlphaPixelEffect : PixelEffect
7 | {
8 | ///
9 | /// Construct the Alpha pixel effect
10 | ///
11 | ///
12 | /// Alpha pixel effect only requires a single effect step
13 | ///
14 | public AlphaPixelEffect()
15 | : base(true)
16 | {
17 | }
18 |
19 | ///
20 | /// Override this to process the pixel in the second pass of the algorithm
21 | ///
22 | /// The pixel to quantize
23 | ///
24 | /// The quantized value
25 | protected override void QuantizePixel(Color32* pixel, Color32* destinationPixel)
26 | {
27 | destinationPixel->Red = pixel->Alpha;
28 | destinationPixel->Blue = pixel->Alpha;
29 | destinationPixel->Green = pixel->Alpha;
30 | destinationPixel->Alpha = 255;
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/SEToolbox.Image.Library/Effects/DesaturatePixelEffect.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.ImageLibrary.Effects
2 | {
3 | ///
4 | /// Summary description for DesaturatePixelEffect.
5 | ///
6 | public unsafe class DesaturatePixelEffect : PixelEffect
7 | {
8 | ///
9 | /// Construct the Desaturate PixelEffect
10 | ///
11 | ///
12 | /// Desaturate effect only requires a single effect step
13 | ///
14 | public DesaturatePixelEffect()
15 | : base(true)
16 | {
17 | }
18 |
19 | ///
20 | /// Override this to process the pixel in the second pass of the algorithm
21 | ///
22 | /// The pixel to quantize
23 | ///
24 | /// The quantized value
25 | protected override void QuantizePixel(Color32* pixel, Color32* destinationPixel)
26 | {
27 | int maxColor = pixel->Red;
28 | if (maxColor < pixel->Green)
29 | maxColor = pixel->Green;
30 | if (maxColor < pixel->Blue)
31 | maxColor = pixel->Blue;
32 |
33 | int minColor = pixel->Red;
34 | if (minColor > pixel->Green)
35 | minColor = pixel->Green;
36 | if (minColor > pixel->Blue)
37 | minColor = pixel->Blue;
38 |
39 | var luminance = (byte)((minColor + maxColor) / 2.00f);
40 |
41 | destinationPixel->Red = luminance;
42 | destinationPixel->Green = luminance;
43 | destinationPixel->Blue = luminance;
44 | destinationPixel->Alpha = pixel->Alpha;
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/SEToolbox.Image.Library/Effects/EmissivePixelEffect.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.ImageLibrary.Effects
2 | {
3 | ///
4 | /// Summary description for EmissiveEffect.
5 | ///
6 | public unsafe class EmissivePixelEffect : PixelEffect
7 | {
8 | private readonly byte _alphaEmmissiveValue;
9 |
10 | ///
11 | /// Construct the Emissive pixel effect
12 | ///
13 | ///
14 | /// Emissive pixel effect only requires a single effect step
15 | ///
16 | public EmissivePixelEffect(byte alphaEmmissiveValue)
17 | : base(true)
18 | {
19 | _alphaEmmissiveValue = alphaEmmissiveValue;
20 | }
21 |
22 | ///
23 | /// Override this to process the pixel in the second pass of the algorithm
24 | ///
25 | /// The pixel to quantize
26 | ///
27 | /// The quantized value
28 | protected override void QuantizePixel(Color32* pixel, Color32* destinationPixel)
29 | {
30 | destinationPixel->Red = pixel->Red;
31 | destinationPixel->Green = pixel->Green;
32 | destinationPixel->Blue = pixel->Blue;
33 |
34 | if (pixel->Alpha == _alphaEmmissiveValue)
35 | {
36 | destinationPixel->Alpha = 255;
37 | }
38 | else
39 | {
40 | destinationPixel->Alpha = 0;
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/SEToolbox.Image.Library/Effects/IPixelEffect.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.ImageLibrary.Effects
2 | {
3 | using System.Drawing;
4 |
5 | public interface IPixelEffect
6 | {
7 | Bitmap Quantize(Bitmap source);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SEToolbox.Image.Library/Effects/MaskPixelEffect.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.ImageLibrary.Effects
2 | {
3 | ///
4 | /// Summary description for MaskEffect.
5 | ///
6 | public unsafe class MaskPixelEffect : PixelEffect
7 | {
8 | ///
9 | /// Construct the Mask pixel effect
10 | ///
11 | ///
12 | /// Mask pixel effect only requires a single effect step
13 | ///
14 | public MaskPixelEffect()
15 | : base(true)
16 | {
17 | }
18 |
19 | ///
20 | /// Override this to process the pixel in the second pass of the algorithm
21 | ///
22 | /// The pixel to quantize
23 | ///
24 | /// The quantized value
25 | protected override void QuantizePixel(Color32* pixel, Color32* destinationPixel)
26 | {
27 | if (pixel->Alpha > 127)
28 | {
29 | destinationPixel->Red = pixel->Red;
30 | destinationPixel->Green = pixel->Green;
31 | destinationPixel->Blue = pixel->Blue;
32 | destinationPixel->Alpha = 255;
33 | }
34 | else
35 | {
36 | int maxColor = pixel->Red;
37 | if (maxColor < pixel->Green)
38 | maxColor = pixel->Green;
39 | if (maxColor < pixel->Blue)
40 | maxColor = pixel->Blue;
41 |
42 | int minColor = pixel->Red;
43 | if (minColor > pixel->Green)
44 | minColor = pixel->Green;
45 | if (minColor > pixel->Blue)
46 | minColor = pixel->Blue;
47 |
48 | var luminance = (byte)((minColor + maxColor) / 2.00f);
49 |
50 | destinationPixel->Red = luminance;
51 | destinationPixel->Green = luminance;
52 | destinationPixel->Blue = luminance;
53 |
54 | //destinationPixel->Alpha = 0;
55 | destinationPixel->Alpha = pixel->Alpha;
56 | }
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/SEToolbox.Image.Library/SEToolbox.ImageLibrary.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SEToolbox.ImageLibrary
5 | Space Engineers Toolbox - Image Library
6 | Mid-Space Productions
7 | SEToolbox.ImageLibrary
8 | Copyright © MidSpace 2013-2015
9 | 1.0.0.0
10 | 1.0.0.0
11 | net48
12 | Library
13 | true
14 | true
15 | true
16 | ..\SEToolbox.snk
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/SEToolbox.Image.Shaders/EffectFiles/DesaturateEffect.cs:
--------------------------------------------------------------------------------
1 | // ===============================================================================
2 | //
3 | // Copyright © 2009 Mid-Space. All rights reserved.
4 | //
5 | // ===============================================================================
6 |
7 | namespace SEToolbox.ImageShaders
8 | {
9 | using System.Windows;
10 | using System.Windows.Media;
11 | using System.Windows.Media.Effects;
12 |
13 | ///
14 | /// This is the implementation of an extensible framework ShaderEffect which loads
15 | /// a shader model 2 pixel shader. Dependecy properties declared in this class are mapped
16 | /// to registers as defined in the *.ps file being loaded below.
17 | ///
18 | public class DesaturateEffect : ShaderEffect
19 | {
20 | #region Dependency Properties
21 |
22 | ///
23 | /// Gets or sets the Input of the shader.
24 | ///
25 | public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(DesaturateEffect), 0);
26 |
27 | #endregion
28 |
29 | #region Member Data
30 |
31 | ///
32 | /// The shader instance.
33 | ///
34 | private static readonly PixelShader pixelShader;
35 |
36 | #endregion
37 |
38 | #region Constructors
39 |
40 | ///
41 | /// Creates an instance of the shader from the included pixel shader.
42 | ///
43 | static DesaturateEffect()
44 | {
45 | pixelShader = new PixelShader { UriSource = Global.MakePackUri("ShaderSource/Desaturate.ps") };
46 | }
47 |
48 | ///
49 | /// Creates an instance and updates the shader's variables to the default values.
50 | ///
51 | public DesaturateEffect()
52 | {
53 | PixelShader = pixelShader;
54 | UpdateShaderValue(InputProperty);
55 | }
56 |
57 | #endregion
58 |
59 | ///
60 | /// Gets or sets the input used in the shader.
61 | ///
62 | [System.ComponentModel.BrowsableAttribute(false)]
63 | public Brush Input
64 | {
65 | get { return (Brush)GetValue(InputProperty); }
66 | set { SetValue(InputProperty, value); }
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/SEToolbox.Image.Shaders/EffectFiles/GreyscaleEffect.cs:
--------------------------------------------------------------------------------
1 | // ===============================================================================
2 | //
3 | // Copyright © 2009 Mid-Space. All rights reserved.
4 | //
5 | // ===============================================================================
6 |
7 | namespace SEToolbox.ImageShaders
8 | {
9 | using System.Windows;
10 | using System.Windows.Media;
11 | using System.Windows.Media.Effects;
12 |
13 | ///
14 | /// This is the implementation of an extensible framework ShaderEffect which loads
15 | /// a shader model 2 pixel shader. Dependecy properties declared in this class are mapped
16 | /// to registers as defined in the *.ps file being loaded below.
17 | ///
18 | public class GreyscaleEffect : ShaderEffect
19 | {
20 | #region Dependency Properties
21 |
22 | ///
23 | /// Gets or sets the Input of the shader.
24 | ///
25 | public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(GreyscaleEffect), 0);
26 |
27 | #endregion
28 |
29 | #region Member Data
30 |
31 | ///
32 | /// The shader instance.
33 | ///
34 | private static readonly PixelShader pixelShader;
35 |
36 | #endregion
37 |
38 | #region Constructors
39 |
40 | ///
41 | /// Creates an instance of the shader from the included pixel shader.
42 | ///
43 | static GreyscaleEffect()
44 | {
45 | pixelShader = new PixelShader { UriSource = Global.MakePackUri("ShaderSource/Greyscale.ps") };
46 | }
47 |
48 | ///
49 | /// Creates an instance and updates the shader's variables to the default values.
50 | ///
51 | public GreyscaleEffect()
52 | {
53 | PixelShader = pixelShader;
54 | UpdateShaderValue(InputProperty);
55 | }
56 |
57 | #endregion
58 |
59 | ///
60 | /// Gets or sets the input used in the shader.
61 | ///
62 | [System.ComponentModel.BrowsableAttribute(false)]
63 | public Brush Input
64 | {
65 | get { return (Brush)GetValue(InputProperty); }
66 | set { SetValue(InputProperty, value); }
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/SEToolbox.Image.Shaders/EffectLibrary.cs:
--------------------------------------------------------------------------------
1 | // (c) Copyright Microsoft Corporation.
2 | // This source is subject to the Microsoft Permissive License.
3 | // See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
4 | // All other rights reserved.
5 |
6 |
7 | namespace SEToolbox.ImageShaders
8 | {
9 | using System;
10 | using System.Reflection;
11 | using System.Text;
12 |
13 | internal static class Global
14 | {
15 | public static Uri MakePackUri(string relativeFile)
16 | {
17 | var uriString = new StringBuilder();
18 | #if !SILVERLIGHT
19 | uriString.Append("pack://application:,,,");
20 | #endif
21 | uriString.Append("/" + AssemblyShortName + ";component/" + relativeFile);
22 | return new Uri(uriString.ToString(), UriKind.RelativeOrAbsolute);
23 | }
24 |
25 | private static string AssemblyShortName
26 | {
27 | get
28 | {
29 | if (_assemblyShortName == null)
30 | {
31 | Assembly a = typeof(Global).Assembly;
32 |
33 | // Pull out the short name.
34 | _assemblyShortName = a.ToString().Split(',')[0];
35 | }
36 |
37 | return _assemblyShortName;
38 | }
39 | }
40 |
41 | private static string _assemblyShortName;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SEToolbox.Image.Shaders/SEToolbox.ImageShaders.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | SEToolbox.ImageShaders
9 | Space Engineers Toolbox - Image Shaders Library
10 | Mid-Space Productions
11 | SEToolbox.ImageShaders
12 | Copyright © MidSpace 2013-2015
13 | 1.0.0.0
14 | 1.0.0.0
15 | Library
16 | net48
17 | true
18 | true
19 | ..\SEToolbox.snk
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/SEToolbox.Image.Shaders/ShaderSource/Desaturate.fx:
--------------------------------------------------------------------------------
1 | //--------------------------------------------------------------------------------------
2 | //
3 | // WPF ShaderEffect HLSL -- DesaturateEffect
4 | //
5 | //--------------------------------------------------------------------------------------
6 |
7 | //-----------------------------------------------------------------------------------------
8 | // Shader constant register mappings (scalars - float, double, Point, Color, Point3D, etc.)
9 | //-----------------------------------------------------------------------------------------
10 |
11 |
12 | //--------------------------------------------------------------------------------------
13 | // Sampler Inputs (Brushes, including ImplicitInput)
14 | //--------------------------------------------------------------------------------------
15 |
16 | sampler2D implicitInputSampler : register(S0);
17 |
18 | //--------------------------------------------------------------------------------------
19 | // Pixel Shader
20 | //--------------------------------------------------------------------------------------
21 |
22 | float4 main(float2 uv : TEXCOORD) : COLOR
23 | {
24 | float2 texuv = uv;
25 | float4 finalColor;
26 | float maxColor;
27 | float minColor;
28 | float gColor;
29 |
30 | float4 srcColor = tex2D(implicitInputSampler, texuv);
31 |
32 | if( srcColor.a == 0 )
33 | {
34 | finalColor = srcColor;
35 | }
36 | else
37 | {
38 | // Desaturate algorithm. Replicates the Photoshop Desaturate filter.
39 | // However this may not properly take into account the Alpha Channel.
40 |
41 | maxColor = srcColor.r;
42 | if (maxColor < srcColor.g)
43 | maxColor = srcColor.g;
44 | if (maxColor < srcColor.b)
45 | maxColor = srcColor.b;
46 |
47 | minColor = srcColor.r;
48 | if (minColor > srcColor.g)
49 | minColor = srcColor.g;
50 | if (minColor > srcColor.b)
51 | minColor = srcColor.b;
52 |
53 | float4 luminance = (minColor + maxColor) / 2.00;
54 | luminance.a = srcColor.a;
55 | finalColor = luminance;
56 | }
57 | return finalColor;
58 | }
59 |
60 |
--------------------------------------------------------------------------------
/SEToolbox.Image.Shaders/ShaderSource/Desaturate.ps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox.Image.Shaders/ShaderSource/Desaturate.ps
--------------------------------------------------------------------------------
/SEToolbox.Image.Shaders/ShaderSource/Greyscale.fx:
--------------------------------------------------------------------------------
1 | //--------------------------------------------------------------------------------------
2 | //
3 | // WPF ShaderEffect HLSL -- GreyscaleEffect
4 | //
5 | //--------------------------------------------------------------------------------------
6 |
7 | //-----------------------------------------------------------------------------------------
8 | // Shader constant register mappings (scalars - float, double, Point, Color, Point3D, etc.)
9 | //-----------------------------------------------------------------------------------------
10 |
11 |
12 | //--------------------------------------------------------------------------------------
13 | // Sampler Inputs (Brushes, including ImplicitInput)
14 | //--------------------------------------------------------------------------------------
15 |
16 | sampler2D implicitInputSampler : register(S0);
17 |
18 | //--------------------------------------------------------------------------------------
19 | // Pixel Shader
20 | //--------------------------------------------------------------------------------------
21 |
22 | float4 main(float2 uv : TEXCOORD) : COLOR
23 | {
24 | float2 texuv = uv;
25 | float4 finalColor;
26 |
27 | float4 srcColor = tex2D(implicitInputSampler, texuv);
28 |
29 | if( srcColor.a == 0 )
30 | {
31 | finalColor = srcColor;
32 | }
33 | else
34 | {
35 | float4 luminance = srcColor.r*0.30 + srcColor.g*0.59 + srcColor.b*0.11;
36 | luminance.a = srcColor.a;
37 | finalColor = luminance;
38 | }
39 | return finalColor;
40 | }
41 |
--------------------------------------------------------------------------------
/SEToolbox.Image.Shaders/ShaderSource/Greyscale.ps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox.Image.Shaders/ShaderSource/Greyscale.ps
--------------------------------------------------------------------------------
/SEToolbox.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox.snk
--------------------------------------------------------------------------------
/SEToolbox/Controls/BusyIndicator.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Controls
2 | {
3 | using System.Windows;
4 | using System.Windows.Controls;
5 |
6 | public class BusyIndicator : Control
7 | {
8 | #region construction
9 |
10 | static BusyIndicator()
11 | {
12 | // This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class.
13 | // This style is defined in themes\generic.xaml
14 | DefaultStyleKeyProperty.OverrideMetadata(typeof(BusyIndicator), new FrameworkPropertyMetadata(typeof(BusyIndicator)));
15 | }
16 |
17 | #endregion
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/SEToolbox/Controls/MyDataGrid.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Controls
2 | {
3 | using System.Windows.Controls;
4 | using System.Windows.Input;
5 |
6 | using SEToolbox.Support;
7 |
8 | ///
9 | /// Provides one click editing on data cells.
10 | ///
11 | public class MyDataGrid : DataGrid
12 | {
13 | public MyDataGrid()
14 | {
15 | // TODO: fix the eventhandler, so it responds correctly when clicking on the dropdown list items.
16 | //PreviewMouseLeftButtonDown += MyDataGrid_PreviewMouseLeftButtonDown;
17 | }
18 |
19 | void MyDataGrid_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
20 | {
21 | var cell = ((DataGrid)sender).GetHitControl(e);
22 |
23 | if (cell != null && !cell.IsEditing && !cell.IsReadOnly)
24 | {
25 | if (!cell.IsFocused)
26 | {
27 | cell.Focus();
28 | }
29 | var dataGrid = cell.FindVisualParent();
30 | if (dataGrid != null)
31 | {
32 | if (dataGrid.SelectionUnit != DataGridSelectionUnit.FullRow)
33 | {
34 | if (!cell.IsSelected)
35 | cell.IsSelected = true;
36 | }
37 | else
38 | {
39 | var row = cell.FindVisualParent();
40 | if (row != null && !row.IsSelected)
41 | {
42 | row.IsSelected = true;
43 | }
44 | }
45 | }
46 | }
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/SEToolbox/Controls/MyWebClient.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Controls
2 | {
3 | using System;
4 | using System.Net;
5 |
6 | // Actually it's a component, but meh.
7 |
8 | class MyWebClient : WebClient
9 | {
10 | public Uri ResponseUri { get; private set; }
11 |
12 | protected override WebResponse GetWebResponse(WebRequest request)
13 | {
14 | WebResponse response;
15 | try
16 | {
17 | response = base.GetWebResponse(request);
18 | }
19 | catch
20 | {
21 | response = null;
22 | }
23 |
24 | ResponseUri = (response != null) ? response.ResponseUri : null;
25 |
26 | return response;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/SEToolbox/Controls/SortableGridViewColumn.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Controls
2 | {
3 | using System.Windows.Data;
4 |
5 | public class SortableGridViewColumn : System.Windows.Controls.GridViewColumn
6 | {
7 | #region fields
8 |
9 | private BindingBase _sortBinding;
10 |
11 | #endregion
12 |
13 | #region SortBinding
14 |
15 | public BindingBase SortBinding
16 | {
17 | get
18 | {
19 | return _sortBinding;
20 | }
21 | set
22 | {
23 | if (_sortBinding != value)
24 | {
25 | _sortBinding = value;
26 | OnDisplayMemberBindingChanged();
27 | }
28 | }
29 | }
30 |
31 | private void OnDisplayMemberBindingChanged()
32 | {
33 | OnPropertyChanged(new System.ComponentModel.PropertyChangedEventArgs("DisplayMemberBinding"));
34 | }
35 |
36 | #endregion
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/SEToolbox/Converters/BooleanConverter.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Converters
2 | {
3 | using System;
4 | using System.Globalization;
5 | using System.Windows;
6 | using System.Windows.Data;
7 |
8 | public class BooleanConverter : IValueConverter
9 | {
10 | private bool _isInverse;
11 |
12 | public bool IsInverse
13 | {
14 | get { return _isInverse; }
15 | set { _isInverse = value; }
16 | }
17 |
18 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
19 | {
20 | bool finalValue;
21 |
22 | if (value == null)
23 | finalValue = false;
24 | else if (value is bool)
25 | finalValue = (bool)value;
26 | else if (value is string)
27 | finalValue = !string.IsNullOrEmpty((string)value);
28 | else
29 | finalValue = true;
30 |
31 | finalValue ^= _isInverse;
32 |
33 | if (targetType == typeof(Visibility))
34 | return finalValue ? Visibility.Visible : Visibility.Collapsed;
35 |
36 | return finalValue;
37 | }
38 |
39 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
40 | {
41 | bool finalValue;
42 |
43 | if (value == null)
44 | finalValue = false;
45 | else if (value is Visibility)
46 | finalValue = (Visibility)value == Visibility.Visible;
47 | else if (value is bool)
48 | finalValue = (bool)value;
49 | else
50 | finalValue = true;
51 |
52 | return finalValue ^ _isInverse;
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/SEToolbox/Converters/BusyMouseConverter.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Converters
2 | {
3 | using System;
4 | using System.Windows.Data;
5 | using System.Windows.Input;
6 |
7 | ///
8 | /// Sets the cursor state of the mouse.
9 | ///
10 | [ValueConversion(typeof(bool), typeof(Cursors))]
11 | public class BusyMouseConverter : IValueConverter
12 | {
13 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
14 | {
15 | if (value is bool)
16 | {
17 | if ((bool)value)
18 | {
19 | return Cursors.Wait;
20 | }
21 | }
22 |
23 | return null;
24 | }
25 |
26 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
27 | {
28 | if (value is Cursors)
29 | {
30 | if (value == Cursors.Wait)
31 | {
32 | return true;
33 | }
34 |
35 | return false;
36 | }
37 |
38 | return null;
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/SEToolbox/Converters/CountToVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Converters
2 | {
3 | using System;
4 | using System.Globalization;
5 | using System.Windows;
6 | using System.Windows.Data;
7 |
8 | public class CountToVisibilityConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
11 | {
12 | var childrenCount = (int)value;
13 |
14 | return childrenCount > 0 ? Visibility.Visible : Visibility.Collapsed;
15 | }
16 |
17 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
18 | {
19 | throw new NotImplementedException();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/SEToolbox/Converters/DistanceConverter.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Converters
2 | {
3 | using System;
4 | using System.Globalization;
5 | using System.Windows.Data;
6 | using Res = SEToolbox.Properties.Resources;
7 |
8 | public class DistanceConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
11 | {
12 | var distance = (double)value;
13 |
14 | if (distance > 1000)
15 | return string.Format("{0:#,###0.0.0} {1}", distance / 1000, Res.GlobalSIDistanceKilometre);
16 |
17 | return string.Format("{0:#,###0.0} {1}", distance, Res.GlobalSIDistanceMetre);
18 | }
19 |
20 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
21 | {
22 | throw new NotImplementedException();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/SEToolbox/Converters/EnumToResouceConverter.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Converters
2 | {
3 | using System;
4 | using System.Windows.Data;
5 |
6 | public class EnumToResouceConverter : IValueConverter
7 | {
8 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
9 | {
10 | if (value != null)
11 | {
12 | if (value is Enum)
13 | {
14 | var header = ((Enum)value).GetType().Name;
15 | var resource = string.Format("{0}_{1}", header, value);
16 | return GetResource(resource, value);
17 | }
18 | else if (value is bool)
19 | {
20 | return GetResource(string.Format("{0}_{1}", value.GetType().Name, value), value);
21 | }
22 |
23 | return value;
24 | }
25 | return null;
26 | }
27 |
28 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
29 | {
30 | return null;
31 | }
32 |
33 | private object GetResource(string resource, object value)
34 | {
35 | try
36 | {
37 | var ret = Properties.Resources.ResourceManager.GetString(resource);
38 | return ret ?? value;
39 | }
40 | catch
41 | {
42 | return value;
43 | }
44 | }
45 |
46 | }
47 | }
--------------------------------------------------------------------------------
/SEToolbox/Converters/I18NFormatterConverter.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Converters
2 | {
3 | using System;
4 | using System.Globalization;
5 | using System.Windows;
6 | using System.Windows.Data;
7 | using WPFLocalizeExtension.Extensions;
8 |
9 | public class I18NFormatterConverter : IMultiValueConverter
10 | {
11 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
12 | {
13 | if (parameter == null) return values;
14 |
15 | var bindingParams = (object[])values.Clone();
16 |
17 | // Remove the {DependancyProperty.UnsetValue} from unbound datasources.
18 | for (var i = 0; i < bindingParams.Length; i++)
19 | {
20 | if (bindingParams[i] != null && bindingParams[i] == DependencyProperty.UnsetValue)
21 | {
22 | bindingParams[i] = null;
23 | }
24 | }
25 |
26 | var keyStr = (string)parameter;
27 | var ext = new LocExtension(keyStr);
28 | string localizedValue;
29 | return ext.ResolveLocalizedValue(out localizedValue) ? string.Format(localizedValue, bindingParams) : null;
30 | }
31 |
32 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
33 | {
34 | return new object[0];
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/SEToolbox/Converters/InverseBooleanConverter.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Converters
2 | {
3 | using System;
4 | using System.Globalization;
5 | using System.Windows;
6 | using System.Windows.Data;
7 |
8 | public class InverseBooleanConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
11 | {
12 | bool finalValue;
13 |
14 | if (value == null)
15 | finalValue = false;
16 | else if (value is bool)
17 | finalValue = (bool)value;
18 | else if (value is string)
19 | finalValue = !string.IsNullOrEmpty((string)value);
20 | else
21 | finalValue = true;
22 |
23 | finalValue = !finalValue;
24 |
25 | if (targetType == typeof(Visibility))
26 | return finalValue ? Visibility.Visible : Visibility.Collapsed;
27 |
28 | return finalValue;
29 | }
30 |
31 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
32 | {
33 | bool finalValue;
34 |
35 | if (value == null)
36 | finalValue = false;
37 | else if (value is Visibility)
38 | finalValue = (Visibility)value == Visibility.Visible;
39 | else if (value is bool)
40 | finalValue = (bool)value;
41 | else
42 | finalValue = true;
43 |
44 | return !finalValue;
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/SEToolbox/Converters/MainColorToBackgroundConverter.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Converters
2 | {
3 | using System;
4 | using System.Globalization;
5 | using System.Windows.Data;
6 | using System.Windows.Media;
7 |
8 | public class MainColorToBackgroundConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
11 | {
12 | var mainColor = (string)value;
13 |
14 | if (mainColor == null)
15 | {
16 | return new SolidColorBrush(Colors.Transparent);
17 | }
18 |
19 | if (mainColor.StartsWith("#"))
20 | {
21 | mainColor = mainColor.Substring(1);
22 | }
23 |
24 | if (mainColor.Length == 8)
25 | {
26 | return new SolidColorBrush(Color.FromArgb(
27 | System.Convert.ToByte(mainColor.Substring(0, 2), 16),
28 | System.Convert.ToByte(mainColor.Substring(2, 2), 16),
29 | System.Convert.ToByte(mainColor.Substring(4, 2), 16),
30 | System.Convert.ToByte(mainColor.Substring(6, 2), 16)
31 | ));
32 | }
33 |
34 | if (mainColor.Length == 6)
35 | {
36 | return new SolidColorBrush(Color.FromRgb(
37 | System.Convert.ToByte(mainColor.Substring(0, 2), 16),
38 | System.Convert.ToByte(mainColor.Substring(2, 2), 16),
39 | System.Convert.ToByte(mainColor.Substring(4, 2), 16)
40 | ));
41 | }
42 |
43 | return new SolidColorBrush(Colors.Black);
44 | }
45 |
46 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
47 | {
48 | throw new NotImplementedException();
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/SEToolbox/Converters/NullImageConverter.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Converters
2 | {
3 | using System;
4 | using System.Globalization;
5 | using System.IO;
6 | using System.Windows;
7 | using System.Windows.Data;
8 | using System.Windows.Media.Imaging;
9 |
10 | public class NullImageConverter : IValueConverter
11 | {
12 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
13 | {
14 | if (value == null)
15 | return DependencyProperty.UnsetValue;
16 |
17 | if (!File.Exists(value as string))
18 | return DependencyProperty.UnsetValue;
19 |
20 | // Load the image, and prevent locking of the existing file.
21 | var bitmapImage = new BitmapImage();
22 | bitmapImage.BeginInit();
23 | bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
24 | bitmapImage.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
25 | bitmapImage.UriSource = new Uri((string)value, UriKind.Absolute);
26 | bitmapImage.EndInit();
27 | return bitmapImage;
28 | }
29 |
30 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
31 | {
32 | throw new NotImplementedException();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/SEToolbox/Converters/RangeRuleD.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Converters
2 | {
3 | using System;
4 | using System.Globalization;
5 | using System.Windows.Controls;
6 | using Res = SEToolbox.Properties.Resources;
7 |
8 | public class RangeRuleD : ValidationRule
9 | {
10 | public double Min { get; set; }
11 |
12 | public double Max { get; set; }
13 |
14 | public override ValidationResult Validate(object value, CultureInfo cultureInfo)
15 | {
16 | double parseValue = 0;
17 |
18 | try
19 | {
20 | if (((string)value).Length > 0)
21 | parseValue = double.Parse((string)value, null);
22 | }
23 | catch (Exception e)
24 | {
25 | return new ValidationResult(false, string.Format(Res.ValidationInvalidCharacters, e.Message));
26 | }
27 |
28 | if ((parseValue < Min) || (parseValue > Max))
29 | {
30 | return new ValidationResult(false, string.Format("{0} {1} - {2}.", Res.ValidationInvalidRange, Min, Max));
31 | }
32 |
33 | return new ValidationResult(true, null);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/SEToolbox/Converters/RangeRuleDec.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Converters
2 | {
3 | using System;
4 | using System.Globalization;
5 | using System.Windows.Controls;
6 | using Res = SEToolbox.Properties.Resources;
7 |
8 | public class RangeRuleDec : ValidationRule
9 | {
10 | public decimal Min { get; set; }
11 |
12 | public decimal Max { get; set; }
13 |
14 | public override ValidationResult Validate(object value, CultureInfo cultureInfo)
15 | {
16 | decimal parseValue = 0;
17 |
18 | try
19 | {
20 | if (((string)value).Length > 0)
21 | parseValue = decimal.Parse((string)value, null);
22 | }
23 | catch (Exception e)
24 | {
25 | return new ValidationResult(false, string.Format(Res.ValidationInvalidCharacters, Res.ValidationInvalidCharacters, e.Message));
26 | }
27 |
28 | if ((parseValue < Min) || (parseValue > Max))
29 | {
30 | return new ValidationResult(false, string.Format("{0} {1} - {2}.", Res.ValidationInvalidRange, Min, Max));
31 | }
32 |
33 | return new ValidationResult(true, null);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/SEToolbox/Converters/RangeRuleI.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Converters
2 | {
3 | using System;
4 | using System.Globalization;
5 | using System.Windows.Controls;
6 | using Res = SEToolbox.Properties.Resources;
7 |
8 | public class RangeRuleI : ValidationRule
9 | {
10 | public int Min { get; set; }
11 |
12 | public int Max { get; set; }
13 |
14 | public override ValidationResult Validate(object value, CultureInfo cultureInfo)
15 | {
16 | int parseValue = 0;
17 |
18 | try
19 | {
20 | if (((string)value).Length > 0)
21 | parseValue = Int32.Parse((string)value, null);
22 | }
23 | catch (Exception e)
24 | {
25 | return new ValidationResult(false, string.Format(Res.ValidationInvalidCharacters, Res.ValidationInvalidCharacters, e.Message));
26 | }
27 |
28 | if ((parseValue < Min) || (parseValue > Max))
29 | {
30 | return new ValidationResult(false, string.Format("{0} {1} - {2}.", Res.ValidationInvalidRange, Min, Max));
31 | }
32 |
33 | return new ValidationResult(true, null);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/SEToolbox/Converters/StringFormatMultiValueConverter.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Converters
2 | {
3 | using System;
4 | using System.Globalization;
5 | using System.Windows;
6 | using System.Windows.Data;
7 |
8 | public class StringFormatMultiValueConverter : IMultiValueConverter
9 | {
10 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
11 | {
12 | var copy = (object[])values.Clone();
13 |
14 | // Remove the {DependancyProperty.UnsetValue} from unbound datasources.
15 | for (int i = 0; i < copy.Length; i++)
16 | {
17 | if (copy[i] != null && copy[i] == DependencyProperty.UnsetValue)
18 | {
19 | copy[i] = null;
20 | }
21 | }
22 |
23 | return String.Format((string)parameter, copy);
24 | }
25 |
26 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
27 | {
28 | return new object[0];
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/SEToolbox/Interfaces/IColorDialog.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Interfaces
2 | {
3 | ///
4 | /// Interface describing the ColorDialog.
5 | ///
6 | public interface IColorDialog
7 | {
8 | ///
9 | /// Gets or sets a value indicating whether the user can use the dialog box to define custom colors.
10 | ///
11 | bool AllowFullOpen { get; set; }
12 |
13 | ///
14 | /// Gets or sets a value indicating whether the dialog box displays all available colors in the set of basic colors.
15 | ///
16 | bool AnyColor { get; set; }
17 |
18 | ///
19 | /// Gets or sets the color selected by the user.
20 | ///
21 | System.Drawing.Color? DrawingColor { get; set; }
22 |
23 | System.Windows.Media.Color? MediaColor { get; set; }
24 |
25 | System.Windows.Media.SolidColorBrush BrushColor { get; set; }
26 |
27 | ///
28 | /// Gets or sets the set of custom colors shown in the dialog box.
29 | ///
30 | int[] CustomColors { get; set; }
31 |
32 | ///
33 | /// Gets or sets a value indicating whether the controls used to create custom colors are visible when the dialog box is opened
34 | ///
35 | bool FullOpen { get; set; }
36 |
37 | ///
38 | /// Gets or sets a value indicating whether a Help button appears in the color dialog box.
39 | ///
40 | bool ShowHelp { get; set; }
41 |
42 | ///
43 | /// Gets or sets a value indicating whether the dialog box will restrict users to selecting solid colors only.
44 | ///
45 | bool SolidColorOnly { get; set; }
46 | }
47 | }
--------------------------------------------------------------------------------
/SEToolbox/Interfaces/IFileDialog.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Interfaces
2 | {
3 | ///
4 | /// Interface describing the FileDialog.
5 | ///
6 | public interface IFileDialog
7 | {
8 | ///
9 | /// Gets or sets a value indicating whether the dialog box automatically adds an extension to a
10 | /// file name if the user omits the extension.
11 | ///
12 | bool AddExtension { get; set; }
13 |
14 | ///
15 | /// Gets or sets a value indicating whether the dialog box displays a warning if the user
16 | /// specifies a file name that does not exist.
17 | ///
18 | bool CheckFileExists { get; set; }
19 |
20 | ///
21 | /// Gets or sets a value indicating whether the dialog box displays a warning if the user
22 | /// specifies a path that does not exist.
23 | ///
24 | bool CheckPathExists { get; set; }
25 |
26 | ///
27 | /// Gets or sets the default file name extension.
28 | ///
29 | string DefaultExt { get; set; }
30 |
31 | ///
32 | /// Gets or sets a string containing the file name selected in the file dialog box.
33 | ///
34 | string FileName { get; set; }
35 |
36 | ///
37 | /// Gets or sets the file names of all selected files in the dialog box.
38 | ///
39 | string[] FileNames { get; set; }
40 |
41 | ///
42 | /// Gets or sets the current file name filter string, which determines the choices that appear
43 | /// in the "Save as file type" or "Files of type" box in the dialog box.
44 | ///
45 | string Filter { get; set; }
46 |
47 | ///
48 | /// Gets or sets the initial directory displayed by the file dialog box.
49 | ///
50 | string InitialDirectory { get; set; }
51 |
52 | ///
53 | /// Gets or sets the file dialog box title.
54 | ///
55 | string Title { get; set; }
56 | }
57 | }
--------------------------------------------------------------------------------
/SEToolbox/Interfaces/IFolderBrowserDialog.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Interfaces
2 | {
3 | ///
4 | /// Interface describing the FolderBrowserDialog.
5 | ///
6 | public interface IFolderBrowserDialog
7 | {
8 | ///
9 | /// Gets or sets the descriptive text displayed above the tree view control in the dialog box.
10 | ///
11 | string Description { get; set; }
12 |
13 | ///
14 | /// Gets or sets the path selected by the user.
15 | ///
16 | string SelectedPath { get; set; }
17 |
18 | ///
19 | /// Gets or sets a value indicating whether the New Folder button appears in the folder browser
20 | /// dialog box.
21 | ///
22 | bool ShowNewFolderButton { get; set; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/SEToolbox/Interfaces/IMainView.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Interfaces
2 | {
3 | using System.Collections.Generic;
4 | using SEToolbox.Models;
5 | using VRage.Game;
6 | using VRage.ObjectBuilders;
7 | using VRageMath;
8 |
9 | public interface IMainView
10 | {
11 | bool IsModified { get; set; }
12 |
13 | bool IsBusy { get; set; }
14 |
15 | void CalcDistances();
16 |
17 | void OptimizeModel(params IStructureViewBase[] viewModels);
18 |
19 | string CreateUniqueVoxelStorageName(string originalFile, MyObjectBuilder_EntityBase[] additionalList);
20 |
21 | string CreateUniqueVoxelStorageName(string originalFile);
22 |
23 | List GetIntersectingEntities(BoundingBoxD box);
24 |
25 | StructureCharacterModel ThePlayerCharacter { get; }
26 |
27 | double Progress { get; set; }
28 |
29 | void ResetProgress(double initial, double maximumProgress);
30 |
31 | void IncrementProgress();
32 |
33 | void ClearProgress();
34 |
35 | MyObjectBuilder_Checkpoint Checkpoint { get; }
36 |
37 | int[] CreativeModeColors { get; set; }
38 |
39 | IStructureBase AddEntity(MyObjectBuilder_EntityBase entity);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/SEToolbox/Interfaces/IOpenFileDialog.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Interfaces
2 | {
3 | ///
4 | /// Interface describing the OpenFileDialog.
5 | ///
6 | public interface IOpenFileDialog : IFileDialog
7 | {
8 | ///
9 | /// Gets or sets a value indicating whether the dialog box allows multiple files to be
10 | /// selected.
11 | ///
12 | bool Multiselect { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/SEToolbox/Interfaces/ISaveFileDialog.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Interfaces
2 | {
3 | ///
4 | /// Interface describing the SaveFileDialog.
5 | ///
6 | public interface ISaveFileDialog : IFileDialog
7 | {
8 | ///
9 | /// Gets or sets a value indicating whether the dialog box will display the overwrite prompt if the specified file already exists.
10 | ///
11 | bool OverwritePrompt { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/SEToolbox/Interfaces/IStructureBase.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Interfaces
2 | {
3 | using SEToolbox.Interop;
4 | using VRage;
5 | using VRage.ObjectBuilders;
6 | using VRageMath;
7 |
8 | public interface IStructureBase
9 | {
10 | MyObjectBuilder_EntityBase EntityBase { get; set; }
11 |
12 | long EntityId { get; set; }
13 |
14 | MyPositionAndOrientation? PositionAndOrientation { get; set; }
15 |
16 | ClassType ClassType { get; set; }
17 |
18 | string DisplayName { get; set; }
19 |
20 | string Description { get; set; }
21 |
22 | double PlayerDistance { get; set; }
23 |
24 | double Mass { get; set; }
25 |
26 | int BlockCount { get; set; }
27 |
28 | Vector3D Center { get; set; }
29 |
30 | BoundingBoxD WorldAABB { get; set; }
31 |
32 | string SerializedEntity { get; set; }
33 |
34 | void UpdateGeneralFromEntityBase();
35 |
36 | bool IsBusy { get; set; }
37 |
38 | bool IsValid { get; set; }
39 |
40 | void InitializeAsync();
41 |
42 | void CancelAsync();
43 |
44 | double PositionX { get; set; }
45 |
46 | double PositionY { get; set; }
47 |
48 | double PositionZ { get; set; }
49 |
50 | double LinearVelocity { get; set; }
51 |
52 | void RecalcPosition(Vector3D playerPosition);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/SEToolbox/Interfaces/IStructureViewBase.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Interfaces
2 | {
3 | public interface IStructureViewBase
4 | {
5 | bool IsSelected { get; set; }
6 |
7 | IStructureBase DataModel { get; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SEToolbox/Interop/Asteroids/MyVoxelBuilderArgs.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Interop.Asteroids
2 | {
3 | using VRageMath;
4 |
5 | public struct MyVoxelBuilderArgs
6 | {
7 | public MyVoxelBuilderArgs(Vector3I size, Vector3I coordinatePoint, byte materialIndex, byte volume)
8 | {
9 | Size = size;
10 | CoordinatePoint = coordinatePoint;
11 | MaterialIndex = materialIndex;
12 | Volume = volume;
13 | }
14 |
15 | ///
16 | /// The size of the Voxel Storage.
17 | ///
18 | public Vector3I Size { get; }
19 |
20 | ///
21 | /// The currently selected Voxel Coordinate in local space.
22 | ///
23 | public Vector3I CoordinatePoint { get; }
24 |
25 | ///
26 | /// The Material to be applied. It may already be set with the existing material.
27 | ///
28 | public byte MaterialIndex { get; set; }
29 |
30 | ///
31 | /// The Volume to be applied. It may already be set with the existing Volume.
32 | ///
33 | public byte Volume { get; set; }
34 | }
35 |
36 | public delegate void VoxelBuilderAction(ref MyVoxelBuilderArgs args);
37 | }
38 |
--------------------------------------------------------------------------------
/SEToolbox/Interop/Asteroids/MyVoxelTaskWorker.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Interop.Asteroids
2 | {
3 | using VRage.Voxels;
4 | using VRageMath;
5 |
6 | class MyVoxelTaskWorker
7 | {
8 | public Vector3I BaseCoords { get; set; }
9 | public MyStorageData VoxelCache { get; set; }
10 |
11 | public MyVoxelTaskWorker(Vector3I baseCoords, MyStorageData voxelCache)
12 | {
13 | BaseCoords = baseCoords;
14 | VoxelCache = voxelCache;
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/SEToolbox/Interop/BlueprintRequirement.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Interop
2 | {
3 | using VRage.ObjectBuilders;
4 |
5 | public class BlueprintRequirement
6 | {
7 | public decimal Amount { get; set; }
8 |
9 | public SerializableDefinitionId Id { get; set; }
10 |
11 | public string SubtypeId { get; set; }
12 |
13 | public string TypeId { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/SEToolbox/Interop/ClassType.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Interop
2 | {
3 | public enum ClassType
4 | {
5 | Unknown,
6 | Character,
7 | FloatingObject,
8 | LargeShip,
9 | LargeStation,
10 | SmallShip,
11 | SmallStation,
12 | Meteor,
13 | Voxel,
14 | Planet,
15 | InventoryBag
16 | };
17 |
18 | public enum ImportModelClassType
19 | {
20 | SmallShip,
21 | SmallStation,
22 | LargeShip,
23 | LargeStation,
24 | Asteroid
25 | };
26 |
27 | public enum ImportImageClassType
28 | {
29 | SmallShip,
30 | SmallStation,
31 | LargeShip,
32 | LargeStation,
33 | };
34 |
35 | public enum ImportArmorType
36 | {
37 | Light,
38 | Heavy
39 | };
40 | }
41 |
--------------------------------------------------------------------------------
/SEToolbox/Interop/ContentDataPath.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Interop
2 | {
3 | public enum ContentPathType
4 | {
5 | Texture,
6 | Model,
7 | SandboxContent,
8 | SandboxSector,
9 | };
10 |
11 | public class ContentDataPath
12 | {
13 | public ContentDataPath(ContentPathType contentType, string referencePath, string absolutePath, string zipFilePath)
14 | {
15 | ContentType = contentType;
16 | ReferencePath = referencePath;
17 | AbsolutePath = absolutePath;
18 | ZipFilePath = zipFilePath;
19 | }
20 |
21 | public ContentPathType ContentType { get; set; }
22 | public string ReferencePath { get; set; }
23 | public string AbsolutePath { get; set; }
24 | public string ZipFilePath { get; set; }
25 | }
26 | }
--------------------------------------------------------------------------------
/SEToolbox/Interop/CubeType.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Interop
2 | {
3 | public enum CubeType : byte
4 | {
5 | None,
6 | Exterior,
7 | Interior,
8 | Cube,
9 | SlopeCenterFrontTop,
10 | SlopeLeftFrontCenter,
11 | SlopeRightFrontCenter,
12 | SlopeCenterFrontBottom,
13 | SlopeLeftCenterTop,
14 | SlopeRightCenterTop,
15 | SlopeLeftCenterBottom,
16 | SlopeRightCenterBottom,
17 | SlopeCenterBackTop,
18 | SlopeLeftBackCenter,
19 | SlopeRightBackCenter,
20 | SlopeCenterBackBottom,
21 | NormalCornerLeftFrontTop,
22 | NormalCornerRightFrontTop,
23 | NormalCornerLeftBackTop,
24 | NormalCornerRightBackTop,
25 | NormalCornerLeftFrontBottom,
26 | NormalCornerRightFrontBottom,
27 | NormalCornerLeftBackBottom,
28 | NormalCornerRightBackBottom,
29 | InverseCornerLeftFrontTop,
30 | InverseCornerRightFrontTop,
31 | InverseCornerLeftBackTop,
32 | InverseCornerRightBackTop,
33 | InverseCornerLeftFrontBottom,
34 | InverseCornerRightFrontBottom,
35 | InverseCornerLeftBackBottom,
36 | InverseCornerRightBackBottom,
37 | };
38 | }
39 |
--------------------------------------------------------------------------------
/SEToolbox/Interop/MySessionReplacement.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Interop
2 | {
3 | using Sandbox.Game.Multiplayer;
4 |
5 | public class MySession
6 | {
7 | private MySession(MySyncLayer syncLayer, bool registerComponents = true)
8 | {
9 | // Dummy replacement for the Sandbox.Game.World.MySession constructor of the same parameters.
10 | // So we can create it without getting involed with Havok and other depdancies.
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/SEToolbox/Interop/NativeMethods.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Interop
2 | {
3 | using System.Runtime.InteropServices;
4 | using System.Windows.Forms;
5 | using System.Windows.Input;
6 |
7 | internal static class NativeMethods
8 | {
9 | private const string User32Library = "user32.dll";
10 |
11 | [DllImport(User32Library, EntryPoint = "GetKeyState", CharSet = CharSet.Auto, ExactSpelling = true)]
12 | private static extern short _GetKeyState(int keyCode);
13 |
14 | internal static KeyStates GetKeyState(Keys key)
15 | {
16 | var state = KeyStates.None;
17 |
18 | var retVal = _GetKeyState((int)key);
19 |
20 | // If the high-order bit is 1, the key is down
21 | // otherwise, it is up.
22 | if ((retVal & 0x8000) == 0x8000)
23 | state |= KeyStates.Down;
24 |
25 | // If the low-order bit is 1, the key is toggled.
26 | if ((retVal & 1) == 1)
27 | state |= KeyStates.Toggled;
28 |
29 | return state;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/SEToolbox/Interop/SpaceEngineersTypes.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Interop
2 | {
3 | using Sandbox.Common.ObjectBuilders;
4 | using Sandbox.Common.ObjectBuilders.Definitions;
5 | using VRage.Game;
6 | using VRage.ObjectBuilders;
7 |
8 | ///
9 | /// Some hopefully generic items.
10 | ///
11 | public class SpaceEngineersTypes
12 | {
13 | public static readonly MyObjectBuilderType AmmoMagazine;
14 | public static readonly MyObjectBuilderType PhysicalGunObject;
15 | public static readonly MyObjectBuilderType OxygenContainerObject;
16 | public static readonly MyObjectBuilderType Ore;
17 | public static readonly MyObjectBuilderType Ingot;
18 | public static readonly MyObjectBuilderType Component;
19 | public static readonly MyObjectBuilderType VoxelMaterialDefinition;
20 | public static readonly MyObjectBuilderType MedicalRoom;
21 | public static readonly MyObjectBuilderType Cockpit;
22 | public static readonly MyObjectBuilderType Thrust;
23 |
24 | ///
25 | /// The base path of the save files, minus the userid.
26 | ///
27 | public static readonly UserDataPath BaseLocalPath;
28 |
29 | public static readonly UserDataPath BaseDedicatedServerHostPath;
30 |
31 | public static readonly UserDataPath BaseDedicatedServerServicePath;
32 |
33 | static SpaceEngineersTypes()
34 | {
35 | AmmoMagazine = new MyObjectBuilderType(typeof(MyObjectBuilder_AmmoMagazine));
36 | PhysicalGunObject = new MyObjectBuilderType(typeof(MyObjectBuilder_PhysicalGunObject));
37 | OxygenContainerObject = new MyObjectBuilderType(typeof(MyObjectBuilder_OxygenContainerObject));
38 | Ore = new MyObjectBuilderType(typeof(MyObjectBuilder_Ore));
39 | Ingot = new MyObjectBuilderType(typeof(MyObjectBuilder_Ingot));
40 | Component = new MyObjectBuilderType(typeof(MyObjectBuilder_Component));
41 | VoxelMaterialDefinition = new MyObjectBuilderType(typeof(MyObjectBuilder_VoxelMaterialDefinition));
42 | MedicalRoom = new MyObjectBuilderType(typeof(MyObjectBuilder_MedicalRoom));
43 | Cockpit = new MyObjectBuilderType(typeof(MyObjectBuilder_Cockpit));
44 | Thrust = new MyObjectBuilderType(typeof(MyObjectBuilder_Thrust));
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/SEToolbox/Interop/VoxelMapLoader.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Interop
2 | {
3 | using System;
4 | using System.Linq;
5 |
6 | public static class VoxelMapLoader
7 | {
8 | static VoxelMapLoader()
9 | {
10 | //var t = typeof(IMyVoxelMap);
11 | //var t2 = typeof(Sandbox.Definitions.MyCubeDefinition);
12 | ////var t2 = typeof(Sandbox.Engine.Voxels.IMyStorage);
13 | //var t3 = typeof(Sandbox.ModAPI.Interfaces.IMyStorage);
14 |
15 | //var a = t2.Assembly;
16 | //Type[] ts;
17 | try
18 | {
19 |
20 | //ts = a.GetExportedTypes();
21 | //var ts = t2.Assembly.GetTypes();
22 |
23 | var type = typeof(VRage.ModAPI.IMyStorage);
24 | var types = AppDomain.CurrentDomain.GetAssemblies()
25 | .SelectMany(s => s.GetTypes())
26 | .Where(p => type.IsAssignableFrom(p));
27 | var c = types.Count();
28 | }
29 | catch (Exception)
30 | {
31 | // The types required to load the current asteroid files are in the Sandbox.Game.dll.
32 | // Trying to iterate through the types in the Sandbox.Game assembly, will practically cause it to load every other assembly in the game.
33 | // Unless there is another way to ignore types dependant on other assemblies I can't even progress with this 'idea' to load asteroids.
34 | }
35 |
36 | }
37 |
38 | public static void Load(string filename)
39 | {
40 |
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SEToolbox/Models/Asteroids/AsteroidFiller.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Models.Asteroids
2 | {
3 | using SEToolbox.Interop.Asteroids;
4 |
5 | // TODO: need to rewite how the fill interface is displayed to allow custom fill methods.
6 | // Otherwise it will have to remain generic.
7 |
8 | public class AsteroidFiller : BaseModel
9 | {
10 | #region fields
11 |
12 | private int _index;
13 | private GenerateVoxelDetailModel _voxelFile;
14 | private IMyVoxelFiller _fillMethod;
15 |
16 | #endregion
17 |
18 | public AsteroidFiller()
19 | {
20 |
21 | }
22 |
23 | #region properties
24 |
25 | public int Index
26 | {
27 | get { return _index; }
28 |
29 | set
30 | {
31 | if (value != _index)
32 | {
33 | _index = value;
34 | OnPropertyChanged(nameof(Index));
35 | }
36 | }
37 | }
38 |
39 | public GenerateVoxelDetailModel VoxelFile
40 | {
41 | get { return _voxelFile; }
42 |
43 | set
44 | {
45 | if (value != _voxelFile)
46 | {
47 | _voxelFile = value;
48 | OnPropertyChanged(nameof(VoxelFile));
49 | }
50 | }
51 | }
52 |
53 | public IMyVoxelFiller FillMethod
54 | {
55 | get { return _fillMethod; }
56 |
57 | set
58 | {
59 | if (value != _fillMethod)
60 | {
61 | _fillMethod = value;
62 | OnPropertyChanged(nameof(FillMethod));
63 | }
64 | }
65 | }
66 |
67 | #endregion
68 |
69 | public void CreateFillProperties()
70 | {
71 | // VoxelCollection.Insert(VoxelCollection.IndexOf(SelectedRow) + 1, (AsteroidByteFillProperties)SelectedRow.Clone());
72 | }
73 |
74 | public void RandomizeFillProperties()
75 | {
76 | //var filler = new AsteroidByteFiller();
77 | //var randomModel = (AsteroidByteFillProperties)filler.CreateRandom(VoxelCollection.Count + 1, _dataModel.BaseMaterial, MaterialsCollection, VoxelFileList);
78 | }
79 |
80 | public void FillAsteroid(MyVoxelMap asteroid, IMyVoxelFillProperties fillProperties)
81 | {
82 | _fillMethod.FillAsteroid(asteroid, fillProperties);
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/SEToolbox/Models/Asteroids/IMyVoxelFillProperties.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Models.Asteroids
2 | {
3 | public interface IMyVoxelFillProperties
4 | {
5 | int Index { get; set; }
6 | GenerateVoxelDetailModel VoxelFile { get; set; }
7 | IMyVoxelFillProperties Clone();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SEToolbox/Models/Asteroids/IMyVoxelFiller.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Models.Asteroids
2 | {
3 | using SEToolbox.Interop.Asteroids;
4 | using System.Collections.Generic;
5 |
6 | public interface IMyVoxelFiller
7 | {
8 | void FillAsteroid(MyVoxelMap asteroid, IMyVoxelFillProperties fillProperties);
9 |
10 | IMyVoxelFillProperties CreateRandom(int index, MaterialSelectionModel defaultMaterial, IEnumerable materialsCollection, IEnumerable voxelCollection);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SEToolbox/Models/BaseModel.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Models
2 | {
3 | using System;
4 | using System.ComponentModel;
5 |
6 | [Serializable]
7 | public class BaseModel : INotifyPropertyChanged
8 | {
9 | #region Methods
10 |
11 | ///
12 | /// Raises the event.
13 | /// Use the in conjunction with OnPropertyChanged.
14 | /// This will set the property name into a string during compile, which will be faster to execute then a runtime interpretation.
15 | ///
16 | /// The name of the property that changed.
17 | protected void OnPropertyChanged(params string[] propertyNames)
18 | {
19 | if (_propertyChanged != null)
20 | {
21 | foreach (var propertyName in propertyNames)
22 | _propertyChanged(this, new PropertyChangedEventArgs(propertyName));
23 | }
24 | }
25 |
26 | #endregion
27 |
28 | #region INotifyPropertyChanged Members
29 |
30 | [NonSerialized]
31 | PropertyChangedEventHandler _propertyChanged;
32 |
33 | ///
34 | /// Occurs when a property value changes.
35 | ///
36 | public event PropertyChangedEventHandler PropertyChanged
37 | {
38 | add { _propertyChanged += value; }
39 | remove { if (_propertyChanged != null) _propertyChanged -= value; }
40 | }
41 |
42 | #endregion
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/SEToolbox/Models/BindablePoint3DIModel.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Models
2 | {
3 | public class BindablePoint3DIModel : BaseModel
4 | {
5 | #region fields
6 |
7 | private int _x;
8 | private int _y;
9 | private int _z;
10 |
11 | #endregion
12 |
13 | #region ctor
14 |
15 | public BindablePoint3DIModel()
16 | {
17 | X = 0;
18 | Y = 0;
19 | Z = 0;
20 | }
21 |
22 | public BindablePoint3DIModel(int x, int y, int z)
23 | : this()
24 | {
25 | X = x;
26 | Y = y;
27 | Z = z;
28 | }
29 |
30 | public BindablePoint3DIModel(VRageMath.Vector3I vector)
31 | : this()
32 | {
33 | X = vector.X;
34 | Y = vector.Y;
35 | Z = vector.Z;
36 | }
37 |
38 | #endregion
39 |
40 | #region Properties
41 |
42 | public int X
43 | {
44 | get
45 | {
46 | return _x;
47 | }
48 |
49 | set
50 | {
51 | if (value != _x)
52 | {
53 | _x = value;
54 | OnPropertyChanged(nameof(X));
55 | }
56 | }
57 | }
58 |
59 | public int Y
60 | {
61 | get
62 | {
63 | return _y;
64 | }
65 |
66 | set
67 | {
68 | if (value != _y)
69 | {
70 | _y = value;
71 | OnPropertyChanged(nameof(Y));
72 | }
73 | }
74 | }
75 |
76 | public int Z
77 | {
78 | get
79 | {
80 | return _z;
81 | }
82 |
83 | set
84 | {
85 | if (value != _z)
86 | {
87 | _z = value;
88 | OnPropertyChanged(nameof(Z));
89 | }
90 | }
91 | }
92 |
93 | #endregion
94 |
95 | #region methods
96 |
97 | public VRageMath.Vector3I ToVector3I()
98 | {
99 | return new VRageMath.Vector3I(X, Y, Z);
100 | }
101 |
102 | public override string ToString()
103 | {
104 | return string.Format("{0},{1},{2}", X, Y, Z);
105 | }
106 |
107 | #endregion
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/SEToolbox/Models/BindableSize3DModel.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Models
2 | {
3 | using System.Windows.Media.Media3D;
4 |
5 | public class BindableSize3DModel : BaseModel
6 | {
7 | #region fields
8 |
9 | private Size3D _size;
10 |
11 | #endregion
12 |
13 | public BindableSize3DModel()
14 | {
15 | _size = new Size3D(0, 0, 0);
16 | }
17 |
18 | public BindableSize3DModel(int width, int height, int depth)
19 | {
20 | _size = new Size3D(width, height, depth);
21 | }
22 |
23 | public BindableSize3DModel(Rect3D size)
24 | {
25 | _size = size.IsEmpty ? new Size3D() : new Size3D(size.SizeX, size.SizeY, size.SizeZ);
26 | }
27 |
28 | public BindableSize3DModel(Size3D size)
29 | {
30 | _size = new Size3D(size.X, size.Y, size.Z);
31 | }
32 |
33 | #region Properties
34 |
35 | public double Width
36 | {
37 | get
38 | {
39 | return _size.X;
40 | }
41 |
42 | set
43 | {
44 | if (value != _size.X)
45 | {
46 | _size.X = value;
47 | OnPropertyChanged(nameof(Width));
48 | }
49 | }
50 | }
51 |
52 | public double Height
53 | {
54 | get
55 | {
56 | return _size.Y;
57 | }
58 |
59 | set
60 | {
61 | if (value != _size.Y)
62 | {
63 | _size.Y = value;
64 | OnPropertyChanged(nameof(Height));
65 | }
66 | }
67 | }
68 |
69 | public double Depth
70 | {
71 | get
72 | {
73 | return _size.Z;
74 | }
75 |
76 | set
77 | {
78 | if (value != _size.Z)
79 | {
80 | _size.Z = value;
81 | OnPropertyChanged(nameof(Depth));
82 | }
83 | }
84 | }
85 |
86 | public Size3D ToSize3D
87 | {
88 | get
89 | {
90 | return _size;
91 | }
92 | }
93 |
94 | #endregion
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/SEToolbox/Models/BindableSizeModel.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Models
2 | {
3 | using System.Drawing;
4 |
5 | public class BindableSizeModel : BaseModel
6 | {
7 | private Size _size;
8 |
9 | public BindableSizeModel()
10 | {
11 | _size = new Size();
12 | }
13 |
14 | public BindableSizeModel(int width, int height)
15 | : this()
16 | {
17 | Width = width;
18 | Height = height;
19 | }
20 |
21 | public BindableSizeModel(Size size)
22 | : this()
23 | {
24 | Width = size.Width;
25 | Height = size.Height;
26 | }
27 |
28 | #region Properties
29 |
30 | public int Width
31 | {
32 | get
33 | {
34 | return _size.Width;
35 | }
36 |
37 | set
38 | {
39 | if (value != _size.Width)
40 | {
41 | _size.Width = value;
42 | OnPropertyChanged(nameof(Width));
43 | }
44 | }
45 | }
46 |
47 | public int Height
48 | {
49 | get
50 | {
51 | return _size.Height;
52 | }
53 |
54 | set
55 | {
56 | if (value != _size.Height)
57 | {
58 | _size.Height = value;
59 | OnPropertyChanged(nameof(Height));
60 | }
61 | }
62 | }
63 |
64 | public Size Size
65 | {
66 | get
67 | {
68 | return _size;
69 | }
70 |
71 | set
72 | {
73 | if (value != _size)
74 | {
75 | _size = value;
76 | OnPropertyChanged(nameof(Size), nameof(Width), nameof(Height));
77 | }
78 | }
79 | }
80 |
81 | #endregion
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/SEToolbox/Models/BlueprintDialogModel.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Models
2 | {
3 | public class BlueprintDialogModel : BaseModel
4 | {
5 | #region Fields
6 |
7 | private string _blueprintName;
8 | private string _dialogTitle;
9 | private bool _checkForExisting;
10 | private string _localBlueprintsFolder;
11 |
12 | #endregion
13 |
14 | #region Properties
15 |
16 | public string BlueprintName
17 | {
18 | get { return _blueprintName; }
19 |
20 | set
21 | {
22 | if (value != _blueprintName)
23 | {
24 | _blueprintName = value;
25 | OnPropertyChanged(nameof(BlueprintName));
26 | }
27 | }
28 | }
29 |
30 | public string DialogTitle
31 | {
32 | get { return _dialogTitle; }
33 |
34 | set
35 | {
36 | if (value != _dialogTitle)
37 | {
38 | _dialogTitle = value;
39 | OnPropertyChanged(nameof(DialogTitle));
40 | }
41 | }
42 | }
43 |
44 | public bool CheckForExisting
45 | {
46 | get { return _checkForExisting; }
47 |
48 | set
49 | {
50 | if (value != _checkForExisting)
51 | {
52 | _checkForExisting = value;
53 | OnPropertyChanged(nameof(CheckForExisting));
54 | }
55 | }
56 | }
57 |
58 | public string LocalBlueprintsFolder
59 | {
60 | get { return _localBlueprintsFolder; }
61 |
62 | set
63 | {
64 | if (value != _localBlueprintsFolder)
65 | {
66 | _localBlueprintsFolder = value;
67 | OnPropertyChanged(nameof(LocalBlueprintsFolder));
68 | }
69 | }
70 | }
71 |
72 | #endregion
73 |
74 | #region methods
75 |
76 | public void Load(string dialogText, bool checkForExisting, string localBlueprintsFolder)
77 | {
78 | DialogTitle = dialogText;
79 | CheckForExisting = checkForExisting;
80 | LocalBlueprintsFolder = localBlueprintsFolder;
81 | }
82 |
83 | #endregion
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/SEToolbox/Models/ErrorDialogModel.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Models
2 | {
3 | public class ErrorDialogModel : BaseModel
4 | {
5 | #region Fields
6 |
7 | private string _errorDescription;
8 | private string _errorText;
9 | private bool _canContinue;
10 |
11 | #endregion
12 |
13 | #region Properties
14 |
15 | public string ErrorDescription
16 | {
17 | get { return _errorDescription; }
18 |
19 | set
20 | {
21 | if (value != _errorDescription)
22 | {
23 | _errorDescription = value;
24 | OnPropertyChanged(nameof(ErrorDescription));
25 | }
26 | }
27 | }
28 |
29 | public string ErrorText
30 | {
31 | get { return _errorText; }
32 |
33 | set
34 | {
35 | if (value != _errorText)
36 | {
37 | _errorText = value;
38 | OnPropertyChanged(nameof(ErrorText));
39 | }
40 | }
41 | }
42 |
43 | public bool CanContinue
44 | {
45 | get { return _canContinue; }
46 |
47 | set
48 | {
49 | if (value != _canContinue)
50 | {
51 | _canContinue = value;
52 | OnPropertyChanged(nameof(CanContinue));
53 | }
54 | }
55 | }
56 |
57 | #endregion
58 |
59 | #region methods
60 |
61 | public void Load(string errorDescription, string errorText, bool canContinue)
62 | {
63 | ErrorDescription = errorDescription;
64 | ErrorText = errorText;
65 | CanContinue = canContinue;
66 | }
67 |
68 | #endregion
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/SEToolbox/Models/FrameworkBuildModel.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Models
2 | {
3 | public class FrameworkBuildModel : BaseModel
4 | {
5 | public const int UniqueUnits = 1;
6 |
7 | #region Fields
8 |
9 | private double? _buildPercent;
10 |
11 | #endregion
12 |
13 | #region Properties
14 |
15 | public double? BuildPercent
16 | {
17 | get
18 | {
19 | return _buildPercent;
20 | }
21 |
22 | set
23 | {
24 | if (value != _buildPercent)
25 | {
26 | _buildPercent = value;
27 | OnPropertyChanged(nameof(BuildPercent));
28 | }
29 | }
30 | }
31 |
32 | #endregion
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/SEToolbox/Models/GenerateVoxelDetailModel.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Models
2 | {
3 | using VRageMath;
4 |
5 | public class GenerateVoxelDetailModel : BaseModel
6 | {
7 | #region Fields
8 |
9 | private string _name;
10 | private string _sourceFilename;
11 | private string _voxelFilename;
12 | private Vector3I _size;
13 |
14 | #endregion
15 |
16 | #region Properties
17 |
18 | public string Name
19 | {
20 | get { return _name; }
21 |
22 | set
23 | {
24 | if (value != _name)
25 | {
26 | _name = value;
27 | OnPropertyChanged(nameof(Name));
28 | }
29 | }
30 | }
31 |
32 | public string SourceFilename
33 | {
34 | get { return _sourceFilename; }
35 |
36 | set
37 | {
38 | if (value != _sourceFilename)
39 | {
40 | _sourceFilename = value;
41 | OnPropertyChanged(nameof(SourceFilename));
42 | }
43 | }
44 | }
45 |
46 | public string VoxelFilename
47 | {
48 | get { return _voxelFilename; }
49 |
50 | set
51 | {
52 | if (value != _voxelFilename)
53 | {
54 | _voxelFilename = value;
55 | OnPropertyChanged(nameof(VoxelFilename));
56 | }
57 | }
58 | }
59 |
60 | public Vector3I Size
61 | {
62 | get { return _size; }
63 |
64 | set
65 | {
66 | if (value != _size)
67 | {
68 | _size = value;
69 | OnPropertyChanged(nameof(Size));
70 | }
71 | }
72 | }
73 |
74 | public int SizeX
75 | {
76 | get { return _size.X; }
77 | }
78 |
79 | public int SizeY
80 | {
81 | get { return _size.Y; }
82 | }
83 |
84 | public int SizeZ
85 | {
86 | get { return _size.Z; }
87 | }
88 |
89 | public long FileSize { get; set; }
90 |
91 | #endregion
92 |
93 | // To allow text searching in ComboBox.
94 | public override string ToString()
95 | {
96 | return _name;
97 | }
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/SEToolbox/Models/LanguageModel.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Models
2 | {
3 | public class LanguageModel : BaseModel
4 | {
5 | #region fields
6 |
7 | private string _ietfLanguageTag;
8 | private string _imageName;
9 | private string _languageName;
10 | private string _nativeName;
11 |
12 | #endregion
13 |
14 | #region Properties
15 |
16 | public string IetfLanguageTag
17 | {
18 | get { return _ietfLanguageTag; }
19 |
20 | set
21 | {
22 | if (value != _ietfLanguageTag)
23 | {
24 | _ietfLanguageTag = value;
25 | OnPropertyChanged(nameof(IetfLanguageTag));
26 | }
27 | }
28 | }
29 |
30 | public string ImageName
31 | {
32 | get { return _imageName; }
33 |
34 | set
35 | {
36 | if (value != _imageName)
37 | {
38 | _imageName = value;
39 | OnPropertyChanged(nameof(ImageName));
40 | }
41 | }
42 | }
43 |
44 | public string Name
45 | {
46 | get { return NativeName == LanguageName ? NativeName : string.Format("{0} / {1}", NativeName, LanguageName); }
47 | }
48 |
49 | ///
50 | /// Localized language name.
51 | ///
52 | public string LanguageName
53 | {
54 | get
55 | {
56 | return _languageName;
57 | }
58 |
59 | set
60 | {
61 | if (value != _languageName)
62 | {
63 | _languageName = value;
64 | OnPropertyChanged(nameof(LanguageName));
65 | OnPropertyChanged(nameof(Name));
66 | }
67 | }
68 | }
69 |
70 | public string NativeName
71 | {
72 | get
73 | {
74 | return _nativeName;
75 | }
76 |
77 | set
78 | {
79 | if (value != _nativeName)
80 | {
81 | _nativeName = value;
82 | OnPropertyChanged(nameof(NativeName));
83 | OnPropertyChanged(nameof(Name));
84 | }
85 | }
86 | }
87 |
88 | #endregion
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/SEToolbox/Models/MaterialSelectionModel.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Models
2 | {
3 | using SEToolbox.Interop;
4 |
5 | public class MaterialSelectionModel : BaseModel
6 | {
7 | private string _displayName;
8 |
9 | private string _value;
10 |
11 | private bool _isRare;
12 |
13 | private float _minedRatio;
14 |
15 | #region Properties
16 |
17 | public string DisplayName
18 | {
19 | get { return _displayName; }
20 |
21 | set
22 | {
23 | if (value != _displayName)
24 | {
25 | _displayName = value;
26 | OnPropertyChanged(nameof(DisplayName));
27 | }
28 | }
29 | }
30 |
31 | public string Value
32 | {
33 | get { return _value; }
34 |
35 | set
36 | {
37 | if (value != _value)
38 | {
39 | _value = value;
40 | OnPropertyChanged(nameof(Value));
41 | }
42 | }
43 | }
44 |
45 | public byte? MaterialIndex => _value == null ? (byte?)null : SpaceEngineersCore.Resources.GetMaterialIndex(_value);
46 |
47 | public bool IsRare
48 | {
49 | get { return _isRare; }
50 |
51 | set
52 | {
53 | if (value != _isRare)
54 | {
55 | _isRare = value;
56 | OnPropertyChanged(nameof(IsRare));
57 | }
58 | }
59 | }
60 |
61 | public float MinedRatio
62 | {
63 | get { return _minedRatio; }
64 |
65 | set
66 | {
67 | if (value != _minedRatio)
68 | {
69 | _minedRatio = value;
70 | OnPropertyChanged(nameof(MinedRatio));
71 | }
72 | }
73 | }
74 |
75 | #endregion
76 | }
77 | }
--------------------------------------------------------------------------------
/SEToolbox/Models/OwnerModel.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Models
2 | {
3 | using Res = SEToolbox.Properties.Resources;
4 |
5 | public class OwnerModel : BaseModel
6 | {
7 | #region fields
8 |
9 | private string _name;
10 |
11 | private string _model;
12 |
13 | private long _playerId;
14 |
15 | private bool _isPlayer;
16 |
17 | #endregion
18 |
19 | #region Properties
20 |
21 | public string Name
22 | {
23 | get { return _name; }
24 |
25 | set
26 | {
27 | if (value != _name)
28 | {
29 | _name = value;
30 | OnPropertyChanged(nameof(Name), nameof(DisplayName));
31 | }
32 | }
33 | }
34 |
35 | public string Model
36 | {
37 | get { return _model; }
38 |
39 | set
40 | {
41 | if (value != _model)
42 | {
43 | _model = value;
44 | OnPropertyChanged(nameof(Model));
45 | }
46 | }
47 | }
48 |
49 | public long PlayerId
50 | {
51 | get { return _playerId; }
52 |
53 | set
54 | {
55 | if (value != _playerId)
56 | {
57 | _playerId = value;
58 | OnPropertyChanged(nameof(PlayerId));
59 | }
60 | }
61 | }
62 |
63 | public bool IsPlayer
64 | {
65 | get { return _isPlayer; }
66 |
67 | set
68 | {
69 | if (value != _isPlayer)
70 | {
71 | _isPlayer = value;
72 | OnPropertyChanged(nameof(IsPlayer), nameof(DisplayName));
73 | }
74 | }
75 | }
76 |
77 | public string DisplayName
78 | {
79 | get
80 | {
81 | if (_isPlayer || _playerId == 0)
82 | return _name;
83 |
84 | return string.Format("{0} ({1})", _name, Res.ClsCharacterDead);
85 | }
86 | }
87 |
88 | #endregion
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/SEToolbox/Models/RegeneratePlanetModel.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Models
2 | {
3 | using System.Collections.ObjectModel;
4 |
5 | public class RegeneratePlanetModel : BaseModel
6 | {
7 | #region Fields
8 |
9 | private int _seed;
10 | private decimal _diameter;
11 | private bool _invalidKeenRange;
12 |
13 | #endregion
14 |
15 | #region ctor
16 |
17 | public RegeneratePlanetModel()
18 | {
19 | }
20 |
21 | #endregion
22 |
23 | #region Properties
24 |
25 | public int Seed
26 | {
27 | get { return _seed; }
28 |
29 | set
30 | {
31 | if (value != _seed)
32 | {
33 | _seed = value;
34 | OnPropertyChanged(nameof(Seed));
35 | }
36 | }
37 | }
38 |
39 | public decimal Diameter
40 | {
41 | get { return _diameter; }
42 |
43 | set
44 | {
45 | if (value != _diameter)
46 | {
47 | _diameter = value;
48 | OnPropertyChanged(nameof(Diameter));
49 | InvalidKeenRange = _diameter < 19000 || _diameter > 120000;
50 | }
51 | }
52 | }
53 |
54 | public bool InvalidKeenRange
55 | {
56 | get { return _invalidKeenRange; }
57 |
58 | set
59 | {
60 | if (value != _invalidKeenRange)
61 | {
62 | _invalidKeenRange = value;
63 | OnPropertyChanged(nameof(InvalidKeenRange));
64 | }
65 | }
66 | }
67 |
68 | #endregion
69 |
70 | #region methods
71 |
72 | public void Load(int seed, float radius)
73 | {
74 | Seed = seed;
75 | Diameter = (decimal)(radius * 2f);
76 |
77 | }
78 |
79 | #endregion
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/SEToolbox/Models/StructureInventoryBagModel.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Models
2 | {
3 | using System;
4 | using System.Runtime.Serialization;
5 |
6 | using SEToolbox.Interop;
7 | using VRage.Game.ObjectBuilders;
8 | using VRage.ObjectBuilders;
9 |
10 | [Serializable]
11 | public class StructureInventoryBagModel : StructureBaseModel
12 | {
13 | #region ctor
14 |
15 | public StructureInventoryBagModel(MyObjectBuilder_EntityBase entityBase)
16 | : base(entityBase)
17 | {
18 | }
19 |
20 | #endregion
21 |
22 | #region methods
23 |
24 | [OnSerializing]
25 | private void OnSerializingMethod(StreamingContext context)
26 | {
27 | SerializedEntity = SpaceEngineersApi.Serialize(EntityBase);
28 | }
29 |
30 | [OnDeserialized]
31 | private void OnDeserializedMethod(StreamingContext context)
32 | {
33 | EntityBase = SpaceEngineersApi.Deserialize(SerializedEntity);
34 | }
35 |
36 | public override void UpdateGeneralFromEntityBase()
37 | {
38 | ClassType = ClassType.InventoryBag;
39 | DisplayName = EntityBase.EntityDefinitionId.HasValue ? EntityBase.EntityDefinitionId.Value.SubtypeName : null;
40 | }
41 |
42 | #endregion
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/SEToolbox/Models/StructureUnknownModel.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Models
2 | {
3 | using System;
4 | using System.Runtime.Serialization;
5 |
6 | using SEToolbox.Interop;
7 | using VRage.ObjectBuilders;
8 |
9 | [Serializable]
10 | public class StructureUnknownModel : StructureBaseModel
11 | {
12 | #region ctor
13 |
14 | public StructureUnknownModel(MyObjectBuilder_EntityBase entityBase)
15 | : base(entityBase)
16 | {
17 | }
18 |
19 | #endregion
20 |
21 | #region methods
22 |
23 | [OnSerializing]
24 | private void OnSerializingMethod(StreamingContext context)
25 | {
26 | SerializedEntity = SpaceEngineersApi.Serialize(EntityBase);
27 | }
28 |
29 | [OnDeserialized]
30 | private void OnDeserializedMethod(StreamingContext context)
31 | {
32 | EntityBase = SpaceEngineersApi.Deserialize(SerializedEntity);
33 | }
34 |
35 | public override void UpdateGeneralFromEntityBase()
36 | {
37 | ClassType = ClassType.Unknown;
38 | DisplayName = EntityBase.TypeId.ToString();
39 | }
40 |
41 | #endregion
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SEToolbox/Models/VoxelMaterialAssetModel.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Models
2 | {
3 | using System;
4 |
5 | [Serializable]
6 | public class VoxelMaterialAssetModel : BaseModel
7 | {
8 | private string _materialName;
9 |
10 | private string _displayName;
11 |
12 | private double _volume;
13 |
14 | private double _percent;
15 |
16 | private string _textureFile;
17 |
18 | #region Properties
19 |
20 | ///
21 | /// 'Name' which represents the name used in the Voxel Material, and .vox file.
22 | ///
23 | public string MaterialName
24 | {
25 | get { return _materialName; }
26 |
27 | set
28 | {
29 | if (value != _materialName)
30 | {
31 | _materialName = value;
32 | OnPropertyChanged(nameof(MaterialName));
33 | }
34 | }
35 | }
36 |
37 | public string DisplayName
38 | {
39 | get { return _displayName; }
40 |
41 | set
42 | {
43 | if (value != _displayName)
44 | {
45 | _displayName = value;
46 | OnPropertyChanged(nameof(DisplayName));
47 | }
48 | }
49 | }
50 |
51 | public double Volume
52 | {
53 | get { return _volume; }
54 |
55 | set
56 | {
57 | if (value != _volume)
58 | {
59 | _volume = value;
60 | OnPropertyChanged(nameof(Volume));
61 | }
62 | }
63 | }
64 |
65 | public double Percent
66 | {
67 | get { return _percent; }
68 |
69 | set
70 | {
71 | if (value != _percent)
72 | {
73 | _percent = value;
74 | OnPropertyChanged(nameof(Percent));
75 | }
76 | }
77 | }
78 |
79 | public string TextureFile
80 | {
81 | get { return _textureFile; }
82 |
83 | set
84 | {
85 | if (value != _textureFile)
86 | {
87 | _textureFile = value;
88 | OnPropertyChanged(nameof(TextureFile));
89 | }
90 | }
91 | }
92 |
93 | #endregion
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/SEToolbox/Resources/Asteroid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/Asteroid.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/Asteroid_model.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/Asteroid_model.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/SECubes16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/SECubes16.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/SEToolbox_splash_en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/SEToolbox_splash_en.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/SEToolbox_splash_zh-cn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/SEToolbox_splash_zh-cn.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/SpaceEngineers16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/SpaceEngineers16x16.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/Toolbox_logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/Toolbox_logo.jpg
--------------------------------------------------------------------------------
/SEToolbox/Resources/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/about.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/add2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/add2.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/battery.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/battery.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/book_open2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/book_open2.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/check24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/check24.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/colors.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/colors.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/components.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/components.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/copy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/copy.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/cube_molecule.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/cube_molecule.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/delete2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/delete2.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/disk_blue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/disk_blue.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/document.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/document.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/document_pulse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/document_pulse.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/document_view.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/document_view.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/earth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/earth.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/error24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/error24.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/export1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/export1.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/find.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/find.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/first_aid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/first_aid.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/fit_to_size.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/fit_to_size.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_brazil.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_brazil.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_catalonia.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_catalonia.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_china.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_china.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_croatia.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_croatia.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_czech_republic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_czech_republic.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_denmark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_denmark.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_estonia.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_estonia.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_finland.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_finland.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_france.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_france.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_germany.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_germany.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_great_britain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_great_britain.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_hungary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_hungary.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_iceland.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_iceland.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_italy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_italy.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_lithuania.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_lithuania.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_mexico.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_mexico.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_netherlands.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_netherlands.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_norway.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_norway.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_poland.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_poland.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_romania.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_romania.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_russia.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_russia.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_slovakia.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_slovakia.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_spain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_spain.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_sweden.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_sweden.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_turkey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_turkey.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_ukraine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_ukraine.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/flag_usa.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/flag_usa.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/folder.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/form_green_view16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/form_green_view16.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/hammer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/hammer.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/help.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/icecube.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/icecube.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/import1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/import1.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/media_stop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/media_stop.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/medical_bag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/medical_bag.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/message_edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/message_edit.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/navigate_cross.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/navigate_cross.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/navigate_left2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/navigate_left2.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/navigate_right2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/navigate_right2.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/package_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/package_add.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/photo_scenery.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/photo_scenery.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/refresh.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/replace2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/replace2.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/screwdriver.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/screwdriver.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/selection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/selection.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/selection_replace.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/selection_replace.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/server_to_client.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/server_to_client.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/shield.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/shield.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/sort_descending.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/sort_descending.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/spedometer 16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/spedometer 16x16.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/target.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/transform.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/transform.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/users_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/users_back.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/warning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/warning.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/workshop16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/workshop16.png
--------------------------------------------------------------------------------
/SEToolbox/Resources/wrench.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mmusu3/SEToolbox/4121dff6878e1f296b7f5c1b875b13b0082e7034/SEToolbox/Resources/wrench.png
--------------------------------------------------------------------------------
/SEToolbox/Services/BrowserBehavior.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Services
2 | {
3 | using System.Windows;
4 | using System.Windows.Controls;
5 |
6 | public class BrowserBehavior
7 | {
8 | public static readonly DependencyProperty HtmlProperty = DependencyProperty.RegisterAttached(
9 | "Html",
10 | typeof(string),
11 | typeof(BrowserBehavior),
12 | new FrameworkPropertyMetadata(OnHtmlChanged));
13 |
14 | [AttachedPropertyBrowsableForType(typeof(WebBrowser))]
15 | public static string GetHtml(WebBrowser d)
16 | {
17 | return (string)d.GetValue(HtmlProperty);
18 | }
19 |
20 | public static void SetHtml(WebBrowser d, string value)
21 | {
22 | d.SetValue(HtmlProperty, value);
23 | }
24 |
25 | static void OnHtmlChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
26 | {
27 | var webBrowser = (WebBrowser)dependencyObject;
28 | if (webBrowser != null)
29 | webBrowser.NavigateToString((string)e.NewValue);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/SEToolbox/Services/BubbleScrollBehavior.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Services
2 | {
3 | using System.Windows;
4 | using System.Windows.Input;
5 | using Microsoft.Xaml.Behaviors;
6 |
7 | // Used on sub-controls of an expander to bubble the mouse wheel scroll event up
8 | public sealed class BubbleScrollBehavior : Behavior
9 | {
10 | protected override void OnAttached()
11 | {
12 | base.OnAttached();
13 | AssociatedObject.PreviewMouseWheel += AssociatedObject_PreviewMouseWheel;
14 | }
15 |
16 | protected override void OnDetaching()
17 | {
18 | AssociatedObject.PreviewMouseWheel -= AssociatedObject_PreviewMouseWheel;
19 | base.OnDetaching();
20 | }
21 |
22 | void AssociatedObject_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
23 | {
24 | e.Handled = true;
25 | var e2 = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta);
26 | e2.RoutedEvent = UIElement.MouseWheelEvent;
27 | AssociatedObject.RaiseEvent(e2);
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/SEToolbox/Services/ButtonDropDownMenuBehavior.cs:
--------------------------------------------------------------------------------
1 | namespace SEToolbox.Services
2 | {
3 | using System.Windows;
4 | using System.Windows.Controls;
5 | using Microsoft.Xaml.Behaviors;
6 |
7 | ///
8 | /// For enabling DropDown menu on Button
9 | ///
10 | public class ButtonDropDownMenuBehavior : Behavior