separate build profile for project manager + minor improvements

- hide console on windows
- embedded font in the binary
This commit is contained in:
Dmitry Stepanov
2024-12-08 11:50:20 +03:00
parent 07b0556b6a
commit 4a7a434ea2
2 changed files with 26 additions and 11 deletions
+16 -5
View File
@@ -7,16 +7,19 @@ members = [
"fyrox-resource",
"fyrox-scripts",
"fyrox-animation",
"editor",
"editor",
"editor-standalone",
"template-core",
"template",
"template-core",
"template",
"fyrox-graph",
"fyrox-math",
"fyrox-dylib",
"fyrox",
"fyrox-impl"
, "project-manager", "fyrox-graphics", "fyrox-build-tools"]
"fyrox-impl",
"project-manager",
"fyrox-graphics",
"fyrox-build-tools"
]
resolver = "2"
[profile.dev]
@@ -26,6 +29,14 @@ opt-level = 0
opt-level = 3
debug = true
[profile.project-manager]
inherits = "release"
opt-level = "z"
debug = false
strip = true
panic = "abort"
lto = true
[profile.github-ci]
inherits = "dev"
strip = "symbols"
+10 -6
View File
@@ -20,6 +20,8 @@
//! Project manager is used to create, import, rename, delete, run and edit projects built with Fyrox.
#![cfg_attr(target_os = "windows", windows_subsystem = "windows")]
mod build;
mod manager;
mod project;
@@ -27,9 +29,8 @@ mod settings;
mod utils;
use crate::{manager::ProjectManager, utils::make_button};
use fyrox::utils::translate_cursor_icon;
use fyrox::{
asset::manager::ResourceManager,
asset::{manager::ResourceManager, untyped::ResourceKind},
core::{
algebra::Matrix3,
instant::Instant,
@@ -42,11 +43,12 @@ use fyrox::{
},
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
gui::font::FontResource,
gui::{
constructor::new_widget_constructor_container, font::Font, message::MessageDirection,
widget::WidgetMessage, UserInterface,
},
utils::translate_event,
utils::{translate_cursor_icon, translate_event},
window::WindowAttributes,
};
use std::sync::Arc;
@@ -82,9 +84,11 @@ fn main() {
.unwrap();
let primary_ui = engine.user_interfaces.first_mut();
primary_ui.default_font = engine
.resource_manager
.request::<Font>("resources/arial.ttf");
primary_ui.default_font = FontResource::new_ok(
ResourceKind::Embedded,
Font::from_memory(include_bytes!("../resources/arial.ttf").to_vec(), 1024).unwrap(),
);
let mut project_manager = ProjectManager::new(&mut primary_ui.build_ctx());
let event_loop = EventLoop::new().unwrap();