Feat: no console in bg and plugin fix
This commit is contained in:
@@ -27,7 +27,7 @@ use cagire::model::{Dictionary, Rng, Variables};
|
|||||||
use cagire::theme;
|
use cagire::theme;
|
||||||
use cagire::views;
|
use cagire::views;
|
||||||
|
|
||||||
use cagire::input_egui::{convert_egui_events, convert_egui_mouse};
|
use cagire::input_egui::{convert_egui_events, convert_egui_mouse, EguiMouseState};
|
||||||
use crate::params::CagireParams;
|
use crate::params::CagireParams;
|
||||||
use crate::PluginBridge;
|
use crate::PluginBridge;
|
||||||
|
|
||||||
@@ -141,6 +141,7 @@ struct EditorState {
|
|||||||
last_frame: Instant,
|
last_frame: Instant,
|
||||||
current_font: FontChoice,
|
current_font: FontChoice,
|
||||||
zoom_factor: f32,
|
zoom_factor: f32,
|
||||||
|
egui_mouse: EguiMouseState,
|
||||||
}
|
}
|
||||||
|
|
||||||
// SAFETY: EditorState is only accessed from the GUI thread via RwLock.
|
// SAFETY: EditorState is only accessed from the GUI thread via RwLock.
|
||||||
@@ -210,6 +211,7 @@ pub fn create_editor(
|
|||||||
last_frame: Instant::now(),
|
last_frame: Instant::now(),
|
||||||
current_font: FontChoice::Size8x13,
|
current_font: FontChoice::Size8x13,
|
||||||
zoom_factor: 1.0,
|
zoom_factor: 1.0,
|
||||||
|
egui_mouse: EguiMouseState::default(),
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -248,7 +250,7 @@ pub fn create_editor(
|
|||||||
let term = editor.terminal.get_frame().area();
|
let term = editor.terminal.get_frame().area();
|
||||||
let widget_rect = ctx.content_rect();
|
let widget_rect = ctx.content_rect();
|
||||||
|
|
||||||
for mouse in convert_egui_mouse(ctx, widget_rect, term) {
|
for mouse in convert_egui_mouse(ctx, widget_rect, term, &mut editor.egui_mouse) {
|
||||||
let mut input_ctx = InputContext {
|
let mut input_ctx = InputContext {
|
||||||
app: &mut editor.app,
|
app: &mut editor.app,
|
||||||
link: &editor.link,
|
link: &editor.link,
|
||||||
|
|||||||
@@ -328,6 +328,11 @@ impl Plugin for CagirePlugin {
|
|||||||
AudioCommand::LoadSamples(samples) => {
|
AudioCommand::LoadSamples(samples) => {
|
||||||
engine.sample_index.extend(samples);
|
engine.sample_index.extend(samples);
|
||||||
}
|
}
|
||||||
|
AudioCommand::LoadSoundfont(path) => {
|
||||||
|
if let Err(e) = engine.load_soundfont(&path) {
|
||||||
|
eprintln!("Failed to load soundfont: {e}");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#![windows_subsystem = "windows"]
|
||||||
|
|
||||||
use std::sync::atomic::{AtomicBool, AtomicI64, AtomicU32, AtomicU64, Ordering};
|
use std::sync::atomic::{AtomicBool, AtomicI64, AtomicU32, AtomicU64, Ordering};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|||||||
Reference in New Issue
Block a user