add Camera to menu
This commit is contained in:
parent
9c148a5a7c
commit
60d3198e41
14
src/menu.rs
14
src/menu.rs
|
@ -47,6 +47,7 @@ pub const MENUDEF: &[(&str, MenuAction)] = &[
|
||||||
("", MenuAction::ToggleAR),
|
("", MenuAction::ToggleAR),
|
||||||
("", MenuAction::ToggleSound),
|
("", MenuAction::ToggleSound),
|
||||||
("", MenuAction::ToggleMusic),
|
("", MenuAction::ToggleMusic),
|
||||||
|
("", MenuAction::ToggleCamera),
|
||||||
("Toggle Fullscreen [F11]", MenuAction::ToggleFullscreen),
|
("Toggle Fullscreen [F11]", MenuAction::ToggleFullscreen),
|
||||||
("", MenuAction::ToggleShadows),
|
("", MenuAction::ToggleShadows),
|
||||||
("Restart Game", MenuAction::Restart),
|
("Restart Game", MenuAction::Restart),
|
||||||
|
@ -59,6 +60,7 @@ pub enum MenuAction {
|
||||||
ToggleAR,
|
ToggleAR,
|
||||||
ToggleSound,
|
ToggleSound,
|
||||||
ToggleMusic,
|
ToggleMusic,
|
||||||
|
ToggleCamera,
|
||||||
ToggleFullscreen,
|
ToggleFullscreen,
|
||||||
ToggleShadows,
|
ToggleShadows,
|
||||||
Restart,
|
Restart,
|
||||||
|
@ -283,6 +285,14 @@ pub fn update_menu(
|
||||||
let onoff = bool2string(settings.map_active);
|
let onoff = bool2string(settings.map_active);
|
||||||
text.sections[i].value = format!("Map: {onoff} [M]\n");
|
text.sections[i].value = format!("Map: {onoff} [M]\n");
|
||||||
}
|
}
|
||||||
|
MenuAction::ToggleCamera => {
|
||||||
|
let onoff = if settings.third_person {
|
||||||
|
"3rd Person"
|
||||||
|
} else {
|
||||||
|
"1st Person"
|
||||||
|
};
|
||||||
|
text.sections[i].value = format!("Camera: {onoff} [C]\n");
|
||||||
|
}
|
||||||
MenuAction::ToggleShadows => {
|
MenuAction::ToggleShadows => {
|
||||||
let onoff = if settings.shadows_sun {
|
let onoff = if settings.shadows_sun {
|
||||||
"Flashlight + Sun"
|
"Flashlight + Sun"
|
||||||
|
@ -353,6 +363,10 @@ pub fn handle_input(
|
||||||
ew_game.send(GameEvent::SetSound(Toggle));
|
ew_game.send(GameEvent::SetSound(Toggle));
|
||||||
ew_updatemenu.send(UpdateMenuEvent);
|
ew_updatemenu.send(UpdateMenuEvent);
|
||||||
},
|
},
|
||||||
|
MenuAction::ToggleCamera => {
|
||||||
|
ew_game.send(GameEvent::SetThirdPerson(Toggle));
|
||||||
|
ew_updatemenu.send(UpdateMenuEvent);
|
||||||
|
},
|
||||||
MenuAction::ToggleFullscreen => {
|
MenuAction::ToggleFullscreen => {
|
||||||
ew_game.send(GameEvent::SetFullscreen(Toggle));
|
ew_game.send(GameEvent::SetFullscreen(Toggle));
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue