Skip to content

Commit 2c162df

Browse files
committed
Changes for v1.6b UI
1 parent 4806336 commit 2c162df

File tree

20 files changed

+128
-74
lines changed

20 files changed

+128
-74
lines changed

BasicUI_MonoGame/BasicUI_MonoGame_Linux/BasicUI_MonoGame_Linux.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,13 @@
6868
</ItemGroup>
6969
<ItemGroup>
7070
<Reference Include="EmptyKeys.UserInterface">
71-
<HintPath>..\..\EmptyKeysUI\MonoGame\AnyCPU\EmptyKeys.UserInterface.dll</HintPath>
71+
<HintPath>..\..\..\..\TFS\LogicMarbles\Modules\EmptyKeysUI\Common\AnyCPU\EmptyKeys.UserInterface.dll</HintPath>
72+
</Reference>
73+
<Reference Include="EmptyKeys.UserInterface.Core">
74+
<HintPath>..\..\..\..\TFS\LogicMarbles\Modules\EmptyKeysUI\Common\AnyCPU\EmptyKeys.UserInterface.Core.dll</HintPath>
75+
</Reference>
76+
<Reference Include="EmptyKeys.UserInterface.MonoGame">
77+
<HintPath>..\..\..\..\TFS\LogicMarbles\Modules\EmptyKeysUI\MonoGame\AnyCPU\EmptyKeys.UserInterface.MonoGame.dll</HintPath>
7278
</Reference>
7379
<Reference Include="OpenTK">
7480
<HintPath>$(MSBuildExtensionsPath)\..\MonoGame\v3.0\Assemblies\Linux\OpenTK.dll</HintPath>

BasicUI_MonoGame/BasicUI_MonoGame_Linux/Game1.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using Microsoft.Xna.Framework.Graphics;
77
using Microsoft.Xna.Framework.Input;
88
using Microsoft.Xna.Framework.Storage;
9-
using Microsoft.Xna.Framework.GamerServices;
109
using EmptyKeys.UserInterface.Generated;
1110
using EmptyKeys.UserInterface;
1211
using EmptyKeys.UserInterface.Input;
@@ -34,6 +33,12 @@ public Game1()
3433
graphics = new GraphicsDeviceManager(this);
3534
Content.RootDirectory = "Content";
3635
graphics.PreparingDeviceSettings += graphics_PreparingDeviceSettings;
36+
graphics.DeviceCreated += graphics_DeviceCreated;
37+
}
38+
39+
void graphics_DeviceCreated(object sender, EventArgs e)
40+
{
41+
Engine engine = new MonoGameEngine(GraphicsDevice, nativeScreenWidth, nativeScreenHeight);
3742
}
3843

3944
private void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
@@ -68,17 +73,18 @@ protected override void LoadContent()
6873
{
6974
this.IsMouseVisible = true;
7075

71-
FontManager.DefaultFont = Content.Load<SpriteFont>("Segoe_UI_10_Regular");
76+
SpriteFont font = Content.Load<SpriteFont>("Segoe_UI_10_Regular");
77+
FontManager.DefaultFont = Engine.Instance.Renderer.CreateFont(font);
7278
Viewport viewport = GraphicsDevice.Viewport;
73-
basicUI = new BasicUI(viewport.Width, viewport.Height, this.GraphicsDevice, nativeScreenWidth, nativeScreenHeight);
79+
basicUI = new BasicUI(viewport.Width, viewport.Height);
7480
basicUI.DataContext = new BasicUIViewModel();
7581
FontManager.Instance.LoadFonts(Content);
7682
ImageManager.Instance.LoadImages(Content);
7783
SoundManager.Instance.LoadSounds(Content);
7884

7985
RelayCommand command = new RelayCommand(new Action<object>(ExitEvent));
8086

81-
KeyBinding keyBinding = new KeyBinding(command, Keys.Escape, ModifierKeys.None);
87+
KeyBinding keyBinding = new KeyBinding(command, KeyCode.Escape, ModifierKeys.None);
8288
basicUI.InputBindings.Add(keyBinding);
8389
}
8490

@@ -103,8 +109,8 @@ protected override void UnloadContent()
103109
/// <param name="gameTime">Provides a snapshot of timing values.</param>
104110
protected override void Update(GameTime gameTime)
105111
{
106-
basicUI.UpdateInput(gameTime);
107-
basicUI.UpdateLayout(gameTime);
112+
basicUI.UpdateInput(gameTime.ElapsedGameTime.TotalMilliseconds);
113+
basicUI.UpdateLayout(gameTime.ElapsedGameTime.TotalMilliseconds);
108114

109115
base.Update(gameTime);
110116
}
@@ -117,7 +123,7 @@ protected override void Draw(GameTime gameTime)
117123
{
118124
GraphicsDevice.Clear(Color.CornflowerBlue);
119125

120-
basicUI.Draw(gameTime);
126+
basicUI.Draw(gameTime.ElapsedGameTime.TotalMilliseconds);
121127

122128
base.Draw(gameTime);
123129
}

