Skip to content

keybind: Add /bind keybinding command#47

Open
dracc wants to merge 2 commits into
masterfrom
keybinds
Open

keybind: Add /bind keybinding command#47
dracc wants to merge 2 commits into
masterfrom
keybinds

Conversation

@dracc
Copy link
Copy Markdown
Owner

@dracc dracc commented Feb 27, 2019

Closes #15

Still untested.
I've tested this a bit, found a couple of bugs, fixed those and am now happy with the function of the script.

Comment thread scripts/module/keybinder.nut Outdated
Comment thread scripts/module/keybinder.nut Outdated
Comment thread scripts/module/keybinder.nut Outdated
Comment thread scripts/module/keybinder.nut Outdated
Comment thread scripts/module/keybinder.nut Outdated
Comment thread scripts/module/keybinder.nut Outdated
Comment thread scripts/module/keybinder.nut Outdated
Comment thread scripts/module/keybinder.nut
Comment thread scripts/module/keybinder.nut Outdated
Comment thread scripts/module/keybinder.nut Outdated
Comment thread scripts/module/keybinder.nut Outdated
Comment thread scripts/module/keybinder.nut Outdated
firstSpace = input.len()-1;
} else {
ret[1] = input.slice(firstSpace+1);
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this return ["foo", null] for "foo" with "bar" separator? Why not ["foo", ""] to keep away edge cases?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. My trail of thought was that the used functions return null when unsuccessful and it felt to me like the most intuitive way to go would be to continue with that tradition.

Comment thread scripts/module/keybinder.nut
Comment thread scripts/module/keybinder.nut Outdated
Comment thread scripts/module/keybinder.nut Outdated
Comment thread scripts/module/keybinder.nut Outdated
Comment thread scripts/module/keybinder.nut Outdated
@dracc dracc changed the title keybind: Add /b keybinding command keybind: Add /bind keybinding command Mar 1, 2019
Copy link
Copy Markdown
Owner Author

@dracc dracc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Client side version untested.
Edit: I've given it a go, taken care of some bugs and now it works as expected.

Comment thread scripts/module/keybinder.nut Outdated
Comment thread scripts/module/keybinder.nut Outdated
Comment thread scripts/module/keybinder.nut Outdated
@dracc
Copy link
Copy Markdown
Owner Author

dracc commented Mar 3, 2019

I'd say that this is ready for merge as soon as I've squashed the commits.

dracc added 2 commits March 3, 2019 10:23
Store a table server- and client-side per session
Send commands from client keybind over socket to server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create bind script

2 participants