-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit be93c67
Showing
31 changed files
with
5,270 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.vscode/launch.json | ||
Cargo.lock | ||
target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"editor.tabSize": 2, | ||
"cSpell.ignoreWords": [ | ||
"ardoris", | ||
"avara", | ||
"barugon", | ||
"brookside", | ||
"ccursor", | ||
"chrono", | ||
"cota", | ||
"cpus", | ||
"debugln", | ||
"dolus", | ||
"eastmarch", | ||
"eframe", | ||
"egui", | ||
"emath", | ||
"epaint", | ||
"etceter", | ||
"fastus", | ||
"fortus", | ||
"fract", | ||
"highvale", | ||
"indigno", | ||
"jaanaford", | ||
"layouter", | ||
"libgtk", | ||
"monospace", | ||
"nefario", | ||
"nefas", | ||
"noninteractive", | ||
"northwood", | ||
"portalarium", | ||
"replacen", | ||
"rfind", | ||
"sota", | ||
"temna", | ||
"threadpool", | ||
"tschüss", | ||
"tschüß", | ||
"tzdata", | ||
"westend", | ||
"winit" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[package] | ||
authors = ["Barugon"] | ||
description = "Companion of the Avatar" | ||
edition = "2021" | ||
name = "cota" | ||
version = "4.1.3" | ||
|
||
[dependencies] | ||
chrono = "0.4" | ||
dirs = "4.0" | ||
eframe = {git = "https://github.com/emilk/egui.git", features = ["persistence"]} | ||
egui_extras = {git = "https://github.com/emilk/egui.git", features = ["image"]} | ||
egui_file = {git = "https://github.com/Barugon/egui_file.git"} | ||
futures = {version = "0.3", features = ["thread-pool"]} | ||
image = {version = "0.24", features = ["png"]} | ||
num-format = "0.4" | ||
num_cpus = "1.13" | ||
regex = "1.5" | ||
serde_json = "1.0" | ||
sys-locale = "0.2" | ||
|
||
[profile.release] | ||
strip = "symbols" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[target.x86_64-unknown-linux-gnu] | ||
image = "docker.io/library/ubuntu:20.04" | ||
|
||
[target.x86_64-pc-windows-gnu] | ||
image = "docker.io/library/ubuntu:20.04" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM docker.io/library/ubuntu:20.04 | ||
RUN apt update | ||
RUN DEBIAN_FRONTEND=noninteractive apt -y install tzdata | ||
RUN apt -y install clang pkg-config libgtk-3-dev mingw-w64 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Companion of the Avatar | ||
|
||
CotA, a companion application for [Shroud of the Avatar](https://www.shroudoftheavatar.com), is written in 100% Rust using [egui](https://github.com/emilk/egui) (also 100% Rust) for it's user interface. | ||
|
||
**Click [here](https://github.com/Barugon/cota/releases) for binaries** | ||
|
||
> **Linux Note**: If you're using Wayland and you find the app's title bar disagreeable then set this environment variable before running: `WINIT_UNIX_BACKEND=x11` | ||
<!-- intentional spacing --> | ||
|
||
> **Windows note**: You might need to right click cota.exe (once unzipped), select `Properties` and then check `Unblock`. | ||
<!-- intentional spacing --> | ||
|
||
> **Mac note**: I no longer provide a Mac build due to Apple's licensing. However, building should be pretty easy — install [rust](https://www.rust-lang.org/tools/install), clone this repository and then build it using `cargo build --release`. You will probably also need to install Apple's [Xcode](https://developer.apple.com/download/all/?q=xcode). | ||
## Features | ||
|
||
### Display stats recorded to chat-logs via the `/stats` command | ||
|
||
- Press F5 to refresh the display after typing `/stats` in-game | ||
- Press Ctrl+R to get a list of effective resists | ||
- Press Ctrl+F to filter the stats | ||
|
||
 | ||
|
||
### Search chat Logs | ||
|
||
Using either straight text or regular expressions. | ||
|
||
 | ||
|
||
### Portal and Cabalist chronometer | ||
|
||
 | ||
|
||
### Experience needed calculator | ||
|
||
 | ||
|
||
### Offline save-game editor | ||
|
||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Cross platform build (from Linux) | ||
|
||
```bash | ||
cargo install cross | ||
``` | ||
|
||
- Create a `Dockerfile` in the project folder | ||
|
||
```Dockerfile | ||
FROM docker.io/library/ubuntu:20.04 | ||
RUN apt update | ||
RUN DEBIAN_FRONTEND=noninteractive apt -y install tzdata | ||
RUN apt -y install clang pkg-config libgtk-3-dev mingw-w64 | ||
``` | ||
|
||
- Create a `Cross.toml` file in the project folder | ||
|
||
```toml | ||
[target.x86_64-unknown-linux-gnu] | ||
image = "docker.io/library/ubuntu:20.04" | ||
|
||
[target.x86_64-pc-windows-gnu] | ||
image = "docker.io/library/ubuntu:20.04" | ||
``` | ||
|
||
- Build the docker image | ||
|
||
```bash | ||
sudo dnf install podman | ||
podman build -t docker.io/library/ubuntu:20.04 . | ||
``` | ||
|
||
- Build the project for Linux using cross | ||
|
||
```bash | ||
cross build --release --target=x86_64-unknown-linux-gnu | ||
``` | ||
|
||
- Build the project for Windows using cross | ||
|
||
```bash | ||
cross build --release --target=x86_64-pc-windows-gnu | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tab_spaces = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
use crate::util::{self, AppState}; | ||
use eframe::{ | ||
egui::{Context, Key, RichText, Window}, | ||
emath::Align2, | ||
epaint::Color32, | ||
}; | ||
use egui_extras::RetainedImage; | ||
use std::sync::{atomic::Ordering, Arc}; | ||
|
||
pub struct AboutDlg { | ||
logo: RetainedImage, | ||
state: Arc<AppState>, | ||
visible: bool, | ||
} | ||
|
||
impl AboutDlg { | ||
pub fn new(state: Arc<AppState>) -> Self { | ||
let logo_id = format!("{}_logo", util::APP_NAME); | ||
let logo = RetainedImage::from_image_bytes(logo_id, util::APP_ICON).unwrap(); | ||
let visible = false; | ||
|
||
Self { | ||
logo, | ||
state, | ||
visible, | ||
} | ||
} | ||
|
||
pub fn show(&mut self, ctx: &Context) -> bool { | ||
if self.visible { | ||
self.handle_hotkeys(ctx); | ||
|
||
let available = ctx.available_rect(); | ||
let mut open = true; | ||
|
||
Window::new(RichText::from(format!("👍 About {}", util::APP_NAME)).strong()) | ||
.open(&mut open) | ||
.collapsible(false) | ||
.current_pos([0.0, 24.0]) | ||
.anchor(Align2::CENTER_TOP, [0.0, 0.0]) | ||
.default_size([available.width(), 0.0]) | ||
.resizable(false) | ||
.show(ctx, |ui| { | ||
ui.add_space(8.0); | ||
ui.vertical_centered(|ui| { | ||
self.logo.show_scaled(ui, 0.5); | ||
ui.add_space(4.0); | ||
ui.label( | ||
RichText::new(util::APP_TITLE) | ||
.heading() | ||
.color(Color32::GOLD), | ||
); | ||
ui.label(format!("Version {}", util::APP_VERSION)); | ||
ui.label(format!("Created by {}", util::APP_AUTHORS)); | ||
}); | ||
ui.add_space(8.0); | ||
ui.separator(); | ||
ui.horizontal(|ui| { | ||
if ui.button("Close").clicked() { | ||
self.close(); | ||
} | ||
}); | ||
}); | ||
if !open { | ||
self.close(); | ||
} | ||
} | ||
|
||
self.visible | ||
} | ||
|
||
pub fn open(&mut self) { | ||
self.state.enabled.store(false, Ordering::Relaxed); | ||
self.visible = true; | ||
} | ||
|
||
fn close(&mut self) { | ||
self.state.enabled.store(true, Ordering::Relaxed); | ||
self.visible = false; | ||
} | ||
|
||
fn handle_hotkeys(&mut self, ctx: &Context) { | ||
if ctx.input().key_pressed(Key::Escape) { | ||
self.close(); | ||
} | ||
} | ||
} |
Oops, something went wrong.