Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

Commit 3de3708

Browse files
committed
remove moss assist
1 parent 9c004dc commit 3de3708

7 files changed

Lines changed: 12 additions & 316 deletions

File tree

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
run: |
2424
sudo apt update
2525
sudo apt install -y pkg-config libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev \
26-
libxkbcommon-dev libssl-dev libxi-dev libx11-dev libxtst-dev
26+
libxkbcommon-dev libssl-dev
2727
2828
- name: Build Release
2929
run: cargo build --release

Cargo.lock

Lines changed: 7 additions & 110 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
[package]
22
name = "codlinux"
3-
version = "0.9.1"
3+
version = "0.9.2"
44
edition = "2024"
55

66
[dependencies]
77
chrono = "0.4.40"
88
compile-time = "0.2.0"
99
eframe = "0.31.1"
10-
rdev = "0.5.3"
1110
sysinfo = "0.34.2"
1211

1312
[profile.release]

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ To run the games, you need a script. But using scripts is a little inconvenient.
77
![Screenshot_2025-04-21_16-41-01](https://github.com/user-attachments/assets/144e615d-1fc0-484e-8730-213c59df2699)
88
- For safety reasons, the wine prefix folder should be created **before** setting in CoDLinux
99
- You can only check for updates 60 times per hour
10-
- Moss Assist requires testing
1110

1211
## Todo
1312
- Verify the game exe (version)

src/main.rs

Lines changed: 3 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
static VERSION: &str = env!("CARGO_PKG_VERSION");
22

33
mod utils;
4-
mod screenshooter;
54

65
use std::sync::atomic::Ordering;
76
use std::sync::{Arc, Mutex};
87
use std::thread;
98
use eframe::egui;
109
use utils::{create_desktop_file, my_exe_path, get_fancy_name, reg_uri_scheme, launch_game, notify};
11-
use screenshooter::capture;
1210

1311
fn main()
1412
{
@@ -80,38 +78,6 @@ fn main()
8078
wineprefix = backupprefix;
8179
}
8280

83-
let assist_moss = utils::load_setting("assist_moss").unwrap_or_default();
84-
if &assist_moss == "yes" {
85-
println!("yes");
86-
screenshooter::ASSIST_MOSS.store(true, Ordering::Relaxed);
87-
}
88-
89-
let capture_thread = Arc::new(Mutex::new(None::<thread::JoinHandle<()>>));
90-
let capture_result = capture();
91-
match capture_result {
92-
Ok(Some(handle)) => {
93-
*capture_thread.lock().unwrap() = Some(handle);
94-
}
95-
Ok(None) => {
96-
println!("ASSIST_MOSS is disabled, skipping screenshot capture.");
97-
}
98-
Err(e) => {
99-
eprintln!("Failed to start capture: {}", e);
100-
}
101-
}
102-
103-
let keyboard_handle = thread::spawn(move || {
104-
if let Err(e) = rdev::listen(|event| {
105-
if event.event_type == rdev::EventType::KeyPress(rdev::Key::KpMinus) {
106-
let current = screenshooter::CAPTURE.load(Ordering::Relaxed);
107-
screenshooter::CAPTURE.store(!current, Ordering::Relaxed);
108-
println!("Capture toggled to: {}", !current);
109-
}
110-
}) {
111-
eprintln!("Failed to listen for keyboard events: {:?}", e);
112-
}
113-
});
114-
11581
let mut args: Vec<String> = std::env::args().skip(1).collect::<Vec<_>>();
11682
if let Some(first_arg) = args.get(0) {
11783
if first_arg.starts_with("iw1x://") || first_arg.starts_with("t1x://") {
@@ -159,7 +125,7 @@ fn main()
159125
let args_str = args.join(" ");
160126
let options = eframe::NativeOptions {
161127
viewport: egui::ViewportBuilder::default()
162-
.with_inner_size([400.0, 145.0 + 115.0 * executables.len() as f32]),
128+
.with_inner_size([400.0, 140.0 + 115.0 * executables.len() as f32]),
163129
centered: true,
164130
..Default::default()
165131
};
@@ -168,7 +134,7 @@ fn main()
168134
let game_thread = Arc::new(Mutex::new(None::<thread::JoinHandle<()>>));
169135
let dl_thread = Arc::new(Mutex::new(None::<thread::JoinHandle<()>>));
170136
let dl_size = utils::get_download_size();
171-
let app = CoDLinuxApp::new(executables.clone(), args_str.clone(), uo, game_thread.clone(), dl_thread.clone(), wineprefix.clone(), dl_size, screenshooter::ASSIST_MOSS.load(Ordering::Relaxed));
137+
let app = CoDLinuxApp::new(executables.clone(), args_str.clone(), uo, game_thread.clone(), dl_thread.clone(), wineprefix.clone(), dl_size);
172138

173139
eframe::run_native(
174140
"CoDLinux",
@@ -185,11 +151,6 @@ fn main()
185151
}
186152
println!("CoDLinux: GUI closed.");
187153
}
188-
189-
if let Some(handle) = capture_thread.lock().unwrap().take() {
190-
handle.join().unwrap();
191-
}
192-
keyboard_handle.join().unwrap();
193154
}
194155

195156
pub struct CoDLinuxApp
@@ -204,12 +165,11 @@ pub struct CoDLinuxApp
204165
show_update_popup: bool,
205166
downloading: bool,
206167
dl_size: String,
207-
assist_moss: bool,
208168
}
209169

210170
impl CoDLinuxApp
211171
{
212-
fn new(executables: Vec<String>, args: String, uo: bool, game_thread: Arc<Mutex<Option<thread::JoinHandle<()>>>>, dl_thread: Arc<Mutex<Option<thread::JoinHandle<()>>>>, wine_prefix: String, dl_size: String, assist_moss: bool) -> Self {
172+
fn new(executables: Vec<String>, args: String, uo: bool, game_thread: Arc<Mutex<Option<thread::JoinHandle<()>>>>, dl_thread: Arc<Mutex<Option<thread::JoinHandle<()>>>>, wine_prefix: String, dl_size: String) -> Self {
213173
println!("CoDLinux: Creating app...");
214174
println!("CoDLinux: Prefix: {:?}", wine_prefix);
215175
CoDLinuxApp {
@@ -223,7 +183,6 @@ impl CoDLinuxApp
223183
show_update_popup: false,
224184
downloading: false,
225185
dl_size,
226-
assist_moss,
227186
}
228187
}
229188
}
@@ -283,13 +242,6 @@ impl eframe::App for CoDLinuxApp
283242
//let _ = utils::remember_game(&executable);
284243
let _ = utils::save_setting("remembered_game", &executable);
285244
}
286-
if self.assist_moss {
287-
screenshooter::ASSIST_MOSS.store(true, Ordering::Relaxed);
288-
let _ = utils::save_setting("assist_moss", "yes");
289-
}
290-
else {
291-
let _ = utils::save_setting("assist_moss", "no");
292-
}
293245
let exe = executable.clone();
294246
let args = self.args.clone();
295247

@@ -310,7 +262,6 @@ impl eframe::App for CoDLinuxApp
310262
ui.heading("Options");
311263

312264
ui.checkbox(&mut self.remember, "Remember my choice");
313-
ui.checkbox(&mut self.assist_moss, "Assist Moss");
314265
let text_edit = ui.add(egui::TextEdit::singleline(&mut self.wine_prefix)
315266
.hint_text("Wine Prefix")
316267
.desired_width(200.0));

0 commit comments

Comments
 (0)