mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-28 06:42:32 +00:00
- fixed crash in DisengageVolatileMode() when opening a map
- shortcut keys now also displayed for editing modes
This commit is contained in:
parent
b6aa1ae9ae
commit
90c7beb17d
2 changed files with 16 additions and 5 deletions
|
@ -728,7 +728,7 @@ namespace CodeImp.DoomBuilder
|
||||||
public static bool DisengageVolatileMode()
|
public static bool DisengageVolatileMode()
|
||||||
{
|
{
|
||||||
// Volatile mode?
|
// Volatile mode?
|
||||||
if((map != null) & (map.Mode != null) && map.Mode.Attributes.Volatile)
|
if((map != null) && (map.Mode != null) && map.Mode.Attributes.Volatile)
|
||||||
{
|
{
|
||||||
// Change back to normal mode
|
// Change back to normal mode
|
||||||
map.ChangeMode(map.PreviousStableMode.Name);
|
map.ChangeMode(map.PreviousStableMode.Name);
|
||||||
|
|
|
@ -1259,6 +1259,7 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
item.Enabled = (General.Map != null);
|
item.Enabled = (General.Map != null);
|
||||||
menumode.DropDownItems.Insert(index, item);
|
menumode.DropDownItems.Insert(index, item);
|
||||||
editmodeitems.Add(item);
|
editmodeitems.Add(item);
|
||||||
|
ApplyShortcutKeys(menumode.DropDownItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This handles edit mode button clicks
|
// This handles edit mode button clicks
|
||||||
|
@ -1316,12 +1317,22 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
ToolStripMenuItem menuitem = (item as ToolStripMenuItem);
|
ToolStripMenuItem menuitem = (item as ToolStripMenuItem);
|
||||||
|
|
||||||
// Tag set for this item?
|
// Tag set for this item?
|
||||||
if((menuitem.Tag != null) && (menuitem.Tag is string))
|
if(menuitem.Tag is string)
|
||||||
{
|
{
|
||||||
// Get the action name
|
|
||||||
string actionname = menuitem.Tag.ToString();
|
|
||||||
|
|
||||||
// Action with this name available?
|
// Action with this name available?
|
||||||
|
string actionname = menuitem.Tag.ToString();
|
||||||
|
if(General.Actions.Exists(actionname))
|
||||||
|
{
|
||||||
|
// Put the action shortcut key on the menu item
|
||||||
|
menuitem.ShortcutKeyDisplayString = Action.GetShortcutKeyDesc(General.Actions[actionname].ShortcutKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Edit mode info set for this item?
|
||||||
|
else if(menuitem.Tag is EditModeInfo)
|
||||||
|
{
|
||||||
|
// Action with this name available?
|
||||||
|
EditModeInfo modeinfo = (menuitem.Tag as EditModeInfo);
|
||||||
|
string actionname = modeinfo.SwitchAction.GetFullActionName(modeinfo.Plugin.Assembly);
|
||||||
if(General.Actions.Exists(actionname))
|
if(General.Actions.Exists(actionname))
|
||||||
{
|
{
|
||||||
// Put the action shortcut key on the menu item
|
// Put the action shortcut key on the menu item
|
||||||
|
|
Loading…
Reference in a new issue