Drop the ControlGroupModifier setting. Use Cmd on osx for group addition.
This commit is contained in:
@@ -101,12 +101,7 @@ namespace OpenRA.GameRules
|
|||||||
public int Timestep = 40;
|
public int Timestep = 40;
|
||||||
public int SheetSize = 2048;
|
public int SheetSize = 2048;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class KeyboardSettings
|
|
||||||
{
|
|
||||||
public Modifiers ControlGroupModifier = Modifiers.Ctrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Settings
|
public class Settings
|
||||||
{
|
{
|
||||||
string SettingsFile;
|
string SettingsFile;
|
||||||
@@ -117,7 +112,6 @@ namespace OpenRA.GameRules
|
|||||||
public GraphicSettings Graphics = new GraphicSettings();
|
public GraphicSettings Graphics = new GraphicSettings();
|
||||||
public ServerSettings Server = new ServerSettings();
|
public ServerSettings Server = new ServerSettings();
|
||||||
public DebugSettings Debug = new DebugSettings();
|
public DebugSettings Debug = new DebugSettings();
|
||||||
public KeyboardSettings Keyboard = new KeyboardSettings();
|
|
||||||
public Dictionary<string, object> Sections;
|
public Dictionary<string, object> Sections;
|
||||||
public Settings(string file, Arguments args)
|
public Settings(string file, Arguments args)
|
||||||
{
|
{
|
||||||
@@ -130,7 +124,6 @@ namespace OpenRA.GameRules
|
|||||||
{"Graphics", Graphics},
|
{"Graphics", Graphics},
|
||||||
{"Server", Server},
|
{"Server", Server},
|
||||||
{"Debug", Debug},
|
{"Debug", Debug},
|
||||||
{"Keyboard",Keyboard}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,8 @@ namespace OpenRA
|
|||||||
|
|
||||||
public void DoControlGroup(World world, int group, Modifiers mods)
|
public void DoControlGroup(World world, int group, Modifiers mods)
|
||||||
{
|
{
|
||||||
if (mods.HasModifier(Game.Settings.Keyboard.ControlGroupModifier))
|
var addModifier = Platform.CurrentPlatform == PlatformType.OSX ? Modifiers.Meta : Modifiers.Ctrl;
|
||||||
|
if (mods.HasModifier(addModifier))
|
||||||
{
|
{
|
||||||
if (actors.Count == 0)
|
if (actors.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
|||||||
var debugSettings = Game.Settings.Debug;
|
var debugSettings = Game.Settings.Debug;
|
||||||
var graphicsSettings = Game.Settings.Graphics;
|
var graphicsSettings = Game.Settings.Graphics;
|
||||||
var soundSettings = Game.Settings.Sound;
|
var soundSettings = Game.Settings.Sound;
|
||||||
var keyboardSettings = Game.Settings.Keyboard;
|
|
||||||
|
|
||||||
// Player profile
|
// Player profile
|
||||||
var nameTextfield = generalPane.GetWidget<TextFieldWidget>("NAME_TEXTFIELD");
|
var nameTextfield = generalPane.GetWidget<TextFieldWidget>("NAME_TEXTFIELD");
|
||||||
@@ -136,11 +135,6 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
|||||||
teamchatCheckbox.IsChecked = () => gameSettings.TeamChatToggle;
|
teamchatCheckbox.IsChecked = () => gameSettings.TeamChatToggle;
|
||||||
teamchatCheckbox.OnClick = () => gameSettings.TeamChatToggle ^= true;
|
teamchatCheckbox.OnClick = () => gameSettings.TeamChatToggle ^= true;
|
||||||
|
|
||||||
var groupModifierDropdown = inputPane.GetWidget<DropDownButtonWidget>("GROUPADD_MODIFIER");
|
|
||||||
groupModifierDropdown.OnMouseDown = _ => ShowGroupModifierDropdown(groupModifierDropdown, keyboardSettings);
|
|
||||||
groupModifierDropdown.GetText = () => keyboardSettings.ControlGroupModifier.ToString();
|
|
||||||
|
|
||||||
|
|
||||||
panel.GetWidget<ButtonWidget>("BACK_BUTTON").OnClick = () =>
|
panel.GetWidget<ButtonWidget>("BACK_BUTTON").OnClick = () =>
|
||||||
{
|
{
|
||||||
playerSettings.Name = nameTextfield.Text;
|
playerSettings.Name = nameTextfield.Text;
|
||||||
@@ -178,30 +172,6 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ShowGroupModifierDropdown(DropDownButtonWidget dropdown, KeyboardSettings s)
|
|
||||||
{
|
|
||||||
var options = new Dictionary<string, Modifiers>()
|
|
||||||
{
|
|
||||||
{ "Ctrl", Modifiers.Ctrl },
|
|
||||||
{ "Alt", Modifiers.Alt },
|
|
||||||
{ "Shift", Modifiers.Shift },
|
|
||||||
// TODO: Display this as Cmd on osx once we have platform detection
|
|
||||||
{ "Meta", Modifiers.Meta }
|
|
||||||
};
|
|
||||||
|
|
||||||
Func<string, ScrollItemWidget, ScrollItemWidget> setupItem = (o, itemTemplate) =>
|
|
||||||
{
|
|
||||||
var item = ScrollItemWidget.Setup(itemTemplate,
|
|
||||||
() => s.ControlGroupModifier == options[o],
|
|
||||||
() => s.ControlGroupModifier = options[o]);
|
|
||||||
item.GetWidget<LabelWidget>("LABEL").GetText = () => o;
|
|
||||||
return item;
|
|
||||||
};
|
|
||||||
|
|
||||||
dropdown.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", 500, options.Keys.ToList(), setupItem);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShowWindowModeDropdown(DropDownButtonWidget dropdown, GraphicSettings s)
|
bool ShowWindowModeDropdown(DropDownButtonWidget dropdown, GraphicSettings s)
|
||||||
{
|
{
|
||||||
var options = new Dictionary<string, WindowMode>()
|
var options = new Dictionary<string, WindowMode>()
|
||||||
|
|||||||
@@ -295,21 +295,6 @@ Container@SETTINGS_PANEL:
|
|||||||
Height:20
|
Height:20
|
||||||
Font:Regular
|
Font:Regular
|
||||||
Text:Shift-Enter Toggles Team Chat
|
Text:Shift-Enter Toggles Team Chat
|
||||||
Label@GROUP_MODIFIER_LABEL:
|
|
||||||
X:375
|
|
||||||
Y:65
|
|
||||||
Width:160
|
|
||||||
Height:20
|
|
||||||
Font:Regular
|
|
||||||
Text:Group Addition Modifier:
|
|
||||||
Align:Right
|
|
||||||
DropDownButton@GROUPADD_MODIFIER:
|
|
||||||
Id:GROUPADD_MODIFIER
|
|
||||||
X:540
|
|
||||||
Y:65
|
|
||||||
Width:100
|
|
||||||
Height:25
|
|
||||||
Font:Regular
|
|
||||||
# Label@BINDING_LABEL:
|
# Label@BINDING_LABEL:
|
||||||
# Font:Bold
|
# Font:Bold
|
||||||
# X:375
|
# X:375
|
||||||
|
|||||||
Reference in New Issue
Block a user