Refactor and clean up code
This commit is contained in:
parent
fdebd1c9c5
commit
55c86b22ef
6 changed files with 5 additions and 25 deletions
|
@ -1,17 +0,0 @@
|
|||
#[derive(GodotClass)]
|
||||
#[class(tool, init, editor_plugin, base=EditorPlugin)]
|
||||
|
||||
struct MiniEditorPlugin {
|
||||
base: Base<EditorPlugin>,
|
||||
}
|
||||
|
||||
#[godot_api]
|
||||
impl IEditorPlugin for MiniEditorPlugin {
|
||||
fn enter_tree(&mut self) {
|
||||
|
||||
}
|
||||
|
||||
fn exit_tree(&mut self) {
|
||||
|
||||
}
|
||||
}
|
|
@ -57,7 +57,6 @@ impl Manager {
|
|||
let editor_hint = Engine::singleton().is_editor_hint();
|
||||
if !editor_hint {
|
||||
let bgm = self.bgm.clone();
|
||||
godot_print!(" Hello world fj");
|
||||
let mut stream: Gd<AudioStreamOggVorbis> = load(bgm);
|
||||
stream.set_loop(false);
|
||||
let mut player = AudioStreamPlayer::new_alloc();
|
3
src/classes/mod.rs
Normal file
3
src/classes/mod.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
pub mod scrambling_text;
|
||||
pub mod manager;
|
||||
pub mod config;
|
|
@ -20,7 +20,6 @@ struct ScramblingText {
|
|||
time_since_scramble: f64, //[DOC] This is the variable used for measuring time since the letters have been scrambled
|
||||
time_since_step: f64, //[DOC] This is the variable used for measuring time since the amount of static letters was changed
|
||||
step_iterator: i32,
|
||||
editor_hint: bool,
|
||||
base: Base<Label>
|
||||
}
|
||||
|
||||
|
@ -45,14 +44,12 @@ impl ILabel for ScramblingText {
|
|||
step_iterator: 0, //[DOC] This is the iterator used for changing which letters to scramble
|
||||
time_since_scramble: 0.0,
|
||||
time_since_step: 0.0,
|
||||
editor_hint: editor_hint,
|
||||
base
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fn set_property(&mut self, property: StringName, value: Variant) -> bool {
|
||||
// godot_print!("{:?}, {:?}", property, value);
|
||||
if property == StringName::from("scrambling") {
|
||||
let boolean_value = value.booleanize();
|
||||
let original_text = self.original_text.clone();
|
||||
|
@ -94,7 +91,6 @@ impl ILabel for ScramblingText {
|
|||
self.time_since_step += delta;
|
||||
|
||||
if !self.infinite && self.time_since_step >= duration {
|
||||
godot_print!("{}", original_text);
|
||||
self.time_since_step = 0.0;
|
||||
self.step_iterator += 1;
|
||||
}
|
|
@ -1,9 +1,8 @@
|
|||
use godot::{init::EditorRunBehavior, prelude::*};
|
||||
|
||||
struct MDT;
|
||||
mod scrambling_text;
|
||||
mod config;
|
||||
mod manager;
|
||||
|
||||
mod classes;
|
||||
|
||||
#[gdextension]
|
||||
unsafe impl ExtensionLibrary for MDT {
|
||||
|
|
Loading…
Reference in a new issue