pub unsafe fn banner_restore_vanilla_values(&self) {
        let index = self.faction_list_filter.map_to_source(&self.faction_list_view.selection_model().current_index());
        let data: HashMap<String, String> = serde_json::from_str(&index.data_1a(FACTION_DATA).to_string().to_std_string()).unwrap();

        if let Some(banner_primary) = data.get("banner_vanilla_primary") {
            set_color_safe(&self.get_ref_banner_colour_primary().as_ptr().static_upcast(), &QColor::from_q_string(&QString::from_std_str(format!("#{}", banner_primary))).as_ptr());
        }
        if let Some(banner_secondary) = data.get("banner_vanilla_secondary") {
            set_color_safe(&self.get_ref_banner_colour_secondary().as_ptr().static_upcast(), &QColor::from_q_string(&QString::from_std_str(format!("#{}", banner_secondary))).as_ptr());
        }
        if let Some(banner_tertiary) = data.get("banner_vanilla_tertiary") {
            set_color_safe(&self.get_ref_banner_colour_tertiary().as_ptr().static_upcast(), &QColor::from_q_string(&QString::from_std_str(format!("#{}", banner_tertiary))).as_ptr());
        }
    }
/// This function restores the banner colours to its vanilla values when we opened the tool.
///
/// Note: This one can fail if the faction is custom and not in the game files. The button should already be disabled
/// in those cases, but we also control it here, just in case.
This function restores the banner colours to its vanilla values when we opened the tool.
Note: This one can fail if the faction is custom and not in the game files. The button should already be disabled
in those cases, but we also control it here, just in case.
This function restores the banner colours to its vanilla values when we opened the tool . Note : This one can fail if the faction is custom and not in the game files . The button should already be disabled in those cases but we also control it here just in case .
pub unsafe fn banner_restore_vanilla_values(&self) {
        let index = self.faction_list_filter.map_to_source(&self.faction_list_view.selection_model().current_index());
        let data: HashMap<String, String> = serde_json::from_str(&index.data_1a(FACTION_DATA).to_string().to_std_string()).unwrap();
        if let Some(banner_primary) = data.get("banner_vanilla_primary") {
            set_color_safe(&self.get_ref_banner_colour_primary().as_ptr().static_upcast(), &QColor::from_q_string(&QString::from_std_str(format!("#{}", banner_primary))).as_ptr());
        }
        if let Some(banner_secondary) = data.get("banner_vanilla_secondary") {
            set_color_safe(&self.get_ref_banner_colour_secondary().as_ptr().static_upcast(), &QColor::from_q_string(&QString::from_std_str(format!("#{}", banner_secondary))).as_ptr());
        }
        if let Some(banner_tertiary) = data.get("banner_vanilla_tertiary") {
            set_color_safe(&self.get_ref_banner_colour_tertiary().as_ptr().static_upcast(), &QColor::from_q_string(&QString::from_std_str(format!("#{}", banner_tertiary))).as_ptr());
        }
    }
pub unsafe fn banner_restore_vanilla_values ( & self ) { let index = self . faction_list_filter . map_to_source ( & self . faction_list_view . selection_model ( ) . current_index ( ) ) ; let data : HashMap < String , String > = serde_json :: from_str ( & index . data_1a ( FACTION_DATA ) . to_string ( ) . to_std_string ( ) ) . unwrap ( ) ; if let Some ( banner_primary ) = data . get ( " " ) { set_color_safe ( & self . get_ref_banner_colour_primary ( ) . as_ptr ( ) . static_upcast ( ) , & QColor :: from_q_string ( & QString :: from_std_str ( format ! ( " " banner_primary ) ) ) . as_ptr ( ) ) ; } if let Some ( banner_secondary ) = data . get ( " " ) { set_color_safe ( & self . get_ref_banner_colour_secondary ( ) . as_ptr ( ) . static_upcast ( ) , & QColor :: from_q_string ( & QString :: from_std_str ( format ! ( " " banner_secondary ) ) ) . as_ptr ( ) ) ; } if let Some ( banner_tertiary ) = data . get ( " " ) { set_color_safe ( & self . get_ref_banner_colour_tertiary ( ) . as_ptr ( ) . static_upcast ( ) , & QColor :: from_q_string ( & QString :: from_std_str ( format ! ( " " banner_tertiary ) ) ) . as_ptr ( ) ) ; } }
This function restores the banner colours to its vanilla values when we opened the tool.
This function restores the banner colours to its vanilla values when we opened the tool .
&self
&self