Skip to content

Commit

Permalink
v4.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Barugon committed Jul 26, 2022
0 parents commit be93c67
Show file tree
Hide file tree
Showing 31 changed files with 5,270 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.vscode/launch.json
Cargo.lock
target
45 changes: 45 additions & 0 deletions .vscode/settings.json
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"
]
}
23 changes: 23 additions & 0 deletions Cargo.toml
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"
5 changes: 5 additions & 0 deletions Cross.toml
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"
4 changes: 4 additions & 0 deletions Dockerfile
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
674 changes: 674 additions & 0 deletions LICENSE.md

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions README.md
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

![screenshot](https://a4.pbase.com/o12/09/605909/1/164136608.rcq0amhQ.Screenshotfrom20220710144634.png)

### Search chat Logs

Using either straight text or regular expressions.

![screenshot](https://a4.pbase.com/o12/09/605909/1/172748130.7CtBnycN.Screenshotfrom20220710145444.png)

### Portal and Cabalist chronometer

![screenshot](https://a4.pbase.com/o12/09/605909/1/166622004.99jNUqv1.Screenshotfrom20220702105817.png)

### Experience needed calculator

![screenshot](https://a4.pbase.com/o12/09/605909/1/169657368.6LSuf2mo.Screenshotfrom20220707123539.png)

### Offline save-game editor

![screenshot](https://a4.pbase.com/o12/09/605909/1/170775639.yDCLLWbV.Screenshotfrom20220710124857.png)
43 changes: 43 additions & 0 deletions cross.md
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
```
1 change: 1 addition & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tab_spaces = 2
87 changes: 87 additions & 0 deletions src/about_dlg.rs
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();
}
}
}
Loading

0 comments on commit be93c67

Please sign in to comment.