Restructure elements

This commit is contained in:
hodasemi 2023-01-18 09:19:55 +01:00
parent 58d824977f
commit dc745ea8af
15 changed files with 25 additions and 21 deletions

View file

@ -10,8 +10,8 @@ const VK_HEADER: &[&str] = &[
const FN_PREFIX: &str = "PFN_";
const SHADER: &[&str] = &[
"src/overlay/elements/shader/single_color.vert",
"src/overlay/elements/shader/single_color.frag",
"src/overlay/elements/pedals/single_color.vert",
"src/overlay/elements/pedals/single_color.frag",
];
fn query_vulkan_function_typedefs() {

View file

@ -0,0 +1,10 @@
<?xml-model href="../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<root>
<grid id="grid" x_dim="9" y_dim="1">
<label id="place" x_slot="0" y_slot="0" text_color="black"></label>
<label id="name"
x_slot="1" y_slot="0" x_size="6" text_color="black"></label>
<label id="time_behind"
x_slot="7" y_slot="0" x_size="2" text_color="black"></label>
</grid>
</root>

View file

@ -1,4 +1,4 @@
<?xml-model href="gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<?xml-model href="../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<root reference_width="2560" reference_height="1440">
<grid id="main_grid" x_dim="1" y_dim="25" x_offset="10" y_offset="70" width="350" height="875"
vert_align="top" hori_align="left" margin="0" padding="0"> </grid>

View file

@ -26,8 +26,8 @@ pub struct LeaderBoard {
}
impl LeaderBoard {
const GRID: &str = include_str!("ui_files/leaderboard_grid.xml");
const ENTRY: &str = include_str!("ui_files/leaderboard_entry.xml");
const GRID: &str = include_str!("leaderboard_grid.xml");
const ENTRY: &str = include_str!("leaderboard_entry.xml");
pub fn new(gui_handler: &Arc<GuiHandler>) -> Result<Self> {
let gui = GuiBuilder::from_str(gui_handler, Self::GRID)?;

View file

@ -1,6 +1,5 @@
mod leaderboard;
mod pedals;
mod pipeline;
mod radar;
mod watermark;

View file

@ -22,7 +22,7 @@ pub struct Pedals {
impl Pedals {
pub fn new(gui_handler: &Arc<GuiHandler>) -> Result<Self> {
const DESC: &str = include_str!("ui_files/pedals.xml");
const DESC: &str = include_str!("pedals.xml");
let gui = GuiBuilder::from_str(gui_handler, DESC)?;

View file

@ -1,4 +1,4 @@
<?xml-model href="gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<?xml-model href="../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<root reference_width="2560" reference_height="1440">
<grid x_dim="7" y_dim="2" x_offset="-750" y_offset="-250" width="150" height="200"
vert_align="bottom" hori_align="right" margin="3" padding="3" background="#686868">

View file

@ -1,3 +1,5 @@
mod pipeline;
use anyhow::Result;
use cgmath::{ortho, vec2, vec3, vec4, Deg, InnerSpace, Matrix4, Rad, Vector2, Vector3, Vector4};
use rfactor_sm_reader::*;
@ -6,7 +8,7 @@ use vulkan_rs::prelude::*;
use std::sync::{Arc, Mutex};
use super::pipeline::SingleColorPipeline;
use pipeline::SingleColorPipeline;
use crate::{
overlay::{

View file

@ -3,7 +3,7 @@ use vulkan_rs::prelude::*;
use std::{mem, sync::Arc};
use super::radar::PositionOnlyVertex;
use super::PositionOnlyVertex;
pub struct SingleColorPipeline {
pipeline: Arc<Pipeline>,
@ -19,12 +19,12 @@ impl SingleColorPipeline {
) -> Result<Self> {
let vertex_shader = ShaderModule::from_slice(
device.clone(),
include_bytes!("shader/single_color.vert.spv"),
include_bytes!("single_color.vert.spv"),
ShaderType::Vertex,
)?;
let fragment_shader = ShaderModule::from_slice(
device.clone(),
include_bytes!("shader/single_color.frag.spv"),
include_bytes!("single_color.frag.spv"),
ShaderType::Fragment,
)?;

View file

@ -1,7 +0,0 @@
<root>
<grid id="grid" x_dim="9" y_dim="1">
<label id="place" x_slot="0" y_slot="0" text_color="black"></label>
<label id="name" x_slot="1" y_slot="0" x_size="6" text_color="black"></label>
<label id="time_behind" x_slot="7" y_slot="0" x_size="2" text_color="black"></label>
</grid>
</root>

View file

@ -15,7 +15,7 @@ pub struct Watermark {
impl Watermark {
pub fn new(gui_handler: &Arc<GuiHandler>) -> Result<Self> {
const DESC: &str = include_str!("ui_files/watermark.xml");
const DESC: &str = include_str!("watermark.xml");
let gui = GuiBuilder::from_str(gui_handler, DESC)?;

View file

@ -1,4 +1,4 @@
<?xml-model href="gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<?xml-model href="../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<root reference_width="2560" reference_height="1440">
<grid x_dim="1" y_dim="1" x_offset="10" y_offset="10" width="300" height="50"
vert_align="top" hori_align="left" margin="2" padding="2" background="#c9c9c9">