Make menu code swap control for command on mac OSX

This commit is contained in:
jack perkins 2019-10-17 17:29:17 +02:00
parent e23a1eb00d
commit 738ec515c9
2 changed files with 9 additions and 4 deletions

View File

@ -40,7 +40,11 @@ const MENU = [
signal quit
var is_mac = false
func _ready():
if OS.get_name() == "OSX":
is_mac = true
if !Engine.editor_hint:
OS.set_window_title(ProjectSettings.get_setting("application/config/name")+" v"+ProjectSettings.get_setting("application/config/release"))
load_recents()
@ -80,7 +84,7 @@ func create_menu(menu, menu_name):
if s == "Alt":
shortcut |= KEY_MASK_ALT
elif s == "Control":
shortcut |= KEY_MASK_CTRL
shortcut |= KEY_MASK_CMD if is_mac else KEY_MASK_CTRL
elif s == "Shift":
shortcut |= KEY_MASK_SHIFT
else:

View File

@ -37,21 +37,21 @@ margin_bottom = 20.0
margin_right = 35.0
margin_bottom = 20.0
text = "File"
items = [ "New material", null, 0, false, false, 0, 0, null, "", false, "Load material", null, 0, false, false, 1, 268435535, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Save material", null, 0, false, false, 4, 268435539, null, "", false, "Save material as...", null, 0, false, false, 5, 301989971, null, "", false, "Save all materials...", null, 0, false, false, 6, 0, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Export material", null, 0, false, false, 8, 268435525, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Close material", null, 0, false, false, 10, 0, null, "", false, "Quit", null, 0, false, false, 11, 268435537, null, "", false ]
items = [ "New material", null, 0, false, false, 0, 0, null, "", false, "Load material", null, 0, false, false, 1, 134217807, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Save material", null, 0, false, false, 4, 134217811, null, "", false, "Save material as...", null, 0, false, false, 5, 167772243, null, "", false, "Save all materials...", null, 0, false, false, 6, 0, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Export material", null, 0, false, false, 8, 134217797, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Close material", null, 0, false, false, 10, 0, null, "", false, "Quit", null, 0, false, false, 11, 134217809, null, "", false ]
[node name="Edit" type="MenuButton" parent="VBoxContainer/Menu"]
margin_left = 39.0
margin_right = 75.0
margin_bottom = 20.0
text = "Edit"
items = [ "Cut", null, 0, false, false, 12, 268435544, null, "", false, "Copy", null, 0, false, false, 13, 268435523, null, "", false, "Paste", null, 0, false, false, 14, 268435542, null, "", false ]
items = [ "Cut", null, 0, false, false, 12, 134217816, null, "", false, "Copy", null, 0, false, false, 13, 134217795, null, "", false, "Paste", null, 0, false, false, 14, 134217814, null, "", false ]
[node name="Tools" type="MenuButton" parent="VBoxContainer/Menu"]
margin_left = 79.0
margin_right = 125.0
margin_bottom = 20.0
text = "Tools"
items = [ "Create", null, 0, false, false, -1, 0, null, "PopupMenu", false, "Create group", null, 0, false, false, 16, 268435527, null, "", false, "Make selected nodes editable", null, 0, false, false, 17, 268435526, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Add selected node to user library", null, 0, false, false, 19, 0, null, "", false, "Save user library", null, 0, false, false, 20, 0, null, "", false ]
items = [ "Create", null, 0, false, false, -1, 0, null, "PopupMenu", false, "Create group", null, 0, false, false, 16, 134217799, null, "", false, "Make selected nodes editable", null, 0, false, false, 17, 134217798, null, "", false, "", null, 0, false, false, -1, 0, null, "", true, "Add selected node to user library", null, 0, false, false, 19, 0, null, "", false, "Save user library", null, 0, false, false, 20, 0, null, "", false ]
[node name="Help" type="MenuButton" parent="VBoxContainer/Menu"]
margin_left = 129.0
@ -137,6 +137,7 @@ script = ExtResource( 7 )
[connection signal="tab_changed" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects" to="." method="_on_Projects_tab_changed"]
[connection signal="connection_request" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects/GraphEdit" to="VBoxContainer/HBoxContainer/ProjectsPane/Projects/GraphEdit" method="connect_node"]
[connection signal="disconnection_request" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects/GraphEdit" to="VBoxContainer/HBoxContainer/ProjectsPane/Projects/GraphEdit" method="disconnect_node"]
[connection signal="gui_input" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects/GraphEdit" to="VBoxContainer/HBoxContainer/ProjectsPane/Projects/GraphEdit" method="_on_GraphEdit_gui_input"]
[connection signal="close_request" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects/GraphEdit/node_Material" to="VBoxContainer/HBoxContainer/ProjectsPane/Projects/GraphEdit/node_Material" method="on_close_request"]
[connection signal="offset_changed" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects/GraphEdit/node_Material" to="VBoxContainer/HBoxContainer/ProjectsPane/Projects/GraphEdit/node_Material" method="on_offset_changed"]
[connection signal="value_changed" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects/GraphEdit/node_Material/HBoxContainer2/metallic" to="VBoxContainer/HBoxContainer/ProjectsPane/Projects/GraphEdit/node_Material/HBoxContainer2/metallic" method="update_label"]