Skip to content

Commit 05a0dc3

Browse files
committed
add statusbar messagetypes & colors, show error message if new project root folder is missing (on new project creation) #175
1 parent 572ca0e commit 05a0dc3

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

Diff for: UnityLauncherPro/Data/MessageType.cs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace UnityLauncherPro.Data
2+
{
3+
public enum MessageType
4+
{
5+
Info,
6+
Warning,
7+
Error
8+
}
9+
}

Diff for: UnityLauncherPro/MainWindow.xaml.cs

+17-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using System.Windows.Input;
2020
using System.Windows.Media;
2121
using System.Windows.Shell;
22+
using UnityLauncherPro.Data;
2223
using UnityLauncherPro.Helpers;
2324
using UnityLauncherPro.Properties;
2425

@@ -1930,6 +1931,7 @@ void CreateNewEmptyProject(string targetFolder = null)
19301931
tabControl.SelectedIndex = 4;
19311932
this.UpdateLayout();
19321933
txtRootFolderForNewProjects.Focus();
1934+
SetStatus("Root folder for new projects is missing or doesn't exist: " + rootFolder, MessageType.Error);
19331935
return;
19341936
}
19351937
}
@@ -3353,8 +3355,22 @@ private void Window_MouseDown(object sender, MouseButtonEventArgs e)
33533355
gridSettingsBg.Focus();
33543356
}
33553357

3356-
public void SetStatus(string msg)
3358+
public void SetStatus(string msg, MessageType messageType = MessageType.Info)
33573359
{
3360+
Console.WriteLine(messageType);
3361+
switch (messageType)
3362+
{
3363+
case MessageType.Info:
3364+
txtStatus.Foreground = (SolidColorBrush)Application.Current.Resources["ThemeStatusText"];
3365+
break;
3366+
case MessageType.Warning:
3367+
txtStatus.Foreground = (SolidColorBrush)Application.Current.Resources["ThemeMessageWarning"];
3368+
break;
3369+
case MessageType.Error:
3370+
txtStatus.Foreground = (SolidColorBrush)Application.Current.Resources["ThemeMessageError"];
3371+
break;
3372+
}
3373+
33583374
txtStatus.Text = msg;
33593375
}
33603376

Diff for: UnityLauncherPro/Resources/Colors.xaml

+5
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,10 @@
6666
<SolidColorBrush x:Key="ThemeSystemHighlight" Color="#FF0078D7"/>
6767
<!--<SolidColorBrush x:Key="ThemeButtonWhiteText" Color="#FFFFFFFF"/>-->
6868
<SolidColorBrush x:Key="ThemeBrightText" Color="#FFFFFFFF"/>
69+
70+
<!--messages-->
71+
<!--<SolidColorBrush x:Key="ThemeMessageInfo" Color="#FF1E1E1E"/>-->
72+
<SolidColorBrush x:Key="ThemeMessageWarning" Color="#FFFF5200"/>
73+
<SolidColorBrush x:Key="ThemeMessageError" Color="Red"/>
6974

7075
</ResourceDictionary>

Diff for: UnityLauncherPro/UnityLauncherPro.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
<Compile Include="Data\BuildReport.cs" />
8989
<Compile Include="Data\BuildReportItem.cs" />
9090
<Compile Include="Data\DownloadProgress.cs" />
91+
<Compile Include="Data\MessageType.cs" />
9192
<Compile Include="Data\Platform.cs" />
9293
<Compile Include="Data\Tabs.cs" />
9394
<Compile Include="Data\ThemeColor.cs" />

0 commit comments

Comments
 (0)