Skip to content

Commit

Permalink
option to disable minimize after sending a message (requested by squa…
Browse files Browse the repository at this point in the history
…tch_)
  • Loading branch information
zefanjajobse committed Aug 13, 2023
1 parent 2d2e16c commit d3c3a31
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
7 changes: 2 additions & 5 deletions config.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
minimize_after_message = false
send_messages = true
messages = [
'test1',
'test2',
'test3',
]
messages = ['t']
chat_type = 'Public'
message_start_time_utc = '12:00'
message_stop_time_utc = '23:00'
Expand Down
4 changes: 3 additions & 1 deletion src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ pub fn send_message(
structs::ChatType::Squad => message_action(current_message, squad_key),
}

ShowWindow(game_info.game_process, 6);
if cfg.minimize_after_message {
ShowWindow(game_info.game_process, 6);
}
}

if message_id + 1 >= cfg.messages.len() as u32 {
Expand Down
1 change: 1 addition & 0 deletions src/shared_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub fn anti_afk_runner(game_name: &str) {
println!("error in config.txt: {}", e);
println!("changing back to default..");
structs::SeederConfig {
minimize_after_message: true,
send_messages: false,
messages: vec!["Join our discord, we are always recruiting: discord.gg/BoB".into()],
chat_type: ChatType::Public,
Expand Down
2 changes: 2 additions & 0 deletions src/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub enum ChatType {

#[derive(Serialize, Deserialize, Clone)]
pub struct SeederConfig {
pub minimize_after_message: bool,
pub send_messages: bool,
pub messages: Vec<String>,
pub chat_type: ChatType,
Expand All @@ -28,6 +29,7 @@ pub struct GameInfo {
impl ::std::default::Default for SeederConfig {
fn default() -> Self {
Self {
minimize_after_message: true,
send_messages: false,
messages: vec!["Join our discord, we are always recruiting: discord.gg/BoB".into()],
chat_type: ChatType::Public,
Expand Down
1 change: 1 addition & 0 deletions src/test_msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ fn main() {
println!("error in config.txt: {}", e);
println!("changing back to default..");
structs::SeederConfig {
minimize_after_message: true,
send_messages: true,
messages: vec!["testmessage1".into()],
chat_type: ChatType::Public,
Expand Down

0 comments on commit d3c3a31

Please sign in to comment.