BasicUI_MonoGame/BasicUI_MonoGame_WinStore/BasicUI_MonoGame_WinStore.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,13 @@
102102
<ItemGroup>
103103
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
104104
<Reference Include="EmptyKeys.UserInterface">
105-
<HintPath>..\..\EmptyKeysUI\MonoGame\AnyCPU\EmptyKeys.UserInterface.dll</HintPath>
105+
<HintPath>..\..\..\..\TFS\LogicMarbles\Modules\EmptyKeysUI\Common\AnyCPU\EmptyKeys.UserInterface.dll</HintPath>
106+
</Reference>
107+
<Reference Include="EmptyKeys.UserInterface.Core">
108+
<HintPath>..\..\..\..\TFS\LogicMarbles\Modules\EmptyKeysUI\Common\AnyCPU\EmptyKeys.UserInterface.Core.dll</HintPath>
109+
</Reference>
110+
<Reference Include="EmptyKeys.UserInterface.MonoGame">
111+
<HintPath>..\..\..\..\TFS\LogicMarbles\Modules\EmptyKeysUI\MonoGame\AnyCPU\EmptyKeys.UserInterface.MonoGame.dll</HintPath>
106112
</Reference>
107113
<Reference Include="MonoGame.Framework">
108114
<HintPath>$(MSBuildExtensionsPath)\..\MonoGame\v3.0\Assemblies\Windows8\MonoGame.Framework.dll</HintPath>

BasicUI_MonoGame/BasicUI_MonoGame_WinStore/Game1.cs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ public Game1()
2828
graphics = new GraphicsDeviceManager(this);
2929
Content.RootDirectory = "Content";
3030
graphics.PreparingDeviceSettings += graphics_PreparingDeviceSettings;
31+
graphics.DeviceCreated += graphics_DeviceCreated;
32+
}
33+
34+
void graphics_DeviceCreated(object sender, EventArgs e)
35+
{
36+
Engine engine = new MonoGameEngine(GraphicsDevice, nativeScreenWidth, nativeScreenHeight);
3137
}
3238

3339
private void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
@@ -62,23 +68,23 @@ protected override void LoadContent()
6268
{
6369
this.IsMouseVisible = true;
6470

65-
FontManager.DefaultFont = Content.Load<SpriteFont>("Segoe_UI_10_Regular");
71+
SpriteFont font = Content.Load<SpriteFont>("Segoe_UI_10_Regular");
72+
FontManager.DefaultFont = Engine.Instance.Renderer.CreateFont(font);
6673
Viewport viewport = GraphicsDevice.Viewport;
67-
basicUI = new BasicUI(viewport.Width, viewport.Height, this.GraphicsDevice, nativeScreenWidth, nativeScreenHeight);
74+
basicUI = new BasicUI(viewport.Width, viewport.Height);
6875
basicUI.DataContext = new BasicUIViewModel();
6976
FontManager.Instance.LoadFonts(Content);
7077
ImageManager.Instance.LoadImages(Content);
7178
SoundManager.Instance.LoadSounds(Content);
7279

7380
RelayCommand command = new RelayCommand(new Action<object>(ExitEvent));
7481

75-
KeyBinding keyBinding = new KeyBinding(command, Keys.Escape, ModifierKeys.None);
82+
KeyBinding keyBinding = new KeyBinding(command, KeyCode.Escape, ModifierKeys.None);
7683
basicUI.InputBindings.Add(keyBinding);
7784
}
7885

