├── .gitattributes
├── .github
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── .gitignore
├── App.config
├── Assets
├── command_block_logo.ico
└── icons8
│ ├── attribution.txt
│ ├── icon_back.png
│ ├── icon_forward.png
│ ├── reload.png
│ └── search.png
├── Browser
└── ControlExtensions.cs
├── Config
├── AboutInfo.json
└── VersionInfo.json
├── Constants
└── TemplateTexts.cs
├── Data
├── AboutInfo.cs
├── AppPreferences.cs
├── DatapackElement.cs
├── DatapackInfo.cs
├── DatapackVersion.cs
├── JSONContainers
│ ├── PackInfo.cs
│ └── TagFunction.cs
├── SettingsProvider.cs
└── VersionManifest.cs
├── Dialogs
├── AboutDialog.Designer.cs
├── AboutDialog.cs
├── AboutDialog.resx
├── AddElementDialog.Designer.cs
├── AddElementDialog.cs
├── AddElementDialog.resx
├── NewProjectDialog.Designer.cs
├── NewProjectDialog.cs
├── NewProjectDialog.resx
├── OpenProjectDialog.Designer.cs
├── OpenProjectDialog.cs
├── OpenProjectDialog.resx
├── SettingsDialog.Designer.cs
├── SettingsDialog.cs
├── SettingsDialog.resx
├── WebBrowserDialog.Designer.cs
├── WebBrowserDialog.cs
└── WebBrowserDialog.resx
├── FodyWeavers.xml
├── FodyWeavers.xsd
├── Global.cs
├── LICENSE
├── Lexers
└── MCFunctionLexer.cs
├── MainForm.Designer.cs
├── MainForm.cs
├── MainForm.resx
├── MinecraftDatapackStudio.csproj
├── MinecraftDatapackStudio.sln
├── Program.cs
├── Properties
├── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Settings.Designer.cs
└── Settings.settings
├── README.md
├── Resources
├── Clock.ico
├── Clock.png
├── DeleteHS.png
├── GoToNextMessage.png
├── GoToPreviousMessage.png
└── LineColorHS.png
├── Theme
├── ColorScheme.cs
├── DarkColorScheme.cs
└── LightColorScheme.cs
├── Utilities.cs
├── app.manifest
├── command_block_logo.ico
└── packages.config
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve Datapack Studio
4 | title: "[BUG]"
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - Windows Version: [e.g. Windows 10 20H2]
28 | - Datapack Studio Version [e.g. v1.1.0]
29 |
30 | **Additional context**
31 | Add any other context about the problem here.
32 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: "[FEATURE]"
5 | labels: enhancement
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Dd]ebugPublic/
19 | [Rr]elease/
20 | [Rr]eleases/
21 | x64/
22 | x86/
23 | bld/
24 | [Bb]in/
25 | [Oo]bj/
26 | [Ll]og/
27 |
28 | # Visual Studio 2015/2017 cache/options directory
29 | .vs/
30 | # Uncomment if you have tasks that create the project's static files in wwwroot
31 | #wwwroot/
32 |
33 | # Visual Studio 2017 auto generated files
34 | Generated\ Files/
35 |
36 | # MSTest test Results
37 | [Tt]est[Rr]esult*/
38 | [Bb]uild[Ll]og.*
39 |
40 | # NUNIT
41 | *.VisualState.xml
42 | TestResult.xml
43 |
44 | # Build Results of an ATL Project
45 | [Dd]ebugPS/
46 | [Rr]eleasePS/
47 | dlldata.c
48 |
49 | # Benchmark Results
50 | BenchmarkDotNet.Artifacts/
51 |
52 | # .NET Core
53 | project.lock.json
54 | project.fragment.lock.json
55 | artifacts/
56 |
57 | # StyleCop
58 | StyleCopReport.xml
59 |
60 | # Files built by Visual Studio
61 | *_i.c
62 | *_p.c
63 | *_h.h
64 | *.ilk
65 | *.meta
66 | *.obj
67 | *.iobj
68 | *.pch
69 | *.pdb
70 | *.ipdb
71 | *.pgc
72 | *.pgd
73 | *.rsp
74 | *.sbr
75 | *.tlb
76 | *.tli
77 | *.tlh
78 | *.tmp
79 | *.tmp_proj
80 | *_wpftmp.csproj
81 | *.log
82 | *.vspscc
83 | *.vssscc
84 | .builds
85 | *.pidb
86 | *.svclog
87 | *.scc
88 |
89 | # Chutzpah Test files
90 | _Chutzpah*
91 |
92 | # Visual C++ cache files
93 | ipch/
94 | *.aps
95 | *.ncb
96 | *.opendb
97 | *.opensdf
98 | *.sdf
99 | *.cachefile
100 | *.VC.db
101 | *.VC.VC.opendb
102 |
103 | # Visual Studio profiler
104 | *.psess
105 | *.vsp
106 | *.vspx
107 | *.sap
108 |
109 | # Visual Studio Trace Files
110 | *.e2e
111 |
112 | # TFS 2012 Local Workspace
113 | $tf/
114 |
115 | # Guidance Automation Toolkit
116 | *.gpState
117 |
118 | # ReSharper is a .NET coding add-in
119 | _ReSharper*/
120 | *.[Rr]e[Ss]harper
121 | *.DotSettings.user
122 |
123 | # JustCode is a .NET coding add-in
124 | .JustCode
125 |
126 | # TeamCity is a build add-in
127 | _TeamCity*
128 |
129 | # DotCover is a Code Coverage Tool
130 | *.dotCover
131 |
132 | # AxoCover is a Code Coverage Tool
133 | .axoCover/*
134 | !.axoCover/settings.json
135 |
136 | # Visual Studio code coverage results
137 | *.coverage
138 | *.coveragexml
139 |
140 | # NCrunch
141 | _NCrunch_*
142 | .*crunch*.local.xml
143 | nCrunchTemp_*
144 |
145 | # MightyMoose
146 | *.mm.*
147 | AutoTest.Net/
148 |
149 | # Web workbench (sass)
150 | .sass-cache/
151 |
152 | # Installshield output folder
153 | [Ee]xpress/
154 |
155 | # DocProject is a documentation generator add-in
156 | DocProject/buildhelp/
157 | DocProject/Help/*.HxT
158 | DocProject/Help/*.HxC
159 | DocProject/Help/*.hhc
160 | DocProject/Help/*.hhk
161 | DocProject/Help/*.hhp
162 | DocProject/Help/Html2
163 | DocProject/Help/html
164 |
165 | # Click-Once directory
166 | publish/
167 |
168 | # Publish Web Output
169 | *.[Pp]ublish.xml
170 | *.azurePubxml
171 | # Note: Comment the next line if you want to checkin your web deploy settings,
172 | # but database connection strings (with potential passwords) will be unencrypted
173 | *.pubxml
174 | *.publishproj
175 |
176 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
177 | # checkin your Azure Web App publish settings, but sensitive information contained
178 | # in these scripts will be unencrypted
179 | PublishScripts/
180 |
181 | # NuGet Packages
182 | *.nupkg
183 | # The packages folder can be ignored because of Package Restore
184 | **/[Pp]ackages/*
185 | # except build/, which is used as an MSBuild target.
186 | !**/[Pp]ackages/build/
187 | # Uncomment if necessary however generally it will be regenerated when needed
188 | #!**/[Pp]ackages/repositories.config
189 | # NuGet v3's project.json files produces more ignorable files
190 | *.nuget.props
191 | *.nuget.targets
192 |
193 | # Microsoft Azure Build Output
194 | csx/
195 | *.build.csdef
196 |
197 | # Microsoft Azure Emulator
198 | ecf/
199 | rcf/
200 |
201 | # Windows Store app package directories and files
202 | AppPackages/
203 | BundleArtifacts/
204 | Package.StoreAssociation.xml
205 | _pkginfo.txt
206 | *.appx
207 |
208 | # Visual Studio cache files
209 | # files ending in .cache can be ignored
210 | *.[Cc]ache
211 | # but keep track of directories ending in .cache
212 | !*.[Cc]ache/
213 |
214 | # Others
215 | ClientBin/
216 | ~$*
217 | *~
218 | *.dbmdl
219 | *.dbproj.schemaview
220 | *.jfm
221 | *.pfx
222 | *.publishsettings
223 | orleans.codegen.cs
224 |
225 | # Including strong name files can present a security risk
226 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
227 | #*.snk
228 |
229 | # Since there are multiple workflows, uncomment next line to ignore bower_components
230 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
231 | #bower_components/
232 |
233 | # RIA/Silverlight projects
234 | Generated_Code/
235 |
236 | # Backup & report files from converting an old project file
237 | # to a newer Visual Studio version. Backup files are not needed,
238 | # because we have git ;-)
239 | _UpgradeReport_Files/
240 | Backup*/
241 | UpgradeLog*.XML
242 | UpgradeLog*.htm
243 | ServiceFabricBackup/
244 | *.rptproj.bak
245 |
246 | # SQL Server files
247 | *.mdf
248 | *.ldf
249 | *.ndf
250 |
251 | # Business Intelligence projects
252 | *.rdl.data
253 | *.bim.layout
254 | *.bim_*.settings
255 | *.rptproj.rsuser
256 |
257 | # Microsoft Fakes
258 | FakesAssemblies/
259 |
260 | # GhostDoc plugin setting file
261 | *.GhostDoc.xml
262 |
263 | # Node.js Tools for Visual Studio
264 | .ntvs_analysis.dat
265 | node_modules/
266 |
267 | # Visual Studio 6 build log
268 | *.plg
269 |
270 | # Visual Studio 6 workspace options file
271 | *.opt
272 |
273 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
274 | *.vbw
275 |
276 | # Visual Studio LightSwitch build output
277 | **/*.HTMLClient/GeneratedArtifacts
278 | **/*.DesktopClient/GeneratedArtifacts
279 | **/*.DesktopClient/ModelManifest.xml
280 | **/*.Server/GeneratedArtifacts
281 | **/*.Server/ModelManifest.xml
282 | _Pvt_Extensions
283 |
284 | # Paket dependency manager
285 | .paket/paket.exe
286 | paket-files/
287 |
288 | # FAKE - F# Make
289 | .fake/
290 |
291 | # JetBrains Rider
292 | .idea/
293 | *.sln.iml
294 |
295 | # CodeRush personal settings
296 | .cr/personal
297 |
298 | # Python Tools for Visual Studio (PTVS)
299 | __pycache__/
300 | *.pyc
301 |
302 | # Cake - Uncomment if you are using it
303 | # tools/**
304 | # !tools/packages.config
305 |
306 | # Tabs Studio
307 | *.tss
308 |
309 | # Telerik's JustMock configuration file
310 | *.jmconfig
311 |
312 | # BizTalk build output
313 | *.btp.cs
314 | *.btm.cs
315 | *.odx.cs
316 | *.xsd.cs
317 |
318 | # OpenCover UI analysis results
319 | OpenCover/
320 |
321 | # Azure Stream Analytics local run output
322 | ASALocalRun/
323 |
324 | # MSBuild Binary and Structured Log
325 | *.binlog
326 |
327 | # NVidia Nsight GPU debugger configuration file
328 | *.nvuser
329 |
330 | # MFractors (Xamarin productivity tool) working folder
331 | .mfractor/
332 |
333 | # Local History for Visual Studio
334 | .localhistory/
335 |
--------------------------------------------------------------------------------
/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/Assets/command_block_logo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeppiidev/MinecraftDatapackStudio/4401137b36a292e640ea7de65ec5a883fe6e831c/Assets/command_block_logo.ico
--------------------------------------------------------------------------------
/Assets/icons8/attribution.txt:
--------------------------------------------------------------------------------
1 | Icons by https://icons8.com
--------------------------------------------------------------------------------
/Assets/icons8/icon_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeppiidev/MinecraftDatapackStudio/4401137b36a292e640ea7de65ec5a883fe6e831c/Assets/icons8/icon_back.png
--------------------------------------------------------------------------------
/Assets/icons8/icon_forward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeppiidev/MinecraftDatapackStudio/4401137b36a292e640ea7de65ec5a883fe6e831c/Assets/icons8/icon_forward.png
--------------------------------------------------------------------------------
/Assets/icons8/reload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeppiidev/MinecraftDatapackStudio/4401137b36a292e640ea7de65ec5a883fe6e831c/Assets/icons8/reload.png
--------------------------------------------------------------------------------
/Assets/icons8/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeppiidev/MinecraftDatapackStudio/4401137b36a292e640ea7de65ec5a883fe6e831c/Assets/icons8/search.png
--------------------------------------------------------------------------------
/Browser/ControlExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace MinecraftDatapackStudio.Browser {
5 | public static class ControlExtensions {
6 | ///
7 | /// Executes the Action asynchronously on the UI thread, does not block execution on the calling thread.
8 | ///
9 | /// the control for which the update is required
10 | /// action to be performed on the control
11 | public static void InvokeOnUiThreadIfRequired(this Control control, Action action) {
12 | //If you are planning on using a similar function in your own code then please be sure to
13 | //have a quick read over https://stackoverflow.com/questions/1874728/avoid-calling-invoke-when-the-control-is-disposed
14 | //No action
15 | if (control.Disposing || control.IsDisposed || !control.IsHandleCreated) {
16 | return;
17 | }
18 |
19 | if (control.InvokeRequired) {
20 | control.BeginInvoke(action);
21 | } else {
22 | action.Invoke();
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Config/AboutInfo.json:
--------------------------------------------------------------------------------
1 | {
2 | "LatestVersion": "v1.0.0.13",
3 | "Contributors": [
4 | "yeppiidev",
5 | "Progamezia",
6 | "y2k04"
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/Config/VersionInfo.json:
--------------------------------------------------------------------------------
1 | {"versions":{"1.19 - 1.19.1":"9","1.18 - 1.18.2":"8","1.17 - 1.17.1":"7","1.16.2 - 1.16.5":"6","1.15 - 1.16.1":"5","1.13 - 1.14.4":"4"}}
2 |
--------------------------------------------------------------------------------
/Constants/TemplateTexts.cs:
--------------------------------------------------------------------------------
1 | namespace MinecraftDatapackStudio.Constants {
2 | class TemplateTexts {
3 | public static class MCFunction {
4 | public static string Header = "# Example function\n/execute as @p at @s run say \"hello\"";
5 | public static string TickFunctionHeader = "# The commands here will be executed every tick (20 times a second)";
6 | public static string LoadFunctionHeader = "# The commands here will be executed when the datapack loads";
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Data/AboutInfo.cs:
--------------------------------------------------------------------------------
1 | namespace MinecraftDatapackStudio.Data {
2 | public class AboutInfo {
3 | public string LatestVersion;
4 | public string[] Contributors;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Data/AppPreferences.cs:
--------------------------------------------------------------------------------
1 | using System.Drawing;
2 |
3 | namespace MinecraftDatapackStudio.Data {
4 | public class AppPreferences {
5 | public Editor Editor;
6 | public FilePaths FilePaths;
7 | }
8 |
9 | public class Editor {
10 | public Font Font;
11 | public int FontSize;
12 | public string Theme;
13 | }
14 |
15 | public class FilePaths {
16 | public string MinecraftInstallationDirectory;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Data/DatapackElement.cs:
--------------------------------------------------------------------------------
1 | namespace MinecraftDatapackStudio.Data {
2 | public enum DatapackElement {
3 | Function,
4 | LootTable,
5 | CraftingRecipe,
6 | Advancement,
7 | Dimension
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Data/DatapackInfo.cs:
--------------------------------------------------------------------------------
1 | namespace MinecraftDatapackStudio.Data {
2 | public class DatapackInfo {
3 | public string packId { get; set; }
4 | public string packDescription { get; set; }
5 | public int packVersion { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Data/DatapackVersion.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace MinecraftDatapackStudio.Data {
4 | public class DatapackVersion {
5 | public Dictionary versions = new Dictionary();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Data/JSONContainers/PackInfo.cs:
--------------------------------------------------------------------------------
1 | namespace MinecraftDatapackStudio.Data.JSONContainers {
2 | public class PackInfo {
3 | public pack pack;
4 | }
5 |
6 | public class pack {
7 | public int pack_format;
8 | public string description;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Data/JSONContainers/TagFunction.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace MinecraftDatapackStudio.Data.JSONContainers {
4 | public class FunctionTag {
5 | public FunctionTag() {
6 | values = new List();
7 | }
8 |
9 | public List values;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Data/SettingsProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Newtonsoft.Json;
3 |
4 | namespace MinecraftDatapackStudio.Data {
5 | public class SettingsProvider {
6 | public static AppPreferences Preferences;
7 |
8 | public static bool LoadSettings() {
9 | string settings = Properties.Settings.Default["SettingsJSON"].ToString();
10 |
11 | if (!string.IsNullOrEmpty(settings) && !string.IsNullOrWhiteSpace(settings)) {
12 | Preferences = JsonConvert.DeserializeObject(settings);
13 | } else {
14 | return false;
15 | }
16 |
17 | return true;
18 | }
19 |
20 | public static bool FlushSettings() {
21 | try {
22 | string settingsJson = JsonConvert.SerializeObject(Preferences);
23 |
24 | Utilities.PutConfig(settingsJson);
25 |
26 | return true;
27 | } catch (Exception) {
28 | return false;
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Data/VersionManifest.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace MinecraftDatapackStudio.Data {
4 | public class VersionManifest {
5 | public class latest {
6 | public string release { get; set; }
7 | public string snapshot { get; set; }
8 | }
9 |
10 | public List versions;
11 | }
12 |
13 | public class Version {
14 | public string id { get; set; }
15 | public string type { get; set; }
16 | public string url { get; set; }
17 | public string time { get; set; }
18 | public string releaseTime { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Dialogs/AboutDialog.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MinecraftDatapackStudio
2 | {
3 | partial class AboutForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | protected override void Dispose(bool disposing)
14 | {
15 | if (disposing && (components != null))
16 | {
17 | components.Dispose();
18 | }
19 | base.Dispose(disposing);
20 | }
21 |
22 | #region Windows Form Designer generated code
23 |
24 | ///
25 | /// Required method for Designer support - do not modify
26 | /// the contents of this method with the code editor.
27 | ///
28 | private void InitializeComponent()
29 | {
30 | this.closeDialog = new System.Windows.Forms.Button();
31 | this.titleText = new System.Windows.Forms.Label();
32 | this.latestVersionLabel = new System.Windows.Forms.Label();
33 | this.contributorsLabel = new System.Windows.Forms.Label();
34 | this.contributorsList = new System.Windows.Forms.ListBox();
35 | this.latestVersionLabelInfo = new System.Windows.Forms.Label();
36 | this.errorText = new System.Windows.Forms.Label();
37 | this.SuspendLayout();
38 | //
39 | // closeDialog
40 | //
41 | this.closeDialog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
42 | | System.Windows.Forms.AnchorStyles.Left)
43 | | System.Windows.Forms.AnchorStyles.Right)));
44 | this.closeDialog.BackColor = System.Drawing.SystemColors.ControlLight;
45 | this.closeDialog.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(110)))), ((int)(((byte)(110)))), ((int)(((byte)(110)))));
46 | this.closeDialog.Location = new System.Drawing.Point(503, 348);
47 | this.closeDialog.Name = "closeDialog";
48 | this.closeDialog.Size = new System.Drawing.Size(75, 23);
49 | this.closeDialog.TabIndex = 0;
50 | this.closeDialog.Text = "Close";
51 | this.closeDialog.UseVisualStyleBackColor = false;
52 | this.closeDialog.Click += new System.EventHandler(this.CloseDialog_Click);
53 | //
54 | // titleText
55 | //
56 | this.titleText.AutoSize = true;
57 | this.titleText.Font = new System.Drawing.Font("Microsoft PhagsPa", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
58 | this.titleText.Location = new System.Drawing.Point(12, 9);
59 | this.titleText.Name = "titleText";
60 | this.titleText.Size = new System.Drawing.Size(465, 46);
61 | this.titleText.TabIndex = 1;
62 | this.titleText.Text = "Minecraft Datapack Studio";
63 | //
64 | // latestVersionLabel
65 | //
66 | this.latestVersionLabel.AutoSize = true;
67 | this.latestVersionLabel.Location = new System.Drawing.Point(22, 68);
68 | this.latestVersionLabel.Name = "latestVersionLabel";
69 | this.latestVersionLabel.Size = new System.Drawing.Size(77, 13);
70 | this.latestVersionLabel.TabIndex = 2;
71 | this.latestVersionLabel.Text = "Latest Version:";
72 | //
73 | // contributorsLabel
74 | //
75 | this.contributorsLabel.AutoSize = true;
76 | this.contributorsLabel.Location = new System.Drawing.Point(33, 88);
77 | this.contributorsLabel.Name = "contributorsLabel";
78 | this.contributorsLabel.Size = new System.Drawing.Size(66, 13);
79 | this.contributorsLabel.TabIndex = 3;
80 | this.contributorsLabel.Text = "Contributors:";
81 | //
82 | // contributorsList
83 | //
84 | this.contributorsList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
85 | | System.Windows.Forms.AnchorStyles.Left)
86 | | System.Windows.Forms.AnchorStyles.Right)));
87 | this.contributorsList.FormattingEnabled = true;
88 | this.contributorsList.Items.AddRange(new object[] {
89 | "Loading..."});
90 | this.contributorsList.Location = new System.Drawing.Point(101, 88);
91 | this.contributorsList.Name = "contributorsList";
92 | this.contributorsList.Size = new System.Drawing.Size(477, 251);
93 | this.contributorsList.TabIndex = 4;
94 | //
95 | // latestVersionLabelInfo
96 | //
97 | this.latestVersionLabelInfo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
98 | | System.Windows.Forms.AnchorStyles.Right)));
99 | this.latestVersionLabelInfo.AutoSize = true;
100 | this.latestVersionLabelInfo.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
101 | this.latestVersionLabelInfo.Location = new System.Drawing.Point(98, 68);
102 | this.latestVersionLabelInfo.Name = "latestVersionLabelInfo";
103 | this.latestVersionLabelInfo.Size = new System.Drawing.Size(64, 13);
104 | this.latestVersionLabelInfo.TabIndex = 5;
105 | this.latestVersionLabelInfo.Text = "Loading...";
106 | //
107 | // errorText
108 | //
109 | this.errorText.AutoSize = true;
110 | this.errorText.Font = new System.Drawing.Font("Microsoft PhagsPa", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
111 | this.errorText.ForeColor = System.Drawing.Color.Brown;
112 | this.errorText.Location = new System.Drawing.Point(13, 357);
113 | this.errorText.Name = "errorText";
114 | this.errorText.Size = new System.Drawing.Size(146, 15);
115 | this.errorText.TabIndex = 6;
116 | this.errorText.Text = "Unable to load about info!";
117 | this.errorText.Visible = false;
118 | //
119 | // AboutForm
120 | //
121 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
122 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
123 | this.BackColor = System.Drawing.SystemColors.ButtonHighlight;
124 | this.ClientSize = new System.Drawing.Size(590, 383);
125 | this.Controls.Add(this.errorText);
126 | this.Controls.Add(this.latestVersionLabelInfo);
127 | this.Controls.Add(this.contributorsList);
128 | this.Controls.Add(this.contributorsLabel);
129 | this.Controls.Add(this.latestVersionLabel);
130 | this.Controls.Add(this.titleText);
131 | this.Controls.Add(this.closeDialog);
132 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
133 | this.MaximizeBox = false;
134 | this.MinimizeBox = false;
135 | this.Name = "AboutForm";
136 | this.Padding = new System.Windows.Forms.Padding(9);
137 | this.ShowIcon = false;
138 | this.ShowInTaskbar = false;
139 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
140 | this.Text = "About Minecraft Datapack Studio";
141 | this.ResumeLayout(false);
142 | this.PerformLayout();
143 |
144 | }
145 |
146 | #endregion
147 |
148 | private System.Windows.Forms.Button closeDialog;
149 | private System.Windows.Forms.Label titleText;
150 | private System.Windows.Forms.Label latestVersionLabel;
151 | private System.Windows.Forms.Label contributorsLabel;
152 | private System.Windows.Forms.ListBox contributorsList;
153 | private System.Windows.Forms.Label latestVersionLabelInfo;
154 | private System.Windows.Forms.Label errorText;
155 | }
156 | }
157 |
--------------------------------------------------------------------------------
/Dialogs/AboutDialog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.IO;
4 | using System.Net;
5 | using System.Windows.Forms;
6 | using MinecraftDatapackStudio.Data;
7 | using Newtonsoft.Json;
8 |
9 | namespace MinecraftDatapackStudio {
10 | partial class AboutForm : Form {
11 | public string AboutInfoDownloadPath = "meta/";
12 | public string AboutInfoDownloadFile = "AboutInfo.json";
13 |
14 | public AboutInfo AboutInfo;
15 |
16 | public AboutForm() {
17 | InitializeComponent();
18 |
19 | LoadAboutInfo();
20 | }
21 |
22 | public void LoadAboutInfo() {
23 | using (var client = new WebClient()) {
24 | try {
25 | if (!Directory.Exists(Global.AboutInfoDownloadPath)) {
26 | Directory.CreateDirectory(Global.AboutInfoDownloadPath);
27 | }
28 |
29 | if (Utilities.IsConnectedToInternet()) {
30 | client.DownloadFileAsync(new Uri(Global.AboutInfoDownloadLink), Path.Combine(Global.AboutInfoDownloadPath, Global.AboutInfoDownloadFile));
31 |
32 | client.DownloadFileCompleted += (object sender, AsyncCompletedEventArgs args) => {
33 | ParseAboutInfo();
34 | };
35 | } else {
36 | ParseAboutInfo();
37 | }
38 | } catch (Exception) {
39 | errorText.Show();
40 | }
41 | }
42 | }
43 |
44 | public void ParseAboutInfo() {
45 |
46 | try {
47 | String json = File.ReadAllText(Path.Combine(Global.AboutInfoDownloadPath, Global.AboutInfoDownloadFile));
48 | AboutInfo = JsonConvert.DeserializeObject(json);
49 |
50 | contributorsList.Items.Clear();
51 |
52 | foreach (var contributor in AboutInfo.Contributors) {
53 | contributorsList.Items.Add(contributor);
54 | }
55 |
56 | latestVersionLabelInfo.Text = AboutInfo.LatestVersion;
57 | } catch (Exception ex) {
58 | errorText.Text = $"Unable to load about info: {ex.Message}";
59 | errorText.Show();
60 | }
61 |
62 | }
63 |
64 | private void CloseDialog_Click(object sender, EventArgs e) {
65 | Close();
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/Dialogs/AboutDialog.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Dialogs/AddElementDialog.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MinecraftDatapackStudio.Dialogs {
2 | partial class AddElementDialog {
3 | ///
4 | /// Required designer variable.
5 | ///
6 | private System.ComponentModel.IContainer components = null;
7 |
8 | ///
9 | /// Clean up any resources being used.
10 | ///
11 | /// true if managed resources should be disposed; otherwise, false.
12 | protected override void Dispose(bool disposing) {
13 | if (disposing && (components != null)) {
14 | components.Dispose();
15 | }
16 | base.Dispose(disposing);
17 | }
18 |
19 | #region Windows Form Designer generated code
20 |
21 | ///
22 | /// Required method for Designer support - do not modify
23 | /// the contents of this method with the code editor.
24 | ///
25 | private void InitializeComponent() {
26 | this.header = new System.Windows.Forms.Label();
27 | this.label1 = new System.Windows.Forms.Label();
28 | this.elementTypeLbl = new System.Windows.Forms.Label();
29 | this.nameBox = new System.Windows.Forms.TextBox();
30 | this.elementType = new System.Windows.Forms.ComboBox();
31 | this.btnPanel = new System.Windows.Forms.Panel();
32 | this.errorText = new System.Windows.Forms.Label();
33 | this.cancelBtn = new System.Windows.Forms.Button();
34 | this.createBtn = new System.Windows.Forms.Button();
35 | this.btnPanel.SuspendLayout();
36 | this.SuspendLayout();
37 | //
38 | // header
39 | //
40 | this.header.AutoSize = true;
41 | this.header.Font = new System.Drawing.Font("Microsoft YaHei", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
42 | this.header.Location = new System.Drawing.Point(14, 15);
43 | this.header.Name = "header";
44 | this.header.Size = new System.Drawing.Size(215, 41);
45 | this.header.TabIndex = 0;
46 | this.header.Text = "Add Element";
47 | //
48 | // label1
49 | //
50 | this.label1.AutoSize = true;
51 | this.label1.Location = new System.Drawing.Point(56, 75);
52 | this.label1.Name = "label1";
53 | this.label1.Size = new System.Drawing.Size(38, 13);
54 | this.label1.TabIndex = 1;
55 | this.label1.Text = "Name:";
56 | //
57 | // elementTypeLbl
58 | //
59 | this.elementTypeLbl.AutoSize = true;
60 | this.elementTypeLbl.Location = new System.Drawing.Point(27, 99);
61 | this.elementTypeLbl.Name = "elementTypeLbl";
62 | this.elementTypeLbl.Size = new System.Drawing.Size(67, 13);
63 | this.elementTypeLbl.TabIndex = 2;
64 | this.elementTypeLbl.Text = "Select Type:";
65 | //
66 | // nameBox
67 | //
68 | this.nameBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
69 | | System.Windows.Forms.AnchorStyles.Right)));
70 | this.nameBox.Location = new System.Drawing.Point(95, 71);
71 | this.nameBox.Name = "nameBox";
72 | this.nameBox.Size = new System.Drawing.Size(333, 20);
73 | this.nameBox.TabIndex = 3;
74 | //
75 | // elementType
76 | //
77 | this.elementType.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
78 | | System.Windows.Forms.AnchorStyles.Right)));
79 | this.elementType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
80 | this.elementType.FormattingEnabled = true;
81 | this.elementType.Items.AddRange(new object[] {
82 | "Function",
83 | "Loot Table",
84 | "Recipe",
85 | "Advancement",
86 | "Dimension"});
87 | this.elementType.Location = new System.Drawing.Point(95, 96);
88 | this.elementType.Name = "elementType";
89 | this.elementType.Size = new System.Drawing.Size(333, 21);
90 | this.elementType.TabIndex = 4;
91 | //
92 | // btnPanel
93 | //
94 | this.btnPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
95 | | System.Windows.Forms.AnchorStyles.Right)));
96 | this.btnPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
97 | this.btnPanel.Controls.Add(this.errorText);
98 | this.btnPanel.Controls.Add(this.cancelBtn);
99 | this.btnPanel.Controls.Add(this.createBtn);
100 | this.btnPanel.Location = new System.Drawing.Point(1, 143);
101 | this.btnPanel.Name = "btnPanel";
102 | this.btnPanel.Size = new System.Drawing.Size(444, 41);
103 | this.btnPanel.TabIndex = 5;
104 | //
105 | // errorText
106 | //
107 | this.errorText.AutoSize = true;
108 | this.errorText.Font = new System.Drawing.Font("Microsoft YaHei", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
109 | this.errorText.ForeColor = System.Drawing.Color.Maroon;
110 | this.errorText.Location = new System.Drawing.Point(13, 14);
111 | this.errorText.Name = "errorText";
112 | this.errorText.Size = new System.Drawing.Size(36, 16);
113 | this.errorText.TabIndex = 2;
114 | this.errorText.Text = "Error";
115 | this.errorText.Visible = false;
116 | //
117 | // cancelBtn
118 | //
119 | this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
120 | this.cancelBtn.BackColor = System.Drawing.Color.White;
121 | this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
122 | this.cancelBtn.FlatAppearance.BorderColor = System.Drawing.SystemColors.Highlight;
123 | this.cancelBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
124 | this.cancelBtn.Location = new System.Drawing.Point(355, 10);
125 | this.cancelBtn.Name = "cancelBtn";
126 | this.cancelBtn.Size = new System.Drawing.Size(75, 23);
127 | this.cancelBtn.TabIndex = 1;
128 | this.cancelBtn.Text = "Cancel";
129 | this.cancelBtn.UseVisualStyleBackColor = false;
130 | this.cancelBtn.Click += new System.EventHandler(this.OnCancelButtonClick);
131 | //
132 | // createBtn
133 | //
134 | this.createBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
135 | this.createBtn.BackColor = System.Drawing.Color.White;
136 | this.createBtn.DialogResult = System.Windows.Forms.DialogResult.OK;
137 | this.createBtn.FlatAppearance.BorderColor = System.Drawing.SystemColors.Highlight;
138 | this.createBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
139 | this.createBtn.Location = new System.Drawing.Point(275, 10);
140 | this.createBtn.Name = "createBtn";
141 | this.createBtn.Size = new System.Drawing.Size(75, 23);
142 | this.createBtn.TabIndex = 0;
143 | this.createBtn.Text = "Add";
144 | this.createBtn.UseVisualStyleBackColor = false;
145 | this.createBtn.Click += new System.EventHandler(this.OnAddButtonClick);
146 | //
147 | // AddElementDialog
148 | //
149 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
150 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
151 | this.BackColor = System.Drawing.Color.White;
152 | this.ClientSize = new System.Drawing.Size(444, 183);
153 | this.Controls.Add(this.btnPanel);
154 | this.Controls.Add(this.elementType);
155 | this.Controls.Add(this.nameBox);
156 | this.Controls.Add(this.elementTypeLbl);
157 | this.Controls.Add(this.label1);
158 | this.Controls.Add(this.header);
159 | this.DoubleBuffered = true;
160 | this.MaximizeBox = false;
161 | this.MinimizeBox = false;
162 | this.Name = "AddElementDialog";
163 | this.ShowIcon = false;
164 | this.Text = "Add Element...";
165 | this.btnPanel.ResumeLayout(false);
166 | this.btnPanel.PerformLayout();
167 | this.ResumeLayout(false);
168 | this.PerformLayout();
169 |
170 | }
171 |
172 | #endregion
173 |
174 | private System.Windows.Forms.Label header;
175 | private System.Windows.Forms.Label label1;
176 | private System.Windows.Forms.Label elementTypeLbl;
177 | private System.Windows.Forms.TextBox nameBox;
178 | private System.Windows.Forms.ComboBox elementType;
179 | private System.Windows.Forms.Panel btnPanel;
180 | private System.Windows.Forms.Button cancelBtn;
181 | private System.Windows.Forms.Button createBtn;
182 | private System.Windows.Forms.Label errorText;
183 | }
184 | }
--------------------------------------------------------------------------------
/Dialogs/AddElementDialog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 | using MinecraftDatapackStudio.Data;
4 |
5 | namespace MinecraftDatapackStudio.Dialogs {
6 | public partial class AddElementDialog : Form {
7 | public DatapackElement DatapackElement { get; set; }
8 | public string DatapackElementName { get; set; }
9 |
10 | public AddElementDialog() {
11 | InitializeComponent();
12 |
13 | elementType.SelectedIndex = 0;
14 | }
15 |
16 | private void OnAddButtonClick(object sender, EventArgs e) {
17 | if (nameBox.Text == "") {
18 | errorText.Text = "Please enter the element name!";
19 | errorText.Show();
20 |
21 | return;
22 | }
23 |
24 | switch (elementType.SelectedItem.ToString()) {
25 | case "Function":
26 | DatapackElement = DatapackElement.Function;
27 | break;
28 | case "Loot Table":
29 | DatapackElement = DatapackElement.LootTable;
30 | break;
31 | case "Recipe":
32 | DatapackElement = DatapackElement.CraftingRecipe;
33 | break;
34 | case "Advancement":
35 | DatapackElement = DatapackElement.Advancement;
36 | break;
37 | case "Dimension":
38 | DatapackElement = DatapackElement.Dimension;
39 | break;
40 | default:
41 | DatapackElement = DatapackElement.Function;
42 | break;
43 | }
44 |
45 | DatapackElementName = nameBox.Text;
46 | }
47 |
48 | private void OnCancelButtonClick(object sender, EventArgs e) {
49 |
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/Dialogs/AddElementDialog.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Dialogs/NewProjectDialog.Designer.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Forms;
2 |
3 | namespace MinecraftDatapackStudio.Dialogs
4 | {
5 | partial class NewProjectDialog
6 | {
7 | ///
8 | /// Required designer variable.
9 | ///
10 | private System.ComponentModel.IContainer components = null;
11 |
12 | ///
13 | /// Clean up any resources being used.
14 | ///
15 | /// true if managed resources should be disposed; otherwise, false.
16 | protected override void Dispose(bool disposing)
17 | {
18 | if (disposing && (components != null))
19 | {
20 | components.Dispose();
21 | }
22 | base.Dispose(disposing);
23 | }
24 |
25 | #region Windows Form Designer generated code
26 |
27 | ///
28 | /// Required method for Designer support - do not modify
29 | /// the contents of this method with the code editor.
30 | ///
31 | private void InitializeComponent()
32 | {
33 | this.labelHeader = new System.Windows.Forms.Label();
34 | this.projectName = new System.Windows.Forms.Label();
35 | this.label2 = new System.Windows.Forms.Label();
36 | this.errorText = new System.Windows.Forms.Label();
37 | this.btnPanel = new System.Windows.Forms.Panel();
38 | this.cancelButton = new System.Windows.Forms.Button();
39 | this.createProjectButton = new System.Windows.Forms.Button();
40 | this.projDescLabel = new System.Windows.Forms.Label();
41 | this.chooseWorldLbl = new System.Windows.Forms.Label();
42 | this.projNameBox = new System.Windows.Forms.TextBox();
43 | this.projDescriptionBox = new System.Windows.Forms.TextBox();
44 | this.minecraftVersionBox = new System.Windows.Forms.ComboBox();
45 | this.worldsList = new System.Windows.Forms.ListBox();
46 | this.btnPanel.SuspendLayout();
47 | this.SuspendLayout();
48 | //
49 | // labelHeader
50 | //
51 | this.labelHeader.AutoSize = true;
52 | this.labelHeader.Font = new System.Drawing.Font("Microsoft PhagsPa", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
53 | this.labelHeader.Location = new System.Drawing.Point(13, 13);
54 | this.labelHeader.Name = "labelHeader";
55 | this.labelHeader.Size = new System.Drawing.Size(218, 48);
56 | this.labelHeader.TabIndex = 0;
57 | this.labelHeader.Text = "New Project";
58 | //
59 | // projectName
60 | //
61 | this.projectName.AutoSize = true;
62 | this.projectName.Location = new System.Drawing.Point(47, 83);
63 | this.projectName.Name = "projectName";
64 | this.projectName.Size = new System.Drawing.Size(74, 13);
65 | this.projectName.TabIndex = 1;
66 | this.projectName.Text = "Project Name:";
67 | //
68 | // label2
69 | //
70 | this.label2.AutoSize = true;
71 | this.label2.Location = new System.Drawing.Point(29, 133);
72 | this.label2.Name = "label2";
73 | this.label2.Size = new System.Drawing.Size(92, 13);
74 | this.label2.TabIndex = 2;
75 | this.label2.Text = "Minecraft Version:";
76 | //
77 | // errorText
78 | //
79 | this.errorText.AutoSize = true;
80 | this.errorText.Font = new System.Drawing.Font("Microsoft Tai Le", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
81 | this.errorText.ForeColor = System.Drawing.Color.Brown;
82 | this.errorText.Location = new System.Drawing.Point(12, 14);
83 | this.errorText.Name = "errorText";
84 | this.errorText.Size = new System.Drawing.Size(163, 14);
85 | this.errorText.TabIndex = 7;
86 | this.errorText.Text = "Unable to retrieve version list!";
87 | //
88 | // btnPanel
89 | //
90 | this.btnPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
91 | | System.Windows.Forms.AnchorStyles.Right)));
92 | this.btnPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
93 | this.btnPanel.Controls.Add(this.cancelButton);
94 | this.btnPanel.Controls.Add(this.createProjectButton);
95 | this.btnPanel.Controls.Add(this.errorText);
96 | this.btnPanel.Location = new System.Drawing.Point(0, 269);
97 | this.btnPanel.Name = "btnPanel";
98 | this.btnPanel.Size = new System.Drawing.Size(544, 40);
99 | this.btnPanel.TabIndex = 8;
100 | //
101 | // cancelButton
102 | //
103 | this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
104 | | System.Windows.Forms.AnchorStyles.Left)
105 | | System.Windows.Forms.AnchorStyles.Right)));
106 | this.cancelButton.BackColor = System.Drawing.Color.White;
107 | this.cancelButton.FlatAppearance.BorderColor = System.Drawing.SystemColors.Highlight;
108 | this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
109 | this.cancelButton.Location = new System.Drawing.Point(457, 9);
110 | this.cancelButton.Name = "cancelButton";
111 | this.cancelButton.Size = new System.Drawing.Size(75, 23);
112 | this.cancelButton.TabIndex = 9;
113 | this.cancelButton.Text = "Cancel";
114 | this.cancelButton.UseVisualStyleBackColor = false;
115 | this.cancelButton.Click += new System.EventHandler(this.CancelClicked);
116 | //
117 | // createProjectButton
118 | //
119 | this.createProjectButton.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
120 | | System.Windows.Forms.AnchorStyles.Left)
121 | | System.Windows.Forms.AnchorStyles.Right)));
122 | this.createProjectButton.BackColor = System.Drawing.Color.White;
123 | this.createProjectButton.FlatAppearance.BorderColor = System.Drawing.SystemColors.Highlight;
124 | this.createProjectButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
125 | this.createProjectButton.Location = new System.Drawing.Point(376, 9);
126 | this.createProjectButton.Name = "createProjectButton";
127 | this.createProjectButton.Size = new System.Drawing.Size(75, 23);
128 | this.createProjectButton.TabIndex = 8;
129 | this.createProjectButton.Text = "Create";
130 | this.createProjectButton.UseVisualStyleBackColor = false;
131 | this.createProjectButton.Click += new System.EventHandler(this.CreateProject);
132 | //
133 | // projDescLabel
134 | //
135 | this.projDescLabel.AutoSize = true;
136 | this.projDescLabel.Location = new System.Drawing.Point(22, 108);
137 | this.projDescLabel.Name = "projDescLabel";
138 | this.projDescLabel.Size = new System.Drawing.Size(99, 13);
139 | this.projDescLabel.TabIndex = 9;
140 | this.projDescLabel.Text = "Project Description:";
141 | //
142 | // chooseWorldLbl
143 | //
144 | this.chooseWorldLbl.AutoSize = true;
145 | this.chooseWorldLbl.Location = new System.Drawing.Point(44, 157);
146 | this.chooseWorldLbl.Name = "chooseWorldLbl";
147 | this.chooseWorldLbl.Size = new System.Drawing.Size(77, 13);
148 | this.chooseWorldLbl.TabIndex = 11;
149 | this.chooseWorldLbl.Text = "Choose World:";
150 | this.chooseWorldLbl.TextAlign = System.Drawing.ContentAlignment.TopCenter;
151 | //
152 | // projNameBox
153 | //
154 | this.projNameBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
155 | | System.Windows.Forms.AnchorStyles.Left)
156 | | System.Windows.Forms.AnchorStyles.Right)));
157 | this.projNameBox.BackColor = System.Drawing.SystemColors.ButtonHighlight;
158 | this.projNameBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
159 | this.projNameBox.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
160 | this.projNameBox.Location = new System.Drawing.Point(122, 79);
161 | this.projNameBox.Name = "projNameBox";
162 | this.projNameBox.Size = new System.Drawing.Size(399, 20);
163 | this.projNameBox.TabIndex = 12;
164 | //
165 | // projDescriptionBox
166 | //
167 | this.projDescriptionBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
168 | | System.Windows.Forms.AnchorStyles.Left)
169 | | System.Windows.Forms.AnchorStyles.Right)));
170 | this.projDescriptionBox.BackColor = System.Drawing.SystemColors.ButtonHighlight;
171 | this.projDescriptionBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
172 | this.projDescriptionBox.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
173 | this.projDescriptionBox.Location = new System.Drawing.Point(122, 105);
174 | this.projDescriptionBox.Name = "projDescriptionBox";
175 | this.projDescriptionBox.Size = new System.Drawing.Size(399, 20);
176 | this.projDescriptionBox.TabIndex = 13;
177 | //
178 | // minecraftVersionBox
179 | //
180 | this.minecraftVersionBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
181 | | System.Windows.Forms.AnchorStyles.Left)
182 | | System.Windows.Forms.AnchorStyles.Right)));
183 | this.minecraftVersionBox.BackColor = System.Drawing.SystemColors.ButtonHighlight;
184 | this.minecraftVersionBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
185 | this.minecraftVersionBox.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
186 | this.minecraftVersionBox.FormattingEnabled = true;
187 | this.minecraftVersionBox.Items.AddRange(new object[] {
188 | "Loading items...."});
189 | this.minecraftVersionBox.Location = new System.Drawing.Point(122, 131);
190 | this.minecraftVersionBox.Name = "minecraftVersionBox";
191 | this.minecraftVersionBox.Size = new System.Drawing.Size(399, 21);
192 | this.minecraftVersionBox.TabIndex = 14;
193 | //
194 | // worldsList
195 | //
196 | this.worldsList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
197 | | System.Windows.Forms.AnchorStyles.Left)
198 | | System.Windows.Forms.AnchorStyles.Right)));
199 | this.worldsList.BackColor = System.Drawing.SystemColors.ButtonHighlight;
200 | this.worldsList.Font = new System.Drawing.Font("Microsoft PhagsPa", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
201 | this.worldsList.ItemHeight = 17;
202 | this.worldsList.Location = new System.Drawing.Point(122, 158);
203 | this.worldsList.Name = "worldsList";
204 | this.worldsList.Size = new System.Drawing.Size(399, 89);
205 | this.worldsList.TabIndex = 15;
206 | //
207 | // NewProjectDialog
208 | //
209 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
210 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
211 | this.BackColor = System.Drawing.Color.White;
212 | this.ClientSize = new System.Drawing.Size(544, 308);
213 | this.Controls.Add(this.worldsList);
214 | this.Controls.Add(this.minecraftVersionBox);
215 | this.Controls.Add(this.projDescriptionBox);
216 | this.Controls.Add(this.projNameBox);
217 | this.Controls.Add(this.chooseWorldLbl);
218 | this.Controls.Add(this.projDescLabel);
219 | this.Controls.Add(this.btnPanel);
220 | this.Controls.Add(this.label2);
221 | this.Controls.Add(this.projectName);
222 | this.Controls.Add(this.labelHeader);
223 | this.DoubleBuffered = true;
224 | this.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
225 | this.MaximizeBox = false;
226 | this.MinimizeBox = false;
227 | this.MinimumSize = new System.Drawing.Size(560, 347);
228 | this.Name = "NewProjectDialog";
229 | this.ShowIcon = false;
230 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
231 | this.Text = "Create New Project";
232 | this.Load += new System.EventHandler(this.OnFormLoad);
233 | this.btnPanel.ResumeLayout(false);
234 | this.btnPanel.PerformLayout();
235 | this.ResumeLayout(false);
236 | this.PerformLayout();
237 |
238 | }
239 |
240 | #endregion
241 |
242 | private System.Windows.Forms.Label labelHeader;
243 | private System.Windows.Forms.Label projectName;
244 | private System.Windows.Forms.Label label2;
245 | private System.Windows.Forms.Label errorText;
246 | private System.Windows.Forms.Panel btnPanel;
247 | private System.Windows.Forms.Label projDescLabel;
248 | private System.Windows.Forms.Label chooseWorldLbl;
249 | private Button createProjectButton;
250 | private Button cancelButton;
251 | private TextBox projNameBox;
252 | private TextBox projDescriptionBox;
253 | private ComboBox minecraftVersionBox;
254 | private ListBox worldsList;
255 | }
256 | }
--------------------------------------------------------------------------------
/Dialogs/NewProjectDialog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Net;
5 | using System.Windows.Forms;
6 | using MinecraftDatapackStudio.Data;
7 | using MinecraftDatapackStudio.Data.JSONContainers;
8 | using Newtonsoft.Json;
9 |
10 | namespace MinecraftDatapackStudio.Dialogs {
11 | public partial class NewProjectDialog : Form {
12 | public static DatapackInfo PackInfo;
13 | public static Dictionary PackVersion;
14 | public static string PackInfoJson;
15 |
16 | public NewProjectDialog() {
17 | InitializeComponent();
18 |
19 | errorText.Hide();
20 | PackVersion = new Dictionary();
21 | }
22 |
23 | private void CancelClicked(object sender, EventArgs e) {
24 | Close();
25 | }
26 |
27 | static bool FileEquals(string path1, string path2) {
28 | byte[] file1 = File.ReadAllBytes(path1);
29 | byte[] file2 = File.ReadAllBytes(path2);
30 | if (file1.Length == file2.Length) {
31 | for (int i = 0; i < file1.Length; i++) {
32 | if (file1[i] != file2[i]) {
33 | return false;
34 | }
35 | }
36 | return true;
37 | }
38 | return false;
39 | }
40 |
41 | private void OnFormLoad(object sender, EventArgs e) {
42 | using (var client = new WebClient()) {
43 | try {
44 | if (!Directory.Exists(Global.VersionManifestDownloadPath)) {
45 | Directory.CreateDirectory(Global.VersionManifestDownloadPath);
46 | }
47 |
48 | if (Utilities.IsConnectedToInternet()) {
49 | client.DownloadFileAsync(new Uri(Global.VersionManifestDownloadLink), Path.Combine(Global.VersionManifestDownloadPath, Global.VersionManifestDownloadFile));
50 |
51 | client.DownloadFileCompleted += (object eventSender, System.ComponentModel.AsyncCompletedEventArgs completedEventArgs) => {
52 | ParseJSON();
53 | };
54 | } else {
55 | ParseJSON();
56 | }
57 | } catch (Exception) {
58 | errorText.Show();
59 | }
60 | }
61 |
62 | string[] worlds = Directory.GetDirectories(Path.Combine(Global.MinecraftPath, "saves"));
63 |
64 | worldsList.Items.Clear();
65 | foreach (string world in worlds) {
66 | worldsList.Items.Add(world.Replace(Path.Combine(Global.MinecraftPath, "saves"), "").Replace("\\", ""));
67 | }
68 | }
69 |
70 | public void ParseJSON() {
71 | try {
72 | String json = File.ReadAllText(Global.VersionManifestDownloadPath + Global.VersionManifestDownloadFile);
73 | DatapackVersion datapackVersion = JsonConvert.DeserializeObject(json);
74 |
75 | minecraftVersionBox.Items.Clear();
76 |
77 | foreach (var version in datapackVersion.versions) {
78 | minecraftVersionBox.Items.Add(version.Key);
79 | PackVersion.Add(version.Key, version.Value);
80 | }
81 | } catch (Exception ex) {
82 | errorText.Text = $"Unable to retrieve versions: {ex.Message}";
83 | errorText.Show();
84 | }
85 | }
86 |
87 | private void CreateProject(object sender, EventArgs e) {
88 | try {
89 | if (projNameBox.Text == "") {
90 | errorText.Text = "Please fill in all the fields!";
91 | errorText.Show();
92 |
93 | return;
94 | }
95 |
96 | if (PackVersion.Count <= 0) {
97 | return;
98 | }
99 |
100 | if (!PackVersion.ContainsKey(minecraftVersionBox.SelectedItem.ToString())) {
101 | errorText.Text = "Invalid Minecraft version!";
102 | errorText.Show();
103 |
104 | return;
105 | }
106 |
107 | // class thats used in the ide
108 | PackInfo = new DatapackInfo() {
109 | packId = projNameBox.Text.Replace(" ", "_")
110 | .Replace("/", "")
111 | .Replace("\\", "")
112 | .Replace("\"", "")
113 | .Replace("?", "")
114 | .Replace("*", "")
115 | .Replace("<", "")
116 | .Replace(">", "")
117 | .Replace(":", "")
118 | .Replace("|", ""),
119 | packDescription = projDescriptionBox.Text,
120 | packVersion = Int32.Parse(PackVersion[minecraftVersionBox.SelectedItem.ToString()])
121 | };
122 |
123 | // class thats used to serialize to json
124 | PackInfo datapackInfo = new PackInfo() {
125 | pack = new pack() {
126 | description = PackInfo.packDescription,
127 | pack_format = PackInfo.packVersion
128 | }
129 | };
130 |
131 | string json = JsonConvert.SerializeObject(datapackInfo, Formatting.Indented);
132 |
133 | if (MainForm.PackCreationFinished(json, Path.Combine(Global.MinecraftPath, "saves"), worldsList.Text, PackInfo)) {
134 | Close();
135 | }
136 | } catch (Exception) {
137 | errorText.Text = "Unable to create project!";
138 | errorText.Show();
139 | }
140 | }
141 | }
142 | }
143 |
--------------------------------------------------------------------------------
/Dialogs/NewProjectDialog.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Dialogs/OpenProjectDialog.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MinecraftDatapackStudio.Dialogs {
2 | partial class OpenProjectDialog {
3 | ///
4 | /// Required designer variable.
5 | ///
6 | private System.ComponentModel.IContainer components = null;
7 |
8 | ///
9 | /// Clean up any resources being used.
10 | ///
11 | /// true if managed resources should be disposed; otherwise, false.
12 | protected override void Dispose(bool disposing) {
13 | if (disposing && (components != null)) {
14 | components.Dispose();
15 | }
16 | base.Dispose(disposing);
17 | }
18 |
19 | #region Windows Form Designer generated code
20 |
21 | ///
22 | /// Required method for Designer support - do not modify
23 | /// the contents of this method with the code editor.
24 | ///
25 | private void InitializeComponent() {
26 | this.selectWorldLabel = new System.Windows.Forms.Label();
27 | this.worldsList = new System.Windows.Forms.ListBox();
28 | this.buttonPanel = new System.Windows.Forms.Panel();
29 | this.cancelButton = new System.Windows.Forms.Button();
30 | this.openButton = new System.Windows.Forms.Button();
31 | this.choosePack = new System.Windows.Forms.Label();
32 | this.datapacksList = new System.Windows.Forms.ComboBox();
33 | this.header = new System.Windows.Forms.Label();
34 | this.buttonPanel.SuspendLayout();
35 | this.SuspendLayout();
36 | //
37 | // selectWorldLabel
38 | //
39 | this.selectWorldLabel.AutoSize = true;
40 | this.selectWorldLabel.Location = new System.Drawing.Point(24, 77);
41 | this.selectWorldLabel.Name = "selectWorldLabel";
42 | this.selectWorldLabel.Size = new System.Drawing.Size(77, 13);
43 | this.selectWorldLabel.TabIndex = 0;
44 | this.selectWorldLabel.Text = "Select a world:";
45 | //
46 | // worldsList
47 | //
48 | this.worldsList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
49 | | System.Windows.Forms.AnchorStyles.Left)
50 | | System.Windows.Forms.AnchorStyles.Right)));
51 | this.worldsList.FormattingEnabled = true;
52 | this.worldsList.Location = new System.Drawing.Point(106, 77);
53 | this.worldsList.Name = "worldsList";
54 | this.worldsList.Size = new System.Drawing.Size(483, 134);
55 | this.worldsList.TabIndex = 1;
56 | this.worldsList.SelectedIndexChanged += new System.EventHandler(this.OnSelectionChanged);
57 | //
58 | // buttonPanel
59 | //
60 | this.buttonPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
61 | | System.Windows.Forms.AnchorStyles.Right)));
62 | this.buttonPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
63 | this.buttonPanel.Controls.Add(this.cancelButton);
64 | this.buttonPanel.Controls.Add(this.openButton);
65 | this.buttonPanel.Location = new System.Drawing.Point(-1, 258);
66 | this.buttonPanel.Name = "buttonPanel";
67 | this.buttonPanel.Size = new System.Drawing.Size(609, 45);
68 | this.buttonPanel.TabIndex = 2;
69 | //
70 | // cancelButton
71 | //
72 | this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
73 | this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
74 | this.cancelButton.FlatAppearance.BorderColor = System.Drawing.SystemColors.Highlight;
75 | this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
76 | this.cancelButton.Location = new System.Drawing.Point(520, 12);
77 | this.cancelButton.Name = "cancelButton";
78 | this.cancelButton.Size = new System.Drawing.Size(75, 23);
79 | this.cancelButton.TabIndex = 1;
80 | this.cancelButton.Text = "Cancel";
81 | this.cancelButton.UseVisualStyleBackColor = true;
82 | //
83 | // openButton
84 | //
85 | this.openButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
86 | this.openButton.DialogResult = System.Windows.Forms.DialogResult.OK;
87 | this.openButton.FlatAppearance.BorderColor = System.Drawing.SystemColors.Highlight;
88 | this.openButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
89 | this.openButton.Location = new System.Drawing.Point(439, 12);
90 | this.openButton.Name = "openButton";
91 | this.openButton.Size = new System.Drawing.Size(75, 23);
92 | this.openButton.TabIndex = 0;
93 | this.openButton.Text = "Open";
94 | this.openButton.UseVisualStyleBackColor = true;
95 | this.openButton.Click += new System.EventHandler(this.OpenProject);
96 | //
97 | // choosePack
98 | //
99 | this.choosePack.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
100 | this.choosePack.AutoSize = true;
101 | this.choosePack.Location = new System.Drawing.Point(19, 222);
102 | this.choosePack.Name = "choosePack";
103 | this.choosePack.Size = new System.Drawing.Size(82, 13);
104 | this.choosePack.TabIndex = 3;
105 | this.choosePack.Text = "Choose a pack:";
106 | //
107 | // datapacksList
108 | //
109 | this.datapacksList.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
110 | | System.Windows.Forms.AnchorStyles.Right)));
111 | this.datapacksList.FormattingEnabled = true;
112 | this.datapacksList.Location = new System.Drawing.Point(106, 219);
113 | this.datapacksList.Name = "datapacksList";
114 | this.datapacksList.Size = new System.Drawing.Size(483, 21);
115 | this.datapacksList.TabIndex = 4;
116 | //
117 | // header
118 | //
119 | this.header.AutoSize = true;
120 | this.header.Font = new System.Drawing.Font("Microsoft YaHei", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
121 | this.header.Location = new System.Drawing.Point(10, 14);
122 | this.header.Name = "header";
123 | this.header.Size = new System.Drawing.Size(254, 48);
124 | this.header.TabIndex = 5;
125 | this.header.Text = "Open Project";
126 | //
127 | // OpenProjectDialog
128 | //
129 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
130 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
131 | this.BackColor = System.Drawing.Color.White;
132 | this.ClientSize = new System.Drawing.Size(607, 302);
133 | this.Controls.Add(this.header);
134 | this.Controls.Add(this.datapacksList);
135 | this.Controls.Add(this.choosePack);
136 | this.Controls.Add(this.buttonPanel);
137 | this.Controls.Add(this.worldsList);
138 | this.Controls.Add(this.selectWorldLabel);
139 | this.Name = "OpenProjectDialog";
140 | this.ShowIcon = false;
141 | this.Text = "Open an existing project...";
142 | this.Load += new System.EventHandler(this.OnFormLoad);
143 | this.buttonPanel.ResumeLayout(false);
144 | this.ResumeLayout(false);
145 | this.PerformLayout();
146 |
147 | }
148 |
149 | #endregion
150 |
151 | private System.Windows.Forms.Label selectWorldLabel;
152 | private System.Windows.Forms.ListBox worldsList;
153 | private System.Windows.Forms.Panel buttonPanel;
154 | private System.Windows.Forms.Button cancelButton;
155 | private System.Windows.Forms.Button openButton;
156 | private System.Windows.Forms.Label choosePack;
157 | private System.Windows.Forms.ComboBox datapacksList;
158 | private System.Windows.Forms.Label header;
159 | }
160 | }
--------------------------------------------------------------------------------
/Dialogs/OpenProjectDialog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Linq;
4 | using System.Windows.Forms;
5 |
6 | namespace MinecraftDatapackStudio.Dialogs {
7 | public partial class OpenProjectDialog : Form {
8 | public string MinecraftPath { get; set; }
9 | public string DatapackName { get; set; }
10 | public string WorldName { get; set; }
11 | public string CurrentWorldPath { get; set; }
12 | public string ProjectFullPath { get; set; }
13 |
14 | public OpenProjectDialog(string minecraftPath) {
15 | InitializeComponent();
16 |
17 | MinecraftPath = minecraftPath;
18 | }
19 |
20 | private bool CheckIfProjectExists() {
21 | return false;
22 | }
23 |
24 | private void OpenProject(object sender, EventArgs e) {
25 | DatapackName = datapacksList.SelectedItem.ToString();
26 | WorldName = worldsList.SelectedItem.ToString();
27 |
28 | ProjectFullPath = Path.Combine(CurrentWorldPath, "datapacks", DatapackName);
29 | }
30 |
31 | private void OnFormLoad(object sender, EventArgs e) {
32 | string[] worlds = Directory.GetDirectories(MinecraftPath + "/saves");
33 |
34 | worldsList.Items.Clear();
35 | foreach (string world in worlds) {
36 | worldsList.Items.Add(world.Replace(MinecraftPath + "/saves", "").Replace("\\", ""));
37 | }
38 | }
39 |
40 | private void OnSelectionChanged(object sender, EventArgs e) {
41 | datapacksList.Items.Clear();
42 |
43 | try {
44 | string worldDir = Path.Combine(MinecraftPath, "saves", worldsList.SelectedItem.ToString(), "datapacks");
45 |
46 | if (!Directory.EnumerateFileSystemEntries(worldDir).Any()) {
47 | datapacksList.Items.Add("No datapacks available in this world");
48 | datapacksList.SelectedIndex = 0;
49 | openButton.Enabled = false;
50 |
51 | return;
52 | }
53 |
54 | string[] datapacks = Directory.GetDirectories(worldDir);
55 |
56 | foreach (string datapack in datapacks) {
57 | datapacksList.Items.Add(datapack.Replace(worldDir, "").Replace("\\", ""));
58 | datapacksList.SelectedIndex++;
59 | }
60 |
61 | CurrentWorldPath = Path.Combine(MinecraftPath, "saves", worldsList.SelectedItem.ToString());
62 | openButton.Enabled = true;
63 | } catch (Exception) {
64 | datapacksList.Items.Add("Invalid world (Doesnt contain datapacks folder)");
65 | datapacksList.SelectedIndex = 0;
66 |
67 | openButton.Enabled = false;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/Dialogs/OpenProjectDialog.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Dialogs/SettingsDialog.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MinecraftDatapackStudio.Dialogs {
2 | partial class SettingsDialog {
3 | ///
4 | /// Required designer variable.
5 | ///
6 | private System.ComponentModel.IContainer components = null;
7 |
8 | ///
9 | /// Clean up any resources being used.
10 | ///
11 | /// true if managed resources should be disposed; otherwise, false.
12 | protected override void Dispose(bool disposing) {
13 | if (disposing && (components != null)) {
14 | components.Dispose();
15 | }
16 | base.Dispose(disposing);
17 | }
18 |
19 | #region Windows Form Designer generated code
20 |
21 | ///
22 | /// Required method for Designer support - do not modify
23 | /// the contents of this method with the code editor.
24 | ///
25 | private void InitializeComponent() {
26 | this.titleLbl = new System.Windows.Forms.Label();
27 | this.btnPanel = new System.Windows.Forms.Panel();
28 | this.okBtn = new System.Windows.Forms.Button();
29 | this.cancelBtn = new System.Windows.Forms.Button();
30 | this.applyBtn = new System.Windows.Forms.Button();
31 | this.settingsTabs = new System.Windows.Forms.TabControl();
32 | this.Editor = new System.Windows.Forms.TabPage();
33 | this.darkGroupBox1 = new System.Windows.Forms.GroupBox();
34 | this.fontTextBox = new System.Windows.Forms.TextBox();
35 | this.chooseFontBtn = new System.Windows.Forms.Button();
36 | this.fontSizeCounter = new System.Windows.Forms.NumericUpDown();
37 | this.fontPickerLbl = new System.Windows.Forms.Label();
38 | this.fontSize = new System.Windows.Forms.Label();
39 | this.ThemesGroup = new System.Windows.Forms.GroupBox();
40 | this.colorSchemePicker = new System.Windows.Forms.ComboBox();
41 | this.editorThemeLabel = new System.Windows.Forms.Label();
42 | this.projGen = new System.Windows.Forms.TabPage();
43 | this.gboxFilePaths = new System.Windows.Forms.GroupBox();
44 | this.chooseMcFolderBtn = new System.Windows.Forms.Button();
45 | this.mcFolderPathBox = new System.Windows.Forms.TextBox();
46 | this.mcinstallfolderlbl = new System.Windows.Forms.Label();
47 | this.fontPicker = new System.Windows.Forms.FontDialog();
48 | this.btnPanel.SuspendLayout();
49 | this.settingsTabs.SuspendLayout();
50 | this.Editor.SuspendLayout();
51 | this.darkGroupBox1.SuspendLayout();
52 | ((System.ComponentModel.ISupportInitialize)(this.fontSizeCounter)).BeginInit();
53 | this.ThemesGroup.SuspendLayout();
54 | this.projGen.SuspendLayout();
55 | this.gboxFilePaths.SuspendLayout();
56 | this.SuspendLayout();
57 | //
58 | // titleLbl
59 | //
60 | this.titleLbl.AutoSize = true;
61 | this.titleLbl.Font = new System.Drawing.Font("Microsoft YaHei UI", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
62 | this.titleLbl.Location = new System.Drawing.Point(16, 17);
63 | this.titleLbl.Name = "titleLbl";
64 | this.titleLbl.Size = new System.Drawing.Size(155, 46);
65 | this.titleLbl.TabIndex = 0;
66 | this.titleLbl.Text = "Settings";
67 | //
68 | // btnPanel
69 | //
70 | this.btnPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
71 | | System.Windows.Forms.AnchorStyles.Right)));
72 | this.btnPanel.BackColor = System.Drawing.SystemColors.ButtonFace;
73 | this.btnPanel.Controls.Add(this.okBtn);
74 | this.btnPanel.Controls.Add(this.cancelBtn);
75 | this.btnPanel.Controls.Add(this.applyBtn);
76 | this.btnPanel.Location = new System.Drawing.Point(-2, 419);
77 | this.btnPanel.Name = "btnPanel";
78 | this.btnPanel.Size = new System.Drawing.Size(720, 43);
79 | this.btnPanel.TabIndex = 1;
80 | //
81 | // okBtn
82 | //
83 | this.okBtn.BackColor = System.Drawing.SystemColors.ControlLight;
84 | this.okBtn.DialogResult = System.Windows.Forms.DialogResult.OK;
85 | this.okBtn.FlatAppearance.BorderColor = System.Drawing.SystemColors.Highlight;
86 | this.okBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
87 | this.okBtn.Location = new System.Drawing.Point(471, 11);
88 | this.okBtn.Name = "okBtn";
89 | this.okBtn.Size = new System.Drawing.Size(75, 23);
90 | this.okBtn.TabIndex = 5;
91 | this.okBtn.Text = "OK";
92 | this.okBtn.UseVisualStyleBackColor = false;
93 | this.okBtn.Click += new System.EventHandler(this.OnOkButtonClick);
94 | //
95 | // cancelBtn
96 | //
97 | this.cancelBtn.BackColor = System.Drawing.SystemColors.ControlLight;
98 | this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
99 | this.cancelBtn.FlatAppearance.BorderColor = System.Drawing.SystemColors.Highlight;
100 | this.cancelBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
101 | this.cancelBtn.Location = new System.Drawing.Point(552, 11);
102 | this.cancelBtn.Name = "cancelBtn";
103 | this.cancelBtn.Size = new System.Drawing.Size(75, 23);
104 | this.cancelBtn.TabIndex = 4;
105 | this.cancelBtn.Text = "Cancel";
106 | this.cancelBtn.UseVisualStyleBackColor = false;
107 | //
108 | // applyBtn
109 | //
110 | this.applyBtn.BackColor = System.Drawing.SystemColors.ControlLight;
111 | this.applyBtn.Enabled = false;
112 | this.applyBtn.FlatAppearance.BorderColor = System.Drawing.SystemColors.Highlight;
113 | this.applyBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
114 | this.applyBtn.Location = new System.Drawing.Point(633, 11);
115 | this.applyBtn.Name = "applyBtn";
116 | this.applyBtn.Size = new System.Drawing.Size(75, 23);
117 | this.applyBtn.TabIndex = 3;
118 | this.applyBtn.Text = "Apply";
119 | this.applyBtn.UseVisualStyleBackColor = false;
120 | this.applyBtn.Click += new System.EventHandler(this.OnApplyButtonClick);
121 | //
122 | // settingsTabs
123 | //
124 | this.settingsTabs.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
125 | | System.Windows.Forms.AnchorStyles.Left)
126 | | System.Windows.Forms.AnchorStyles.Right)));
127 | this.settingsTabs.Controls.Add(this.Editor);
128 | this.settingsTabs.Controls.Add(this.projGen);
129 | this.settingsTabs.HotTrack = true;
130 | this.settingsTabs.Location = new System.Drawing.Point(24, 80);
131 | this.settingsTabs.Name = "settingsTabs";
132 | this.settingsTabs.SelectedIndex = 0;
133 | this.settingsTabs.Size = new System.Drawing.Size(675, 323);
134 | this.settingsTabs.TabIndex = 2;
135 | //
136 | // Editor
137 | //
138 | this.Editor.BackColor = System.Drawing.Color.White;
139 | this.Editor.Controls.Add(this.darkGroupBox1);
140 | this.Editor.Controls.Add(this.ThemesGroup);
141 | this.Editor.Location = new System.Drawing.Point(4, 22);
142 | this.Editor.Name = "Editor";
143 | this.Editor.Padding = new System.Windows.Forms.Padding(3);
144 | this.Editor.Size = new System.Drawing.Size(667, 297);
145 | this.Editor.TabIndex = 0;
146 | this.Editor.Text = "Editor";
147 | //
148 | // darkGroupBox1
149 | //
150 | this.darkGroupBox1.BackColor = System.Drawing.Color.White;
151 | this.darkGroupBox1.Controls.Add(this.fontTextBox);
152 | this.darkGroupBox1.Controls.Add(this.chooseFontBtn);
153 | this.darkGroupBox1.Controls.Add(this.fontSizeCounter);
154 | this.darkGroupBox1.Controls.Add(this.fontPickerLbl);
155 | this.darkGroupBox1.Controls.Add(this.fontSize);
156 | this.darkGroupBox1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
157 | this.darkGroupBox1.Location = new System.Drawing.Point(342, 6);
158 | this.darkGroupBox1.Name = "darkGroupBox1";
159 | this.darkGroupBox1.Size = new System.Drawing.Size(319, 283);
160 | this.darkGroupBox1.TabIndex = 3;
161 | this.darkGroupBox1.TabStop = false;
162 | this.darkGroupBox1.Text = "Fonts && Stuff";
163 | //
164 | // fontTextBox
165 | //
166 | this.fontTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
167 | this.fontTextBox.Location = new System.Drawing.Point(62, 45);
168 | this.fontTextBox.Name = "fontTextBox";
169 | this.fontTextBox.Size = new System.Drawing.Size(170, 20);
170 | this.fontTextBox.TabIndex = 11;
171 | this.fontTextBox.TextChanged += new System.EventHandler(this.OnFontTextBoxTextChange);
172 | //
173 | // chooseFontBtn
174 | //
175 | this.chooseFontBtn.BackColor = System.Drawing.SystemColors.ControlLight;
176 | this.chooseFontBtn.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
177 | this.chooseFontBtn.Location = new System.Drawing.Point(236, 44);
178 | this.chooseFontBtn.Name = "chooseFontBtn";
179 | this.chooseFontBtn.Size = new System.Drawing.Size(70, 22);
180 | this.chooseFontBtn.TabIndex = 10;
181 | this.chooseFontBtn.Text = "Choose...";
182 | this.chooseFontBtn.UseVisualStyleBackColor = false;
183 | this.chooseFontBtn.Click += new System.EventHandler(this.OnChooseFontButtonClick);
184 | //
185 | // fontSizeCounter
186 | //
187 | this.fontSizeCounter.Location = new System.Drawing.Point(62, 19);
188 | this.fontSizeCounter.Name = "fontSizeCounter";
189 | this.fontSizeCounter.Size = new System.Drawing.Size(243, 20);
190 | this.fontSizeCounter.TabIndex = 9;
191 | this.fontSizeCounter.ValueChanged += new System.EventHandler(this.OnFontSizeVounterValueChanged);
192 | //
193 | // fontPickerLbl
194 | //
195 | this.fontPickerLbl.AutoSize = true;
196 | this.fontPickerLbl.Location = new System.Drawing.Point(30, 47);
197 | this.fontPickerLbl.Name = "fontPickerLbl";
198 | this.fontPickerLbl.Size = new System.Drawing.Size(31, 13);
199 | this.fontPickerLbl.TabIndex = 8;
200 | this.fontPickerLbl.Text = "Font:";
201 | //
202 | // fontSize
203 | //
204 | this.fontSize.AutoSize = true;
205 | this.fontSize.Location = new System.Drawing.Point(7, 22);
206 | this.fontSize.Name = "fontSize";
207 | this.fontSize.Size = new System.Drawing.Size(54, 13);
208 | this.fontSize.TabIndex = 7;
209 | this.fontSize.Text = "Font Size:";
210 | //
211 | // ThemesGroup
212 | //
213 | this.ThemesGroup.BackColor = System.Drawing.Color.White;
214 | this.ThemesGroup.Controls.Add(this.colorSchemePicker);
215 | this.ThemesGroup.Controls.Add(this.editorThemeLabel);
216 | this.ThemesGroup.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
217 | this.ThemesGroup.Location = new System.Drawing.Point(6, 6);
218 | this.ThemesGroup.Name = "ThemesGroup";
219 | this.ThemesGroup.Size = new System.Drawing.Size(330, 283);
220 | this.ThemesGroup.TabIndex = 5;
221 | this.ThemesGroup.TabStop = false;
222 | this.ThemesGroup.Text = "Themes";
223 | //
224 | // colorSchemePicker
225 | //
226 | this.colorSchemePicker.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
227 | this.colorSchemePicker.FormattingEnabled = true;
228 | this.colorSchemePicker.Items.AddRange(new object[] {
229 | "Default Dark",
230 | "Default Light"});
231 | this.colorSchemePicker.Location = new System.Drawing.Point(87, 20);
232 | this.colorSchemePicker.Name = "colorSchemePicker";
233 | this.colorSchemePicker.Size = new System.Drawing.Size(229, 21);
234 | this.colorSchemePicker.TabIndex = 2;
235 | this.colorSchemePicker.SelectedValueChanged += new System.EventHandler(this.OnColorSchemePickerSelectedItemChanged);
236 | //
237 | // editorThemeLabel
238 | //
239 | this.editorThemeLabel.AutoSize = true;
240 | this.editorThemeLabel.BackColor = System.Drawing.Color.Transparent;
241 | this.editorThemeLabel.Location = new System.Drawing.Point(9, 23);
242 | this.editorThemeLabel.Name = "editorThemeLabel";
243 | this.editorThemeLabel.Size = new System.Drawing.Size(76, 13);
244 | this.editorThemeLabel.TabIndex = 0;
245 | this.editorThemeLabel.Text = "Color Scheme:";
246 | //
247 | // projGen
248 | //
249 | this.projGen.Controls.Add(this.gboxFilePaths);
250 | this.projGen.Location = new System.Drawing.Point(4, 22);
251 | this.projGen.Name = "projGen";
252 | this.projGen.Padding = new System.Windows.Forms.Padding(3);
253 | this.projGen.Size = new System.Drawing.Size(667, 297);
254 | this.projGen.TabIndex = 1;
255 | this.projGen.Text = "Project Generator";
256 | this.projGen.UseVisualStyleBackColor = true;
257 | //
258 | // gboxFilePaths
259 | //
260 | this.gboxFilePaths.Controls.Add(this.chooseMcFolderBtn);
261 | this.gboxFilePaths.Controls.Add(this.mcFolderPathBox);
262 | this.gboxFilePaths.Controls.Add(this.mcinstallfolderlbl);
263 | this.gboxFilePaths.Location = new System.Drawing.Point(7, 7);
264 | this.gboxFilePaths.Name = "gboxFilePaths";
265 | this.gboxFilePaths.Size = new System.Drawing.Size(654, 284);
266 | this.gboxFilePaths.TabIndex = 0;
267 | this.gboxFilePaths.TabStop = false;
268 | this.gboxFilePaths.Text = "File Paths";
269 | //
270 | // chooseMcFolderBtn
271 | //
272 | this.chooseMcFolderBtn.Location = new System.Drawing.Point(579, 16);
273 | this.chooseMcFolderBtn.Name = "chooseMcFolderBtn";
274 | this.chooseMcFolderBtn.Size = new System.Drawing.Size(68, 22);
275 | this.chooseMcFolderBtn.TabIndex = 2;
276 | this.chooseMcFolderBtn.Text = "Choose...\r\n";
277 | this.chooseMcFolderBtn.UseVisualStyleBackColor = true;
278 | this.chooseMcFolderBtn.Click += new System.EventHandler(this.ChooseMinecraftFolder);
279 | //
280 | // mcFolderPathBox
281 | //
282 | this.mcFolderPathBox.Location = new System.Drawing.Point(96, 17);
283 | this.mcFolderPathBox.Name = "mcFolderPathBox";
284 | this.mcFolderPathBox.Size = new System.Drawing.Size(478, 20);
285 | this.mcFolderPathBox.TabIndex = 1;
286 | this.mcFolderPathBox.TextChanged += new System.EventHandler(this.OnMinecraftFolderPathBoxTextChanged);
287 | //
288 | // mcinstallfolderlbl
289 | //
290 | this.mcinstallfolderlbl.AutoSize = true;
291 | this.mcinstallfolderlbl.Location = new System.Drawing.Point(10, 20);
292 | this.mcinstallfolderlbl.Name = "mcinstallfolderlbl";
293 | this.mcinstallfolderlbl.Size = new System.Drawing.Size(83, 13);
294 | this.mcinstallfolderlbl.TabIndex = 0;
295 | this.mcinstallfolderlbl.Text = "Minecraft folder:";
296 | //
297 | // fontPicker
298 | //
299 | this.fontPicker.FontMustExist = true;
300 | this.fontPicker.ShowApply = true;
301 | this.fontPicker.ShowEffects = false;
302 | //
303 | // SettingsDialog
304 | //
305 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
306 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
307 | this.BackColor = System.Drawing.Color.White;
308 | this.ClientSize = new System.Drawing.Size(718, 461);
309 | this.Controls.Add(this.settingsTabs);
310 | this.Controls.Add(this.btnPanel);
311 | this.Controls.Add(this.titleLbl);
312 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
313 | this.MaximizeBox = false;
314 | this.MinimizeBox = false;
315 | this.Name = "SettingsDialog";
316 | this.ShowIcon = false;
317 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
318 | this.Text = "Preferences";
319 | this.Load += new System.EventHandler(this.OnFormLoad);
320 | this.btnPanel.ResumeLayout(false);
321 | this.settingsTabs.ResumeLayout(false);
322 | this.Editor.ResumeLayout(false);
323 | this.darkGroupBox1.ResumeLayout(false);
324 | this.darkGroupBox1.PerformLayout();
325 | ((System.ComponentModel.ISupportInitialize)(this.fontSizeCounter)).EndInit();
326 | this.ThemesGroup.ResumeLayout(false);
327 | this.ThemesGroup.PerformLayout();
328 | this.projGen.ResumeLayout(false);
329 | this.gboxFilePaths.ResumeLayout(false);
330 | this.gboxFilePaths.PerformLayout();
331 | this.ResumeLayout(false);
332 | this.PerformLayout();
333 |
334 | }
335 |
336 | #endregion
337 |
338 | private System.Windows.Forms.Label titleLbl;
339 | private System.Windows.Forms.Panel btnPanel;
340 | private System.Windows.Forms.TabControl settingsTabs;
341 | private System.Windows.Forms.TabPage Editor;
342 | private System.Windows.Forms.TabPage projGen;
343 | private System.Windows.Forms.Label editorThemeLabel;
344 | private System.Windows.Forms.FontDialog fontPicker;
345 | private System.Windows.Forms.GroupBox ThemesGroup;
346 | private System.Windows.Forms.ComboBox colorSchemePicker;
347 | private System.Windows.Forms.GroupBox darkGroupBox1;
348 | private System.Windows.Forms.TextBox fontTextBox;
349 | private System.Windows.Forms.Button chooseFontBtn;
350 | private System.Windows.Forms.NumericUpDown fontSizeCounter;
351 | private System.Windows.Forms.Label fontPickerLbl;
352 | private System.Windows.Forms.Label fontSize;
353 | private System.Windows.Forms.Button okBtn;
354 | private System.Windows.Forms.Button cancelBtn;
355 | private System.Windows.Forms.Button applyBtn;
356 | private System.Windows.Forms.GroupBox gboxFilePaths;
357 | private System.Windows.Forms.Button chooseMcFolderBtn;
358 | private System.Windows.Forms.TextBox mcFolderPathBox;
359 | private System.Windows.Forms.Label mcinstallfolderlbl;
360 | }
361 | }
--------------------------------------------------------------------------------
/Dialogs/SettingsDialog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using System.Windows.Forms;
4 | using Microsoft.WindowsAPICodePack.Dialogs;
5 | using MinecraftDatapackStudio.Data;
6 | using MinecraftDatapackStudio.Theme;
7 | using Newtonsoft.Json;
8 |
9 | namespace MinecraftDatapackStudio.Dialogs {
10 | public partial class SettingsDialog : Form {
11 | public AppPreferences preferences;
12 |
13 | public SettingsDialog() {
14 | InitializeComponent();
15 |
16 | applyBtn.Enabled = false;
17 |
18 | fontPicker.Apply += OnFontApply;
19 | colorSchemePicker.SelectedIndex = 0;
20 |
21 | try {
22 | if (SettingsProvider.LoadSettings()) {
23 |
24 | fontTextBox.Text = SettingsProvider.Preferences.Editor.Font.Name;
25 | fontSizeCounter.Value = SettingsProvider.Preferences.Editor.FontSize;
26 | mcFolderPathBox.Text = SettingsProvider.Preferences.FilePaths.MinecraftInstallationDirectory == "" ? MainForm.DefaultMinecraftFolder : preferences.FilePaths.MinecraftInstallationDirectory;
27 |
28 | switch (SettingsProvider.Preferences.Editor.Theme) {
29 | case "Default Dark":
30 | MainForm.Context.ChangeEditorThemes(new DarkColorScheme());
31 | break;
32 | case "Default Light":
33 | MainForm.Context.ChangeEditorThemes(new LightColorScheme());
34 | break;
35 | default:
36 | MainForm.Context.ChangeEditorThemes(new DarkColorScheme());
37 | break;
38 | }
39 | colorSchemePicker.SelectedItem = SettingsProvider.Preferences.Editor.Theme;
40 |
41 | } else {
42 | fontSizeCounter.Value = 14;
43 | fontTextBox.Text = "Consolas";
44 |
45 | string settingsJson = JsonConvert.SerializeObject(preferences);
46 | Utilities.PutConfig(settingsJson);
47 | }
48 | } catch (Exception) {
49 | }
50 | }
51 |
52 | private void OnFormLoad(object sender, EventArgs e) {
53 |
54 | }
55 |
56 | private void OnFontApply(object sender, EventArgs e) {
57 | fontTextBox.Text = fontPicker.Font.Name;
58 | }
59 |
60 | private void OnChooseFontButtonClick(object sender, EventArgs e) {
61 | if (fontPicker.ShowDialog() == DialogResult.OK) {
62 | fontTextBox.Text = fontPicker.Font.Name;
63 | fontSizeCounter.Value = (decimal) fontPicker.Font.SizeInPoints;
64 | }
65 | }
66 |
67 | private void OnApplyButtonClick(object sender, EventArgs e) {
68 | ApplySettings();
69 | }
70 |
71 | public void ApplySettings() {
72 | preferences = new AppPreferences() {
73 | Editor = new Editor() {
74 | Font = new Font(fontTextBox.Text, (float) fontSizeCounter.Value),
75 | FontSize = (int) fontSizeCounter.Value,
76 | Theme = colorSchemePicker.SelectedItem.ToString()
77 | },
78 | FilePaths = new FilePaths() {
79 | MinecraftInstallationDirectory = mcFolderPathBox.Text
80 | }
81 | };
82 |
83 | string settingsJson = JsonConvert.SerializeObject(preferences);
84 | Utilities.PutConfig(settingsJson);
85 |
86 | switch (preferences.Editor.Theme) {
87 | case "Default Dark":
88 | MainForm.Context.ChangeEditorThemes(new DarkColorScheme());
89 | break;
90 | case "Default Light":
91 | MainForm.Context.ChangeEditorThemes(new LightColorScheme());
92 | break;
93 | default:
94 | MainForm.Context.ChangeEditorThemes(new DarkColorScheme());
95 | break;
96 | }
97 |
98 | MainForm.LoadConfig();
99 |
100 | applyBtn.Enabled = false;
101 | }
102 |
103 | private void OnColorSchemePickerSelectedItemChanged(object sender, EventArgs e) {
104 | applyBtn.Enabled = true;
105 | }
106 |
107 | private void OnFontSizeVounterValueChanged(object sender, EventArgs e) {
108 | applyBtn.Enabled = true;
109 | }
110 |
111 | private void OnFontTextBoxTextChange(object sender, EventArgs e) {
112 | applyBtn.Enabled = true;
113 | }
114 |
115 | private void OnOkButtonClick(object sender, EventArgs e) {
116 | ApplySettings();
117 | }
118 |
119 | private void ChooseMinecraftFolder(object sender, EventArgs e) {
120 | CommonOpenFileDialog dialog = new CommonOpenFileDialog();
121 |
122 | dialog.IsFolderPicker = true;
123 | dialog.Title = "Select where you installed Minecraft...";
124 | dialog.InitialDirectory = "%APPDATA%\\.minecraft";
125 | dialog.EnsurePathExists = true;
126 |
127 | if (dialog.ShowDialog() == CommonFileDialogResult.Ok) {
128 | mcFolderPathBox.Text = dialog.FileName;
129 | }
130 | }
131 |
132 | private void OnMinecraftFolderPathBoxTextChanged(object sender, EventArgs e) {
133 | applyBtn.Enabled = true;
134 | }
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/Dialogs/SettingsDialog.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
124 | 81
125 |
126 |
--------------------------------------------------------------------------------
/Dialogs/WebBrowserDialog.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MinecraftDatapackStudio.Dialogs
2 | {
3 | partial class WebBrowserDialog
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.browser = new CefSharp.WinForms.ChromiumWebBrowser();
32 | this.backBtn = new System.Windows.Forms.Button();
33 | this.forwardBtn = new System.Windows.Forms.Button();
34 | this.urlBox = new System.Windows.Forms.TextBox();
35 | this.reloadBtn = new System.Windows.Forms.Button();
36 | this.statusStrip1 = new System.Windows.Forms.StatusStrip();
37 | this.windowStatus = new System.Windows.Forms.ToolStripStatusLabel();
38 | this.statusStrip1.SuspendLayout();
39 | this.SuspendLayout();
40 | //
41 | // browser
42 | //
43 | this.browser.ActivateBrowserOnCreation = false;
44 | this.browser.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
45 | | System.Windows.Forms.AnchorStyles.Left)
46 | | System.Windows.Forms.AnchorStyles.Right)));
47 | // TODO: Code generation for '' failed because of Exception 'Invalid Primitive Type: System.IntPtr. Consider using CodeObjectCreateExpression.'.
48 | this.browser.Location = new System.Drawing.Point(0, 42);
49 | this.browser.Name = "browser";
50 | this.browser.Size = new System.Drawing.Size(800, 406);
51 | this.browser.TabIndex = 0;
52 | this.browser.LoadError += new System.EventHandler(this.OnLoadError);
53 | //
54 | // backBtn
55 | //
56 | this.backBtn.BackColor = System.Drawing.Color.Gainsboro;
57 | this.backBtn.BackgroundImage = global::MinecraftDatapackStudio.Properties.Resources.icon_back;
58 | this.backBtn.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
59 | this.backBtn.FlatAppearance.BorderColor = System.Drawing.Color.Gainsboro;
60 | this.backBtn.FlatAppearance.BorderSize = 0;
61 | this.backBtn.Location = new System.Drawing.Point(6, 5);
62 | this.backBtn.Name = "backBtn";
63 | this.backBtn.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
64 | this.backBtn.Size = new System.Drawing.Size(29, 29);
65 | this.backBtn.TabIndex = 1;
66 | this.backBtn.UseVisualStyleBackColor = false;
67 | this.backBtn.Click += new System.EventHandler(this.backBtn_Click);
68 | //
69 | // forwardBtn
70 | //
71 | this.forwardBtn.BackColor = System.Drawing.Color.Gainsboro;
72 | this.forwardBtn.BackgroundImage = global::MinecraftDatapackStudio.Properties.Resources.icon_forward;
73 | this.forwardBtn.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
74 | this.forwardBtn.FlatAppearance.BorderSize = 0;
75 | this.forwardBtn.Location = new System.Drawing.Point(38, 5);
76 | this.forwardBtn.Name = "forwardBtn";
77 | this.forwardBtn.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
78 | this.forwardBtn.Size = new System.Drawing.Size(29, 29);
79 | this.forwardBtn.TabIndex = 2;
80 | this.forwardBtn.UseVisualStyleBackColor = false;
81 | this.forwardBtn.Click += new System.EventHandler(this.forwardBtn_Click);
82 | //
83 | // urlBox
84 | //
85 | this.urlBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
86 | | System.Windows.Forms.AnchorStyles.Right)));
87 | this.urlBox.Location = new System.Drawing.Point(106, 10);
88 | this.urlBox.Name = "urlBox";
89 | this.urlBox.ReadOnly = true;
90 | this.urlBox.Size = new System.Drawing.Size(682, 20);
91 | this.urlBox.TabIndex = 3;
92 | //
93 | // reloadBtn
94 | //
95 | this.reloadBtn.BackColor = System.Drawing.Color.Gainsboro;
96 | this.reloadBtn.BackgroundImage = global::MinecraftDatapackStudio.Properties.Resources.reload;
97 | this.reloadBtn.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
98 | this.reloadBtn.FlatAppearance.BorderSize = 0;
99 | this.reloadBtn.Location = new System.Drawing.Point(70, 5);
100 | this.reloadBtn.Name = "reloadBtn";
101 | this.reloadBtn.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
102 | this.reloadBtn.Size = new System.Drawing.Size(29, 29);
103 | this.reloadBtn.TabIndex = 4;
104 | this.reloadBtn.UseVisualStyleBackColor = false;
105 | this.reloadBtn.Click += new System.EventHandler(this.reloadBtn_Click);
106 | //
107 | // statusStrip1
108 | //
109 | this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
110 | this.windowStatus});
111 | this.statusStrip1.Location = new System.Drawing.Point(0, 428);
112 | this.statusStrip1.Name = "statusStrip1";
113 | this.statusStrip1.Size = new System.Drawing.Size(800, 22);
114 | this.statusStrip1.TabIndex = 5;
115 | this.statusStrip1.Text = "statusStrip1";
116 | //
117 | // windowStatus
118 | //
119 | this.windowStatus.Name = "windowStatus";
120 | this.windowStatus.Size = new System.Drawing.Size(59, 17);
121 | this.windowStatus.Text = "Loading...";
122 | //
123 | // WebBrowserDialog
124 | //
125 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
126 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
127 | this.ClientSize = new System.Drawing.Size(800, 450);
128 | this.Controls.Add(this.statusStrip1);
129 | this.Controls.Add(this.reloadBtn);
130 | this.Controls.Add(this.urlBox);
131 | this.Controls.Add(this.forwardBtn);
132 | this.Controls.Add(this.backBtn);
133 | this.Controls.Add(this.browser);
134 | this.MinimumSize = new System.Drawing.Size(816, 489);
135 | this.Name = "WebBrowserDialog";
136 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
137 | this.Text = "Loading...";
138 | this.statusStrip1.ResumeLayout(false);
139 | this.statusStrip1.PerformLayout();
140 | this.ResumeLayout(false);
141 | this.PerformLayout();
142 |
143 | }
144 |
145 | #endregion
146 |
147 | private CefSharp.WinForms.ChromiumWebBrowser browser;
148 | private System.Windows.Forms.Button backBtn;
149 | private System.Windows.Forms.Button forwardBtn;
150 | private System.Windows.Forms.TextBox urlBox;
151 | private System.Windows.Forms.Button reloadBtn;
152 | private System.Windows.Forms.StatusStrip statusStrip1;
153 | private System.Windows.Forms.ToolStripStatusLabel windowStatus;
154 | }
155 | }
--------------------------------------------------------------------------------
/Dialogs/WebBrowserDialog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Drawing;
4 | using System.IO;
5 | using System.Net;
6 | using System.Windows.Forms;
7 | using CefSharp;
8 | using MinecraftDatapackStudio.Browser;
9 |
10 | namespace MinecraftDatapackStudio.Dialogs {
11 | public partial class WebBrowserDialog : Form {
12 | public WebBrowserDialog() {
13 | InitializeComponent();
14 | ResetIcon();
15 |
16 | browser.TitleChanged += OnTitleChange;
17 | browser.LoadError += OnLoadError;
18 | browser.FrameLoadEnd += OnFrameLoaded;
19 |
20 | forwardBtn.BackColor = forwardBtn.Enabled ? Color.Gainsboro : Color.Gray;
21 | backBtn.BackColor = backBtn.Enabled ? Color.Gainsboro : Color.Gray;
22 | }
23 |
24 | private void OnFrameLoaded(object sender, FrameLoadEndEventArgs e) {
25 | forwardBtn.Enabled = browser.CanGoForward;
26 | backBtn.Enabled = browser.CanGoBack;
27 |
28 | forwardBtn.BackColor = forwardBtn.Enabled ? Color.Gainsboro : Color.Gray;
29 | backBtn.BackColor = backBtn.Enabled ? Color.Gainsboro : Color.Gray;
30 |
31 | urlBox.Text = browser.GetMainFrame().Url;
32 | }
33 |
34 | private void OnLoadError(object sender, LoadErrorEventArgs e) {
35 | if (e.ErrorCode != CefErrorCode.Aborted) {
36 | windowStatus.Text = "Unable to load page: " + e.ErrorText;
37 | browser.LoadHtml(
38 | "Unable to load page:(
Unable to load page: " + e.ErrorText + "
"
39 | );
40 | }
41 | }
42 |
43 | private void OnTitleChange(object sender, TitleChangedEventArgs e) {
44 | this.InvokeOnUiThreadIfRequired(() => {
45 | Text = e.Title + " - Datapack Studio Wiki Browser";
46 |
47 | try {
48 | WebClient wc = new WebClient();
49 | MemoryStream memorystream = new MemoryStream(wc.DownloadData("http://" + new Uri(browser.Address.ToString()).Host + "/favicon.ico"));
50 | Icon icon = new Icon(memorystream);
51 | Icon = icon;
52 | } catch (Exception) {
53 | ResetIcon();
54 | }
55 | });
56 | }
57 |
58 | public void ResetIcon() {
59 | ComponentResourceManager resources = new ComponentResourceManager(typeof(MainForm));
60 | Icon = (Icon) resources.GetObject("$this.Icon");
61 | }
62 |
63 | public void LoadURL(string url) {
64 | browser.Load(url);
65 | }
66 |
67 | private void backBtn_Click(object sender, EventArgs e) {
68 | browser.Back();
69 | }
70 |
71 | private void forwardBtn_Click(object sender, EventArgs e) {
72 | browser.Forward();
73 | }
74 |
75 | private void reloadBtn_Click(object sender, EventArgs e) {
76 | browser.Reload();
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/Dialogs/WebBrowserDialog.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
--------------------------------------------------------------------------------
/FodyWeavers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/FodyWeavers.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Used to control if the On_PropertyName_Changed feature is enabled.
12 |
13 |
14 |
15 |
16 | Used to control if the Dependent properties feature is enabled.
17 |
18 |
19 |
20 |
21 | Used to control if the IsChanged property feature is enabled.
22 |
23 |
24 |
25 |
26 | Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form.
27 |
28 |
29 |
30 |
31 | Used to control if equality checks should be inserted. If false, equality checking will be disabled for the project.
32 |
33 |
34 |
35 |
36 | Used to control if equality checks should use the Equals method resolved from the base class.
37 |
38 |
39 |
40 |
41 | Used to control if equality checks should use the static Equals method resolved from the base class.
42 |
43 |
44 |
45 |
46 | Used to turn off build warnings from this weaver.
47 |
48 |
49 |
50 |
51 | Used to turn off build warnings about mismatched On_PropertyName_Changed methods.
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.
60 |
61 |
62 |
63 |
64 | A comma-separated list of error codes that can be safely ignored in assembly verification.
65 |
66 |
67 |
68 |
69 | 'false' to turn off automatic generation of the XML Schema file.
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/Global.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 |
4 | namespace MinecraftDatapackStudio {
5 | public class Global {
6 | public static string MinecraftPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), ".minecraft");
7 |
8 | public static string AboutInfoDownloadLink = "https://raw.githubusercontent.com/yeppiidev/MinecraftDatapackStudio/main/Config/AboutInfo.json";
9 | public static string AboutInfoDownloadPath = "meta/";
10 | public static string AboutInfoDownloadFile = "AboutInfo.json";
11 |
12 | public static string VersionManifestDownloadLink = "https://raw.githubusercontent.com/yeppiidev/MinecraftDatapackStudio/main/Config/VersionInfo.json";
13 | public static string VersionManifestDownloadPath = "meta/minecraft/";
14 | public static string VersionManifestDownloadFile = "version_manifest.json";
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 yeppiidev & contributors
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Lexers/MCFunctionLexer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text.RegularExpressions;
5 | using ScintillaNET;
6 |
7 | namespace MinecraftDatapackStudio.Lexers {
8 | public class MCFunctionLexer {
9 | public const int StyleDefault = 0;
10 | public const int StyleKeyword = 1;
11 | public const int StyleIdentifier = 2;
12 | public const int StyleNumber = 3;
13 | public const int StyleString = 4;
14 | public const int StyleComment = 5;
15 |
16 | private const int STATE_UNKNOWN = 0;
17 | private const int STATE_IDENTIFIER = 1;
18 | private const int STATE_NUMBER = 2;
19 | private const int STATE_STRING = 3;
20 | private const int STATE_COMMENT = 4;
21 |
22 | private HashSet keywords;
23 |
24 | public void Style(Scintilla scintilla, int startPos, int endPos) {
25 | // Back up to the line start
26 | var line = scintilla.LineFromPosition(startPos);
27 | startPos = scintilla.Lines[line].Position;
28 |
29 | var length = 0;
30 | var state = STATE_UNKNOWN;
31 |
32 | // Start styling
33 | scintilla.StartStyling(startPos);
34 | while (startPos < endPos) {
35 | var c = (char) scintilla.GetCharAt(startPos);
36 |
37 | REPROCESS:
38 | switch (state) {
39 | case STATE_UNKNOWN:
40 | if (c == '"') {
41 | // Start of "string"
42 | scintilla.SetStyling(1, StyleString);
43 | state = STATE_STRING;
44 | } else if (Char.IsDigit(c)) {
45 | state = STATE_NUMBER;
46 | goto REPROCESS;
47 | } else if (Char.IsLetter(c)) {
48 | state = STATE_IDENTIFIER;
49 | goto REPROCESS;
50 | } else {
51 | // Everything else
52 | scintilla.SetStyling(1, StyleDefault);
53 | }
54 | break;
55 |
56 | case STATE_STRING:
57 | if (c == '"') {
58 | length++;
59 | scintilla.SetStyling(length, StyleString);
60 | length = 0;
61 | state = STATE_UNKNOWN;
62 | } else if (c == '#') {
63 | length++;
64 | scintilla.SetStyling(length, StyleComment);
65 | length = 0;
66 | state = STATE_UNKNOWN;
67 | } else {
68 | length++;
69 | }
70 | break;
71 |
72 | case STATE_NUMBER:
73 | if (Char.IsDigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F') || c == 'x') {
74 | length++;
75 | } else {
76 | scintilla.SetStyling(length, StyleNumber);
77 | length = 0;
78 | state = STATE_UNKNOWN;
79 | goto REPROCESS;
80 | }
81 | break;
82 |
83 | case STATE_IDENTIFIER:
84 | if (Char.IsLetterOrDigit(c)) {
85 | length++;
86 | } else {
87 | var style = StyleIdentifier;
88 | var identifier = scintilla.GetTextRange(startPos - length, length);
89 | if (keywords.Contains(identifier))
90 | style = StyleKeyword;
91 |
92 | scintilla.SetStyling(length, style);
93 | length = 0;
94 | state = STATE_UNKNOWN;
95 | goto REPROCESS;
96 | }
97 | break;
98 | }
99 |
100 | startPos++;
101 | }
102 | }
103 |
104 | public MCFunctionLexer(string keywords) {
105 | // Put keywords in a HashSet
106 | var list = Regex.Split(keywords ?? string.Empty, @"\s+").Where(l => !string.IsNullOrEmpty(l));
107 | this.keywords = new HashSet(list);
108 | }
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/MinecraftDatapackStudio.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Debug
10 | AnyCPU
11 | {FCB7E8C1-E687-4BC1-9548-881E8FF3C5E9}
12 | WinExe
13 | MinecraftDatapackStudio
14 | MinecraftDatapackStudio
15 | v4.7.2
16 | 512
17 | true
18 | true
19 |
20 |
21 |
22 |
23 | AnyCPU
24 | true
25 | full
26 | true
27 | bin\Debug\
28 | DEBUG;TRACE
29 | prompt
30 | 4
31 |
32 |
33 | AnyCPU
34 | pdbonly
35 | true
36 | bin\Release\
37 | TRACE
38 | prompt
39 | 4
40 |
41 |
42 | true
43 | bin\x86\Debug\
44 | DEBUG;TRACE
45 | true
46 | full
47 | x86
48 | 7.3
49 | prompt
50 | MinimumRecommendedRules.ruleset
51 | true
52 |
53 |
54 | bin\x86\Release\
55 | TRACE
56 | true
57 | pdbonly
58 | x86
59 | 7.3
60 | prompt
61 | MinimumRecommendedRules.ruleset
62 | true
63 |
64 |
65 | app.manifest
66 |
67 |
68 | command_block_logo.ico
69 |
70 |
71 | MinecraftDatapackStudio.Program
72 |
73 |
74 |
75 | ..\..\..\..\..\Windows\microsoft.net\framework\v2.0.50727\aspnet_regsql.exe
76 |
77 |
78 | packages\AutoCompleteMenu-ScintillaNET.1.6.2\lib\net461\AutocompleteMenu-ScintillaNET.dll
79 |
80 |
81 | packages\CefSharp.Common.93.1.111\lib\net452\CefSharp.dll
82 |
83 |
84 | packages\CefSharp.Common.93.1.111\lib\net452\CefSharp.Core.dll
85 |
86 |
87 | packages\CefSharp.WinForms.93.1.111\lib\net452\CefSharp.WinForms.dll
88 |
89 |
90 | packages\DarkUI.2.0.2\lib\DarkUI.dll
91 |
92 |
93 |
94 |
95 | packages\Microsoft.WindowsAPICodePack-Core.1.1.0.0\lib\Microsoft.WindowsAPICodePack.dll
96 |
97 |
98 | packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.Shell.dll
99 |
100 |
101 | packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.ShellExtensions.dll
102 |
103 |
104 | packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll
105 |
106 |
107 | packages\PropertyChanged.Fody.3.4.0\lib\net40\PropertyChanged.dll
108 |
109 |
110 | packages\unofficial.ScintillaNET.3.8.7\lib\net40\ScintillaNET.dll
111 |
112 |
113 | packages\ScintillaNET_FindReplaceDialog.1.5.0\lib\net40\ScintillaNET_FindReplaceDialog.dll
114 |
115 |
116 | True
117 |
118 |
119 |
120 | packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll
121 |
122 |
123 |
124 |
125 |
126 | packages\System.Memory.4.5.4\lib\net461\System.Memory.dll
127 |
128 |
129 |
130 | packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll
131 |
132 |
133 | packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 | packages\VPKSoft.ScintillaLexers.1.1.7\lib\net45\VPKSoft.ScintillaLexers.dll
147 |
148 |
149 | packages\VPKSoft.ScintillaSpellCheck.1.0.7\lib\net47\VPKSoft.ScintillaSpellCheck.dll
150 |
151 |
152 | packages\VPKSoft.ScintillaTabbedTextControl.1.1.5\lib\net47\VPKSoft.ScintillaTabbedTextControl.dll
153 |
154 |
155 | packages\VPKSoft.ScintillaUrlDetect.1.0.1\lib\net47\VPKSoft.ScintillaUrlDetect.dll
156 |
157 |
158 | packages\VPKSoft.SpellCheck.ExternalDictionarySource.1.0.2\lib\netstandard2.0\VPKSoft.SpellCheck.ExternalDictionarySource.dll
159 |
160 |
161 | packages\WeCantSpell.Hunspell.3.0.1\lib\net45\WeCantSpell.Hunspell.dll
162 |
163 |
164 | packages\DockPanelSuite.3.1.0\lib\net40\WeifenLuo.WinFormsUI.Docking.dll
165 |
166 |
167 | packages\DockPanelSuite.ThemeVS2015.3.1.0\lib\net40\WeifenLuo.WinFormsUI.Docking.ThemeVS2015.dll
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 | Form
183 |
184 |
185 | AboutDialog.cs
186 |
187 |
188 |
189 | Form
190 |
191 |
192 | AddElementDialog.cs
193 |
194 |
195 | Form
196 |
197 |
198 | NewProjectDialog.cs
199 |
200 |
201 | Form
202 |
203 |
204 | OpenProjectDialog.cs
205 |
206 |
207 | Form
208 |
209 |
210 | SettingsDialog.cs
211 |
212 |
213 | Form
214 |
215 |
216 | WebBrowserDialog.cs
217 |
218 |
219 |
220 | True
221 | True
222 | Resources.resx
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 | Form
231 |
232 |
233 | MainForm.cs
234 |
235 |
236 |
237 |
238 | AboutDialog.cs
239 |
240 |
241 | AddElementDialog.cs
242 |
243 |
244 | NewProjectDialog.cs
245 |
246 |
247 | OpenProjectDialog.cs
248 |
249 |
250 | SettingsDialog.cs
251 |
252 |
253 | WebBrowserDialog.cs
254 |
255 |
256 | MainForm.cs
257 |
258 |
259 | ResXFileCodeGenerator
260 | Designer
261 | Resources.Designer.cs
262 |
263 |
264 |
265 |
266 | SettingsSingleFileGenerator
267 | Settings.Designer.cs
268 |
269 |
270 | True
271 | Settings.settings
272 | True
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
--------------------------------------------------------------------------------
/MinecraftDatapackStudio.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.30002.166
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MinecraftDatapackStudio", "MinecraftDatapackStudio.csproj", "{FCB7E8C1-E687-4BC1-9548-881E8FF3C5E9}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Debug|x86 = Debug|x86
12 | Release|Any CPU = Release|Any CPU
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {FCB7E8C1-E687-4BC1-9548-881E8FF3C5E9}.Debug|Any CPU.ActiveCfg = Debug|x86
17 | {FCB7E8C1-E687-4BC1-9548-881E8FF3C5E9}.Debug|Any CPU.Build.0 = Debug|x86
18 | {FCB7E8C1-E687-4BC1-9548-881E8FF3C5E9}.Debug|x86.ActiveCfg = Debug|x86
19 | {FCB7E8C1-E687-4BC1-9548-881E8FF3C5E9}.Debug|x86.Build.0 = Debug|x86
20 | {FCB7E8C1-E687-4BC1-9548-881E8FF3C5E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {FCB7E8C1-E687-4BC1-9548-881E8FF3C5E9}.Release|Any CPU.Build.0 = Release|Any CPU
22 | {FCB7E8C1-E687-4BC1-9548-881E8FF3C5E9}.Release|x86.ActiveCfg = Release|Any CPU
23 | {FCB7E8C1-E687-4BC1-9548-881E8FF3C5E9}.Release|x86.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {42B87158-0A54-42F6-9B31-6484C5A9F971}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Windows.Forms;
4 | using CefSharp;
5 | using CefSharp.WinForms;
6 |
7 | namespace MinecraftDatapackStudio {
8 | static class Program {
9 | static void InitializeCEF() {
10 | var settings = new CefSettings();
11 |
12 | //We're going to manually call Cef.Shutdown below, this maybe required in some complex scenarios
13 | CefSharpSettings.ShutdownOnExit = false;
14 |
15 | settings.LogSeverity = LogSeverity.Error;
16 | settings.CachePath = Path.Combine(Environment.CurrentDirectory, "wikibrowser/cache");
17 |
18 | // Don't use a proxy server, always make direct connections. Overrides any other proxy server flags that are passed.
19 | // Slightly improves Cef initialize time as it won't attempt to resolve a proxy
20 | settings.CefCommandLineArgs.Add("no-proxy-server");
21 |
22 | //For Windows 7 and above, best to include relevant app.manifest entries as well
23 | Cef.EnableHighDPISupport();
24 |
25 | Cef.Initialize(settings);
26 | }
27 |
28 | ///
29 | /// The main entry point for the application.
30 | ///
31 | [STAThread]
32 | static void Main() {
33 | InitializeCEF();
34 |
35 | Application.EnableVisualStyles();
36 | Application.SetCompatibleTextRenderingDefault(false);
37 | Application.Run(new MainForm());
38 |
39 | Cef.Shutdown();
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("Minecraft Datapack Studio")]
8 | [assembly: AssemblyDescription("An easy-to-use Minecraft datapack creator for Windows")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("YeppiiDev")]
11 | [assembly: AssemblyProduct("Minecraft Datapack Studio")]
12 | [assembly: AssemblyCopyright("Copyright © YeppiiDev 2022")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("fcb7e8c1-e687-4bc1-9548-881e8ff3c5e9")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.13")]
35 | [assembly: AssemblyFileVersion("1.0.0.13")]
36 |
--------------------------------------------------------------------------------
/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace MinecraftDatapackStudio.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MinecraftDatapackStudio.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
65 | ///
66 | internal static System.Drawing.Icon command_block_logo {
67 | get {
68 | object obj = ResourceManager.GetObject("command_block_logo", resourceCulture);
69 | return ((System.Drawing.Icon)(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// Looks up a localized resource of type System.Drawing.Bitmap.
75 | ///
76 | internal static System.Drawing.Bitmap icon_back {
77 | get {
78 | object obj = ResourceManager.GetObject("icon_back", resourceCulture);
79 | return ((System.Drawing.Bitmap)(obj));
80 | }
81 | }
82 |
83 | ///
84 | /// Looks up a localized resource of type System.Drawing.Bitmap.
85 | ///
86 | internal static System.Drawing.Bitmap icon_forward {
87 | get {
88 | object obj = ResourceManager.GetObject("icon_forward", resourceCulture);
89 | return ((System.Drawing.Bitmap)(obj));
90 | }
91 | }
92 |
93 | ///
94 | /// Looks up a localized resource of type System.Drawing.Bitmap.
95 | ///
96 | internal static System.Drawing.Bitmap reload {
97 | get {
98 | object obj = ResourceManager.GetObject("reload", resourceCulture);
99 | return ((System.Drawing.Bitmap)(obj));
100 | }
101 | }
102 |
103 | ///
104 | /// Looks up a localized resource of type System.Drawing.Bitmap.
105 | ///
106 | internal static System.Drawing.Bitmap search {
107 | get {
108 | object obj = ResourceManager.GetObject("search", resourceCulture);
109 | return ((System.Drawing.Bitmap)(obj));
110 | }
111 | }
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Assets\command_block_logo.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
125 | ..\Assets\icons8\icon_back.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
128 | ..\Assets\icons8\icon_forward.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
129 |
130 |
131 | ..\Assets\icons8\reload.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
132 |
133 |
134 | ..\Assets\icons8\search.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
135 |
136 |
--------------------------------------------------------------------------------
/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace MinecraftDatapackStudio.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("")]
29 | public string SettingsJSON {
30 | get {
31 | return ((string)(this["SettingsJSON"]));
32 | }
33 | set {
34 | this["SettingsJSON"] = value;
35 | }
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Minecraft Datapack Studio
2 | An easy-to-use IDE for making Minecraft Datapacks.
3 |
4 | ### PS: Development is currently stale. Feel free to fork and modify :)
5 |
6 | > **_Warning: This application is experimental: It may contain a lot of bugs, use only if you know what you're doing (It can sometimes even corrupt your Minecraft worlds, so think twice before using this!)_**
7 |
8 | # Screenshots
9 | 
10 |
11 | # How to use?
12 | - Head over to the [releases](https://github.com/yeppiidev/MinecraftDatapackStudio/releases) page and download the latest release
13 | - Make sure you have .NET Framework 4.7 or above installed (It should be installed if you have the latest Windows updates installed)
14 | - Download the `.zip` file or the installer `.exe` (`.zip` is recommended)
15 | - If you've downloaded the zip, go to the folder where you extracted the zip and double click the executable (`MinecraftDatapackStudio.exe`) to run the IDE
16 | - If you've downloaded the installer, go ahead and install it. After you've installed it, you should now see an icon in the desktop. Double click the icon to run the IDE
17 |
18 | # Libraries and icons used
19 | - Browser icons by [Icons8](https://icons8.com)
20 | - [CEFSharp](https://cefsharp.github.io/) - C# bindings for [CEF](https://bitbucket.org/chromiumembedded/cef/src/master/) (Chromium Embedded Framework)
21 | - [Scintilla.NET](https://github.com/jacobslusser/ScintillaNET/) - C# bindings for [Scintilla](https://www.scintilla.org) Editor Library
22 |
23 | # Contributors
24 | - **[yeppiidev](https://github.com/yeppiidev)** (author/owner)
25 | - [Progamezia](https://github.com/Aagney-github) (testing)
26 | - [y2k04](https://github.com/y2k04) (bug fixes)
27 |
28 | # External links
29 | - [Changelog](https://yeppiidev.github.io/MinecraftDatapackStudio/CHANGELOG.html)
30 |
--------------------------------------------------------------------------------
/Resources/Clock.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeppiidev/MinecraftDatapackStudio/4401137b36a292e640ea7de65ec5a883fe6e831c/Resources/Clock.ico
--------------------------------------------------------------------------------
/Resources/Clock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeppiidev/MinecraftDatapackStudio/4401137b36a292e640ea7de65ec5a883fe6e831c/Resources/Clock.png
--------------------------------------------------------------------------------
/Resources/DeleteHS.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeppiidev/MinecraftDatapackStudio/4401137b36a292e640ea7de65ec5a883fe6e831c/Resources/DeleteHS.png
--------------------------------------------------------------------------------
/Resources/GoToNextMessage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeppiidev/MinecraftDatapackStudio/4401137b36a292e640ea7de65ec5a883fe6e831c/Resources/GoToNextMessage.png
--------------------------------------------------------------------------------
/Resources/GoToPreviousMessage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeppiidev/MinecraftDatapackStudio/4401137b36a292e640ea7de65ec5a883fe6e831c/Resources/GoToPreviousMessage.png
--------------------------------------------------------------------------------
/Resources/LineColorHS.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeppiidev/MinecraftDatapackStudio/4401137b36a292e640ea7de65ec5a883fe6e831c/Resources/LineColorHS.png
--------------------------------------------------------------------------------
/Theme/ColorScheme.cs:
--------------------------------------------------------------------------------
1 | using System.Drawing;
2 |
3 | namespace MinecraftDatapackStudio.Theme {
4 | public class ColorScheme {
5 | public ThemeElement.CommentLine CommentLine = new ThemeElement.CommentLine();
6 | public ThemeElement.Word Word = new ThemeElement.Word();
7 | public ThemeElement.Word2 Word2 = new ThemeElement.Word2();
8 | public ThemeElement.String String = new ThemeElement.String();
9 | public ThemeElement.Editor Editor = new ThemeElement.Editor();
10 |
11 | public ColorScheme() {
12 | // Constructor for subclasses
13 | }
14 | }
15 |
16 | public class ThemeElement {
17 | public class Editor {
18 | public Color ForeColor;
19 | public Color BackColor;
20 | public Color MarginBackColor;
21 | public Color CaretForeColor;
22 | }
23 |
24 | public class String {
25 | public Color ForeColor;
26 | public Color BackColor;
27 | }
28 |
29 | public class Word2 {
30 | public Color ForeColor;
31 | public Color BackColor;
32 | }
33 |
34 | public class Word {
35 | public Color ForeColor;
36 | public Color BackColor;
37 | }
38 |
39 | public class CommentLine {
40 | public Color ForeColor;
41 | public Color BackColor;
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Theme/DarkColorScheme.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 |
4 | namespace MinecraftDatapackStudio.Theme {
5 | public class DarkColorScheme : ColorScheme {
6 | public DarkColorScheme() {
7 | // do nothing
8 | String.ForeColor = Color.FromArgb(152, 195, 121);
9 | CommentLine.ForeColor = Color.FromArgb(157, 152, 152);
10 | Word.ForeColor = Color.FromArgb(97, 175, 239);
11 | Word2.ForeColor = Color.FromArgb(229, 192, 123);
12 | Editor.BackColor = Color.FromArgb(49, 58, 64);
13 | Editor.MarginBackColor = Color.FromArgb(67, 79, 87);
14 | Editor.ForeColor = Color.FromArgb(245, 245, 245);
15 | Editor.CaretForeColor = Color.White;
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/Theme/LightColorScheme.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 |
4 | namespace MinecraftDatapackStudio.Theme {
5 | public class LightColorScheme : ColorScheme {
6 | public LightColorScheme() {
7 | // do nothing
8 | String.ForeColor = Color.FromArgb(163, 21, 21);
9 | CommentLine.ForeColor = Color.FromArgb(0, 128, 0); ;
10 | Word.ForeColor = Color.Blue;
11 | Word2.ForeColor = Color.Blue;
12 | Editor.BackColor = Color.White;
13 | Editor.MarginBackColor = Color.Gainsboro;
14 | Editor.ForeColor = Color.Black;
15 | Editor.CaretForeColor = Color.Black;
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/Utilities.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Runtime.InteropServices;
4 | using System.Text;
5 | using System.Windows.Forms;
6 | using Newtonsoft.Json;
7 |
8 | namespace MinecraftDatapackStudio {
9 | public class Utilities {
10 | public Utilities() { }
11 |
12 | public static void PutConfig(string value) {
13 | Properties.Settings.Default.SettingsJSON = value;
14 | Properties.Settings.Default.Save();
15 | }
16 |
17 | public static bool WriteFile(string fileName, string content) {
18 | try {
19 | // Check if file already exists. If yes, delete it.
20 | if (File.Exists(fileName)) {
21 | File.Delete(fileName);
22 | }
23 |
24 | // Create a new file
25 | using (FileStream fs = File.Create(fileName)) {
26 | // Add some text to file
27 | Byte[] text = new UTF8Encoding(true).GetBytes(content);
28 | fs.Write(text, 0, text.Length);
29 | }
30 |
31 | return true;
32 | } catch (Exception Ex) {
33 | MessageBox.Show(Ex.ToString());
34 | return false;
35 | }
36 | }
37 |
38 | //Creating the extern function...
39 | [DllImport("wininet.dll")]
40 | private extern static bool InternetGetConnectedState(out int Description, int ReservedValue);
41 |
42 | //Creating a function that uses the API function...
43 | public static bool IsConnectedToInternet() {
44 | int Desc;
45 | return InternetGetConnectedState(out Desc, 0);
46 | }
47 |
48 | public static bool WriteJson(string file, object obj) {
49 | string json = JsonConvert.SerializeObject(obj, Formatting.Indented);
50 |
51 | return WriteFile(file, json);
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
33 |
34 |
35 | true
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/command_block_logo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeppiidev/MinecraftDatapackStudio/4401137b36a292e640ea7de65ec5a883fe6e831c/command_block_logo.ico
--------------------------------------------------------------------------------
/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------