Add font png to pkgbuild

This commit is contained in:
hodasemi 2023-01-17 16:11:48 +01:00
parent be7a746931
commit 8a7c4ab44d
2 changed files with 6 additions and 7 deletions

View file

@ -26,4 +26,7 @@ package() {
# copy layer discovery info file
install -Dm644 ${_pkgbase}/rFactorOverlay.json "${pkgdir}"/usr/share/vulkan/implicit_layer.d/rFactorOverlay.json
# copy font png
install -Dm644 ${_pkgbase}/font.png "${pkgdir}"/usr/share/vulkan_rf2_layer/font.png
}

View file

@ -46,9 +46,7 @@ impl UiSelectorConfig {
#[derive(Deserialize, Serialize)]
pub struct OverlayConfig {
pub ui_config: UiSelectorConfig,
pub radar_config: RadarConfig,
pub font_path: String,
}
impl OverlayConfig {
@ -56,7 +54,6 @@ impl OverlayConfig {
Self {
ui_config: UiSelectorConfig::new(),
radar_config: RadarConfig::new(),
font_path: String::new(),
}
}
}
@ -93,8 +90,6 @@ impl Overlay {
pub fn set_config(&mut self, config: OverlayConfig) {
self.config = config;
self.config.font_path = "/opt/sata_ssd/Workspace/vk_layer_rs/font.png".to_string();
}
pub fn set_instance(&mut self, instance: Arc<Instance>) {
@ -144,9 +139,10 @@ impl Overlay {
// only font is used
let mut create_info = GuiHandlerCreateInfo::default();
// create_info.font_path = AssetPath::from(self.config.font_path.clone());
create_info.font_path = AssetPath::from("/opt/sata_ssd/Workspace/vk_layer_rs/font.png");
create_info.font_path = AssetPath::from("/usr/share/vulkan_rf2_layer/font.png");
create_info.font_path.assume_prefix_free();
// required to not crash
create_info.resource_directory = AssetPath::from("");
create_info.resource_directory.assume_prefix_free();