Compare commits
3
Commits
ui_fix
..
0a6677ae5d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a6677ae5d | ||
|
|
f05926e1be | ||
|
|
ac7c57e288 |
@@ -133,7 +133,6 @@ jobs:
|
|||||||
libxi6 \
|
libxi6 \
|
||||||
libxkbcommon-dev \
|
libxkbcommon-dev \
|
||||||
libxkbcommon-x11-0 \
|
libxkbcommon-x11-0 \
|
||||||
blender \
|
|
||||||
lld-19 \
|
lld-19 \
|
||||||
llvm-19 \
|
llvm-19 \
|
||||||
mesa-vulkan-drivers \
|
mesa-vulkan-drivers \
|
||||||
|
|||||||
+4
-23
@@ -3,9 +3,11 @@
|
|||||||
use std::{collections::HashMap, time::Duration};
|
use std::{collections::HashMap, time::Duration};
|
||||||
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
camera::{CameraOutputMode, visibility::RenderLayers}, input::InputSystems, prelude::*, render::render_resource::BlendState, settings::{ReflectSettingsGroup, SaveSettingsDeferred, SettingsGroup},
|
input::InputSystems,
|
||||||
|
prelude::*,
|
||||||
|
settings::{ReflectSettingsGroup, SaveSettingsDeferred, SettingsGroup},
|
||||||
};
|
};
|
||||||
use bevy_egui::{EguiContexts, EguiGlobalSettings, EguiPrimaryContextPass, PrimaryEguiContext, egui};
|
use bevy_egui::{EguiContexts, EguiPrimaryContextPass, egui};
|
||||||
use bevy_ggrs::{RollbackFrameRate, RunGgrsSystems};
|
use bevy_ggrs::{RollbackFrameRate, RunGgrsSystems};
|
||||||
use enum_cycling::EnumCycle;
|
use enum_cycling::EnumCycle;
|
||||||
use enum_cycling_derive::EnumCycle;
|
use enum_cycling_derive::EnumCycle;
|
||||||
@@ -395,7 +397,6 @@ impl Plugin for DebugToolsPlugin {
|
|||||||
.before(RunGgrsSystems)
|
.before(RunGgrsSystems)
|
||||||
.run_if(in_state(AppState::InMatch)),
|
.run_if(in_state(AppState::InMatch)),
|
||||||
)
|
)
|
||||||
.add_systems(Startup, spawn_egui_camera)
|
|
||||||
.add_systems(PreUpdate, restore_frame_step_time.after(RunGgrsSystems))
|
.add_systems(PreUpdate, restore_frame_step_time.after(RunGgrsSystems))
|
||||||
.add_systems(
|
.add_systems(
|
||||||
Update,
|
Update,
|
||||||
@@ -407,26 +408,6 @@ impl Plugin for DebugToolsPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn spawn_egui_camera(mut commands: Commands, mut egui_global_settings: ResMut<EguiGlobalSettings>,) {
|
|
||||||
egui_global_settings.auto_create_primary_context = false;
|
|
||||||
commands.spawn((
|
|
||||||
// The `PrimaryEguiContext` component requires everything needed to render a primary context.
|
|
||||||
PrimaryEguiContext,
|
|
||||||
Camera2d,
|
|
||||||
// Setting RenderLayers to none makes sure we won't render anything apart from the UI.
|
|
||||||
RenderLayers::none(),
|
|
||||||
Camera {
|
|
||||||
order: 2,
|
|
||||||
output_mode: CameraOutputMode::Write {
|
|
||||||
blend_state: Some(BlendState::ALPHA_BLENDING),
|
|
||||||
clear_color: ClearColorConfig::None,
|
|
||||||
},
|
|
||||||
clear_color: ClearColorConfig::Custom(Color::NONE),
|
|
||||||
..default()
|
|
||||||
},
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
fn player_handles(players: &Query<&Player>) -> Vec<usize> {
|
fn player_handles(players: &Query<&Player>) -> Vec<usize> {
|
||||||
let mut handles = players
|
let mut handles = players
|
||||||
.iter()
|
.iter()
|
||||||
|
|||||||
@@ -1,8 +1,19 @@
|
|||||||
use bevy::{picking::pointer::PointerId, prelude::*};
|
use bevy::{picking::pointer::PointerId, prelude::*};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
AppState, fighter::manifest::{FighterManifest, FighterManifestRegistry}, game_settings::CommonAssets, input::{LocalInputAssignments, LocalInputSource}, menus::{
|
AppState,
|
||||||
MenuCameraMarker, MenuMarker, button::FGUiButton, character_select::{character_box::CharacterBox, token::CharacterSelectToken}, cursor::{FGMenuCursor, MenuCursorInputSource}, errors::MenuErrors::FighterManifestNotFound, match_config::{MenuMatchConfig, MenuMatchPlayerSlot}, scaling, spawn_menu, style::{FGUiButtonType, FGUiStyle},
|
fighter::manifest::{FighterManifest, FighterManifestRegistry},
|
||||||
|
game_settings::CommonAssets,
|
||||||
|
input::{LocalInputAssignments, LocalInputSource},
|
||||||
|
menus::{
|
||||||
|
MenuMarker,
|
||||||
|
button::FGUiButton,
|
||||||
|
character_select::{character_box::CharacterBox, token::CharacterSelectToken},
|
||||||
|
cursor::{FGMenuCursor, MenuCursorInputSource},
|
||||||
|
errors::MenuErrors::FighterManifestNotFound,
|
||||||
|
match_config::{MenuMatchConfig, MenuMatchPlayerSlot},
|
||||||
|
scaling, spawn_menu,
|
||||||
|
style::{FGUiButtonType, FGUiStyle},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -230,7 +241,7 @@ pub fn copy_cursor_transform_to_token(
|
|||||||
character_boxes: Query<(&CharacterBox, &ComputedNode, &UiGlobalTransform)>,
|
character_boxes: Query<(&CharacterBox, &ComputedNode, &UiGlobalTransform)>,
|
||||||
match_config: Res<MenuMatchConfig>,
|
match_config: Res<MenuMatchConfig>,
|
||||||
cursors: Query<&UiGlobalTransform, With<FGMenuCursor>>,
|
cursors: Query<&UiGlobalTransform, With<FGMenuCursor>>,
|
||||||
cam: Single<&Camera, With<MenuCameraMarker>>,
|
cam: Single<&Camera>,
|
||||||
ui_scale: Res<UiScale>,
|
ui_scale: Res<UiScale>,
|
||||||
) -> Result {
|
) -> Result {
|
||||||
let camera = cam.into_inner();
|
let camera = cam.into_inner();
|
||||||
|
|||||||
+6
-3
@@ -9,8 +9,11 @@ use bevy::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
input::{LocalInputAssignments, LocalInputSource}, menus::{
|
input::{LocalInputAssignments, LocalInputSource},
|
||||||
MenuCameraMarker, input::{MenuInput, MenuInputState}, scaling, style::FGUiStyle,
|
menus::{
|
||||||
|
input::{MenuInput, MenuInputState},
|
||||||
|
scaling,
|
||||||
|
style::FGUiStyle,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -178,7 +181,7 @@ pub fn cursor_input(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_cursor_transform(
|
pub fn update_cursor_transform(
|
||||||
camera: Single<&Camera, With<MenuCameraMarker>>,
|
camera: Single<&Camera>,
|
||||||
query: Query<(&mut Node, &PointerLocation), With<FGMenuCursor>>,
|
query: Query<(&mut Node, &PointerLocation), With<FGMenuCursor>>,
|
||||||
ui_scale: Res<UiScale>,
|
ui_scale: Res<UiScale>,
|
||||||
) {
|
) {
|
||||||
|
|||||||
+4
-1
@@ -53,7 +53,6 @@ pub fn wrap_menu(menu: impl Scene) -> impl Scene {
|
|||||||
#MenuCamera
|
#MenuCamera
|
||||||
Camera
|
Camera
|
||||||
Camera2d
|
Camera2d
|
||||||
MenuCameraMarker
|
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
#MenuContainer
|
#MenuContainer
|
||||||
@@ -74,6 +73,7 @@ pub fn wrap_menu(menu: impl Scene) -> impl Scene {
|
|||||||
|
|
||||||
pub fn despawn_menu(
|
pub fn despawn_menu(
|
||||||
existing_menu: Option<Single<Entity, With<MenuMarker>>>,
|
existing_menu: Option<Single<Entity, With<MenuMarker>>>,
|
||||||
|
existing_menu_camera: Option<Single<Entity, With<MenuCameraMarker>>>,
|
||||||
mut commands: Commands,
|
mut commands: Commands,
|
||||||
) {
|
) {
|
||||||
if let Some(entity) = existing_menu {
|
if let Some(entity) = existing_menu {
|
||||||
@@ -82,6 +82,9 @@ pub fn despawn_menu(
|
|||||||
.despawn();
|
.despawn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(menu_cam) = existing_menu_camera {
|
||||||
|
commands.entity(*menu_cam).despawn();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn spawn_menu(
|
pub fn spawn_menu(
|
||||||
|
|||||||
Reference in New Issue
Block a user