2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
#region ================== Copyright (c) 2007 Pascal vd Heiden
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com
|
|
|
|
* This program is released under GNU General Public License
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region ================== Namespaces
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.Windows
|
|
|
|
{
|
|
|
|
public struct StatusInfo
|
|
|
|
{
|
2015-09-16 12:10:43 +00:00
|
|
|
public const string NO_SELECTION = "Nothing selected."; //mxd
|
|
|
|
public const string LOADING_TEXT = "Loading resources...";
|
|
|
|
public const string READY_TEXT = "Ready.";
|
|
|
|
|
|
|
|
public readonly StatusType type;
|
|
|
|
public readonly string message;
|
|
|
|
public readonly string selectioninfo; //mxd
|
2009-04-19 18:07:22 +00:00
|
|
|
internal bool displayed;
|
|
|
|
|
|
|
|
internal StatusInfo(StatusType type, string message)
|
|
|
|
{
|
|
|
|
this.type = type;
|
2015-09-16 12:10:43 +00:00
|
|
|
|
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case StatusType.Selection:
|
|
|
|
this.selectioninfo = (string.IsNullOrEmpty(message) ? NO_SELECTION : message);
|
|
|
|
this.message = General.MainWindow.Status.message;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case StatusType.Ready:
|
|
|
|
bool mapopened = (General.Map != null) && (General.Map.Data != null);
|
|
|
|
bool mapisloading = mapopened && General.Map.Data.IsLoading;
|
|
|
|
this.selectioninfo = ((string.IsNullOrEmpty(message) && mapopened) ? NO_SELECTION : message);
|
|
|
|
this.message = (mapisloading ? LOADING_TEXT : (mapopened ? string.Empty : READY_TEXT));
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
this.selectioninfo = (string.IsNullOrEmpty(message) ? NO_SELECTION : General.MainWindow.Status.selectioninfo);
|
|
|
|
this.message = message;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
this.displayed = false;
|
|
|
|
}
|
2015-09-16 12:10:43 +00:00
|
|
|
|
|
|
|
//mxd
|
|
|
|
public override string ToString()
|
|
|
|
{
|
|
|
|
if(string.IsNullOrEmpty(selectioninfo)) return message;
|
|
|
|
if(string.IsNullOrEmpty(message)) return selectioninfo;
|
|
|
|
return selectioninfo + " " + message;
|
|
|
|
}
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
|
2015-09-16 12:10:43 +00:00
|
|
|
public enum StatusType
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// When no particular information is to be displayed. The messages displayed depends on running background processes.
|
|
|
|
/// </summary>
|
|
|
|
Ready,
|
2013-07-09 11:29:10 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// mxd. Displays information about current selection.
|
|
|
|
/// </summary>
|
|
|
|
Selection,
|
2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Shows action information and flashes up the status icon once.
|
|
|
|
/// </summary>
|
|
|
|
Action,
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Shows information without flashing the icon.
|
|
|
|
/// </summary>
|
|
|
|
Info,
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Shows information with the busy icon.
|
|
|
|
/// </summary>
|
|
|
|
Busy,
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Shows a warning, makes a warning sound and flashes a warning icon.
|
|
|
|
/// </summary>
|
|
|
|
Warning
|
|
|
|
}
|
|
|
|
}
|