revert small windows cross compilation changes

main
Elijah Voigt 4 months ago
parent f7dfb346ae
commit e7557c67f2

@ -30,7 +30,6 @@ rustflags = [
"link-arg=-fuse-ld=mold"
]
# for Windows
[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"

@ -105,23 +105,44 @@ struct DialogBox;
/// Initialize the UI which consists soley of a dialog box (for now?)
fn init_ui(mut commands: Commands) {
commands.spawn((
DialogBox,
BackgroundColor(BLACK.with_alpha(0.9).into()),
Node {
align_self: AlignSelf::End,
justify_self: JustifySelf::Center,
width: Val::Percent(98.0),
max_height: Val::Percent(25.0),
align_items: AlignItems::Center,
margin: UiRect::all(Val::Percent(1.0)),
padding: UiRect::all(Val::Percent(1.0)),
flex_direction: FlexDirection::Column,
// Scroll on the Y axis
overflow: Overflow::scroll_y(),
..default()
},
));
commands
.spawn((
DialogBox,
BackgroundColor(BLACK.with_alpha(0.9).into()),
Node {
align_self: AlignSelf::End,
justify_self: JustifySelf::Center,
width: Val::Percent(98.0),
max_height: Val::Percent(25.0),
align_items: AlignItems::Center,
margin: UiRect::all(Val::Percent(1.0)),
padding: UiRect::all(Val::Percent(1.0)),
flex_direction: FlexDirection::Column,
// Scroll on the Y axis
overflow: Overflow::scroll_y(),
..default()
},
))
.observe(hover_dialog_box_over)
.observe(hover_dialog_box_out);
}
fn hover_dialog_box_over(
trigger: Trigger<Pointer<Over>>,
mut query: Query<&mut BackgroundColor, With<DialogBox>>,
) {
if let Ok(mut bg) = query.get_mut(trigger.target()) {
bg.0.set_alpha(0.95);
}
}
fn hover_dialog_box_out(
trigger: Trigger<Pointer<Out>>,
mut query: Query<&mut BackgroundColor, With<DialogBox>>,
) {
if let Ok(mut bg) = query.get_mut(trigger.target()) {
bg.0.set_alpha(0.9);
}
}
/// On startup move the camera to a suitable position
@ -226,17 +247,15 @@ fn choose_dialog_option(
fn hover_dialog_option_over(
trigger: Trigger<Pointer<Over>>,
mut query: Query<&mut TextColor>,
mut query: Query<(&mut TextColor, &mut BackgroundColor)>,
) {
if let Ok(mut tc) = query.get_mut(trigger.target()) {
if let Ok((mut tc, mut bg)) = query.get_mut(trigger.target()) {
*tc = TextColor(DARK_ORANGE.into());
bg.set_alpha(1.0);
}
}
fn hover_dialog_option_out(
trigger: Trigger<Pointer<Out>>,
mut query: Query<&mut TextColor>,
) {
fn hover_dialog_option_out(trigger: Trigger<Pointer<Out>>, mut query: Query<&mut TextColor>) {
if let Ok(mut tc) = query.get_mut(trigger.target()) {
*tc = TextColor(ORANGE.into());
}

Loading…
Cancel
Save