Add chat_scroll_up and chat_scroll_down to keybinds
This commit is contained in:
@@ -26,6 +26,8 @@ public class DefaultKeybinds {
|
|||||||
"block_info", Input.CONTROL_LEFT,
|
"block_info", Input.CONTROL_LEFT,
|
||||||
"player_list", Input.TAB,
|
"player_list", Input.TAB,
|
||||||
"chat", Input.ENTER,
|
"chat", Input.ENTER,
|
||||||
|
"chat_scroll_up", Input.UP,
|
||||||
|
"chat_scroll_down", Input.DOWN,
|
||||||
"console", Input.GRAVE,
|
"console", Input.GRAVE,
|
||||||
"weapon_1", Input.NUM_1,
|
"weapon_1", Input.NUM_1,
|
||||||
"weapon_2", Input.NUM_2,
|
"weapon_2", Input.NUM_2,
|
||||||
@@ -53,6 +55,8 @@ public class DefaultKeybinds {
|
|||||||
"rotate", new Axis(Input.CONTROLLER_A, Input.CONTROLLER_B),
|
"rotate", new Axis(Input.CONTROLLER_A, Input.CONTROLLER_B),
|
||||||
"player_list", Input.CONTROLLER_START,
|
"player_list", Input.CONTROLLER_START,
|
||||||
"chat", Input.ENTER,
|
"chat", Input.ENTER,
|
||||||
|
"chat_scroll_up", Input.UP,
|
||||||
|
"chat_scroll_down", Input.DOWN,
|
||||||
"console", Input.GRAVE,
|
"console", Input.GRAVE,
|
||||||
"weapon_1", Input.NUM_1,
|
"weapon_1", Input.NUM_1,
|
||||||
"weapon_2", Input.NUM_2,
|
"weapon_2", Input.NUM_2,
|
||||||
|
|||||||
@@ -62,14 +62,12 @@ public class ChatFragment extends Table implements Fragment{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chatOpen) {
|
if (chatOpen) {
|
||||||
// up arrow key
|
if (Inputs.keyTap("chat_scroll_up") && historyPos < history.size - 1) {
|
||||||
if (Inputs.keyTap(19) && historyPos < history.size - 1) {
|
|
||||||
if (historyPos == 0) history.set(0, chatfield.getText());
|
if (historyPos == 0) history.set(0, chatfield.getText());
|
||||||
historyPos++;
|
historyPos++;
|
||||||
updateChat();
|
updateChat();
|
||||||
}
|
}
|
||||||
// down arrow key
|
if (Inputs.keyTap("chat_scroll_down") && historyPos > 0) {
|
||||||
if (Inputs.keyTap(20) && historyPos > 0) {
|
|
||||||
historyPos--;
|
historyPos--;
|
||||||
updateChat();
|
updateChat();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user