use std::time::Instant;
use imgui::ImColor32;

pub struct ImGuiUiState {
    pub show_registers: bool,
    pub show_memory: bool,
    pub show_video: bool,
    pub show_keypad: bool,
    pub filename_to_load: String,
    pub on_colour: ImColor32,
    pub off_colour: ImColor32,
    pub is_running: bool,
    pub frame_time: f32,
    pub last_frame_instant: Instant
}

impl Clone for ImGuiUiState {
    fn clone(&self) -> Self {
        ImGuiUiState {
            show_registers: self.show_registers,
            show_memory: self.show_memory,
            show_video: self.show_video,
            show_keypad: self.show_keypad,
            filename_to_load: self.filename_to_load.to_string(),
            on_colour: self.on_colour,
            off_colour: self.off_colour,
            is_running: self.is_running,
            frame_time: self.frame_time,
            last_frame_instant: self.last_frame_instant
        }
    }
}

impl Default for ImGuiUiState {
    fn default() -> Self {
        ImGuiUiState {
            show_registers: false,
            show_memory: false,
            show_video: true,
            show_keypad: true,
            filename_to_load: String::new(),
            on_colour: ImColor32::from_rgb(0xff, 0xff, 0x00),
            off_colour: ImColor32::from_rgb(0x00, 0xff, 0xff),
            is_running: false,
            frame_time: 1.0,
            last_frame_instant: Instant::now()
        }
    }
}
