mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 04:12:12 +00:00
e8cda3c9c5
Added: Tab text now looks differently when appropriate script was changed. Added: Script Editor now has it's own status bar. Added: several files can now be opened at once when using "Open File" command. Added: ACS scripts navigator now shows script and function arguments. Changed: when closing a tab, previous tab is selected instead of the first tab. Changed: SCRIPTS lump can't be compiled as a library. Changed: external acs files can only be compiled as libraries. Changed: when an external acs file is marked as #library, it will be saved as [library name].o alongside [filename].acs. Fixed: files opened using "Open File" command were immediately flagged as changed. Fixed: Script Editor was unable to navigate to error location after clicking on the error description when the error was in include file. Updated ZDoom ACC.
161 lines
4 KiB
C#
161 lines
4 KiB
C#
|
|
#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
|
|
|
|
using System;
|
|
|
|
#endregion
|
|
|
|
namespace CodeImp.DoomBuilder.Windows
|
|
{
|
|
public struct StatusInfo
|
|
{
|
|
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
|
|
internal bool displayed;
|
|
|
|
internal StatusInfo(StatusType type, string message)
|
|
{
|
|
this.type = type;
|
|
|
|
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) ? (string.IsNullOrEmpty(General.MainWindow.Status.selectioninfo) ? NO_SELECTION : General.MainWindow.Status.selectioninfo) : 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;
|
|
}
|
|
|
|
this.displayed = false;
|
|
}
|
|
|
|
//mxd
|
|
public override string ToString()
|
|
{
|
|
if(string.IsNullOrEmpty(selectioninfo)) return message;
|
|
if(string.IsNullOrEmpty(message)) return selectioninfo;
|
|
return selectioninfo + " " + message;
|
|
}
|
|
}
|
|
|
|
public enum StatusType
|
|
{
|
|
/// <summary>
|
|
/// When no particular information is to be displayed. The messages displayed depends on running background processes.
|
|
/// </summary>
|
|
Ready,
|
|
|
|
/// <summary>
|
|
/// mxd. Displays information about current selection.
|
|
/// </summary>
|
|
Selection,
|
|
|
|
/// <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
|
|
}
|
|
|
|
//mxd. StatusInfo used by Script Editor
|
|
public struct ScriptStatusInfo
|
|
{
|
|
public const string READY_TEXT = "Ready.";
|
|
|
|
public readonly ScriptStatusType type;
|
|
public readonly string message;
|
|
internal bool displayed;
|
|
|
|
internal ScriptStatusInfo(ScriptStatusType type, string message)
|
|
{
|
|
this.type = type;
|
|
|
|
switch(type)
|
|
{
|
|
case ScriptStatusType.Ready:
|
|
this.message = READY_TEXT;
|
|
break;
|
|
|
|
case ScriptStatusType.Info:
|
|
case ScriptStatusType.Warning:
|
|
case ScriptStatusType.Busy:
|
|
this.message = message;
|
|
break;
|
|
|
|
default:
|
|
throw new NotImplementedException("Unsupported Script Status Type!");
|
|
}
|
|
|
|
this.displayed = false;
|
|
}
|
|
}
|
|
|
|
//mxd. StatusType used by Script Editor
|
|
public enum ScriptStatusType
|
|
{
|
|
/// <summary>
|
|
/// When no particular information is to be displayed.
|
|
/// </summary>
|
|
Ready,
|
|
|
|
/// <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
|
|
}
|
|
}
|