7986
private void ExitEvent(object parameter)
80-
{
81-
Exit();
87+
{
8288
}
8389

8490
/// <summary>
@@ -97,8 +103,8 @@ protected override void UnloadContent()
97103
/// <param name="gameTime">Provides a snapshot of timing values.</param>
98104
protected override void Update(GameTime gameTime)
99105
{
100-
basicUI.UpdateInput(gameTime);
101-
basicUI.UpdateLayout(gameTime);
106+
basicUI.UpdateInput(gameTime.ElapsedGameTime.TotalMilliseconds);
107+
basicUI.UpdateLayout(gameTime.ElapsedGameTime.TotalMilliseconds);
102108

103109
base.Update(gameTime);
104110
}
@@ -111,7 +117,7 @@ protected override void Draw(GameTime gameTime)
111117
{
112118
GraphicsDevice.Clear(Color.CornflowerBlue);
113119

114-
basicUI.Draw(gameTime);
120+
basicUI.Draw(gameTime.ElapsedGameTime.TotalMilliseconds);
115121

116122
base.Draw(gameTime);
117123
}

BasicUI_MonoGame/BasicUI_MonoGame_Win_Desktop/BasicUI_MonoGame_Win_Desktop.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@
6363
</ItemGroup>
6464
<ItemGroup>
6565
<Reference Include="EmptyKeys.UserInterface">
66-
<HintPath>..\..\EmptyKeysUI\MonoGame\AnyCPU\EmptyKeys.UserInterface.dll</HintPath>
66+
<HintPath>..\..\..\..\TFS\LogicMarbles\Modules\EmptyKeysUI\Common\AnyCPU\EmptyKeys.UserInterface.dll</HintPath>
67+
</Reference>
68+
<Reference Include="EmptyKeys.UserInterface.Core">
69+
<HintPath>..\..\..\..\TFS\LogicMarbles\Modules\EmptyKeysUI\Common\AnyCPU\EmptyKeys.UserInterface.Core.dll</HintPath>
70+
</Reference>
71+
<Reference Include="EmptyKeys.UserInterface.MonoGame">
72+
<HintPath>..\..\..\..\TFS\LogicMarbles\Modules\EmptyKeysUI\MonoGame\AnyCPU\EmptyKeys.UserInterface.MonoGame.dll</HintPath>
6773
</Reference>
6874
<Reference Include="MonoGame.Framework">
6975
<HintPath>$(MSBuildExtensionsPath)\..\MonoGame\v3.0\Assemblies\Windows\MonoGame.Framework.dll</HintPath>

BasicUI_MonoGame/BasicUI_MonoGame_Win_Desktop/Game1.cs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using Microsoft.Xna.Framework.Graphics;
77
using Microsoft.Xna.Framework.Input;
88
using Microsoft.Xna.Framework.Storage;
9-
using Microsoft.Xna.Framework.GamerServices;
109
using EmptyKeys.UserInterface;
1110
using EmptyKeys.UserInterface.Generated;
1211
using EmptyKeys.UserInterface.Input;
@@ -34,6 +33,13 @@ public Game1()
3433
graphics = new GraphicsDeviceManager(this);
3534
Content.RootDirectory = "Content";
3635
graphics.PreparingDeviceSettings += graphics_PreparingDeviceSettings;
36+
graphics.DeviceCreated += graphics_DeviceCreated;
37+
38+
}
39+
40+
void graphics_DeviceCreated(object sender, EventArgs e)
41+
{
42+
Engine engine = new MonoGameEngine(GraphicsDevice, nativeScreenWidth, nativeScreenHeight);
3743
}
3844

3945
private void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
@@ -68,17 +74,18 @@ protected override void LoadContent()
6874
{
6975
this.IsMouseVisible = true;
7076

71-
FontManager.DefaultFont = Content.Load<SpriteFont>("Segoe_UI_10_Regular");
77+
SpriteFont font = Content.Load<SpriteFont>("Segoe_UI_10_Regular");
78+
FontManager.DefaultFont = Engine.Instance.Renderer.CreateFont(font);
7279
Viewport viewport = GraphicsDevice.Viewport;
73-
basicUI = new BasicUI(viewport.Width, viewport.Height, this.GraphicsDevice, nativeScreenWidth, nativeScreenHeight);
80+
basicUI = new BasicUI(viewport.Width, viewport.Height);
7481
basicUI.DataContext = new BasicUIViewModel();
7582
FontManager.Instance.LoadFonts(Content);
7683
ImageManager.Instance.LoadImages(Content);
7784
SoundManager.Instance.LoadSounds(Content);
7885

7986
RelayCommand command = new RelayCommand(new Action<object>(ExitEvent));
8087

81-
KeyBinding keyBinding = new KeyBinding(command, Keys.Escape, ModifierKeys.None);
88+
KeyBinding keyBinding = new KeyBinding(command, KeyCode.Escape, ModifierKeys.None);
8289
basicUI.InputBindings.Add(keyBinding);
8390
}
8491

