Skip to content

Commit 0f2c4af

Browse files
authored
first prerelease
2 parents be1c7f8 + 737c569 commit 0f2c4af

File tree

11 files changed

+621
-10
lines changed

11 files changed

+621
-10
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "eframe_template"
2+
name = "godot_scons_gui"
33
version = "0.1.0"
44
edition = "2021"
55

@@ -11,3 +11,6 @@ panic = "abort"
1111

1212
[dependencies]
1313
eframe = { version = "0.28.1", default-features = false, features = ["glow", "default_fonts"] }
14+
serde = { version = "1.0", features = ["derive"] }
15+
indexmap = "2.5.0"
16+
rfd = "0.14.1"

src/app.rs

Lines changed: 70 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,81 @@
1+
use crate::views::*;
12
use eframe::egui;
3+
use egui::Color32;
24

35
#[derive(Default)]
4-
pub struct TemplateApp {}
6+
pub struct GodotSconsGUI {
7+
state: AppState,
8+
}
9+
10+
#[derive(Debug)]
11+
pub enum AppState {
12+
Start(StartState),
13+
Clone(CloneState),
14+
Setup(SetupState),
15+
Build(BuildState),
16+
}
17+
18+
19+
impl AppState {
20+
pub fn start() -> Self {
21+
AppState::Start(Default::default())
22+
}
23+
pub fn clone() -> Self {
24+
AppState::Clone(Default::default())
25+
}
26+
pub fn setup() -> Self {
27+
AppState::Setup(Default::default())
28+
}
29+
pub fn build() -> Self {
30+
AppState::Build(Default::default())
31+
}
32+
}
533

