Compare commits
No commits in common. "55c86b22efdfb09ee70d742c3cd3a1c783139cf1" and "0eee56f66c6e672b524b7521ee17dd5cc41fa71e" have entirely different histories.
55c86b22ef
...
0eee56f66c
6 changed files with 33 additions and 6 deletions
17
src/MiniEditorPlugin.rs
Normal file
17
src/MiniEditorPlugin.rs
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#[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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,3 +0,0 @@
|
||||||
pub mod scrambling_text;
|
|
||||||
pub mod manager;
|
|
||||||
pub mod config;
|
|
|
@ -85,7 +85,7 @@ impl INode for Config {
|
||||||
self.resolution_scale = config.get_value(GString::from("graphics"), GString::from("resolution_scale")).to::<f32>();
|
self.resolution_scale = config.get_value(GString::from("graphics"), GString::from("resolution_scale")).to::<f32>();
|
||||||
}
|
}
|
||||||
if !editor_hint {
|
if !editor_hint {
|
||||||
// THIS CHECK IS VERY IMPORTANT!!! I don't want to screw my godot up again by resizing the editor and moving it out of bounds..
|
// THIS CHECK IS VERY IMPORTANT!!! I don't want to fuck my godot up again by resizing the editor and moving it out of bounds..
|
||||||
Self::apply_video_settings(self);
|
Self::apply_video_settings(self);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,8 +1,9 @@
|
||||||
use godot::{init::EditorRunBehavior, prelude::*};
|
use godot::{init::EditorRunBehavior, prelude::*};
|
||||||
|
|
||||||
struct MDT;
|
struct MDT;
|
||||||
|
mod scrambling_text;
|
||||||
mod classes;
|
mod config;
|
||||||
|
mod manager;
|
||||||
|
|
||||||
#[gdextension]
|
#[gdextension]
|
||||||
unsafe impl ExtensionLibrary for MDT {
|
unsafe impl ExtensionLibrary for MDT {
|
||||||
|
|
|
@ -57,6 +57,7 @@ impl Manager {
|
||||||
let editor_hint = Engine::singleton().is_editor_hint();
|
let editor_hint = Engine::singleton().is_editor_hint();
|
||||||
if !editor_hint {
|
if !editor_hint {
|
||||||
let bgm = self.bgm.clone();
|
let bgm = self.bgm.clone();
|
||||||
|
godot_print!(" Hello world fj");
|
||||||
let mut stream: Gd<AudioStreamOggVorbis> = load(bgm);
|
let mut stream: Gd<AudioStreamOggVorbis> = load(bgm);
|
||||||
stream.set_loop(false);
|
stream.set_loop(false);
|
||||||
let mut player = AudioStreamPlayer::new_alloc();
|
let mut player = AudioStreamPlayer::new_alloc();
|
|
@ -20,6 +20,7 @@ struct ScramblingText {
|
||||||
time_since_scramble: f64, //[DOC] This is the variable used for measuring time since the letters have been scrambled
|
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
|
time_since_step: f64, //[DOC] This is the variable used for measuring time since the amount of static letters was changed
|
||||||
step_iterator: i32,
|
step_iterator: i32,
|
||||||
|
editor_hint: bool,
|
||||||
base: Base<Label>
|
base: Base<Label>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,12 +45,14 @@ impl ILabel for ScramblingText {
|
||||||
step_iterator: 0, //[DOC] This is the iterator used for changing which letters to scramble
|
step_iterator: 0, //[DOC] This is the iterator used for changing which letters to scramble
|
||||||
time_since_scramble: 0.0,
|
time_since_scramble: 0.0,
|
||||||
time_since_step: 0.0,
|
time_since_step: 0.0,
|
||||||
|
editor_hint: editor_hint,
|
||||||
base
|
base
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_property(&mut self, property: StringName, value: Variant) -> bool {
|
fn set_property(&mut self, property: StringName, value: Variant) -> bool {
|
||||||
|
// godot_print!("{:?}, {:?}", property, value);
|
||||||
if property == StringName::from("scrambling") {
|
if property == StringName::from("scrambling") {
|
||||||
let boolean_value = value.booleanize();
|
let boolean_value = value.booleanize();
|
||||||
let original_text = self.original_text.clone();
|
let original_text = self.original_text.clone();
|
||||||
|
@ -74,6 +77,8 @@ impl ILabel for ScramblingText {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Self::set_text(self, GString::from(self.original_text.clone().unwrap()))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn enter_tree(&mut self) {
|
fn enter_tree(&mut self) {
|
||||||
|
@ -81,16 +86,22 @@ impl ILabel for ScramblingText {
|
||||||
self.original_text = Some(text.to_string());
|
self.original_text = Some(text.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//TODO: THIS IS RETARDED:::::: PLEASE FIX BRUHHH
|
||||||
|
|
||||||
fn process(&mut self, delta: f64) {
|
fn process(&mut self, delta: f64) {
|
||||||
if self.scrambling {
|
if self.scrambling {
|
||||||
let original_text = self.original_text.clone().unwrap();
|
let original_text = self.original_text.clone().unwrap();
|
||||||
let duration = self.duration;
|
let duration = self.duration;
|
||||||
let speed = self.speed;
|
let speed = self.speed;
|
||||||
|
|
||||||
|
// godot_print!("{}", Engine::singleton().is_editor_hint());
|
||||||
|
|
||||||
self.time_since_scramble += delta;
|
self.time_since_scramble += delta;
|
||||||
self.time_since_step += delta;
|
self.time_since_step += delta;
|
||||||
|
|
||||||
if !self.infinite && self.time_since_step >= duration {
|
if !self.infinite && self.time_since_step >= duration {
|
||||||
|
godot_print!("{}", original_text);
|
||||||
self.time_since_step = 0.0;
|
self.time_since_step = 0.0;
|
||||||
self.step_iterator += 1;
|
self.step_iterator += 1;
|
||||||
}
|
}
|
Loading…
Reference in a new issue