Tag Range plugin: fixed a problem where the new tags were not displayed in Sectors Mode when selection numbering was disabled. Fixes #795

This commit is contained in:
biwa 2022-10-03 11:29:31 +02:00
parent 2d7aebbe31
commit 9e5a6b5377
5 changed files with 29 additions and 3 deletions

View file

@ -1596,7 +1596,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
//mxd
public override void OnViewSelectionNumbersChanged(bool enabled)
{
if(enabled) UpdateSelectedLabels();
UpdateSelectedLabels();
}
//mxd

View file

@ -16,10 +16,12 @@
#region ================== Namespaces
using System.Windows.Forms;
using CodeImp.DoomBuilder.Windows;
using CodeImp.DoomBuilder.Editing;
using CodeImp.DoomBuilder.Plugins;
using CodeImp.DoomBuilder.Actions;
using CodeImp.DoomBuilder.BuilderModes;
#endregion
@ -77,8 +79,22 @@ namespace CodeImp.DoomBuilder.TagRange
{
TagRangeForm f = new TagRangeForm();
f.Setup();
if(f.SelectionCount > 0)
f.ShowDialog(General.Interface);
if (f.SelectionCount > 0)
{
if (f.ShowDialog(General.Interface) == DialogResult.OK)
{
if (General.Editing.Mode is BaseClassicMode mode)
{
// Bit of a hack to make sectors mode update the sector labels, otherwise the new tags will not be
// displayed when selection numbering is disabled.
// See https://github.com/jewalky/UltimateDoomBuilder/issues/795
mode.OnViewSelectionNumbersChanged(BuilderModes.BuilderPlug.Me.ViewSelectionNumbers);
// Redraw to make the updated labels to show up
General.Interface.RedrawDisplay();
}
}
}
else
General.Interface.DisplayStatus(StatusType.Warning, "This action requires a selection!"); //mxd
f.Dispose();

View file

@ -154,6 +154,10 @@
<Name>Builder</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\BuilderModes\BuilderModes.csproj">
<Project>{b42d5aa0-f9a6-4234-9c4b-a05b11a64851}</Project>
<Name>BuilderModes</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">

View file

@ -244,6 +244,8 @@ namespace CodeImp.DoomBuilder.TagRange
storedstep = rangestep.GetResult(1);
storedrelative = relativemode.Checked;
DialogResult = DialogResult.OK;
//We are done here.
this.Close();
}

View file

@ -152,6 +152,10 @@
<Name>Builder</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\BuilderModes\BuilderModesMono.csproj">
<Project>{b42d5aa0-f9a6-4234-9c4b-a05b11a64851}</Project>
<Name>BuilderModesMono</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">