diff options
author | metamuffin <metamuffin@disroot.org> | 2025-01-26 22:22:53 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-01-26 22:22:53 +0100 |
commit | 724e6e4d97f608282e891742565b1036f3e970d5 (patch) | |
tree | d75c43703c55ff35a8dd7f01960812f5b147d683 /client/src/interfaces/mod.rs | |
parent | f0b213d51ee7b44362b5618bf5bd1eacf50d2bb8 (diff) | |
download | weareserver-724e6e4d97f608282e891742565b1036f3e970d5.tar weareserver-724e6e4d97f608282e891742565b1036f3e970d5.tar.bz2 weareserver-724e6e4d97f608282e891742565b1036f3e970d5.tar.zst |
graphics config
Diffstat (limited to 'client/src/interfaces/mod.rs')
-rw-r--r-- | client/src/interfaces/mod.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/client/src/interfaces/mod.rs b/client/src/interfaces/mod.rs index 5fb9e6e..9cbfbe3 100644 --- a/client/src/interfaces/mod.rs +++ b/client/src/interfaces/mod.rs @@ -14,15 +14,17 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ +pub mod graphicsconfig; pub mod prefabindex; pub mod profiler; use crate::{ download::Downloader, network::Network, - render::{scene::ScenePreparer, ui::UI_POSITION_OFFSET}, + render::{GraphicsConfig, scene::ScenePreparer, ui::UI_POSITION_OFFSET}, }; use egui::{Pos2, Widget}; +use graphicsconfig::GraphicsConfigInterface; use prefabindex::PrefabIndexInterface; use profiler::{Profiler, TimingProfiler}; use std::sync::{Arc, Mutex}; @@ -33,6 +35,7 @@ enum Interface { Selector, Profiler(Profiler), PrefabIndex(PrefabIndexInterface), + GraphicsConfig(GraphicsConfigInterface), } pub struct InterfaceData { @@ -42,6 +45,7 @@ pub struct InterfaceData { pub prefab_index: Arc<PrefabIndex>, pub render_timing: Arc<Mutex<TimingProfiler>>, pub adapter_info: Arc<AdapterInfo>, + pub graphics_config: Arc<Mutex<(bool, GraphicsConfig)>>, } pub fn ui_selector(idata: Arc<InterfaceData>) -> impl Fn(&egui::Context) -> bool { @@ -53,6 +57,7 @@ pub fn ui_selector(idata: Arc<InterfaceData>) -> impl Fn(&egui::Context) -> bool Interface::Selector => "Select Interface", Interface::Profiler(_) => "Profiler", Interface::PrefabIndex(_) => "Prefab Index", + Interface::GraphicsConfig(_) => "Graphics Configuration", }) .open(&mut open) .default_pos(Pos2::new(UI_POSITION_OFFSET, UI_POSITION_OFFSET)) @@ -68,10 +73,18 @@ pub fn ui_selector(idata: Arc<InterfaceData>) -> impl Fn(&egui::Context) -> bool idata: idata.clone(), }) } + if ui.button("Graphics Config").clicked() { + *state = Interface::GraphicsConfig(GraphicsConfigInterface { + idata: idata.clone(), + }) + } ui.response() } Interface::Profiler(profiler) => profiler.ui(ui), Interface::PrefabIndex(prefab_index_interface) => prefab_index_interface.ui(ui), + Interface::GraphicsConfig(graphics_config_interface) => { + graphics_config_interface.ui(ui) + } }); open } |