diff --git a/src/app/panels/middle/xvb.rs b/src/app/panels/middle/xvb.rs index b29d88f..86adcaa 100644 --- a/src/app/panels/middle/xvb.rs +++ b/src/app/panels/middle/xvb.rs @@ -14,9 +14,9 @@ use crate::regex::num_lines; use crate::utils::constants::{ GREEN, LIGHT_GRAY, ORANGE, RED, XVB_DONATED_1H_FIELD, XVB_DONATED_24H_FIELD, XVB_FAILURE_FIELD, XVB_HELP, XVB_ROUND_TYPE_FIELD, XVB_TOKEN_FIELD, XVB_TOKEN_LEN, XVB_URL_RULES, - XVB_WINNER_FIELD, XVB_HERO_SELECT, XVB_MODE_MANUALLY_DONATE, XVB_MODE_MANUALLY_KEEP, XVB_MODE_MANUAL_DONATION_LEVEL, + XVB_WINNER_FIELD, XVB_HERO_SELECT, XVB_MODE_MANUAL_XVB_HELP, XVB_MODE_MANUAL_P2POOL_HELP, XVB_MODE_MANUAL_DONATION_LEVEL_HELP, XVB_DONATION_LEVEL_DONOR_HELP, XVB_DONATION_LEVEL_VIP_DONOR_HELP, XVB_DONATION_LEVEL_WHALE_DONOR_HELP, - XVB_DONATION_LEVEL_MEGA_DONOR_HELP, XVB_MANUAL_SLIDER_DONATE_HELP, XVB_MANUAL_SLIDER_KEEP_HELP + XVB_DONATION_LEVEL_MEGA_DONOR_HELP, XVB_MANUAL_SLIDER_MANUAL_XVB_HELP, XVB_MANUAL_SLIDER_MANUAL_P2POOL_HELP }; use crate::utils::macros::lock; use crate::utils::regex::Regexes; @@ -154,16 +154,16 @@ impl crate::disk::state::Xvb { egui::ComboBox::from_label("") .selected_text(format!("{:?}", self.mode)) .show_ui(ui, |ui| { - ui.selectable_value(&mut self.mode, XvbMode::Auto, "Automatic"); - ui.selectable_value(&mut self.mode, XvbMode::Hero, "Hero Mode"); - ui.selectable_value(&mut self.mode, XvbMode::ManuallyDonate, "Manually Donate") - .on_hover_text(XVB_MODE_MANUALLY_DONATE); - ui.selectable_value(&mut self.mode, XvbMode::ManuallyKeep, "Manually Keep") - .on_hover_text(XVB_MODE_MANUALLY_KEEP); - ui.selectable_value(&mut self.mode, XvbMode::ManualDonationLevel, "Manual Donation Level") - .on_hover_text(XVB_MODE_MANUAL_DONATION_LEVEL); + ui.selectable_value(&mut self.mode, XvbMode::Auto, "Auto"); + ui.selectable_value(&mut self.mode, XvbMode::Hero, "Hero"); + ui.selectable_value(&mut self.mode, XvbMode::ManualXvb, "ManualXvb") + .on_hover_text(XVB_MODE_MANUAL_XVB_HELP); + ui.selectable_value(&mut self.mode, XvbMode::ManualP2pool, "ManualP2pool") + .on_hover_text(XVB_MODE_MANUAL_P2POOL_HELP); + ui.selectable_value(&mut self.mode, XvbMode::ManualDonationLevel, "ManualDonationLevel") + .on_hover_text(XVB_MODE_MANUAL_DONATION_LEVEL_HELP); }); - if self.mode == XvbMode::ManuallyDonate || self.mode == XvbMode::ManuallyKeep { + if self.mode == XvbMode::ManualXvb || self.mode == XvbMode::ManualP2pool { ui.add_space(space_h); @@ -181,10 +181,10 @@ impl crate::disk::state::Xvb { hashrate_xmrig /= 1000.0; } - let slider_help_text = if self.mode == XvbMode::ManuallyDonate { - XVB_MANUAL_SLIDER_DONATE_HELP + let slider_help_text = if self.mode == XvbMode::ManualXvb { + XVB_MANUAL_SLIDER_MANUAL_XVB_HELP } else { - XVB_MANUAL_SLIDER_KEEP_HELP + XVB_MANUAL_SLIDER_MANUAL_P2POOL_HELP }; ui.add_enabled_ui(is_alive, |ui| { diff --git a/src/disk/state.rs b/src/disk/state.rs index 3230603..9d9ef28 100644 --- a/src/disk/state.rs +++ b/src/disk/state.rs @@ -258,8 +258,8 @@ pub struct Xvb { pub enum XvbMode { #[default] Auto, - ManuallyDonate, - ManuallyKeep, + ManualXvb, + ManualP2pool, Hero, ManualDonationLevel, } diff --git a/src/helper/tests.rs b/src/helper/tests.rs index 0ea3963..5f83b79 100644 --- a/src/helper/tests.rs +++ b/src/helper/tests.rs @@ -788,7 +788,7 @@ Uptime = 0h 2m 4s lock!(gui_api_p2pool).p2pool_difficulty_u64 = 95000000; lock!(gui_api_xvb).stats_priv.donor_1hr_avg = 0.0; lock!(gui_api_xmrig).hashrate_raw_15m = 5000.0; - lock!(gui_api_xvb).stats_priv.runtime_mode = RuntimeMode::ManuallyDonate; + lock!(gui_api_xvb).stats_priv.runtime_mode = RuntimeMode::ManualXvb; lock!(gui_api_xvb).stats_priv.runtime_manual_amount = 500.0; let given_time = calcul_donated_time( @@ -801,7 +801,7 @@ Uptime = 0h 2m 4s assert_eq!(given_time, 60); - lock!(gui_api_xvb).stats_priv.runtime_mode = RuntimeMode::ManuallyKeep; + lock!(gui_api_xvb).stats_priv.runtime_mode = RuntimeMode::ManualP2pool; let given_time = calcul_donated_time( lock!(gui_api_xmrig).hashrate_raw_15m, diff --git a/src/helper/xvb/algorithm.rs b/src/helper/xvb/algorithm.rs index d2ee9a2..d16415e 100644 --- a/src/helper/xvb/algorithm.rs +++ b/src/helper/xvb/algorithm.rs @@ -83,15 +83,15 @@ pub(crate) fn calcul_donated_time( output_console(gui_api_xvb, "Hero mode is enabled for this decision"); default_spared_time }, - RuntimeMode::ManuallyDonate => { + RuntimeMode::ManualXvb => { let donate_hr = lock!(gui_api_xvb).stats_priv.runtime_manual_amount; - info!("RuntimeMode::ManuallyDonate - lhr:{lhr} donate_hr:{donate_hr}"); + info!("RuntimeMode::ManualXvb - lhr:{lhr} donate_hr:{donate_hr}"); XVB_TIME_ALGO * (donate_hr as u32) / (lhr as u32) }, - RuntimeMode::ManuallyKeep => { + RuntimeMode::ManualP2pool => { let keep_hr = lock!(gui_api_xvb).stats_priv.runtime_manual_amount; - info!("RuntimeMode::ManuallyDonate - lhr:{lhr} keep_hr:{keep_hr}"); + info!("RuntimeMode::ManualXvb - lhr:{lhr} keep_hr:{keep_hr}"); XVB_TIME_ALGO - (XVB_TIME_ALGO * (keep_hr as u32) / (lhr as u32)) }, diff --git a/src/helper/xvb/priv_stats.rs b/src/helper/xvb/priv_stats.rs index 9243fbc..bf52a69 100644 --- a/src/helper/xvb/priv_stats.rs +++ b/src/helper/xvb/priv_stats.rs @@ -21,8 +21,8 @@ use super::{nodes::XvbNode, rounds::XvbRound, PubXvbApi}; pub enum RuntimeMode { #[default] Auto, - ManuallyDonate, - ManuallyKeep, + ManualXvb, + ManualP2pool, Hero, ManualDonationLevel } @@ -135,8 +135,8 @@ impl From for RuntimeMode { fn from(mode: XvbMode) -> Self { match mode { XvbMode::Auto => Self::Auto, - XvbMode::ManuallyDonate => Self::ManuallyDonate, - XvbMode::ManuallyKeep => Self::ManuallyKeep, + XvbMode::ManualXvb => Self::ManualXvb, + XvbMode::ManualP2pool => Self::ManualP2pool, XvbMode::Hero => Self::Hero, XvbMode::ManualDonationLevel => Self::ManualDonationLevel } diff --git a/src/utils/constants.rs b/src/utils/constants.rs index d46130e..48fef19 100644 --- a/src/utils/constants.rs +++ b/src/utils/constants.rs @@ -412,8 +412,8 @@ pub const XMRIG_PATH_EMPTY: &str = "XMRig PATH is empty! To fix: goto the [G // XvB pub const XVB_HELP: &str = "You need to register an account by clicking on the link above to get your token with the same p2pool XMR address you use for payment."; -pub const XVB_MANUAL_SLIDER_DONATE_HELP: &str = "Set the hashrate amount to donate to XvB manually"; -pub const XVB_MANUAL_SLIDER_KEEP_HELP: &str = "Set the hashrate amount to keep on p2pool manually"; +pub const XVB_MANUAL_SLIDER_MANUAL_XVB_HELP: &str = "Set the hashrate amount to donate to XvB manually, The remaining hashrate will be sent to p2pool"; +pub const XVB_MANUAL_SLIDER_MANUAL_P2POOL_HELP: &str = "Set the hashrate amount to keep on p2pool manually, The remaining hasrate will be donated to xvb"; pub const XVB_URL: &str = "https://xmrvsbeast.com"; pub const XVB_URL_PUBLIC_API: &str = "https://xmrvsbeast.com/p2pool/stats"; @@ -443,9 +443,9 @@ pub const XVB_ROUND_DONOR_WHALE_MIN_HR: u32 = 100000; pub const XVB_ROUND_DONOR_MEGA_MIN_HR: u32 = 1000000; // Manual Mode -pub const XVB_MODE_MANUALLY_DONATE: &str = "Set the amount donated to XvB manually"; -pub const XVB_MODE_MANUALLY_KEEP: &str = "Set the p2pool hashrate manually"; -pub const XVB_MODE_MANUAL_DONATION_LEVEL: &str = "Set the XvB donation level manually"; +pub const XVB_MODE_MANUAL_XVB_HELP: &str = "Manually set the amount to donate to XmrVsBeast, The remaining hashrate will be sent to p2pool"; +pub const XVB_MODE_MANUAL_P2POOL_HELP: &str = "Manually set the amount to keep on P2pool, The remaining hashrate will be donated to xvb"; +pub const XVB_MODE_MANUAL_DONATION_LEVEL_HELP: &str = "Manually set the XvB donation level"; // Manual Donation Levels