diff options
| author | mat <github@matdoes.dev> | 2021-12-08 00:41:42 -0600 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2021-12-08 00:41:42 -0600 |
| commit | c16d55ccddd741057bf532bd946b2854dc208c65 (patch) | |
| tree | e6ae8af47e1931ef98ea55913831197b8e65a7ee /minecraft-chat/src/events.rs | |
| parent | 4a44c58444c901d939a8594669c819ab2bfbac13 (diff) | |
| download | azalea-drasl-c16d55ccddd741057bf532bd946b2854dc208c65.tar.xz | |
start adding minecraft-chat
Diffstat (limited to 'minecraft-chat/src/events.rs')
| -rw-r--r-- | minecraft-chat/src/events.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/minecraft-chat/src/events.rs b/minecraft-chat/src/events.rs new file mode 100644 index 00000000..a547169e --- /dev/null +++ b/minecraft-chat/src/events.rs @@ -0,0 +1,26 @@ +enum ClickAction { + OPEN_URL = Action::new("open_url", true), + OPEN_FILE = Action::new("open_file", false), + RUN_COMMAND = Action::new("run_command", true), + SUGGEST_COMMAND = Action::new("suggest_command", true), + CHANGE_PAGE = Action::new("change_page", true), + COPY_TO_CLIPBOARD = Action::new("copy_to_clipboard", true), +} + +struct ClickAction { + pub name: String, + pub allow_from_server: bool, +} + +impl ClickAction { + fn new(name: &str, allow_from_server: bool) -> Self { + Self { + name: name.to_string(), + allow_from_server, + } + } +} + +struct ClickEvent { + action: ClickAction, +} |
