hunt down some unused pubs

This commit is contained in:
2025-04-19 04:45:47 +01:00
parent 27524e855a
commit 585f454bc0
6 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ pub fn can_activate() -> bool {
is_window_focused(WINDOW_TITLE) && !is_any_key_pressed(&PRESS_KEYS) && !is_cursor_visible() is_window_focused(WINDOW_TITLE) && !is_any_key_pressed(&PRESS_KEYS) && !is_cursor_visible()
} }
pub fn send(vk_codes: &[VIRTUAL_KEY]) { fn send(vk_codes: &[VIRTUAL_KEY]) {
vk_codes.iter().for_each(|vk_code| unsafe { vk_codes.iter().for_each(|vk_code| unsafe {
keybd_event( keybd_event(
vk_code.0 as u8, vk_code.0 as u8,
+3 -3
View File
@@ -9,7 +9,7 @@ use windows::Win32::{
System::Threading::{OpenProcess, PROCESS_SUSPEND_RESUME}, System::Threading::{OpenProcess, PROCESS_SUSPEND_RESUME},
}; };
pub const INTERVAL: Duration = Duration::from_secs(10); const INTERVAL: Duration = Duration::from_secs(10);
#[derive(Debug)] #[derive(Debug)]
pub struct EmptySession { pub struct EmptySession {
@@ -44,8 +44,8 @@ impl EmptySession {
#[link(name = "ntdll")] #[link(name = "ntdll")]
unsafe extern "system" { unsafe extern "system" {
pub unsafe fn NtSuspendProcess(ProcessHandle: HANDLE) -> NTSTATUS; unsafe fn NtSuspendProcess(ProcessHandle: HANDLE) -> NTSTATUS;
pub unsafe fn NtResumeProcess(ProcessHandle: HANDLE) -> NTSTATUS; unsafe fn NtResumeProcess(ProcessHandle: HANDLE) -> NTSTATUS;
} }
fn get_gta_pid(sysinfo: &mut System) -> u32 { fn get_gta_pid(sysinfo: &mut System) -> u32 {
+4 -4
View File
@@ -2,13 +2,13 @@ use crate::util::consts::game::{EXE_ENHANCED, EXE_LEGACY};
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
use sysinfo::System; use sysinfo::System;
pub const INTERVAL: Duration = Duration::from_secs(3); const INTERVAL: Duration = Duration::from_secs(3);
#[derive(Debug)] #[derive(Debug)]
pub struct ForceClose { pub struct ForceClose {
pub button_text: String, pub button_text: String,
pub prompting: bool, prompting: bool,
pub interval: Instant, interval: Instant,
current_frame: bool, current_frame: bool,
} }
@@ -47,7 +47,7 @@ impl ForceClose {
} }
} }
pub fn activate(sysinfo: &mut System) { fn activate(sysinfo: &mut System) {
sysinfo.refresh_all(); sysinfo.refresh_all();
sysinfo sysinfo
.processes() .processes()
+2 -2
View File
@@ -18,7 +18,7 @@ use strum::{Display, EnumIter};
pub const WINDOW_SIZE: [f32; 2] = [240.0, 240.0]; pub const WINDOW_SIZE: [f32; 2] = [240.0, 240.0];
#[derive(Clone, Copy, Debug, Default, Display, PartialEq, Eq, EnumIter)] #[derive(Clone, Copy, Debug, Default, Display, PartialEq, Eq, EnumIter)]
pub enum Stage { enum Stage {
#[default] #[default]
Main, Main,
Settings, Settings,
@@ -39,7 +39,7 @@ pub struct App {
stage: Stage, stage: Stage,
pub flags: Flags, pub flags: Flags,
pub sysinfo: sysinfo::System, pub sysinfo: sysinfo::System,
pub game_handle: windows::Win32::Foundation::HANDLE, game_handle: windows::Win32::Foundation::HANDLE,
pub launch: features::launch::Launch, pub launch: features::launch::Launch,
force_close: features::force_close::ForceClose, force_close: features::force_close::ForceClose,
empty_session: features::empty_session::EmptySession, empty_session: features::empty_session::EmptySession,
+4 -4
View File
@@ -2,11 +2,11 @@ use std::time::{Duration, Instant};
#[derive(Debug)] #[derive(Debug)]
pub struct Countdown { pub struct Countdown {
pub i: u64, i: u64,
pub i_original: u64, i_original: u64,
pub i_string: String, pub i_string: String,
pub interval: Instant, interval: Instant,
pub first_count: bool, first_count: bool,
} }
impl Countdown { impl Countdown {
+1 -1
View File
@@ -1,4 +1,4 @@
pub mod codeberg; mod codeberg;
pub mod consts; pub mod consts;
pub mod countdown; pub mod countdown;
pub mod meta; pub mod meta;