6-
impl TemplateApp {
7-
pub fn new(_cc: &eframe::CreationContext<'_>) -> Self {
34+
impl Default for AppState {
35+
fn default() -> Self {
36+
Self::Start(Default::default())
37+
}
38+
}
39+
40+
41+
impl GodotSconsGUI {
42+
pub fn new(cc: &eframe::CreationContext) -> Self {
43+
cc.egui_ctx.style_mut(|style| {
44+
style.visuals.override_text_color = Some(Color32::from_rgb(170, 170, 170));
45+
});
846
Default::default()
947
}
1048
}
1149

12-
impl eframe::App for TemplateApp {
50+
impl eframe::App for GodotSconsGUI {
1351
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
14-
egui::CentralPanel::default().show(ctx, |ui| {
15-
ui.heading("Hello, World!");
16-
});
52+
#[cfg(debug_assertions)] {
53+
egui::TopBottomPanel::bottom("debug").show(ctx, |ui| {
54+
ui.label(format!("{:?}", &self.state));
55+
56+
ui.horizontal(|ui| {
57+
if let Some(s) = {
58+
let mut s = None;
59+
if ui.button("Start").clicked() { s = Some(AppState::start()); }
60+
if ui.button("Clone").clicked() { s = Some(AppState::clone()); }
61+
if ui.button("Setup").clicked() { s = Some(AppState::setup()); }
62+
if ui.button("Build").clicked() { s = Some(AppState::build()); }
63+
s
64+
} { self.state = s; }
65+
});
66+
});
67+
}
68+
69+
let new_state = match &mut self.state {
70+
AppState::Start(state) => start::show(state, ctx),
71+
AppState::Clone(state) => clone::show(state, ctx),
72+
AppState::Setup(state) => setup::show(state, ctx),
73+
AppState::Build(state) => build::show(state, ctx),
74+
};
75+
76+
if let Some(s) = new_state {
77+
#[cfg(debug_assertions)] println!("Transitioning to {s:?}");
78+
self.state = s;
79+
}
1780
}
1881
}

src/main.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
22

33
mod app;
4+
mod options;
5+
mod views;
6+
47
use eframe::egui;
8+
use indexmap::IndexMap;
9+
510

611
fn main() -> eframe::Result {
712
let native_options = eframe::NativeOptions {
@@ -11,8 +16,23 @@ fn main() -> eframe::Result {
1116
..Default::default()
1217
};
1318
eframe::run_native(
14-
"eframe template",
19+
"godot-scons-gui",
1520
native_options,
16-
Box::new(|cc| Ok(Box::new(app::TemplateApp::new(cc)))),
21+
Box::new(|cc| Ok(Box::new(app::GodotSconsGUI::new(cc)))),
1722
)
1823
}
24+
25+
#[derive(Debug, Default)]
26+
struct Options {
27+
pub options: IndexMap<String, OptionDetail>,
28+
// todo: categories
29+
}
30+
31+
#[derive(Debug, Default)]
32+
struct OptionDetail {
33+
pub description: String,
34+
pub values: Vec<String>,
35+
pub default: Option<String>,
36+
pub actual: Option<String>,
37+
pub aliases: Vec<String>,
38+
}

src/options.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

src/options.toml

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
[options.platform]
2+
description = "Target platform"
3+
values = ["windows"]
4+
default = ""
5+
6+
[options.target]
7+
description = "Compilation target"
8+
values = ["editor", "template_release", "template_debug"]
9+
default = "editor"
10+
11+
[options.arch]
12+
description = "CPU architecture"
13+
values = ["auto", "x86_32", "x86_64", "arm32", "arm64", "rv64", "ppc32", "ppc64", "wasm32"]
14+
default = "auto"
15+
16+
[options.dev_build]
17+
description = "Developer build"
18+
values = ["yes", "no"]
19+
default = "no"
20+
21+
[options.optimize]
22+
description = "Optimization level"
23+
values = ["none", "custom", "debug", "speed", "speed_trace", "size"]
24+
default = "speed_trace"
25+
26+
[options.debug_symbols]
27+
description = "Build with debugging symbols"
28+
values = ["yes", "no"]
29+
default = "no"
30+
31+
[options.separate_debug_symbols]
32+
description = "Extract debugging symbols to a separate file"
33+
values = ["yes", "no"]
34+
default = "no"
35+
36+
[options.lto]
37+
description = "Link-time optimization"
38+
values = ["none", "auto", "thin", "full"]
39+
default = "none"
40+
41+
[options.production]
42+
description = "Set defaults to build Godot for use in production"
43+
values = ["yes", "no"]
44+
default = "no"
45+
46+
[options.deprecated]
47+
description = "Enable compatibility code for deprecated and removed options"
48+
values = ["yes", "no"]
49+
default = "yes"
50+
51+
[options.precision]
52+
description = "Set the floating-point precision level"
53+
values = ["single", "double"]
54+
default = "single"
55+
56+
[options.minizip]
57+
description = "Enable ZIP archive support using minizip"
58+
values = ["yes", "no"]
59+
default = "yes"
60+
61+
[options.brotli]
62+
description = "Enable Brotli for decompresson and WOFF2 fonts support"
63+
values = ["yes", "no"]
64+
default = "yes"
65+
66+
[options.xaudio2]
67+
description = "Enable the XAudio2 audio driver"
68+
values = ["yes", "no"]
69+
default = "no"
70+
71+
[options.vulkan]
72+
description = "Enable the vulkan rendering driver"
73+
values = ["yes", "no"]
74+
default = "yes"
75+
76+
[options.opengl3]
77+
description = "Enable the OpenGL/GLES3 rendering driver"
78+
values = ["yes", "no"]
79+
default = "yes"
80+
81+
[options.openxr]
82+
description = "Enable the OpenXR driver"
83+
values = ["yes", "no"]
84+
default = "yes"
85+
86+
[options.use_volk]
87+
description = "Use the volk library to load the Vulkan loader dynamically"
88+
values = ["yes", "no"]
89+
default = "yes"
90+
91+
[options.disable_exceptions]
92+
description = "Force disabling exception handling code"
93+
values = ["yes", "no"]
94+
default = "yes"
95+
96+
[options.custom_modules]
97+
description = "A list of comma-separated directory paths containing custom modules to build."
98+
values = []
99+
default = ""
100+
101+
[options.custom_modules_recursive]
102+
description = "Detect custom modules recursively for each specified path."
103+
values = ["yes", "no"]
104+
default = "yes"
105+
106+
[options.dev_mode]
107+
description = "Alias for dev options: verbose=yes warnings=extra werror=yes tests=yes"
108+
values = ["yes", "no"]
109+
default = "no"
110+
111+
[options.tests]
112+
description = "Build the unit tests"
113+
values = ["yes", "no"]
114+
default = "no"
115+
116+
[options.fast_unsafe]
117+
description = "Enable unsafe options for faster rebuilds"
118+
values = ["yes", "no"]
119+
default = "no"
120+
121+
[options.compiledb]
122+
description = "Generate compilation DB (`compile_commands.json`) for external tools"
123+
values = ["yes", "no"]
124+
default = "no"
125+
126+
[options.verbose]
127+
description = "Enable verbose output for the compilation"
128+
values = ["yes", "no"]
129+
default = "no"
130+
131+
[options.progress]
132+
description = "Show a progress indicator during compilation"
133+
values = ["yes", "no"]
134+
default = "yes"
135+
136+
[options.warnings]
137+
description = "Level of compilation warnings"
138+
values = ["extra", "all", "moderate", "no"]
139+
default = "all"
140+
141+
[options.werror]
142+
description = "Treat compiler warnings as errors"
143+
values = ["yes", "no"]
144+
default = "no"
145+
146+
[options.extra_suffix]
147+
description = "Custom extra suffix added to the base filename of all generated binary files"
148+
values = []
149+
default = ""
150+
151+
[options.vsproj]
152+
description = "Generate a Visual Studio solution"
153+
values = ["yes", "no"]
154+
default = "no"
155+
156+
[options.vsproj_name]
157+
description = "Name of the Visual Studio solution"
158+
values = []
159+
default = "godot"
160+
161+
[options.disable_3d]
162+
description = "Disable 3D nodes for a smaller executable"
163+
values = ["yes", "no"]
164+
default = "no"
165+
166+
[options.disable_advanced_gui]
167+
description = "Disable advanced GUI nodes and behaviors"
168+
values = ["yes", "no"]
169+
default = "no"
170+
171+
[options.build_profile]
172+
description = "Path to a file containing a feature build profile"
173+
values = []
174+
default = ""
175+
176+
[options.modules_enabled_by_default]
177+
description = "If no, disable all modules except ones explicitly enabled"
178+
values = ["yes", "no"]
179+
default = "yes"
180+
181+
[options.no_editor_splash]
182+
description = "Don't use the custom splash screen for the editor"
183+
values = ["yes", "no"]
184+
default = "yes"
185+
186+
[options.system_certs_path]
187+
description = "Use this path as TLS certificates default for editor and Linux/BSD export templates (for package maintainers)"
188+
values = []
189+
default = ""
190+
191+
[options.use_precise_math_checks]
192+
description = "Math checks use very precise epsilon (debug option)"
193+
values = ["yes", "no"]
194+
default = "no"
195+
196+
[options.scu_build]
197+
description = "Use single compilation unit build"
198+
values = ["yes", "no"]
199+
default = "no"
200+
201+
[options.scu_limit]
202+
description = "Max includes per SCU file when using scu_build (determines RAM use)"
203+
values = []
204+
default = "0"

src/views.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pub mod start;
2+
pub mod clone;
3+
pub mod setup;
4+
pub mod build;
5+
6+
pub use build::BuildState;
7+
pub use clone::CloneState;
8+
pub use setup::SetupState;
9+
pub use start::StartState;
10+
11+
use crate::app::AppState;
12+
use eframe::egui;
13+
use egui::{Align, Button, Color32, Context, Frame, Label, Layout, Stroke, TextEdit, Vec2};
14+
use egui::{CentralPanel, ScrollArea, TopBottomPanel};

src/views/build.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
use super::*;
2+
3+
#[derive(Debug, Default)]
4+
pub struct BuildState {
5+
pub path: String,
6+
}
7+
8+
pub fn show(state: &mut BuildState, ctx: &Context) -> Option<AppState> {
9+
CentralPanel::default().show(ctx, |_ui| {});
10+
None
11+
}

0 commit comments

Comments
 (0)