mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 14:31:50 +00:00
Linedef info panel: tag is no longer shown in Hexen map format.
Numeric textbox: in addition to '++NN' and '--NN', you can use '*NN' and '/NN' to multiply or divide the values. Configurations, ZDoom_linedefs.cfg: some linedef action arguments were missing a proper type. Rewritten parts of hints system. Hints are now loaded from "Hints.cfg" file.
This commit is contained in:
parent
a697cbfd0f
commit
88b12750c1
26 changed files with 520 additions and 405 deletions
|
@ -475,7 +475,7 @@ zdoom
|
|||
}
|
||||
arg2
|
||||
{
|
||||
title = "Target TID";
|
||||
title = "Target MapSpot Tag";
|
||||
}
|
||||
}
|
||||
86
|
||||
|
@ -491,7 +491,7 @@ zdoom
|
|||
}
|
||||
arg2
|
||||
{
|
||||
title = "Target TID";
|
||||
title = "Target MapSpot Tag";
|
||||
}
|
||||
}
|
||||
87
|
||||
|
@ -1607,6 +1607,7 @@ zdoom
|
|||
arg0
|
||||
{
|
||||
title = "Line ID";
|
||||
type = 15;
|
||||
}
|
||||
arg1
|
||||
{
|
||||
|
@ -1980,7 +1981,7 @@ zdoom
|
|||
|
||||
arg0
|
||||
{
|
||||
title = "Thing ID";
|
||||
title = "Thing Tag";
|
||||
type = 14;
|
||||
}
|
||||
arg1
|
||||
|
@ -2000,12 +2001,12 @@ zdoom
|
|||
|
||||
arg0
|
||||
{
|
||||
title = "Thing ID";
|
||||
title = "Thing Tag";
|
||||
type = 14;
|
||||
}
|
||||
arg1
|
||||
{
|
||||
title = "Target Thing ID";
|
||||
title = "Target Thing Tag";
|
||||
type = 14;
|
||||
}
|
||||
}
|
||||
|
@ -2015,7 +2016,7 @@ zdoom
|
|||
|
||||
arg0
|
||||
{
|
||||
title = "Thing ID";
|
||||
title = "Thing Tag";
|
||||
type = 14;
|
||||
}
|
||||
arg1
|
||||
|
@ -2042,7 +2043,7 @@ zdoom
|
|||
|
||||
arg0
|
||||
{
|
||||
title = "Thing ID";
|
||||
title = "Thing Tag";
|
||||
type = 14;
|
||||
}
|
||||
arg1
|
||||
|
@ -2100,7 +2101,7 @@ zdoom
|
|||
|
||||
arg0
|
||||
{
|
||||
title = "Mapspot ID";
|
||||
title = "Mapspot Tag";
|
||||
type = 14;
|
||||
}
|
||||
arg1
|
||||
|
@ -2117,7 +2118,7 @@ zdoom
|
|||
}
|
||||
arg3
|
||||
{
|
||||
title = "New Thing ID";
|
||||
title = "New Thing Tag";
|
||||
}
|
||||
}
|
||||
175
|
||||
|
@ -2126,7 +2127,7 @@ zdoom
|
|||
|
||||
arg0
|
||||
{
|
||||
title = "Mapspot ID";
|
||||
title = "Mapspot Tag";
|
||||
type = 14;
|
||||
}
|
||||
arg1
|
||||
|
@ -2141,26 +2142,28 @@ zdoom
|
|||
}
|
||||
arg3
|
||||
{
|
||||
title = "Thing ID target";
|
||||
title = "Target Thing Tag";
|
||||
type = 14;
|
||||
}
|
||||
arg4
|
||||
{
|
||||
title = "New Thing ID";
|
||||
title = "New Thing Tag";
|
||||
type = 14;
|
||||
}
|
||||
}
|
||||
176
|
||||
{
|
||||
title = "Thing ID Change";
|
||||
title = "Change Thing Tag";
|
||||
|
||||
arg0
|
||||
{
|
||||
title = "Old Thing ID";
|
||||
title = "Old Thing Tag";
|
||||
type = 14;
|
||||
}
|
||||
arg1
|
||||
{
|
||||
title = "New Thing ID";
|
||||
title = "New Thing Tag";
|
||||
type = 14;
|
||||
}
|
||||
}
|
||||
177
|
||||
|
@ -2169,12 +2172,12 @@ zdoom
|
|||
|
||||
arg0
|
||||
{
|
||||
title = "Hater ID";
|
||||
title = "Hater Tag";
|
||||
type = 14;
|
||||
}
|
||||
arg1
|
||||
{
|
||||
title = "Hatee ID";
|
||||
title = "Hatee Tag";
|
||||
type = 14;
|
||||
}
|
||||
arg2
|
||||
|
@ -2199,7 +2202,7 @@ zdoom
|
|||
|
||||
arg0
|
||||
{
|
||||
title = "Mapspot ID";
|
||||
title = "Mapspot Tag";
|
||||
type = 14;
|
||||
}
|
||||
arg1
|
||||
|
@ -2214,12 +2217,13 @@ zdoom
|
|||
}
|
||||
arg3
|
||||
{
|
||||
title = "Target Thing ID";
|
||||
title = "Target Thing Tag";
|
||||
type = 14;
|
||||
}
|
||||
arg4
|
||||
{
|
||||
title = "New Thing ID";
|
||||
title = "New Thing Tag";
|
||||
type = 14;
|
||||
}
|
||||
}
|
||||
180
|
||||
|
@ -2228,7 +2232,8 @@ zdoom
|
|||
|
||||
arg0
|
||||
{
|
||||
title = "Thing ID";
|
||||
title = "Thing Tag";
|
||||
type = 14;
|
||||
}
|
||||
arg1
|
||||
{
|
||||
|
@ -2426,6 +2431,7 @@ zdoom
|
|||
arg0
|
||||
{
|
||||
title = "Line ID";
|
||||
type = 15;
|
||||
}
|
||||
arg1
|
||||
{
|
||||
|
@ -2721,10 +2727,12 @@ zdoom
|
|||
arg0
|
||||
{
|
||||
title = "Line ID";
|
||||
type = 15;
|
||||
}
|
||||
arg1
|
||||
{
|
||||
title = "Sector Tag";
|
||||
type = 13;
|
||||
}
|
||||
arg2
|
||||
{
|
||||
|
@ -2827,6 +2835,7 @@ zdoom
|
|||
arg0
|
||||
{
|
||||
title = "Sector Tag";
|
||||
type = 13;
|
||||
}
|
||||
arg1
|
||||
{
|
||||
|
@ -2861,6 +2870,7 @@ zdoom
|
|||
arg0
|
||||
{
|
||||
title = "Sector Tag";
|
||||
type = 13;
|
||||
}
|
||||
arg1
|
||||
{
|
||||
|
@ -3240,12 +3250,12 @@ zdoom
|
|||
|
||||
arg0
|
||||
{
|
||||
title = "Target ID";
|
||||
title = "Target Tag";
|
||||
type = 14;
|
||||
}
|
||||
arg1
|
||||
{
|
||||
title = "Emitter ID";
|
||||
title = "Emitter Tag";
|
||||
type = 14;
|
||||
}
|
||||
}
|
||||
|
@ -3330,18 +3340,22 @@ zdoom
|
|||
arg0
|
||||
{
|
||||
title = "Front Floor Tag";
|
||||
type = 13;
|
||||
}
|
||||
arg1
|
||||
{
|
||||
title = "Front Ceiling Tag";
|
||||
type = 13;
|
||||
}
|
||||
arg2
|
||||
{
|
||||
title = "Back Floor Tag";
|
||||
type = 13;
|
||||
}
|
||||
arg3
|
||||
{
|
||||
title = "Back Ceiling Tag";
|
||||
type = 13;
|
||||
}
|
||||
arg4
|
||||
{
|
||||
|
@ -3363,6 +3377,7 @@ zdoom
|
|||
arg0
|
||||
{
|
||||
title = "Sector Tag";
|
||||
type = 13;
|
||||
}
|
||||
arg1
|
||||
{
|
||||
|
@ -3413,6 +3428,7 @@ zdoom
|
|||
arg0
|
||||
{
|
||||
title = "Sector Tag";
|
||||
type = 13;
|
||||
}
|
||||
arg1
|
||||
{
|
||||
|
|
|
@ -179,6 +179,7 @@ namespace CodeImp.DoomBuilder.Actions
|
|||
// Done with the resource
|
||||
actionsreader.Dispose();
|
||||
actionsdata.Dispose();
|
||||
break; //mxd. Usually we have a single "Actions.cfg", right?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,151 @@
|
|||
|
||||
#region ================== Namespaces
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace CodeImp.DoomBuilder.Actions
|
||||
{
|
||||
public class HintsManager
|
||||
{
|
||||
#region ================== Public constants
|
||||
|
||||
public readonly string GENERAL = "general";
|
||||
public readonly string MULTISELECTION = "multiselection";
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Constants
|
||||
|
||||
private const string HINTS_RESOURCE = "Hints.cfg";
|
||||
private const string CLASS_MARKER = "class";
|
||||
private const string GROUP_MARKER = "group";
|
||||
private const string DEFAULT_HINT = "{\\rtf1 Press {\\b F1} to show help for current editing mode}";
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Variables
|
||||
|
||||
private readonly Dictionary<string, Dictionary<string, string>> hints; //<classname, <group, hints as rtf string>>
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Constructor
|
||||
|
||||
public HintsManager() {
|
||||
hints = new Dictionary<string, Dictionary<string, string>>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Hints
|
||||
|
||||
//Hints.cfg is dev-only stuff so bare minimum of boilerplate is present
|
||||
//(e.g. create your Hints.cfg exactly the way it's done in the main project).
|
||||
internal void LoadHints(Assembly asm) {
|
||||
// Find a resource named Hints.cfg
|
||||
string[] resnames = asm.GetManifestResourceNames();
|
||||
string asmname = asm.GetName().Name.ToLowerInvariant() + "_";
|
||||
|
||||
foreach (string rn in resnames) {
|
||||
// Found one?
|
||||
if(rn.EndsWith(HINTS_RESOURCE, StringComparison.InvariantCultureIgnoreCase)) {
|
||||
string line;
|
||||
string classname = string.Empty;
|
||||
string groupname = string.Empty;
|
||||
List<string> lines = new List<string>(2);
|
||||
|
||||
// Get a stream from the resource
|
||||
using(Stream data = asm.GetManifestResourceStream(rn)) {
|
||||
using(StreamReader reader = new StreamReader(data, Encoding.ASCII)) {
|
||||
while (!reader.EndOfStream) {
|
||||
lines.Add(reader.ReadLine());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Dictionary<string, List<string>> group = new Dictionary<string, List<string>>();
|
||||
|
||||
foreach(string s in lines) {
|
||||
line = s.Trim();
|
||||
if(string.IsNullOrEmpty(line) || line.StartsWith("//"))
|
||||
continue;
|
||||
|
||||
//class declaration?
|
||||
if(line.StartsWith(CLASS_MARKER)) {
|
||||
if(!string.IsNullOrEmpty(classname)) {
|
||||
hints.Add(asmname + classname, processHints(group));
|
||||
}
|
||||
|
||||
classname = line.Substring(6, line.Length - 6);
|
||||
groupname = string.Empty;
|
||||
group.Clear();
|
||||
continue;
|
||||
}
|
||||
|
||||
//group declaration?
|
||||
if(line.StartsWith(GROUP_MARKER)) {
|
||||
groupname = line.Substring(6, line.Length - 6);
|
||||
group.Add(groupname, new List<string>());
|
||||
continue;
|
||||
}
|
||||
|
||||
//regular lines
|
||||
line = line.Replace("\"", string.Empty).Replace("<b>", "{\\b ").Replace("</b>", "}").Replace("<br>", "\\par ");
|
||||
|
||||
//replace action names with keys
|
||||
int start = line.IndexOf("<k>");
|
||||
while(start != -1) {
|
||||
int end = line.IndexOf("</k>");
|
||||
string key = line.Substring(start + 3, end - start - 3);
|
||||
line = line.Substring(0, start) + "{\\b " + Action.GetShortcutKeyDesc(key) + "}" + line.Substring(end + 4, line.Length - end - 4);
|
||||
start = line.IndexOf("<k>");
|
||||
}
|
||||
|
||||
group[groupname].Add(line);
|
||||
}
|
||||
|
||||
//add the last class
|
||||
hints.Add(asmname + classname, processHints(group));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Dictionary<string, string> processHints(Dictionary<string, List<string>> hintsgroup) {
|
||||
Dictionary<string, string> result = new Dictionary<string, string>();
|
||||
foreach(KeyValuePair<string, List<string>> group in hintsgroup) {
|
||||
result.Add(group.Key, "{\\rtf1" + string.Join("\\par\\par ", group.Value.ToArray()) + "}");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void ShowHints(Type type, string groupname) {
|
||||
string fullname = type.Assembly.GetName().Name.ToLowerInvariant() + "_" + type.Name;
|
||||
|
||||
if (!hints.ContainsKey(fullname) || !hints[fullname].ContainsKey(groupname)) {
|
||||
General.Interface.ShowHints(DEFAULT_HINT);
|
||||
#if DEBUG
|
||||
Console.WriteLine("WARNING: Unable to get hints for class '" + fullname + "', group '" + groupname + "'");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
General.Interface.ShowHints(hints[fullname][groupname]);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Utility
|
||||
|
||||
public static string GetRtfString(string text) {
|
||||
text = text.Replace("<b>", "{\\b ").Replace("</b>", "}").Replace("<br>", "\\par\\par ");
|
||||
return "{\\rtf1" + text + "}";
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -933,9 +933,6 @@
|
|||
<None Include="Resources\GZDB2.ico" />
|
||||
<None Include="Resources\fog.png" />
|
||||
<None Include="Resources\fx.png" />
|
||||
<Content Include="Resources\DrawEllipseMode.png" />
|
||||
<Content Include="Resources\DrawLinesMode.png" />
|
||||
<Content Include="Resources\DrawRectMode.png" />
|
||||
<None Include="Resources\GZDB_Logo_small.png" />
|
||||
<None Include="Resources\InfoLine.png" />
|
||||
<None Include="Resources\Keyboard.png" />
|
||||
|
|
|
@ -10,15 +10,10 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
hints.Clear();
|
||||
}
|
||||
|
||||
internal void SetHints(string[] hintsText) {
|
||||
//hints should be in rtf markup!
|
||||
internal void SetHints(string hintsText) {
|
||||
hints.Clear();
|
||||
if(hintsText.Length == 0) return;
|
||||
|
||||
//convert to rtf markup
|
||||
hintsText[0] = "{\\rtf1" + hintsText[0];
|
||||
hintsText[hintsText.Length - 1] += "}";
|
||||
|
||||
hints.SelectedRtf = string.Join("\\par\\par ", hintsText).Replace("<b>", "{\\b ").Replace("</b>", "}");
|
||||
hints.SelectedRtf = hintsText;
|
||||
}
|
||||
|
||||
internal void ClearHints() {
|
||||
|
|
|
@ -89,17 +89,40 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
infopanel.Width = hexenformatwidth;
|
||||
}
|
||||
|
||||
//mxd. Show activation
|
||||
//mxd. Hide activation or tag and rearrange labels
|
||||
if(!General.Map.FormatInterface.HasBuiltInActivations && General.Map.FormatInterface.HasNumericLinedefActivations) { //Hexen map format?
|
||||
activation.Visible = true;
|
||||
activationlabel.Visible = true;
|
||||
taglabel.Visible = false;
|
||||
tag.Visible = false;
|
||||
|
||||
foreach(LinedefActivateInfo ai in General.Map.Config.LinedefActivates) {
|
||||
if(l.Activate == ai.Index) {
|
||||
activation.Text = ai.Title;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else { //rearange labels
|
||||
|
||||
activation.Top = labelPositionsY[0];
|
||||
activationlabel.Top = labelPositionsY[0];
|
||||
unpegged.Top = labelPositionsY[0];
|
||||
peglabel.Top = labelPositionsY[0];
|
||||
|
||||
length.Top = labelPositionsY[1];
|
||||
lengthlabel.Top = labelPositionsY[1];
|
||||
frontoffset.Top = labelPositionsY[1];
|
||||
frontoffsetlabel.Top = labelPositionsY[1];
|
||||
|
||||
angle.Top = labelPositionsY[2];
|
||||
anglelabel.Top = labelPositionsY[2];
|
||||
backoffset.Top = labelPositionsY[2];
|
||||
backoffsetlabel.Top = labelPositionsY[2];
|
||||
|
||||
} else {
|
||||
activation.Visible = false;
|
||||
activationlabel.Visible = false;
|
||||
taglabel.Visible = true;
|
||||
tag.Visible = true;
|
||||
|
||||
length.Top = labelPositionsY[0];
|
||||
lengthlabel.Top = labelPositionsY[0];
|
||||
|
@ -137,7 +160,9 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
action.Text = act.ToString();
|
||||
length.Text = l.Length.ToString("0.##");
|
||||
angle.Text = l.AngleDeg + "\u00B0";
|
||||
tag.Text = l.Tag + (General.Map.Options.TagLabels.ContainsKey(l.Tag) ? " (" + General.Map.Options.TagLabels[l.Tag] + ")" : string.Empty);
|
||||
if(tag.Visible) { //mxd
|
||||
tag.Text = l.Tag + (General.Map.Options.TagLabels.ContainsKey(l.Tag) ? " (" + General.Map.Options.TagLabels[l.Tag] + ")" : string.Empty);
|
||||
}
|
||||
unpegged.Text = peggedness;
|
||||
|
||||
//mxd
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#region ================== Namespaces
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
|
@ -32,10 +33,10 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
#region ================== Variables
|
||||
|
||||
private bool allownegative = false; // Allow negative numbers
|
||||
private bool allowrelative = false; // Allow ++ and -- prefix for relative changes
|
||||
private bool allowdecimal = false; // Allow decimal (float) numbers
|
||||
private bool controlpressed = false;
|
||||
private bool allownegative; // Allow negative numbers
|
||||
private bool allowrelative; // Allow ++, --, * and / prefix for relative changes
|
||||
private bool allowdecimal; // Allow decimal (float) numbers
|
||||
private bool controlpressed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -85,9 +86,10 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
// Determine allowed chars
|
||||
if(allownegative) allowedchars += CultureInfo.CurrentUICulture.NumberFormat.NegativeSign;
|
||||
if(allowrelative) allowedchars += "+-";
|
||||
if(allowrelative) allowedchars += "+-*/"; //mxd
|
||||
if(controlpressed) allowedchars += "\u0018\u0003\u0016";
|
||||
if(allowdecimal) allowedchars += CultureInfo.CurrentUICulture.NumberFormat.NumberDecimalSeparator;
|
||||
if(allowdecimal || this.Text.StartsWith("*") || this.Text.StartsWith("/")) //mxd
|
||||
allowedchars += CultureInfo.CurrentUICulture.NumberFormat.NumberDecimalSeparator;
|
||||
|
||||
// Check if key is not allowed
|
||||
if(allowedchars.IndexOf(e.KeyChar) == -1)
|
||||
|
@ -97,8 +99,12 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
else
|
||||
{
|
||||
//mxd. Check if * or / is pressed
|
||||
if(e.KeyChar == '*' || e.KeyChar == '/') {
|
||||
if (this.SelectionStart - 1 > -1) e.Handled = true; //only valid when at the start of the text
|
||||
}
|
||||
// Check if + or - is pressed
|
||||
if((e.KeyChar == '+') || (e.KeyChar == '-'))
|
||||
else if((e.KeyChar == '+') || (e.KeyChar == '-'))
|
||||
{
|
||||
// Determine non-selected text
|
||||
if(this.SelectionLength > 0)
|
||||
|
@ -163,7 +169,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
string textpart = this.Text;
|
||||
|
||||
// Strip prefixes
|
||||
textpart = textpart.Replace("+", "");
|
||||
textpart = textpart.Replace("+", "").Replace("*", "").Replace("/", ""); //mxd
|
||||
if(!allownegative) textpart = textpart.Replace("-", "");
|
||||
|
||||
// No numbers left?
|
||||
|
@ -174,7 +180,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
} else if(allowdecimal) { //mxd
|
||||
float value;
|
||||
if(float.TryParse(textpart, NumberStyles.Float, CultureInfo.CurrentCulture, out value)) {
|
||||
if(value == System.Math.Round(value))
|
||||
if(value == Math.Round(value))
|
||||
this.Text = this.Text.Replace(textpart, value.ToString("0.0"));
|
||||
}
|
||||
}
|
||||
|
@ -186,8 +192,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// This checks if the number is relative
|
||||
public bool CheckIsRelative()
|
||||
{
|
||||
// Prefixed with ++ or --?
|
||||
return (this.Text.StartsWith("++") || this.Text.StartsWith("--"));
|
||||
// Prefixed with ++, --, * or /?
|
||||
return (this.Text.StartsWith("++") || this.Text.StartsWith("--") || this.Text.StartsWith("*") || this.Text.StartsWith("/")); //mxd
|
||||
}
|
||||
|
||||
// This determines the result value
|
||||
|
@ -196,8 +202,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
string textpart = this.Text;
|
||||
|
||||
// Strip prefixes
|
||||
textpart = textpart.Replace("+", "");
|
||||
textpart = textpart.Replace("-", "");
|
||||
textpart = textpart.Replace("+", "").Replace("-", "").Replace("*", "").Replace("/", ""); //mxd
|
||||
|
||||
// Any numbers left?
|
||||
if(textpart.Length > 0)
|
||||
|
@ -220,6 +225,25 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
if(!allownegative && (newvalue < 0)) newvalue = 0;
|
||||
return newvalue;
|
||||
}
|
||||
//mxd. Prefixed with *?
|
||||
if(this.Text.StartsWith("*")) {
|
||||
// Multiply original by number
|
||||
float resultf;
|
||||
float.TryParse(textpart, NumberStyles.Float, CultureInfo.CurrentCulture, out resultf);
|
||||
int newvalue = (int)Math.Round(original * resultf);
|
||||
if(!allownegative && (newvalue < 0)) newvalue = 0;
|
||||
return newvalue;
|
||||
}
|
||||
//mxd. Prefixed with /?
|
||||
if(this.Text.StartsWith("/")) {
|
||||
// Divide original by number
|
||||
float resultf;
|
||||
float.TryParse(textpart, NumberStyles.Float, CultureInfo.CurrentCulture, out resultf);
|
||||
if (resultf == 0) return original;
|
||||
int newvalue = (int)Math.Round(original / resultf);
|
||||
if(!allownegative && (newvalue < 0)) newvalue = 0;
|
||||
return newvalue;
|
||||
}
|
||||
|
||||
//mxd. Return the new value
|
||||
if(!int.TryParse(this.Text, out result)) return original;
|
||||
|
@ -238,8 +262,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
float result;
|
||||
|
||||
// Strip prefixes
|
||||
textpart = textpart.Replace("+", "");
|
||||
textpart = textpart.Replace("-", "");
|
||||
textpart = textpart.Replace("+", "").Replace("-", "").Replace("*", "").Replace("/", ""); //mxd;
|
||||
|
||||
// Any numbers left?
|
||||
if(textpart.Length > 0)
|
||||
|
@ -252,7 +275,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
return original + result;
|
||||
}
|
||||
// Prefixed with --?
|
||||
else if(this.Text.StartsWith("--"))
|
||||
if(this.Text.StartsWith("--"))
|
||||
{
|
||||
// Subtract number from original
|
||||
if(!float.TryParse(textpart, NumberStyles.Float, CultureInfo.CurrentCulture, out result)) result = 0;
|
||||
|
@ -260,19 +283,31 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
if(!allownegative && (newvalue < 0)) newvalue = 0;
|
||||
return newvalue;
|
||||
}
|
||||
else
|
||||
{
|
||||
//mxd. Return the new value
|
||||
if(!float.TryParse(this.Text, NumberStyles.Float, CultureInfo.CurrentCulture, out result)) return original;
|
||||
if(!allownegative && (result < 0)) return 0;
|
||||
return result;
|
||||
//mxd. Prefixed with *?
|
||||
if(this.Text.StartsWith("*")) {
|
||||
// Multiply original by number
|
||||
if(!float.TryParse(textpart, NumberStyles.Float, CultureInfo.CurrentCulture, out result)) result = 0;
|
||||
float newvalue = original * result;
|
||||
if(!allownegative && (newvalue < 0)) newvalue = 0;
|
||||
return newvalue;
|
||||
}
|
||||
//mxd. Prefixed with /?
|
||||
if(this.Text.StartsWith("/")) {
|
||||
// Divide original by number
|
||||
if (!float.TryParse(textpart, NumberStyles.Float, CultureInfo.CurrentCulture, out result)) return original;
|
||||
float newvalue = (float)Math.Round(original / result, 3);
|
||||
if(!allownegative && (newvalue < 0)) newvalue = 0;
|
||||
return newvalue;
|
||||
}
|
||||
|
||||
//mxd. Return the new value
|
||||
if(!float.TryParse(this.Text, NumberStyles.Float, CultureInfo.CurrentCulture, out result)) return original;
|
||||
if(!allownegative && (result < 0)) return 0;
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Nothing given, keep original value
|
||||
return original;
|
||||
}
|
||||
|
||||
// Nothing given, keep original value
|
||||
return original;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -711,7 +711,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
protected virtual void OnEndMultiSelection()
|
||||
{
|
||||
selecting = false;
|
||||
General.Interface.ShowEditModeHints(hints); //mxd
|
||||
General.Hints.ShowHints(this.GetType(), General.Hints.GENERAL);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -724,8 +724,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
selectionrect = new RectangleF(selectstart.x, selectstart.y, 0, 0);
|
||||
|
||||
//mxd
|
||||
General.Interface.HideInfo();
|
||||
General.Interface.ShowEditModeHints(multiselectionHints);
|
||||
General.Hints.ShowHints(this.GetType(), General.Hints.MULTISELECTION);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -45,11 +45,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
private EditModeAttribute attributes;
|
||||
|
||||
// Disposing
|
||||
protected bool isdisposed = false;
|
||||
|
||||
//mxd. Hints
|
||||
protected string[] hints;
|
||||
protected string[] multiselectionHints;
|
||||
protected bool isdisposed;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -88,9 +84,6 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
|
||||
// No attributes found?
|
||||
if(attributes == null) throw new Exception("Editing mode \"" + this.GetType().Name + "\" is missing EditMode attributes!");
|
||||
|
||||
SetupHints(); //mxd
|
||||
SetupMultiselectionHints(); //mxd
|
||||
|
||||
// We have no destructor
|
||||
GC.SuppressFinalize(this);
|
||||
|
@ -136,25 +129,6 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
|
||||
#endregion
|
||||
|
||||
#region ================== Methods (mxd)
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Override this to setup hints for this editing mode
|
||||
/// </summary>
|
||||
protected virtual void SetupHints() { //mxd
|
||||
hints = new[] { "Press F1 to view help about current editing mode" };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override this to setup hints shown while multiselecting for this editing mode
|
||||
/// </summary>
|
||||
protected virtual void SetupMultiselectionHints() { //mxd
|
||||
multiselectionHints = new[] { "Press F1 to view help about current editing mode" };
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Events
|
||||
|
||||
//
|
||||
|
@ -174,7 +148,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
General.Actions.BindMethods(this);
|
||||
|
||||
//mxd. Show hints for this mode
|
||||
General.Interface.ShowEditModeHints(hints);
|
||||
General.Hints.ShowHints(this.GetType(), General.Hints.GENERAL);
|
||||
}
|
||||
|
||||
// Mode disengages
|
||||
|
|
|
@ -161,6 +161,7 @@ namespace CodeImp.DoomBuilder
|
|||
private static MapManager map;
|
||||
private static EditingManager editing;
|
||||
private static ActionManager actions;
|
||||
private static HintsManager hints; //mxd
|
||||
private static PluginManager plugins;
|
||||
private static ColorCollection colors;
|
||||
private static TypesManager types;
|
||||
|
@ -214,6 +215,7 @@ namespace CodeImp.DoomBuilder
|
|||
internal static Dictionary<string, ScriptConfiguration> ScriptConfigs { get { return scriptconfigs; } }
|
||||
public static MapManager Map { get { return map; } }
|
||||
public static ActionManager Actions { get { return actions; } }
|
||||
public static HintsManager Hints { get { return hints; } } //mxd
|
||||
internal static PluginManager Plugins { get { return plugins; } }
|
||||
public static Clock Clock { get { return clock; } }
|
||||
public static bool DebugBuild { get { return debugbuild; } }
|
||||
|
@ -609,6 +611,9 @@ namespace CodeImp.DoomBuilder
|
|||
// Bind static methods to actions
|
||||
General.Actions.BindMethods(typeof(General));
|
||||
|
||||
//mxd. Create hints manager
|
||||
hints = new HintsManager();
|
||||
|
||||
// Initialize static classes
|
||||
MapSet.Initialize();
|
||||
ilInit();
|
||||
|
@ -944,7 +949,6 @@ namespace CodeImp.DoomBuilder
|
|||
if(editing != null) editing.Dispose(); editing = null;
|
||||
if(mainwindow != null) mainwindow.Dispose();
|
||||
if(actions != null) actions.Dispose();
|
||||
//if (clock != null) clock.Dispose(); //mxd
|
||||
if(plugins != null) plugins.Dispose();
|
||||
if(types != null) types.Dispose();
|
||||
try { D3DDevice.Terminate(); } catch(Exception) { }
|
||||
|
|
|
@ -167,6 +167,9 @@ namespace CodeImp.DoomBuilder.Plugins
|
|||
|
||||
// Load actions
|
||||
General.Actions.LoadActions(p.Assembly);
|
||||
|
||||
//mxd. And hints
|
||||
General.Hints.LoadHints(p.Assembly);
|
||||
|
||||
// Plugin is now initialized
|
||||
p.Plug.OnInitialize();
|
||||
|
@ -198,6 +201,9 @@ namespace CodeImp.DoomBuilder.Plugins
|
|||
|
||||
// Load actions
|
||||
General.Actions.LoadActions(p.Assembly);
|
||||
|
||||
//mxd. And hints
|
||||
General.Hints.LoadHints(p.Assembly);
|
||||
|
||||
// Plugin is now initialized
|
||||
p.Plug.OnInitialize();
|
||||
|
|
|
@ -59,8 +59,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
void ShowThingInfo(Thing t);
|
||||
void ShowVertexInfo(Vertex v);
|
||||
void HideInfo();
|
||||
void ShowEditModeHints(string[] hints); //mxd
|
||||
void ClearEditModeHints(); //mxd
|
||||
void ShowHints(string hints); //mxd
|
||||
void ClearHints(); //mxd
|
||||
void RefreshInfo();
|
||||
void UpdateCoordinates(Vector2D coords);
|
||||
bool Focus();
|
||||
|
|
|
@ -2787,13 +2787,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
if(General.Editing.Mode == null || !(General.Editing.Mode is VisualMode))
|
||||
cursorLocation = Cursor.Position - new Size(bounds.Location);
|
||||
|
||||
string date = DateTime.Now.ToString();
|
||||
|
||||
//because date may be returned like this: 1\1\2000
|
||||
char[] invalidChars = Path.GetInvalidFileNameChars();
|
||||
foreach(char c in invalidChars) date = date.Replace(c, '.');
|
||||
|
||||
//create path
|
||||
string date = DateTime.Now.ToString("dd.MM.yyyy HH-mm-ss");
|
||||
string path = Path.Combine(folder, name + date + ".jpg");
|
||||
|
||||
//save image
|
||||
|
@ -2912,16 +2907,16 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
}
|
||||
|
||||
//mxd
|
||||
public void ShowEditModeHints(string[] hintsText) {
|
||||
if (hintsText != null) {
|
||||
public void ShowHints(string hintsText) {
|
||||
if (!string.IsNullOrEmpty(hintsText)) {
|
||||
hintsPanel.SetHints(hintsText);
|
||||
} else {
|
||||
ClearEditModeHints();
|
||||
ClearHints();
|
||||
}
|
||||
}
|
||||
|
||||
//mxd
|
||||
public void ClearEditModeHints() {
|
||||
public void ClearHints() {
|
||||
hintsPanel.ClearHints();
|
||||
}
|
||||
|
||||
|
|
|
@ -449,17 +449,12 @@
|
|||
<ItemGroup>
|
||||
<None Include="Resources\TextureLock.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\AnnotationsMode.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\Lightbulb.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\Reset.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\DrawGridMode.png" />
|
||||
<EmbeddedResource Include="Resources\Hints.cfg" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
|
|
@ -511,16 +511,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
|
||||
// This redraws only the required things
|
||||
protected virtual void UpdateRedraw()
|
||||
{
|
||||
}
|
||||
|
||||
//mxd
|
||||
protected override void SetupHints() {
|
||||
hints = new[] { "Hold Shift to " + (General.Interface.SnapToGrid ? "disable" : "enable") + " grid snapping.",
|
||||
"Hold Ctrl to " + (General.Interface.AutoMerge ? "disable" : "enable") + " snapping to nearest vertex."
|
||||
};
|
||||
}
|
||||
protected virtual void UpdateRedraw() { }
|
||||
|
||||
// When edit button is released
|
||||
protected override void OnEditEnd()
|
||||
|
|
|
@ -433,13 +433,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
}
|
||||
|
||||
//mxd
|
||||
protected override void SetupHints() {
|
||||
hints = new[] { "Hold Shift to "+(General.Interface.SnapToGrid ? "disable" : "enable")+ " grid snapping.",
|
||||
"Hold Ctrl to snap to nearest vertex."
|
||||
};
|
||||
}
|
||||
|
||||
// When edit button is released
|
||||
protected override void OnEditEnd()
|
||||
{
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
private int minSegmentLength = 16;
|
||||
private int maxSegmentLength = 4096; //just some arbitrary number
|
||||
|
||||
public DrawCurveMode() : base() {
|
||||
public DrawCurveMode() {
|
||||
hintLabel = new HintLabel();
|
||||
}
|
||||
|
||||
|
@ -217,24 +217,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
General.Editing.ChangeMode(General.Editing.PreviousStableMode.Name);
|
||||
}
|
||||
|
||||
//mxd. Setup hints for current editing mode
|
||||
protected override void SetupHints() {
|
||||
string selectKey = Actions.Action.GetShortcutKeyDesc("builder_classicselect");
|
||||
string editKey = Actions.Action.GetShortcutKeyDesc("builder_classicedit");
|
||||
string acceptKey = Actions.Action.GetShortcutKeyDesc("builder_acceptmode");
|
||||
string cancelKey = Actions.Action.GetShortcutKeyDesc("builder_cancelmode");
|
||||
string removeKey = Actions.Action.GetShortcutKeyDesc("buildermodes_removepoint");
|
||||
string incSub = Actions.Action.GetShortcutKeyDesc("buildermodes_increasesubdivlevel");
|
||||
string decSub = Actions.Action.GetShortcutKeyDesc("buildermodes_decreasesubdivlevel");
|
||||
|
||||
hints = new[]{"Press " + selectKey + " to place a vertex",
|
||||
"Use " + incSub + " and " + decSub + " to change detail level of the curve",
|
||||
"Press " + removeKey + " to remove last vertex",
|
||||
"Press " + acceptKey + " to accept",
|
||||
"Press " + cancelKey + " or " + editKey + " to cancel"
|
||||
};
|
||||
}
|
||||
|
||||
//ACTIONS
|
||||
[BeginAction("increasesubdivlevel")]
|
||||
protected virtual void increaseSubdivLevel() {
|
||||
|
|
|
@ -108,24 +108,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
return "BVL: "+bevelWidth+"; VERTS: "+subdivisions;
|
||||
}
|
||||
|
||||
//mxd. Setup hints for current editing mode
|
||||
/*protected override void SetupHints() {
|
||||
string selectKey = Actions.Action.GetShortcutKeyDesc("builder_classicselect");
|
||||
string editKey = Actions.Action.GetShortcutKeyDesc("builder_classicedit");
|
||||
string cancelKey = Actions.Action.GetShortcutKeyDesc("builder_cancelmode");
|
||||
string incSub = Actions.Action.GetShortcutKeyDesc("buildermodes_increasesubdivlevel");
|
||||
string decSub = Actions.Action.GetShortcutKeyDesc("buildermodes_decreasesubdivlevel");
|
||||
string incBvl = Actions.Action.GetShortcutKeyDesc("buildermodes_increasebevel");
|
||||
string decBvl = Actions.Action.GetShortcutKeyDesc("buildermodes_decreasebevel");
|
||||
|
||||
hints = new[]{"Press " + selectKey + " to place a vertex",
|
||||
"Use " + incBvl + " and " + decBvl + " to change bevel by current grid size",
|
||||
"Use " + incSub + " and " + decSub + " to change the number of points in ellipse",
|
||||
"Place second vertex to finish drawing",
|
||||
"Press " + cancelKey + " or " + editKey + " to cancel"
|
||||
};
|
||||
}*/
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Events
|
||||
|
|
|
@ -408,15 +408,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
//mxd. Setup hints for current editing mode
|
||||
protected override void SetupHints() {
|
||||
hints = new[]{ "Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_classicselect") + "</b> to place a vertex",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_removepoint") + "</b> to remove last vertex",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_acceptmode") + "</b> to accept",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_cancelmode") + "</b> or <b>" + Actions.Action.GetShortcutKeyDesc("builder_classicedit") + "</b> to cancel"
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -222,16 +222,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
return "BVL: " + bevelWidth + "; SUB: " + subdivisions;
|
||||
}
|
||||
|
||||
//mxd. Setup hints for current editing mode
|
||||
/*protected override void SetupHints() {
|
||||
hints = new[]{"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_classicselect") + "</b> to place a vertex",
|
||||
"Use <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_increasebevel") + "</b> and <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_decreasebevel") + "</b> to change corners bevel by current grid size",
|
||||
"Use <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_increasesubdivlevel") + "</b> and <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_decreasesubdivlevel") + "</b> to change bevel detail level",
|
||||
"Place second vertex to finish drawing",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_cancelmode") + "</b> or <b>" + Actions.Action.GetShortcutKeyDesc("builder_classicedit") + "</b> to cancel"
|
||||
};
|
||||
}*/
|
||||
|
||||
//update top-left and bottom-right points, which define drawing shape
|
||||
protected void updateReferencePoints(DrawnVertex p1, DrawnVertex p2) {
|
||||
if(!p1.pos.IsFinite() || !p2.pos.IsFinite()) return;
|
||||
|
|
|
@ -256,34 +256,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
return selectionrect.Contains(l.Start.Position.x, l.Start.Position.y) && selectionrect.Contains(l.End.Position.x, l.End.Position.y);
|
||||
}
|
||||
|
||||
//mxd. Setup hints for current editing mode
|
||||
protected override void SetupHints() {
|
||||
string selectKey = Actions.Action.GetShortcutKeyDesc("builder_classicselect");
|
||||
|
||||
hints = new[]{ "Hold <b>" + Actions.Action.GetShortcutKeyDesc("builder_pan_view") + "</b> to pan the view",
|
||||
"Press <b>" + selectKey + "</b> to select a linedef",
|
||||
"Hold <b>" + selectKey + "</b> and drag to use rectangular selection",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_clearselection") + "</b> to clear selection",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_deleteitem") + "</b> to delete selected linedef(s)",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_dissolveitem") + "</b> to delete selected linedef(s) and try to preserve surrounding geometry",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_classicedit") + "</b> to edit properties of current selection",
|
||||
"Use <b>" + Actions.Action.GetShortcutKeyDesc("builder_griddec") + "</b> and <b>" + Actions.Action.GetShortcutKeyDesc("builder_gridinc") + "</b> to change grid size",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_drawlinesmode") + "</b> or <b>" + Actions.Action.GetShortcutKeyDesc("builder_insertitem") + "</b> to start drawing lines",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_flipsidedefs") + "</b> to flips the sidedefs on the selected linedefs around",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_selectsinglesided") + "</b> to keep only the single-sided lines in your selection selected",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_selectdoublesided") + "</b> to keep only the double-sided lines in your selection selected",
|
||||
"Check <b>'Linedefs'</b> menu for additional actions"
|
||||
};
|
||||
}
|
||||
|
||||
//mxd
|
||||
protected override void SetupMultiselectionHints() {
|
||||
multiselectionHints = new[] { "Hold <b>Shift</b> to " + (BuilderPlug.Me.AdditiveSelect ? "disable" : "enable") + " additive selection",
|
||||
"Hold <b>Ctrl</b> to enable subtractive selection",
|
||||
"Hold <b>Ctrl-Shift</b> to intersect the new selection with already existing one",
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -524,37 +524,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
return false;
|
||||
}
|
||||
|
||||
//mxd. Setup hints for current editing mode
|
||||
protected override void SetupHints() {
|
||||
string selectKey = Actions.Action.GetShortcutKeyDesc("builder_classicselect");
|
||||
|
||||
hints = new[]{ "Hold <b>" + Actions.Action.GetShortcutKeyDesc("builder_pan_view") + "</b> to pan the view",
|
||||
"Press <b>" + selectKey + "</b> to select a sector. Hold <b>Alt</b> to (de)select things inside of a sector",
|
||||
"Hold <b>" + selectKey + "</b> and drag to use rectangular selection",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_clearselection") + "</b> to clear selection",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_deleteitem") + "</b> to delete selected sector(s)",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_classicedit") + "</b> to edit properties of current selection",
|
||||
"Use <b>" + Actions.Action.GetShortcutKeyDesc("builder_griddec") + "</b> and <b>" + Actions.Action.GetShortcutKeyDesc("builder_gridinc") + "</b> to change grid size",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_joinsectors") + "</b> to join two or more selected sectors together and keep all linedefs",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_mergesectors") + "</b> to join two or more selected sectors together and remove the shared inedefs",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_gradientbrightness") + "</b> to create a brightness or color gradient over all selected sectors from the first to the last selected sector",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_gradientfloors") + "</b> to create a floor heights gradient over all selected sectors from the first to the last selected sector",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_gradientceilings") + "</b> to create a ceiling heights gradient over all selected sectors from the first to the last selected sector",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_makedoor") + "</b> to create doors from the highlighted or selected sectors",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_drawlinesmode") + "</b> or <b>" + Actions.Action.GetShortcutKeyDesc("builder_insertitem") + "</b> to start drawing lines",
|
||||
"Check <b>'Sectors'</b> menu for additional actions"
|
||||
};
|
||||
}
|
||||
|
||||
//mxd
|
||||
protected override void SetupMultiselectionHints() {
|
||||
multiselectionHints = new[] { "Hold <b>Shift</b> to " + (BuilderPlug.Me.AdditiveSelect ? "disable" : "enable") + " additive selection",
|
||||
"Hold <b>Ctrl</b> to enable subtractive selection",
|
||||
"Hold <b>Ctrl-Shift</b> to intersect the new selection with already existing one",
|
||||
"Hold <b>Alt</b> to select things inside of selected sectors"
|
||||
};
|
||||
}
|
||||
|
||||
//mxd
|
||||
public override void SelectMapElement(SelectableElement element) {
|
||||
if(element is Sector) {
|
||||
|
|
|
@ -635,34 +635,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
General.Interface.DisplayStatus(StatusType.Selection, string.Empty);
|
||||
}
|
||||
|
||||
//mxd. Setup hints for current editing mode
|
||||
protected override void SetupHints() {
|
||||
string selectKey = Actions.Action.GetShortcutKeyDesc("builder_classicselect");
|
||||
|
||||
hints = new[]{ "Hold <b>" + Actions.Action.GetShortcutKeyDesc("builder_pan_view") + "</b> to pan the view",
|
||||
"Press <b>" + selectKey + "</b> to select a thing",
|
||||
"Hold <b>" + selectKey + "</b> and drag to use rectangular selection",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_thingsselectinsectors") + "</b> to select things in selected sectors",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_clearselection") + "</b> to clear selection",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_deleteitem") + "</b> to delete selected thing(s)",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_classicedit") + "</b> to edit properties of current selection",
|
||||
"Use <b>" + Actions.Action.GetShortcutKeyDesc("builder_griddec") + "</b> and <b>" + Actions.Action.GetShortcutKeyDesc("builder_gridinc") + "</b> to change grid size",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_insertitem") + "</b> to create a new thing",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_thinglookatcursor") + "</b> to point selected things to cursor position. Hold <b>Ctrl</b> to point away from cursor",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_thingaligntowall") + "</b> to align selected things to closest linedef",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_drawlinesmode") + "</b> to start drawing lines",
|
||||
"Check <b>'Things'</b> menu for additional actions"
|
||||
};
|
||||
}
|
||||
|
||||
//mxd
|
||||
protected override void SetupMultiselectionHints() {
|
||||
multiselectionHints = new[] { "Hold <b>Shift</b> to " + (BuilderPlug.Me.AdditiveSelect ? "disable" : "enable") + " additive selection",
|
||||
"Hold <b>Ctrl</b> to enable subtractive selection",
|
||||
"Hold <b>Ctrl-Shift</b> to intersect the new selection with already existing one",
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Actions
|
||||
|
|
|
@ -189,12 +189,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
else
|
||||
General.Interface.HideInfo();
|
||||
}
|
||||
|
||||
//mxd
|
||||
protected override void StartMultiSelection() {
|
||||
General.Interface.ShowEditModeHints(multiselectionHints);
|
||||
base.StartMultiSelection();
|
||||
}
|
||||
|
||||
// Selection
|
||||
protected override void OnSelectBegin()
|
||||
|
@ -659,32 +653,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
else
|
||||
General.Interface.DisplayStatus(StatusType.Selection, string.Empty);
|
||||
}
|
||||
|
||||
//mxd. Setup hints for current editing mode
|
||||
protected override void SetupHints() {
|
||||
string selectKey = Actions.Action.GetShortcutKeyDesc("builder_classicselect");
|
||||
|
||||
hints = new[]{ "Hold <b>" + Actions.Action.GetShortcutKeyDesc("builder_pan_view") + "</b> to pan the view",
|
||||
"Press <b>" + selectKey + "</b> to select a vertex",
|
||||
"Hold <b>" + selectKey + "</b> and drag to use rectangular selection",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_clearselection") + "</b> to clear selection",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_insertitem") + "</b> to insert a new vertex",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_deleteitem") + "</b> to delete selected vertices",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_dissolveitem") + "</b> to delete selected vertices and try to preserve surrounding geometry",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_classicedit") + "</b> to edit properties of current selection",
|
||||
"Use <b>" + Actions.Action.GetShortcutKeyDesc("builder_griddec") + "</b> and <b>" + Actions.Action.GetShortcutKeyDesc("builder_gridinc") + "</b> to change grid size",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_drawlinesmode") + "</b> to start drawing lines",
|
||||
"Check <b>'Vertices'</b> menu for additional actions"
|
||||
};
|
||||
}
|
||||
|
||||
//mxd
|
||||
protected override void SetupMultiselectionHints() {
|
||||
multiselectionHints = new[] { "Hold <b>Shift</b> to " + (BuilderPlug.Me.AdditiveSelect ? "disable" : "enable") + " additive selection",
|
||||
"Hold <b>Ctrl</b> to enable subtractive selection",
|
||||
"Hold <b>Ctrl-Shift</b> to intersect the new selection with already existing one",
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
202
Source/Plugins/BuilderModes/Resources/Hints.cfg
Normal file
202
Source/Plugins/BuilderModes/Resources/Hints.cfg
Normal file
|
@ -0,0 +1,202 @@
|
|||
// This is GZDB hints configuration file. It's dev-only stuff so bare minimum of boilerplate is present in the parser class
|
||||
// (e.g. create your Hints.cfg exactly the way it's done here or face consequences).
|
||||
// "class" should exactly match your classname; "group" can be anything. "general" and "multiselection" groups are shown automatically when appropriate.
|
||||
// Supported tags are <b> for Bold and <br> for line break. Action name inside of <k> tag will insert keyboard shortcut for given action in bold.
|
||||
// Only single-line comments are supported.
|
||||
|
||||
class VerticesMode
|
||||
group general
|
||||
"Hold <k>builder_pan_view</k> to pan the view"
|
||||
"Press <k>builder_classicselect</k> to select a vertex"
|
||||
"Hold <k>builder_classicselect</k> and drag to use rectangular selection"
|
||||
"Press <k>builder_clearselection</k> to clear selection"
|
||||
"Press <k>builder_insertitem</k> to insert a new vertex"
|
||||
"Press <k>builder_deleteitem</k> to delete selected vertices"
|
||||
"Press <k>builder_dissolveitem</k> to delete selected vertices and try to preserve surrounding geometry"
|
||||
"Press <k>builder_classicedit</k> to edit properties of current selection"
|
||||
"Use <k>builder_griddec</k> and <k>builder_gridinc</k> to change grid size"
|
||||
"Press <k>buildermodes_drawlinesmode</k> to start drawing lines"
|
||||
"Check <b>'Vertices'</b> menu for additional actions"
|
||||
|
||||
group multiselection
|
||||
"Hold <b>Shift</b> to toggle additive selection"
|
||||
"Hold <b>Ctrl</b> to enable subtractive selection"
|
||||
"Hold <b>Ctrl-Shift</b> to intersect the new selection with already existing one"
|
||||
|
||||
|
||||
class LinedefsMode
|
||||
group general
|
||||
"Hold <k>builder_pan_view</k> to pan the view"
|
||||
"Press <k>builder_classicselect</k> to select a linedef"
|
||||
"Hold <k>builder_classicselect</k> and drag to use rectangular selection"
|
||||
"Press <k>builder_clearselection</k> to clear selection"
|
||||
"Press <k>builder_deleteitem</k> to delete selected linedef(s)"
|
||||
"Press <k>builder_dissolveitem</k> to delete selected linedef(s) and try to preserve surrounding geometry"
|
||||
"Press <k>builder_classicedit</k> to edit properties of current selection"
|
||||
"Use <k>builder_griddec</k> and <k>builder_gridinc</k> to change grid size"
|
||||
"Press <k>buildermodes_drawlinesmode</k> or <k>builder_insertitem</k> to start drawing lines"
|
||||
"Press <k>buildermodes_flipsidedefs</k> to flips the sidedefs on the selected linedefs around"
|
||||
"Press <k>buildermodes_selectsinglesided</k> to keep only the single-sided lines in your selection selected"
|
||||
"Press <k>buildermodes_selectdoublesided</k> to keep only the double-sided lines in your selection selected"
|
||||
"Check <b>'Linedefs'</b> menu for additional actions"
|
||||
|
||||
group multiselection
|
||||
"Hold <b>Shift</b> to toggle additive selection"
|
||||
"Hold <b>Ctrl</b> to enable subtractive selection"
|
||||
"Hold <b>Ctrl-Shift</b> to intersect the new selection with already existing one"
|
||||
|
||||
|
||||
class SectorsMode
|
||||
group general
|
||||
"Hold <k>builder_pan_view</k> to pan the view"
|
||||
"Press <k>builder_classicselect</k> to select a sector. Hold <b>Alt</b> to (de)select things inside of a sector"
|
||||
"Hold <k>builder_classicselect</k> and drag to use rectangular selection"
|
||||
"Press <k>builder_clearselection</k> to clear selection"
|
||||
"Press <k>builder_deleteitem</k> to delete selected sector(s)"
|
||||
"Press <k>builder_classicedit</k> to edit properties of current selection"
|
||||
"Use <k>builder_griddec</k> and <k>builder_gridinc</k> to change grid size"
|
||||
"Press <k>buildermodes_joinsectors</k> to join two or more selected sectors together and keep all linedefs"
|
||||
"Press <k>buildermodes_mergesectors</k> to join two or more selected sectors together and remove the shared inedefs"
|
||||
"Press <k>buildermodes_gradientbrightness</k> to create a brightness or color gradient over all selected sectors from the first to the last selected sector"
|
||||
"Press <k>buildermodes_gradientfloors</k> to create a floor heights gradient over all selected sectors from the first to the last selected sector"
|
||||
"Press <k>buildermodes_gradientceilings</k> to create a ceiling heights gradient over all selected sectors from the first to the last selected sector"
|
||||
"Press <k>buildermodes_makedoor</k> to create doors from the highlighted or selected sectors"
|
||||
"Press <k>buildermodes_drawlinesmode</k> or <k>builder_insertitem</k> to start drawing lines"
|
||||
"Check <b>'Sectors'</b> menu for additional actions"
|
||||
|
||||
group multiselection
|
||||
"Hold <b>Shift</b> to toggle additive selection"
|
||||
"Hold <b>Ctrl</b> to enable subtractive selection"
|
||||
"Hold <b>Ctrl-Shift</b> to intersect the new selection with already existing one"
|
||||
"Hold <b>Alt</b> to select things inside of selected sectors"
|
||||
|
||||
|
||||
class ThingsMode
|
||||
group general
|
||||
"Hold <k>builder_pan_view</k> to pan the view"
|
||||
"Press <k>builder_classicselect</k> to select a thing"
|
||||
"Hold <k>builder_classicselect</k> and drag to use rectangular selection"
|
||||
"Press <k>buildermodes_thingsselectinsectors</k> to select things in selected sectors"
|
||||
"Press <k>builder_clearselection</k> to clear selection"
|
||||
"Press <k>builder_deleteitem</k> to delete selected thing(s)"
|
||||
"Press <k>builder_classicedit</k> to edit properties of current selection"
|
||||
"Use <k>builder_griddec</k> and <k>builder_gridinc</k> to change grid size"
|
||||
"Press <k>builder_insertitem</k> to create a new thing"
|
||||
"Press <k>buildermodes_thinglookatcursor</k> to point selected things to cursor position. Hold <b>Ctrl</b> to point away from cursor"
|
||||
"Press <k>buildermodes_thingaligntowall</k> to align selected things to closest linedef"
|
||||
"Press <k>buildermodes_drawlinesmode</k> to start drawing lines"
|
||||
"Check <b>'Things'</b> menu for additional actions"
|
||||
|
||||
group multiselection
|
||||
"Hold <b>Shift</b> to toggle additive selection"
|
||||
"Hold <b>Ctrl</b> to enable subtractive selection"
|
||||
"Hold <b>Ctrl-Shift</b> to intersect the new selection with already existing one"
|
||||
|
||||
|
||||
class BaseVisualMode
|
||||
group general
|
||||
"Use <k>builder_moveforward</k>, <k>builder_movebackward</k>, <k>builder_moveleft</k> and <k>builder_moveright</k> to move around. Hold <b>Shift</b> to double the speed"
|
||||
"Use <k>builder_moveup</k> and <k>builder_movedown</k> to move up and down"
|
||||
"Press <k>builder_gztogglevisualvertices</k> to toggle vertex handles rendering (UDMF only)"
|
||||
|
||||
group things
|
||||
"Use <k>builder_moveforward</k>, <k>builder_movebackward</k>, <k>builder_moveleft</k> and <k>builder_moveright</k> to move around. Hold <b>Shift</b> to double the speed"
|
||||
"Use <k>builder_moveup</k> and <k>builder_movedown</k> to move up and down"
|
||||
"Press <k>builder_gztogglevisualvertices</k> to toggle vertex handles rendering (UDMF only)"
|
||||
"Press <k>builder_insertitem</k> to insert a thing at current cursor position"
|
||||
"Press <k>builder_visualselect</k> to select the highlighted thing"
|
||||
"Press <k>builder_clearselection</k> to clear selection"
|
||||
"Press <k>builder_deleteitem</k> to delete selected things"
|
||||
"Use <k>buildermodes_raisesector8</k> and <k>buildermodes_lowersector8</k> to change height of selected/targeted things by 8 map units"
|
||||
"Use <k>buildermodes_lowersectortonearest</k> and <k>buildermodes_raisesectortonearest</k> to align selected/targeted things to floor or ceiling"
|
||||
"Use <k>builder_movethingfwd</k>, <k>builder_movethingback</k>, <k>builder_movethingleft</k> and <k>builder_movethingright</k> to move selected things around"
|
||||
"Press <k>builder_placethingatcursor</k> to move selected things to cursor location"
|
||||
"Press <k>buildermodes_showvisualthings</k> to cycle through the different ways the things are shown"
|
||||
|
||||
group sidedefs
|
||||
"Use <k>builder_moveforward</k>, <k>builder_movebackward</k>, <k>builder_moveleft</k> and <k>builder_moveright</k> to move around. Hold <b>Shift</b> to double the speed"
|
||||
"Use <k>builder_moveup</k> and <k>builder_movedown</k> to move up and down"
|
||||
"Press <k>builder_gztogglevisualvertices</k> to toggle vertex handles rendering (UDMF only)"
|
||||
"Press <k>builder_insertitem</k> to insert a thing at current cursor position"
|
||||
"Press <k>builder_visualselect</k> to select the highlighted surface. Hold <b>Shift</b> to select adjacent surfaces with the same texture. Hold <b>Ctrl</b> to select adjacent surfaces with the same height"
|
||||
"Press <k>builder_deleteitem</k> to remove textures from selected surfaces"
|
||||
"Use <k>buildermodes_movetextureleft</k>, <k>buildermodes_movetextureright</k>, <k>buildermodes_movetextureup</k> and <k>buildermodes_movetexturedown</k> to change texture offsets by 1 mp."
|
||||
"Use <k>buildermodes_movetextureleft8</k>, <k>buildermodes_movetextureright8</k>, <k>buildermodes_movetextureup8</k> and <k>buildermodes_movetexturedown8</k> to change texture offsets by current grid size"
|
||||
"Use <k>buildermodes_scaletextureupx</k>, <k>buildermodes_scaletexturedownx</k>, <k>buildermodes_scaletextureupy</k> and <k>buildermodes_scaletexturedowny</k> to scale selected textures (UDMF only)"
|
||||
"Press <k>buildermodes_textureselect</k> to open texture browser"
|
||||
"Use <k>buildermodes_texturecopy</k>, <k>buildermodes_texturepaste</k> and <k>buildermodes_floodfilltextures</k> to copy, paste and flood-fill highlighted texture"
|
||||
"Use <k>buildermodes_texturecopyoffsets</k> and <k>buildermodes_texturepasteoffsets</k> to copy and paste texture offsets"
|
||||
"Use <k>buildermodes_visualautoalignx</k>, <k>buildermodes_visualautoalign</k> or <k>buildermodes_visualautoalign</k> to auto align textures on X, Y and XY axis"
|
||||
"Use <k>buildermodes_visualfittexturesx</k>, <k>buildermodes_visualfittexturesy</k> or <k>buildermodes_visualfittextures</k> to fit texture's width, height or both into it's surface (UDMF only)"
|
||||
"Use <k>buildermodes_resettexture</k> to reset global texture offsets"
|
||||
"Use <k>buildermodes_resettextureudmf</k> to reset local texture offsets and scale (UDMF only)"
|
||||
"Use <k>buildermodes_toggleupperunpegged</k> or <k>buildermodes_togglelowerunpegged</k> to toggle Upper or Lower Unpegged setting"
|
||||
|
||||
group sectors
|
||||
"Use <k>builder_moveforward</k>, <k>builder_movebackward</k>, <k>builder_moveleft</k> and <k>builder_moveright</k> to move around. Hold <b>Shift</b> to double the speed"
|
||||
"Use <k>builder_moveup</k> and <k>builder_movedown</k> to move up and down"
|
||||
"Press <k>builder_gztogglevisualvertices</k> to toggle vertex handles rendering (UDMF only)"
|
||||
"Press <k>builder_insertitem</k> to insert a thing at current cursor position"
|
||||
"Press <k>builder_visualselect</k> to select the highlighted surface. Hold <b>Shift</b> to select adjacent surfaces with the same texture. Hold <b>Ctrl</b> to select adjacent surfaces with the same height"
|
||||
"Press <k>builder_deleteitem</k> to remove textures from selected surfaces"
|
||||
"Use <k>buildermodes_movetextureleft</k>, <k>buildermodes_movetextureright</k>, <k>buildermodes_movetextureup</k> and <k>buildermodes_movetexturedown</k> to change texture offsets by 1 mp. (UDMF only)"
|
||||
"Use <k>buildermodes_movetextureleft8</k>, <k>buildermodes_movetextureright8</k>, <k>buildermodes_movetextureup8</k> and <k>buildermodes_movetexturedown8</k> to change texture offsets by current grid size (UDMF only)"
|
||||
"Use <k>buildermodes_scaletextureupx</k>, <k>buildermodes_scaletexturedownx</k>, <k>buildermodes_scaletextureupy</k> and <k>buildermodes_scaletexturedowny</k> to scale selected textures (UDMF only)"
|
||||
"Use <k>buildermodes_resettextureudmf</k> to reset local texture offsets and scale (UDMF only)"
|
||||
"Press <k>buildermodes_textureselect</k> to open texture browser"
|
||||
"Use <k>buildermodes_texturecopy</k> and <k>buildermodes_texturepaste</k> to copy and paste highlighted texture"
|
||||
|
||||
|
||||
group vertices
|
||||
"Use <k>builder_moveforward</k>, <k>builder_movebackward</k>, <k>builder_moveleft</k> and <k>builder_moveright</k> to move around. Hold <b>Shift</b> to double the speed"
|
||||
"Use <k>builder_moveup</k> and <k>builder_movedown</k> to move up and down"
|
||||
"Press <k>builder_gztogglevisualvertices</k> to toggle vertex handles rendering (UDMF only)"
|
||||
"Press <k>builder_insertitem</k> to insert a thing at current cursor position"
|
||||
"Press <k>builder_deleteitem</k> to reset vertex height offsets for selected vertex handles"
|
||||
|
||||
|
||||
class DragGeometryMode
|
||||
group general
|
||||
"Hold <b>Shift</b> to toggle grid snapping"
|
||||
"Hold <b>Ctrl</b> to toggle snapping to nearest vertex"
|
||||
|
||||
|
||||
class DragThingsMode
|
||||
group general
|
||||
"Hold <b>Shift</b> to toggle grid snapping"
|
||||
"Hold <b>Ctrl</b> to toggle snapping to nearest vertex"
|
||||
|
||||
|
||||
class DrawGeometryMode
|
||||
group general
|
||||
"Press <k>builder_classicselect</k> to place a vertex"
|
||||
"Press <k>buildermodes_removepoint</k> to remove last vertex"
|
||||
"Press <k>builder_acceptmode</k> to accept"
|
||||
"Press <k>builder_cancelmode</k> or <k>builder_classicedit</k> to cancel"
|
||||
|
||||
|
||||
class DrawCurveMode
|
||||
group general
|
||||
"Press <k>builder_classicselect</k> to place a vertex"
|
||||
"Use <k>buildermodes_increasesubdivlevel</k> and <k>buildermodes_decreasesubdivlevel</k> to change detail level of the curve"
|
||||
"Press <k>buildermodes_removepoint</k> to remove last vertex"
|
||||
"Press <k>builder_acceptmode</k> to accept"
|
||||
"Press <k>builder_cancelmode</k> or <k>builder_classicedit</k> to cancel"
|
||||
|
||||
|
||||
class DrawRectangleMode
|
||||
group general
|
||||
"Press <k>builder_classicselect</k> to place a vertex"
|
||||
"Use <k>buildermodes_increasebevel</k> and <k>buildermodes_decreasebevel</k> to change corners bevel by current grid size"
|
||||
"Use <k>buildermodes_increasesubdivlevel</k> and <k>buildermodes_decreasesubdivlevel</k> to change bevel detail level"
|
||||
"Place second vertex to finish drawing"
|
||||
"Press <k>builder_cancelmode</k> or <k>builder_classicedit</k> to cancel"
|
||||
|
||||
|
||||
class DrawEllipseMode
|
||||
group general
|
||||
"Press <k>builder_classicselect</k> to place a vertex"
|
||||
"Use <k>buildermodes_increasebevel</k> and <k>buildermodes_decreasebevel</k> to change bevel by current grid size"
|
||||
"Use <k>buildermodes_increasesubdivlevel</k> and <k>buildermodes_decreasesubdivlevel</k> to change the number of points in ellipse"
|
||||
"Place second vertex to finish drawing"
|
||||
"Press <k>builder_cancelmode</k> or <k>builder_classicedit</k> to cancel"
|
|
@ -110,13 +110,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// must be subtracted from the X offset first.
|
||||
public bool forward;
|
||||
}
|
||||
|
||||
//mxd. All sorts of hints
|
||||
private string[] thingHints;
|
||||
private string[] sidedefHints;
|
||||
private string[] sectorHints;
|
||||
private string[] vertexHints;
|
||||
private string[] generalHints;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -315,13 +308,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
if(singleselection)
|
||||
return General.Map.UndoRedo.CreateUndo(description, this, group, grouptag);
|
||||
else
|
||||
return General.Map.UndoRedo.CreateUndo(description, this, UndoGroup.None, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
return General.Map.UndoRedo.CreateUndo(description, this, UndoGroup.None, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// This creates an undo, when only a single selection is made
|
||||
|
@ -626,21 +616,21 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
numWalls++;
|
||||
}
|
||||
|
||||
string result = "";
|
||||
List<string> results = new List<string>();
|
||||
if (numWalls > 0) results.Add(numWalls + (numWalls > 1 ? " sidedefs" : " sidedef"));
|
||||
if (numFloors > 0) results.Add(numFloors + (numFloors > 1 ? " floors" : " floor"));
|
||||
if (numCeilings > 0) results.Add(numCeilings + (numCeilings > 1 ? " ceilings" : " ceiling"));
|
||||
if (numThings > 0) results.Add(numThings + (numThings > 1 ? " things" : " thing"));
|
||||
if (numVerts > 0) results.Add(numVerts + (numVerts > 1 ? " vertices" : " vertex"));
|
||||
|
||||
if(numWalls > 0) result = numWalls + (numWalls > 1 ? " sidedefs" : " sidedef");
|
||||
if(numFloors > 0) result += (result.Length > 0 ? ", " : "") + numFloors + (numFloors > 1 ? " floors" : " floor");
|
||||
if(numCeilings > 0) result += (result.Length > 0 ? ", " : "") + numCeilings + (numCeilings > 1 ? " ceilings" : " ceiling");
|
||||
if(numThings > 0) result += (result.Length > 0 ? ", " : "") + numThings + (numThings > 1 ? " things" : " thing");
|
||||
if(numVerts > 0) result += (result.Length > 0 ? ", " : "") + numVerts + (numVerts > 1 ? " vertices" : " vertex");
|
||||
|
||||
if(!string.IsNullOrEmpty(result)) {
|
||||
if (results.Count == 0) {
|
||||
General.Interface.DisplayStatus(StatusType.Selection, string.Empty);
|
||||
} else {
|
||||
string result = string.Join(", ", results.ToArray());
|
||||
int pos = result.LastIndexOf(",");
|
||||
if(pos != -1) result = result.Remove(pos, 1).Insert(pos, " and");
|
||||
result += " selected";
|
||||
General.Interface.DisplayStatus(StatusType.Selection, result + " selected");
|
||||
}
|
||||
|
||||
General.Interface.DisplayStatus(StatusType.Selection, result);
|
||||
}
|
||||
|
||||
//mxd
|
||||
|
@ -1266,15 +1256,15 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
//mxd. Show hints!
|
||||
if (o.GetType() != lasthighlighttype) {
|
||||
if (o is BaseVisualGeometrySidedef) {
|
||||
General.Interface.ShowEditModeHints(sidedefHints);
|
||||
General.Hints.ShowHints(this.GetType(), "sidedefs");
|
||||
} else if (o is BaseVisualGeometrySector) {
|
||||
General.Interface.ShowEditModeHints(sectorHints);
|
||||
General.Hints.ShowHints(this.GetType(), "sectors");
|
||||
} else if (o is BaseVisualThing) {
|
||||
General.Interface.ShowEditModeHints(thingHints);
|
||||
General.Hints.ShowHints(this.GetType(), "things");
|
||||
} else if (o is BaseVisualVertex) {
|
||||
General.Interface.ShowEditModeHints(vertexHints);
|
||||
General.Hints.ShowHints(this.GetType(), "vertices");
|
||||
} else {
|
||||
General.Interface.ShowEditModeHints(generalHints);
|
||||
General.Hints.ShowHints(this.GetType(), General.Hints.GENERAL);
|
||||
}
|
||||
|
||||
lasthighlighttype = o.GetType();
|
||||
|
@ -1374,75 +1364,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
#endregion
|
||||
|
||||
#region ================== Hints (mxd)
|
||||
|
||||
protected override void SetupHints() {
|
||||
base.SetupHints();
|
||||
|
||||
//GENERAL PURPOSE
|
||||
List<string> generalHintsList = new List<string>() {
|
||||
"Use <b>" + Actions.Action.GetShortcutKeyDesc("builder_moveforward") + "</b>, <b>" +
|
||||
Actions.Action.GetShortcutKeyDesc("builder_movebackward") + "</b>, <b>" +
|
||||
Actions.Action.GetShortcutKeyDesc("builder_moveleft") + "</b> and <b>" +
|
||||
Actions.Action.GetShortcutKeyDesc("builder_moveright") + "</b> to move around. Hold <b>Shift</b> to double the speed",
|
||||
"Use <b>" + Actions.Action.GetShortcutKeyDesc("builder_moveup") + "</b> and <b>" +
|
||||
Actions.Action.GetShortcutKeyDesc("builder_movedown") + "</b> to move up and down",
|
||||
};
|
||||
|
||||
if (General.Map.UDMF) {
|
||||
generalHintsList.Add("Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_gztogglevisualvertices") + "</b> to toggle vertex handles rendering");
|
||||
}
|
||||
|
||||
//THINGS
|
||||
List<string> thingHintsList = new List<string>() {
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_visualselect") + "</b> to select the highlighted thing",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_clearselection") + "</b> to clear selection",
|
||||
"Use <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_raisesector8") +
|
||||
"</b> and <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_lowersector8") + "</b> to change height of selected/targeted things by 8 map units",
|
||||
"Use <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_lowersectortonearest") +
|
||||
"</b> and <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_raisesectortonearest") + "</b> to align selected/targeted things to floor or ceiling",
|
||||
"Use <b>" + Actions.Action.GetShortcutKeyDesc("builder_movethingfwd") + "</b>, <b>" +
|
||||
Actions.Action.GetShortcutKeyDesc("builder_movethingback") + "</b>, <b>" +
|
||||
Actions.Action.GetShortcutKeyDesc("builder_movethingleft") + "</b> and <b>" +
|
||||
Actions.Action.GetShortcutKeyDesc("builder_movethingright") + "</b> to move selected things around",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_placethingatcursor") + "</b> to move selected things to cursor location",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("buildermodes_showvisualthings") + "</b> to cycle through the different ways the things are shown",
|
||||
};
|
||||
|
||||
//SIDEDEFS
|
||||
List<string> sidedefHintsList = new List<string>() {
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_insertitem") + "</b> to insert a Thing at current cursor position",
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_visualselect") + "</b> to select the highlighted surface. Hold <b>Shift</b> to select adjacent surfaces with the same texture. Hold <b>Ctrl</b> to select adjacent surfaces with the same height",
|
||||
"TODO: show more sidedef-related hints here"
|
||||
};
|
||||
|
||||
//SECTORS
|
||||
List<string> sectorHintsList = new List<string>() {
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_insertitem") + "</b> to insert a Thing at current cursor position",
|
||||
"TODO: show more sector-related hints here"
|
||||
};
|
||||
|
||||
//VERTICES
|
||||
List<string> vertexHintsList = new List<string>() {
|
||||
"Press <b>" + Actions.Action.GetShortcutKeyDesc("builder_insertitem") + "</b> to insert a Thing at current cursor position",
|
||||
"TODO: show more vertex-related hints here"
|
||||
};
|
||||
|
||||
//instert general stuff into each array
|
||||
generalHints = generalHintsList.ToArray();
|
||||
thingHintsList.InsertRange(0, generalHints);
|
||||
sidedefHintsList.InsertRange(0, generalHints);
|
||||
sectorHintsList.InsertRange(0, generalHints);
|
||||
vertexHintsList.InsertRange(0, generalHints);
|
||||
|
||||
thingHints = thingHintsList.ToArray();
|
||||
sidedefHints = sidedefHintsList.ToArray();
|
||||
sectorHints = sectorHintsList.ToArray();
|
||||
vertexHints = vertexHintsList.ToArray();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Action Assist
|
||||
|
||||
// Because some actions can only be called on a single (the targeted) object because
|
||||
|
|
Loading…
Reference in a new issue