Skip to content

Commit bcf15d8

Browse files
committed
Unset key bindings
1 parent 4e3e232 commit bcf15d8

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

core/assets/bundles/bundle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,7 @@ settings.data = Game Data
10971097
settings.reset = Reset to Defaults
10981098
settings.rebind = Rebind
10991099
settings.resetKey = Reset
1100+
settings.unbindKey = Unbind
11001101
settings.controls = Controls
11011102
settings.game = Game
11021103
settings.sound = Sound

core/src/mindustry/ui/dialogs/KeybindDialog.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ private void rebuildBinds(){
8787
}
8888

8989
if(lastCategory != keybind.category && keybind.category != null){
90-
table.add(bundle.get("category." + keybind.category + ".name", Strings.capitalize(keybind.category))).color(Color.gray).colspan(4).pad(10).padBottom(4).row();
91-
table.image().color(Color.gray).fillX().height(3).pad(6).colspan(4).padTop(0).padBottom(10).row();
90+
table.add(bundle.get("category." + keybind.category + ".name", Strings.capitalize(keybind.category))).color(Color.gray).colspan(5).pad(10).padBottom(4).row();
91+
table.image().color(Color.gray).fillX().height(3).pad(6).colspan(5).padTop(0).padBottom(10).row();
9292
lastCategory = keybind.category;
9393
}
9494

@@ -118,11 +118,12 @@ private void rebuildBinds(){
118118
openDialog(keybind);
119119
}).size(bw, bh);
120120
}
121+
table.button("@settings.unbindKey", tstyle, keybind::unset).disabled(t -> keybind.isUnset()).size(bw, bh).pad(2f).padLeft(4f);
121122
table.button("@settings.resetKey", tstyle, keybind::resetToDefault).disabled(t -> keybind.isDefault()).size(bw, bh).pad(2f).padLeft(4f);
122123
table.row();
123124
}
124125

125-
table.button("@settings.reset", Icon.refresh, tstyle, KeyBind::resetAll).minWidth(200f).colspan(4).padTop(4).margin(10f).height(50f).fill();
126+
table.button("@settings.reset", Icon.refresh, tstyle, KeyBind::resetAll).minWidth(200f).colspan(5).padTop(4).margin(10f).height(50f).fill();
126127
}
127128

128129
void rebind(KeyBind bind, KeyCode newKey){

0 commit comments

Comments
 (0)