-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEditorApp.cs
114 lines (97 loc) · 2.63 KB
/
EditorApp.cs
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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
110
111
112
113
114
using Caravel;
using Caravel.Core;
using Caravel.Core.Physics;
using CaravelEditor;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MonoGame.Forms.Services;
namespace CaravelEditor
{
public class EditorApp : CaravelApp
{
public EditorWindow EWindow
{
get; set;
}
public EditorForm EForm
{
get; set;
}
public string CurrentScene
{
get; set;
}
public string CurrentResourceBundle
{
get; set;
}
public EditorLogic EditorLogic
{
get
{
return (EditorLogic) Logic;
}
}
public enum EditorMode
{
TRANSFORM,
CAMERA,
CREATE
}
public EditorMode Mode
{
get; set;
}
private UpdateService _updateService;
public EditorApp(GraphicsDevice gd, UpdateService editor, int screenWidth, int screenHeight) : base(screenWidth, screenHeight)
{
CurrentGraphicsDevice = gd;
_updateService = editor;
EditorRunning = true;
UseDevelopmentDirectories = true;
IsMouseVisible = true;
}
protected override bool VCheckGameSystemResources()
{
return true;
}
protected override Cv_GameLogic VCreateGameLogic()
{
return new EditorLogic(this);
}
protected override Cv_GamePhysics VCreateGamePhysics()
{
return Cv_GamePhysics.CreateNullPhysics(this);
}
protected override Cv_GameView[] VCreateGameViews()
{
var gvs = new Cv_GameView[1];
gvs[0] = new EditorView(Cv_Player.One, _updateService.spriteBatch);
return gvs;
}
protected override string VGetGameAppDirectoryName()
{
return "CaravelEditor/1.0";
}
protected override string VGetGameTitle()
{
return "Caravel Editor";
}
protected override bool VInitialize()
{
EditorLogic.EditorView.Init();
return true;
}
protected override bool VLoadGame()
{
EForm.LoadComponentDefinitions();
Logic.UnloadScene(null);
Logic.LoadScene(CurrentScene, CurrentResourceBundle, "Root");
EForm.InitializeSceneEntities();
EForm.InitializeTools();
EForm.InitializeAssets();
EForm.InitializeEntityTypes();
return true;
}
}
}