mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-26 22:01:45 +00:00
Linedef edit form (UDMF): fixed a problem where the first argument was set to 0 instead left blank when multiple lines with script execution actions were being edited
This commit is contained in:
parent
00d9be5266
commit
5a1ceb2a9c
1 changed files with 25 additions and 16 deletions
|
@ -371,26 +371,35 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
else if (isacs)
|
||||
{
|
||||
Arg0Mode = ArgZeroMode.INT;
|
||||
int a0 = arg0.GetResult(0);
|
||||
if(General.Map.NumberedScripts.ContainsKey(a0))
|
||||
{
|
||||
int i = 0;
|
||||
foreach(ScriptItem item in General.Map.NumberedScripts.Values)
|
||||
{
|
||||
if(item.Index == a0)
|
||||
{
|
||||
arg0int.SelectedIndex = i;
|
||||
UpdateScriptArguments(item);
|
||||
break;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
// Special handling when there are multiple lines selected with different values for arg0 (so that it's left empty)
|
||||
if (string.IsNullOrEmpty(arg0.Text))
|
||||
{
|
||||
arg0int.Text = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unknown script number...
|
||||
arg0int.Text = a0.ToString();
|
||||
int a0 = arg0.GetResult(0);
|
||||
if (General.Map.NumberedScripts.ContainsKey(a0))
|
||||
{
|
||||
int i = 0;
|
||||
foreach (ScriptItem item in General.Map.NumberedScripts.Values)
|
||||
{
|
||||
if (item.Index == a0)
|
||||
{
|
||||
arg0int.SelectedIndex = i;
|
||||
UpdateScriptArguments(item);
|
||||
break;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unknown script number...
|
||||
arg0int.Text = a0.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue