From 96b6ea890b212cb0e7324238b568b84a70d5c131 Mon Sep 17 00:00:00 2001 From: Alex Knauth Date: Wed, 17 Jul 2024 09:51:41 -0400 Subject: [PATCH] register the variables on start (#92) Some variables are initialized with dashes at first. This should put them in the combo-boxes and stuff for layout editing. --- src/hit_counter.rs | 2 +- src/lib.rs | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/hit_counter.rs b/src/hit_counter.rs index 15e10777..c09c95ef 100644 --- a/src/hit_counter.rs +++ b/src/hit_counter.rs @@ -10,7 +10,7 @@ use crate::hollow_knight_memory::*; use crate::timer::{Resettable, Timer}; /// The dash symbol to use for generic dashes in text. -const DASH: &str = "—"; +pub const DASH: &str = "—"; /// The minus symbol to use for negative numbers. const MINUS: &str = "−"; /// The plus symbol to use for positive numbers. diff --git a/src/lib.rs b/src/lib.rs index 4bd40b55..5a8e5c30 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,7 +23,7 @@ use hollow_knight_memory::*; use splits::Split; use timer::{Resettable, SplitterAction, Timer}; use load_remover::LoadRemover; -use hit_counter::HitCounter; +use hit_counter::{HitCounter, DASH}; use ugly_widget::store::StoreGui; asr::async_main!(stable); @@ -56,6 +56,14 @@ async fn main() { asr::print_message("Hello, World!"); + // register the variables on start + asr::timer::set_variable_int("hits", 0); + asr::timer::set_variable_int("segment hits", 0); + asr::timer::set_variable("pb hits", DASH); + asr::timer::set_variable("comparison hits", DASH); + asr::timer::set_variable("delta hits", DASH); + asr::timer::set_variable("item", ""); + let mut gui = Box::new(SettingsGui::wait_load_merge_register().await); let mut ticks_since_gui = 0;