@@ -103,8 +110,8 @@ protected override void UnloadContent()
103110
/// <param name="gameTime">Provides a snapshot of timing values.</param>
104111
protected override void Update(GameTime gameTime)
105112
{
106-
basicUI.UpdateInput(gameTime);
107-
basicUI.UpdateLayout(gameTime);
113+
basicUI.UpdateInput(gameTime.ElapsedGameTime.TotalMilliseconds);
114+
basicUI.UpdateLayout(gameTime.ElapsedGameTime.TotalMilliseconds);
108115

109116
base.Update(gameTime);
110117
}
@@ -117,7 +124,7 @@ protected override void Draw(GameTime gameTime)
117124
{
118125
GraphicsDevice.Clear(Color.CornflowerBlue);
119126

120-
basicUI.Draw(gameTime);
127+
basicUI.Draw(gameTime.ElapsedGameTime.TotalMilliseconds);
121128

122129
base.Draw(gameTime);
123130
}

BasicUI_MonoGame/ContentProject/ContentProjectContent/ContentProjectContent.contentproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,6 @@
7171
<Processor>NuclexSpriteFontDescriptionProcessor</Processor>
7272
</Compile>
7373
</ItemGroup>
74-
<ItemGroup>
75-
<Compile Include="Images\MonogameLogo.png">
76-
<Name>MonogameLogo</Name>
77-
<Importer>TextureImporter</Importer>
78-
<Processor>TextureProcessor</Processor>
79-
</Compile>
80-
</ItemGroup>
8174
<ItemGroup>
8275
<Compile Include="Images\EmptyKeysLogoTextSmall.png">
8376
<Name>EmptyKeysLogoTextSmall</Name>
@@ -107,6 +100,13 @@
107100
<Processor>SoundEffectProcessor</Processor>
108101
</Compile>
109102
</ItemGroup>
103+
<ItemGroup>
104+
<Compile Include="Images\MonoGameLogo.png">
105+
<Name>MonoGameLogo</Name>
106+
<Importer>TextureImporter</Importer>
107+
<Processor>TextureProcessor</Processor>
108+
</Compile>
109+
</ItemGroup>
110110
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" />
111111
<!--
112112
To modify your build process, add your task inside one of the targets below and uncomment it.
-7.32 KB
Loading

BasicUI_MonoGame/GameUILibrary/GameUILibrary.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@
4242
</ItemGroup>
4343
<ItemGroup>
4444
<Reference Include="EmptyKeys.UserInterface">
45-
<HintPath>..\..\EmptyKeysUI\MonoGame\AnyCPU\EmptyKeys.UserInterface.dll</HintPath>
45+
<HintPath>..\..\..\..\TFS\LogicMarbles\Modules\EmptyKeysUI\Common\AnyCPU\EmptyKeys.UserInterface.dll</HintPath>
46+
</Reference>
47+
<Reference Include="EmptyKeys.UserInterface.Core">
48+
<HintPath>..\..\..\..\TFS\LogicMarbles\Modules\EmptyKeysUI\Common\AnyCPU\EmptyKeys.UserInterface.Core.dll</HintPath>
4649
</Reference>
4750
<Reference Include="MonoGame.Framework">
4851
<HintPath>C:\Program Files %28x86%29\MonoGame\v3.0\Assemblies\Windows\MonoGame.Framework.dll</HintPath>

