mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2024-11-10 06:41:49 +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
2be07ef1ee
commit
4b91a6d76b
2 changed files with 57 additions and 9 deletions
|
@ -183,7 +183,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
if(args != null)
|
||||
{
|
||||
int x = 0;
|
||||
argtext = " args: (";
|
||||
argtext = ". Args: ";
|
||||
|
||||
//mxd. Check script name...
|
||||
if(!string.IsNullOrEmpty(arg0str))
|
||||
|
@ -204,9 +204,33 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
match = false;
|
||||
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)
|
||||
|
@ -236,9 +260,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Add to list
|
||||
LinedefActionInfo info = General.Map.Config.GetLinedefActionInfo(l.Action);
|
||||
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
|
||||
objs.Add(new FindReplaceObject(l, "Linedef " + l.Index + argtext));
|
||||
objs.Add(new FindReplaceObject(l, "Linedef " + l.Index + " (Action " + l.Action + argtext + ")"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -187,7 +187,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
if(args != null)
|
||||
{
|
||||
int x = 0;
|
||||
argtext = " args: (";
|
||||
argtext = ". Args: ";
|
||||
|
||||
//mxd. Check script name...
|
||||
if(!string.IsNullOrEmpty(arg0str))
|
||||
|
@ -208,9 +208,33 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
match = false;
|
||||
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)
|
||||
|
@ -239,7 +263,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
// Add to list
|
||||
ThingTypeInfo ti = General.Map.Data.GetThingInfo(t.SRB2Type);
|
||||
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