33 Commits

Author SHA1 Message Date
762b2f61aa Version 4.0.1
Fix updater not installing new versions
2023-01-28 23:57:51 -08:00
3bd05ba8dd Bump to version 4.0.0
Switch from druid to egui

Support deletion of builds

Auto-updater!

Add a test
2023-01-28 23:29:20 -08:00
ff311475dc Add blessed build text coloring 2023-01-15 14:31:55 -08:00
8e61c8a2f2 Merge branch 'hotfix-2.0.0' 2022-11-28 19:37:10 -08:00
97cdf4829a push to 2.3 2022-11-28 19:23:30 -08:00
7244c24fe4 Fix sorting 2022-11-28 19:20:05 -08:00
fbc4c747a5 Merge branch 'hotfix-2.0.0' 2022-11-14 18:37:53 -08:00
7f1a6c6bc1 Bump to 2.2.0 2022-11-14 18:20:32 -08:00
856cffd740 No timeouts while downloading 2022-11-14 18:15:24 -08:00
9468194718 Remove windows-only components
Attempt to divide initialization
2022-10-11 21:03:33 -07:00
69f67d303e Merge branch 'master' of http://git.dormedas.com/dormedas/town-of-us-updater 2022-09-26 19:08:26 -07:00
6d05440d98 Merge branch 'hotfix-2.0.0' 2022-09-26 19:07:54 -07:00
686d24f7b5 Hotfix: Fix initialization of mod if Among Us path is known 2022-09-26 19:02:17 -07:00
972c310673 Update 'README.md' 2022-09-26 14:47:01 -07:00
90b703ee30 Bump to 3.0.0 2022-09-26 08:15:17 -07:00
38c975b44c Massive GUI code improvements!
Almost all data initialization and processing happens through druid

Tokio removed for now, web requests block again
2022-09-25 23:50:07 -07:00
762d96baee Added a semver class
Auto updater improvements, not yet ready

Registry and Epic Games auto-detection started
2022-09-03 18:56:03 -07:00
81e8eaad0f Merge branch 'feature-cleanup' 2022-08-31 12:53:29 -07:00
84d206a87b Merge branch 'master' of http://git.dormedas.com/dormedas/town-of-us-updater 2022-08-31 12:52:52 -07:00
e59c25af25 Cleaned up dead code comments
Locating the among us folder and launching the app are one in the same, need GUI work to allow it to update after location

More and changed log messages
2022-08-31 12:51:56 -07:00
cf75410860 Clippy fixes 2022-08-29 23:30:29 -07:00
35828e4b5b Clippy fixes 2022-08-29 22:59:53 -07:00
bac49bc766 Fix clippy compile error 2022-08-29 22:59:19 -07:00
9564c70a33 Remove comments, simplify 2022-08-29 19:17:47 -07:00
c9e9cbc66d Merge branch 'master' into feature-cleanup 2022-08-29 18:43:53 -07:00
88f8ca7031 Bump to 2.0.0 2022-08-29 18:43:40 -07:00
721e08cfc6 Fix warning 2022-08-29 18:43:22 -07:00
d6e3a7133b Move AmongUsVersion to its own file. Concatenate and reduce imports. 2022-08-29 18:41:03 -07:00
9e90a18c6a Update 'README.md' 2022-08-29 14:31:59 -07:00
9132afe917 Add .gitignore 2022-08-29 11:32:40 -07:00
ebad7cb893 Fix blocking reqwest crash 2022-08-29 11:31:21 -07:00
b4c22cdc48 Migrated to druid gui 2022-08-21 10:50:48 -07:00
54b2b8b117 Updated log message 2022-08-16 08:55:26 -07:00
7 changed files with 713 additions and 337 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
/target
Cargo.lock

View File

