Struct map_gui::SimpleAppArgs
source · pub struct SimpleAppArgs {
pub map_path: Option<String>,
pub cam: Option<String>,
pub dev: bool,
pub color_scheme: Option<ColorSchemeChoice>,
pub minimal_controls: bool,
pub scale_factor: Option<f64>,
}
Fields§
§map_path: Option<String>
Path to a map to initially load. If not provided, load the last map used or a fixed default.
cam: Option<String>
Initially position the camera here. The format is an OSM-style zoom/lat/lon
string
(https://wiki.openstreetmap.org/wiki/Browsing#Other_URL_tricks).
dev: bool
Dev mode exposes experimental tools useful for debugging, but that’d likely confuse most players.
color_scheme: Option<ColorSchemeChoice>
The color scheme for map elements, agents, and the UI.
minimal_controls: bool
When making a screen recording, enable this option to hide some UI elements
scale_factor: Option<f64>
Override the monitor’s auto-detected scale factor
Implementations§
source§impl SimpleAppArgs
impl SimpleAppArgs
sourcepub fn override_options(&self, opts: &mut Options)
pub fn override_options(&self, opts: &mut Options)
Options are passed in by each app, usually seeded with defaults or from a config file. For the few options that we allow to be specified by command-line, overwrite the values.
pub fn update_widgetry_settings(&self, settings: Settings) -> Settings
pub fn map_name(&self) -> MapName
Trait Implementations§
source§impl StructOpt for SimpleAppArgs
impl StructOpt for SimpleAppArgs
source§fn from_clap(matches: &ArgMatches<'_>) -> Self
fn from_clap(matches: &ArgMatches<'_>) -> Self
Builds the struct from
clap::ArgMatches
. It’s guaranteed to succeed
if matches
originates from an App
generated by [StructOpt::clap
] called on
the same type, otherwise it must panic.§fn from_args() -> Selfwhere
Self: Sized,
fn from_args() -> Selfwhere
Self: Sized,
Builds the struct from the command line arguments (
std::env::args_os
).
Calls clap::Error::exit
on failure, printing the error message and aborting the program.§fn from_args_safe() -> Result<Self, Error>where
Self: Sized,
fn from_args_safe() -> Result<Self, Error>where
Self: Sized,
Builds the struct from the command line arguments (
std::env::args_os
).
Unlike [StructOpt::from_args
], returns clap::Error
on failure instead of aborting the program,
so calling .exit
is up to you.§fn from_iter<I>(iter: I) -> Self
fn from_iter<I>(iter: I) -> Self
Gets the struct from any iterator such as a
Vec
of your making.
Print the error message and quit the program in case of failure. Read more§fn from_iter_safe<I>(iter: I) -> Result<Self, Error>
fn from_iter_safe<I>(iter: I) -> Result<Self, Error>
Gets the struct from any iterator such as a
Vec
of your making. Read moreAuto Trait Implementations§
impl Freeze for SimpleAppArgs
impl RefUnwindSafe for SimpleAppArgs
impl Send for SimpleAppArgs
impl Sync for SimpleAppArgs
impl Unpin for SimpleAppArgs
impl UnwindSafe for SimpleAppArgs
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.