1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2025-03-23 14:56:11 +00:00

Update menu.rs

This commit is contained in:
jugeeya 2023-08-23 22:10:25 -07:00 committed by GitHub
parent 6a1253671d
commit 34cbeb3478
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,10 +9,10 @@ use training_mod_tui::{App, AppPage, NUM_LISTS};
use crate::common::menu::{
MENU_CLOSE_WAIT_FRAMES, VISUAL_FRAME_COUNTER, VISUAL_FRAME_COUNTER_SHOULD_COUNT,
};
use crate::training::frame_counter;
use crate::{common, common::menu::QUICK_MENU_ACTIVE, input::*};
use super::fade_out;
use super::set_icon_text;
pub static NUM_MENU_TEXT_OPTIONS: usize = 32;
pub static _NUM_MENU_TABS: usize = 3;
@ -359,7 +359,7 @@ pub unsafe fn draw(root_pane: &Pane) {
} else {
*VISUAL_FRAME_COUNTER.lock() = 0;
}
// Determine if we're in the menu by seeing if the "help" footer has
// begun moving upward. It starts at -80 and moves to 0 over 10 frames
// in info_training_in_menu.bflan
@ -491,7 +491,10 @@ pub unsafe fn draw(root_pane: &Pane) {
// Left/Right tabs have keys
if let Some(key) = key {
set_icon_text(icon_pane, &vec![**key]);
let it = icon_pane.text_buf as *mut u16;
icon_pane.text_len = 1;
*it = **key;
*(it.add(1)) = 0x0;
}
if *name == "CurrentTab" {
@ -515,7 +518,11 @@ pub unsafe fn draw(root_pane: &Pane) {
.find_pane_by_name_recursive("set_txt_icon")
.unwrap()
.as_textbox();
set_icon_text(icon_pane, &vec![*key.unwrap()]);
icon_pane.set_text_string("");
let it = icon_pane.text_buf as *mut u16;
icon_pane.text_len = 1;
*it = *key.unwrap();
*(it.add(1)) = 0x0;
key_help_pane
.find_pane_by_name_recursive("set_txt_help")