mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-12 07:01:21 +00:00
Added, Find and Replace mode: action arguments are now displayed in "Linedef Action and Arguments" and "Thing Action and Arguments" search results.
This commit is contained in:
parent
a61f02f7cc
commit
56fec9eb14
2 changed files with 57 additions and 9 deletions
|
@ -186,7 +186,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
if(args != null)
|
if(args != null)
|
||||||
{
|
{
|
||||||
int x = 0;
|
int x = 0;
|
||||||
argtext = " args: (";
|
argtext = ". Args: ";
|
||||||
|
|
||||||
//mxd. Check script name...
|
//mxd. Check script name...
|
||||||
if(!string.IsNullOrEmpty(arg0str))
|
if(!string.IsNullOrEmpty(arg0str))
|
||||||
|
@ -207,9 +207,33 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
match = false;
|
match = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
argtext += (x == 0 ? "" : ",") + l.Args[x];
|
argtext += (x == 0 ? "" : ", ") + l.Args[x];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//mxd. Add action args
|
||||||
|
else
|
||||||
|
{
|
||||||
|
List<string> argslist = new List<string>();
|
||||||
|
|
||||||
|
// Process args, drop trailing zeroes
|
||||||
|
for(int i = l.Args.Length - 1; i > -1; i--)
|
||||||
|
{
|
||||||
|
if(l.Args[i] == 0 && argslist.Count == 0) continue; // Skip tail zeroes
|
||||||
|
argslist.Insert(0, l.Args[i].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process arg0str...
|
||||||
|
if(Array.IndexOf(GZGeneral.ACS_SPECIALS, l.Action) != -1)
|
||||||
|
{
|
||||||
|
string s = l.Fields.GetValue("arg0str", string.Empty);
|
||||||
|
if(!string.IsNullOrEmpty(s)) argslist[0] = "\"" + s + "\"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create args string
|
||||||
|
if(argslist.Count > 0)
|
||||||
|
{
|
||||||
|
argtext = ". Args: " + string.Join(", ", argslist.ToArray());
|
||||||
}
|
}
|
||||||
argtext += ")";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(match)
|
if(match)
|
||||||
|
@ -239,9 +263,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
// Add to list
|
// Add to list
|
||||||
LinedefActionInfo info = General.Map.Config.GetLinedefActionInfo(l.Action);
|
LinedefActionInfo info = General.Map.Config.GetLinedefActionInfo(l.Action);
|
||||||
if(!info.IsNull)
|
if(!info.IsNull)
|
||||||
objs.Add(new FindReplaceObject(l, "Linedef " + l.Index + " (" + info.Title + ")" + argtext));
|
objs.Add(new FindReplaceObject(l, "Linedef " + l.Index + " (" + info.Title + argtext + ")"));
|
||||||
else
|
else
|
||||||
objs.Add(new FindReplaceObject(l, "Linedef " + l.Index + argtext));
|
objs.Add(new FindReplaceObject(l, "Linedef " + l.Index + " (Action " + l.Action + argtext + ")"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,7 +190,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
if(args != null)
|
if(args != null)
|
||||||
{
|
{
|
||||||
int x = 0;
|
int x = 0;
|
||||||
argtext = " args: (";
|
argtext = ". Args: ";
|
||||||
|
|
||||||
//mxd. Check script name...
|
//mxd. Check script name...
|
||||||
if(!string.IsNullOrEmpty(arg0str))
|
if(!string.IsNullOrEmpty(arg0str))
|
||||||
|
@ -211,9 +211,33 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
match = false;
|
match = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
argtext += (x == 0 ? "" : ",") + t.Args[x];
|
argtext += (x == 0 ? "" : ", ") + t.Args[x];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//mxd. Add action args
|
||||||
|
else
|
||||||
|
{
|
||||||
|
List<string> argslist = new List<string>();
|
||||||
|
|
||||||
|
// Process args, drop trailing zeroes
|
||||||
|
for(int i = t.Args.Length - 1; i > -1; i--)
|
||||||
|
{
|
||||||
|
if(t.Args[i] == 0 && argslist.Count == 0) continue; // Skip tail zeroes
|
||||||
|
argslist.Insert(0, t.Args[i].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process arg0str...
|
||||||
|
if(Array.IndexOf(GZGeneral.ACS_SPECIALS, t.Action) != -1)
|
||||||
|
{
|
||||||
|
string s = t.Fields.GetValue("arg0str", string.Empty);
|
||||||
|
if(!string.IsNullOrEmpty(s)) argslist[0] = "\"" + s + "\"";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create args string
|
||||||
|
if(argslist.Count > 0)
|
||||||
|
{
|
||||||
|
argtext = ". Args: " + string.Join(", ", argslist.ToArray());
|
||||||
}
|
}
|
||||||
argtext += ")";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(match)
|
if(match)
|
||||||
|
@ -242,7 +266,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
|
|
||||||
// Add to list
|
// Add to list
|
||||||
ThingTypeInfo ti = General.Map.Data.GetThingInfo(t.Type);
|
ThingTypeInfo ti = General.Map.Data.GetThingInfo(t.Type);
|
||||||
objs.Add(new FindReplaceObject(t, "Thing " + t.Index + " (" + ti.Title + ")" + argtext));
|
objs.Add(new FindReplaceObject(t, "Thing " + t.Index + " (" + ti.Title + argtext + ")"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue