stevenarella/README.md

61 lines
1.8 KiB
Markdown
Raw Normal View History

2016-03-31 17:20:10 -04:00
# Steven (Rust)
2018-10-31 22:27:30 -04:00
[![Build Status](https://travis-ci.org/iceiix/steven.svg?branch=updates)](https://travis-ci.org/iceiix/steven)
2016-03-31 17:20:10 -04:00
2016-04-14 17:13:32 -04:00
A Minecraft client coded in Rust. Ported from [steven-go](https://github.com/Thinkofname/steven-go).
2016-03-31 17:20:10 -04:00
Don't expect it to go anywhere, just doing this for fun.
## Images
2016-04-21 07:01:20 -04:00
![Steven on Hypixel](https://i.imgur.com/PM5fLuu.png)
2016-04-01 15:06:24 -04:00
![Steven](https://i.imgur.com/RRspOQF.png)
2016-03-31 17:20:10 -04:00
In action: http://gfycat.com/NeedyElaborateGypsymoth
## Chat
I generally am on the `irc.spi.gt` irc network in the `#think` channel.
Feel free to pop in to say hi, [Webchat can be found here](https://irc.spi.gt/iris/?channels=think)
## Downloads
Windows users can download pre-compiled builds from here: https://ci.appveyor.com/project/iceiix/steven
(Select your platform, Click the artifacts tab and download Steven.zip)
The Visual Studio 2017 Redistributable is required to run these builds.
2016-03-31 17:20:10 -04:00
## Building
Use glutin to replace sdl2 (#35) * Add glutin dependency * Create a glutin window * Use the glutin window, basics work * Store DPI factor on game object, update on Resized * Use physical size for rendering only. Fixes UI scaled too small Fixes https://github.com/iceiix/steven/pull/35#issuecomment-442683373 See also https://github.com/iceiix/steven/issues/22 * Begin adding mouse input events * Listen for DeviceEvents * Call hover_at on mouse motion * Listen for CursorMoved window event, hovering works Glutin has separate WindowEvent::CursorMoved and DeviceEvent::MouseMotion events, for absolute cursor and relative mouse motion, respectively, instead of SDL's Event::MouseMotion for both. * Use tuple pattern matching instead of nested if for MouseInput * Implement left clicking * Use grab_cursor() to capture the cursor * Hide the cursor when grabbing * Implement MouseWheel event * Listen for keyboard input, escape key release * Keyboard input: console toggling, glutin calls backquote 'grave' * Implement fullscreen in glutin, updates https://github.com/iceiix/steven/pull/31 * Update settings for glutin VirtualKeyCode * Keyboard controls (note: must clear conf.cfg to use correct bindings) * Move DeviceEvent match arm up higher for clarity * Remove SDL * Pass physical dimensions to renderer tick so blit_framebuffer can use full size but the ui is still sized logically. * Listen for DeviceEvent::Text * Implement text input using ReceivedCharacter window event, works https://github.com/iceiix/steven/pull/35#issuecomment-443247267 * Request specific version of OpenGL, version 3.2 * Request OpenGL 3.2 but fallback to OpenGL ES 2.0 if available (not tested) * Set core profile and depth 24-bits, stencil 0-bits * Allow changing vsync, but require restarting (until https://github.com/tomaka/glutin/issues/693) * Clarify specific Rust version requirement * Import glutin::* in handle_window_event() to avoid overly repetitive code * Linux in VM fix: manually calculate delta in MouseMotion For the third issue on https://github.com/iceiix/steven/pull/35#issuecomment-443084458 https://github.com/tomaka/glutin/issues/1084 MouseMotion event returns absolute instead of relative values, when running Linux in a VM * Heuristic to detect absolute/relative MouseMotion from delta:(xrel, yrel); use a higher scaling factor * Add clipboard pasting with clipboard crate instead of sdl2 https://github.com/iceiix/steven/pull/35#issuecomment-443307295
2018-11-30 14:35:35 -05:00
Currently requires Rust version 1.31.0-beta or newer to build.
2016-03-31 17:20:10 -04:00
Compile and run:
```bash
cargo run --release
```
Just compile:
```bash
cargo build --release
```
2016-03-31 17:20:10 -04:00
### Prerequisites
An easy way to manage multiple Rust toolchains is [`rustup`](https://github.com/rust-lang-nursery/rustup.rs). Installation instructions for `rustup` can be found on its [website](https://www.rustup.rs/).
Once you've set up `rustup`, grab Rust beta by running
```sh
rustup install beta
```
Now we need to make sure that `steven` is compiled with beta. To do this without making beta the default across the entire system, run the following command in the `steven` directory:
```sh
rustup override set beta
```
2016-03-31 17:20:10 -04:00
## Running
### Standalone
Just running steven via a double click (Windows) or `./steven` (everything else)
will bring up a login screen followed by a server list which you can select a server
from.