Welcome menu
This commit is contained in:
parent
ae154195b5
commit
516150f9c5
@ -1,18 +1,6 @@
|
||||
{
|
||||
"help_expr": [
|
||||
"- sqrt(x): square root of x",
|
||||
"- abs(x): absolute value of x",
|
||||
"- ln(x): log with base e",
|
||||
"- log10(x): base 10 logarithm of x",
|
||||
"- log(x): same as log10(x)",
|
||||
"- sin(x): Sine of x",
|
||||
"- cos(x): Cosine of x",
|
||||
"- tan(x): Tangent of x",
|
||||
"- asin(x): arcsine of x",
|
||||
"- acos(x): arccosine of x",
|
||||
"- atan(x): arctangent of x",
|
||||
"- atan2, sinh, cosh, tanh, asinh, acosh, atanh",
|
||||
"- floor, ceil, round, signum"
|
||||
"abs, signum, sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, floor, round, ceil, trunc, fract, exp, sqrt, cbrt, ln, log2, log10"
|
||||
],
|
||||
"help_vars": [
|
||||
"- Euler's number is supported via 'e' or 'E'",
|
||||
@ -34,5 +22,9 @@
|
||||
"- Extrema (local minimums and maximums) and Roots (intersections with the x-axis) are displayed though yellow and light blue points on the graph. You can toggle these in the Side Panel.",
|
||||
"- In some edge cases, math functions may not parse correctly. More specifically with implicit multiplication. If you incounter this issue, please do report it on the project's Github page (linked on the side panel). But a current workaround would be explicitly stating a multiplication operation through the use of an asterisk."
|
||||
],
|
||||
"license_info": "The AGPL license ensures that the end user, even if not hosting the program itself, is still guaranteed access to the source code of the project in question."
|
||||
"license_info": "The AGPL license ensures that the end user, even if not hosting the program itself, is still guaranteed access to the source code of the project in question.",
|
||||
"welcome": [
|
||||
"Welcome to the (Yet-to-be-named) Graphing Software!",
|
||||
"This project aims to provide an intuitive experience graphing mathematical functions with features such as Integration, differentiation, extrema, roots, and much more! (see Help menu for more details)"
|
||||
]
|
||||
}
|
||||
|
||||
@ -7,8 +7,8 @@ use egui::{
|
||||
FontFamily, Key, RichText, SidePanel, Slider, TopBottomPanel, Vec2, Visuals, Window,
|
||||
};
|
||||
use instant::Duration;
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
use std::{collections::BTreeSet, io::Read, ops::BitXorAssign, str};
|
||||
use std::collections::BTreeMap;
|
||||
use std::{io::Read, ops::BitXorAssign, str};
|
||||
|
||||
#[cfg(threading)]
|
||||
use rayon::iter::{IndexedParallelIterator, ParallelIterator};
|
||||
@ -24,6 +24,7 @@ struct Assets {
|
||||
pub text_help_panel: String,
|
||||
pub text_help_function: String,
|
||||
pub text_help_other: String,
|
||||
pub text_welcome: String,
|
||||
|
||||
// Explanation of license
|
||||
pub text_license_info: String,
|
||||
@ -39,6 +40,7 @@ impl Assets {
|
||||
text_help_function: json.help_function,
|
||||
text_help_other: json.help_other,
|
||||
text_license_info: json.license_info,
|
||||
text_welcome: json.welcome_text,
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,6 +53,7 @@ impl Assets {
|
||||
help_function: self.text_help_function.clone(),
|
||||
help_other: self.text_help_other.clone(),
|
||||
license_info: self.text_license_info.clone(),
|
||||
welcome_text: self.text_welcome.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -276,14 +279,16 @@ struct Opened {
|
||||
pub help: bool,
|
||||
pub info: bool,
|
||||
pub side_panel: bool,
|
||||
pub welcome: bool,
|
||||
}
|
||||
|
||||
impl Default for Opened {
|
||||
fn default() -> Opened {
|
||||
Self {
|
||||
help: true,
|
||||
info: true,
|
||||
info: false,
|
||||
side_panel: true,
|
||||
welcome: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -560,6 +565,8 @@ impl epi::App for MathApp {
|
||||
false => Visuals::light(),
|
||||
});
|
||||
|
||||
let center_pos = ctx.available_rect().center();
|
||||
|
||||
// if text boxes aren't in focus, allow H keybind to toggle side panel.
|
||||
// this is behind this check as if it wasn't, it would trigger if the user
|
||||
// presses the h key in a text box as well
|
||||
@ -668,6 +675,16 @@ impl epi::App for MathApp {
|
||||
});
|
||||
});
|
||||
|
||||
// Window with information about the build and current commit
|
||||
Window::new("Welcome!")
|
||||
.default_pos(center_pos)
|
||||
.open(&mut self.opened.welcome)
|
||||
.resizable(false)
|
||||
.collapsible(false)
|
||||
.show(ctx, |ui| {
|
||||
ui.label(&*ASSETS.text_welcome);
|
||||
});
|
||||
|
||||
// Window with information about the build and current commit
|
||||
Window::new("Info")
|
||||
.default_pos([200.0, 200.0])
|
||||
|
||||
@ -194,6 +194,7 @@ pub struct JsonFileOutput {
|
||||
pub help_function: String,
|
||||
pub help_other: String,
|
||||
pub license_info: String,
|
||||
pub welcome_text: String,
|
||||
}
|
||||
|
||||
/// Helps parsing text data from `text.json`
|
||||
@ -232,6 +233,7 @@ impl SerdeValueHelper {
|
||||
help_function: self.parse_multiline("help_function"),
|
||||
help_other: self.parse_multiline("help_other"),
|
||||
license_info: self.parse_singleline("license_info"),
|
||||
welcome_text: self.parse_multiline("welcome"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user