@@ -1,6 +1,6 @@
[package]
name = "town-of-us-updater"
version = "1.0.0"
version = "4.0.1"
edition = "2021"
build = "src/build.rs"
@@ -12,9 +12,13 @@ regex = "1.5"
fs_extra = "1.2.0"
dirs = "4.0.0"
reqwest = {version = "0.11.11", features = ["blocking"]}
iui = "0.3.0"
serde_json = "1.0"
md-5 = "0.10.5"
tokio = {version="1", features=["full"]}
registry = "1"
egui = "0.20.1"
eframe = "0.20.1"
rfd = "0.10"
[build-dependencies]
embed-resource = "1.6"

View File

@@ -1,2 +1,21 @@
# town-of-us-updater
# Town of Us Updater
A tool to automatically install the **Town of Us R** mod for **Among Us**.
## Features
- Caches old builds to allow you to continue playing the mod in case of a breaking Among Us update
- GUI to select which build to play
- Auto-detection of Among Us install directory
- Auto-launch of BetterCrewLink if installed
# Contributing
Help. I have no standards. Just look at the code.
## How to Build
- [Install Rust](https://www.rust-lang.org/learn/get-started)
- Download repository
- Navigate to repository
- `cargo build`

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 42 KiB

91
src/among_us_version.rs Normal file
View File

@@ -0,0 +1,91 @@
use std::fmt;
#[derive(Ord, PartialOrd, Eq, PartialEq, Clone, Debug)]
pub struct AmongUsVersion {
year: i32,
month: i32,
day: i32,
}
impl AmongUsVersion {
pub fn as_american_string(&self) -> String {
format!("{}-{}-{}", self.month, self.day, self.year)
}
}
impl fmt::Display for AmongUsVersion {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}.{}.{}", self.year, self.month, self.day)
}
}
impl Default for AmongUsVersion {
fn default() -> Self {
AmongUsVersion {
year: 0,
month: 0,
day: 0,
}
}
}
impl From<&str> for AmongUsVersion {
fn from(s: &str) -> AmongUsVersion {
// Ignore a prepending "v"
let tmp_str = s.replace("v", "");
let v: Vec<&str> = tmp_str.split('.').collect();
AmongUsVersion {
year: v[0].parse().unwrap(),
month: v[1].parse().unwrap(),
day: v[2].parse().unwrap(),
}
}
}
impl From<(i32, i32, i32)> for AmongUsVersion {
fn from(s: (i32, i32, i32)) -> AmongUsVersion {
AmongUsVersion {
year: s.0,
month: s.1,
day: s.2,
}
}
}
#[test]
fn ordering_test() {
let mut vec = Vec::new();
vec.push(AmongUsVersion {
year: 2019,
month: 1,
day: 25,
});
vec.push(AmongUsVersion {
year: 2022,
month: 12,
day: 25,
});
vec.push(AmongUsVersion {
year: 2022,
month: 12,
day: 14,
});
vec.push(AmongUsVersion {
year: 2022,
month: 12,
day: 8,
});
vec.sort();
assert_eq!(vec[0].year, 2019);
assert_eq!(vec[1].year, 2022);
assert_eq!(vec[1].day, 8);
assert_eq!(vec[2].year, 2022);
assert_eq!(vec[2].day, 14);
assert_eq!(vec[3].year, 2022);
assert_eq!(vec[3].day, 25);
}

File diff suppressed because it is too large Load Diff

31
src/semver.rs Normal file
View File

@@ -0,0 +1,31 @@
//! # SemVer
//! A simple Semantic Versioning struct to handle comparisons and ordering
// Uses
use std::fmt;
#[derive(Clone, Ord, PartialOrd, Eq, PartialEq, Debug)]
pub struct SemVer {
pub major: i32,
pub minor: i32,
pub patch: i32,
}
impl fmt::Display for SemVer {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}.{}.{}", self.major, self.minor, self.patch)
}
}
impl From<&str> for SemVer {
fn from(s: &str) -> SemVer {
let v: Vec<&str> = s.split('.').collect();
SemVer {
major: v[0].parse().unwrap(),
minor: v[1].parse().unwrap(),
patch: v[2].parse().unwrap(),
}
}
}