1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#![feature(unix_socket_ancillary_data)]
#![feature(str_from_utf16_endian)]
#![feature(try_blocks)]
#![allow(dead_code, unused_variables)]
mod assets;
mod terminal;
mod background;
mod toggle;
mod overlay;
mod input;
mod ffi;
mod texture_server;
use teleia::*;
use clap::{command, Command, Arg};
use std::io::Write as _;
pub fn main() -> Erm<()> {
let matches = command!()
.propagate_version(true)
.subcommand_required(true)
.arg_required_else_help(true)
.subcommand(
Command::new("overlay")
.about("Run the full-screen transparent overlay")
)
.subcommand(
Command::new("model-terminal")
.about("Run the LCOLONQ model renderer in a terminal")
)
.subcommand(
Command::new("repair-card")
.arg(Arg::new("path"))
.about("Repair the TCG card at the given path.")
)
.get_matches();
match matches.subcommand() {
Some(("overlay", _cm)) => {
teleia::run("LCOLONQ", 1920, 1080, teleia::Options::OVERLAY, |ctx| {
overlay::Overlays::new(ctx, vec![
Box::new(overlay::automata::Overlay::new(ctx)),
Box::new(overlay::shader::Overlay::new(ctx)),
Box::new(overlay::tcg::Overlay::new(ctx)),
Box::new(overlay::clippy::Overlay::new(ctx)),
Box::new(overlay::combo::Overlay::new(ctx)),
Box::new(overlay::drawing::Overlay::new(ctx)),
// Box::new(overlay::model::Overlay::new(ctx)),
// Box::new(overlay::loopback::Overlay::new(ctx)),
])
})?;
},
Some(("model-terminal", _cm)) => {
teleia::run("LCOLONQ", 1920, 1080, teleia::Options::HIDDEN, overlay::model::Terminal::new)?;
},
_ => unreachable!("no subcommand"),
}
Ok(())
}
|