BasicUI_MonoGame/GameUILibrary/GeneratedUI/BasicUI.xaml.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ namespace EmptyKeys.UserInterface.Generated {
1414
using EmptyKeys.UserInterface.Media;
1515
using EmptyKeys.UserInterface.Media.Animation;
1616
using EmptyKeys.UserInterface.Media.Imaging;
17+
using EmptyKeys.UserInterface.Shapes;
18+
using EmptyKeys.UserInterface.Renderers;
1719
using EmptyKeys.UserInterface.Themes;
18-
using Microsoft.Xna.Framework;
19-
using Microsoft.Xna.Framework.Graphics;
2020

2121

22-
[GeneratedCodeAttribute("Empty Keys UI Generator", "1.5.0.0")]
22+
[GeneratedCodeAttribute("Empty Keys UI Generator", "1.6.0.0")]
2323
public partial class BasicUI : UIRoot {
2424

2525
private Grid e_0;
@@ -72,8 +72,8 @@ public partial class BasicUI : UIRoot {
7272

7373
private Border animBorder2;
7474

75-
public BasicUI(int width, int height, GraphicsDevice graphicsDevice, int nativeScreenWidth, int nativeScreenHeight) :
76-
base(width, height, graphicsDevice, nativeScreenWidth, nativeScreenHeight) {
75+
public BasicUI(int width, int height) :
76+
base(width, height) {
7777
Style style = RootStyle.CreateRootStyle();
7878
style.TargetType = this.GetType();
7979
this.Style = style;
@@ -101,7 +101,7 @@ private void InitializeComponent() {
101101
this.e_1 = new StackPanel();
102102
this.e_0.Children.Add(this.e_1);
103103
this.e_1.Name = "e_1";
104-
this.e_1.Background = new SolidColorBrush(new Color(0, 0, 0, 255));
104+
this.e_1.Background = new SolidColorBrush(new ColorW(0, 0, 0, 255));
105105
Grid.SetColumnSpan(this.e_1, 2);
106106
// logo element
107107
this.logo = new Image();
@@ -119,7 +119,7 @@ private void InitializeComponent() {
119119
this.e_2.Name = "e_2";
120120
this.e_2.HorizontalAlignment = HorizontalAlignment.Center;
121121
this.e_2.VerticalAlignment = VerticalAlignment.Center;
122-
this.e_2.Foreground = new SolidColorBrush(new Color(211, 211, 211, 255));
122+
this.e_2.Foreground = new SolidColorBrush(new ColorW(211, 211, 211, 255));
123123
this.e_2.TextWrapping = TextWrapping.Wrap;
124124
FontManager.Instance.AddFont("Segoe UI", 20F, FontStyle.Bold, "Segoe_UI_15_Bold");
125125
this.e_2.FontFamily = new FontFamily("Segoe UI");
@@ -254,8 +254,8 @@ private void InitializeComponent() {
254254
this.imageButton.Width = 96F;
255255
ImageBrush imageButton_Background = new ImageBrush();
256256
BitmapImage imageButton_Background_bm = new BitmapImage();
257-
imageButton_Background_bm.TextureAsset = "Images/MonogameLogo";
258-
ImageManager.Instance.AddImage("Images/MonogameLogo");
257+
imageButton_Background_bm.TextureAsset = "Images/MonoGameLogo";
258+
ImageManager.Instance.AddImage("Images/MonoGameLogo");
259259
imageButton_Background.ImageSource = imageButton_Background_bm;
260260
imageButton_Background.Stretch = Stretch.None;
261261
this.imageButton.Background = imageButton_Background;
@@ -318,8 +318,8 @@ private void InitializeComponent() {
318318
animBorder1_ET_0_AC_0_SB_TL_0.AutoReverse = true;
319319
animBorder1_ET_0_AC_0_SB_TL_0.Duration = new Duration(new TimeSpan(0, 0, 0, 5, 0));
320320
animBorder1_ET_0_AC_0_SB_TL_0.RepeatBehavior = RepeatBehavior.Forever;
321-
animBorder1_ET_0_AC_0_SB_TL_0.From = new Color(255, 255, 0, 255);
322-
animBorder1_ET_0_AC_0_SB_TL_0.To = new Color(0, 0, 255, 255);
321+
animBorder1_ET_0_AC_0_SB_TL_0.From = new ColorW(255, 255, 0, 255);
322+
animBorder1_ET_0_AC_0_SB_TL_0.To = new ColorW(0, 0, 255, 255);
323323
ExponentialEase animBorder1_ET_0_AC_0_SB_TL_0_EA = new ExponentialEase();
324324
animBorder1_ET_0_AC_0_SB_TL_0.EasingFunction = animBorder1_ET_0_AC_0_SB_TL_0_EA;
325325
Storyboard.SetTargetName(animBorder1_ET_0_AC_0_SB_TL_0, "animBorder1");
@@ -345,8 +345,8 @@ private void InitializeComponent() {
345345
animBorder2_ET_0_AC_0_SB_TL_0.AutoReverse = true;
346346
animBorder2_ET_0_AC_0_SB_TL_0.Duration = new Duration(new TimeSpan(0, 0, 0, 3, 0));
347347
animBorder2_ET_0_AC_0_SB_TL_0.RepeatBehavior = RepeatBehavior.Forever;
348-
animBorder2_ET_0_AC_0_SB_TL_0.From = new Color(255, 0, 0, 255);
349-
animBorder2_ET_0_AC_0_SB_TL_0.To = new Color(255, 255, 255, 255);
348+
animBorder2_ET_0_AC_0_SB_TL_0.From = new ColorW(255, 0, 0, 255);
349+
animBorder2_ET_0_AC_0_SB_TL_0.To = new ColorW(255, 255, 255, 255);
350350
CubicEase animBorder2_ET_0_AC_0_SB_TL_0_EA = new CubicEase();
351351
animBorder2_ET_0_AC_0_SB_TL_0.EasingFunction = animBorder2_ET_0_AC_0_SB_TL_0_EA;
352352
Storyboard.SetTargetName(animBorder2_ET_0_AC_0_SB_TL_0, "animBorder2");

0 commit comments

Comments
 (0)