Compare commits

..

No commits in common. "55c86b22efdfb09ee70d742c3cd3a1c783139cf1" and "0eee56f66c6e672b524b7521ee17dd5cc41fa71e" have entirely different histories.

6 changed files with 33 additions and 6 deletions

17
src/MiniEditorPlugin.rs Normal file
View 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) {
}
}

View file

@ -1,3 +0,0 @@
pub mod scrambling_text;
pub mod manager;
pub mod config;

View file

@ -85,7 +85,7 @@ impl INode for Config {
self.resolution_scale = config.get_value(GString::from("graphics"), GString::from("resolution_scale")).to::<f32>();
}
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);
}
}

View file

@ -1,8 +1,9 @@
use godot::{init::EditorRunBehavior, prelude::*};
struct MDT;
mod classes;
mod scrambling_text;
mod config;
mod manager;
#[gdextension]
unsafe impl ExtensionLibrary for MDT {

View file

@ -57,6 +57,7 @@ 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();

View file

@ -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_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>
}
@ -44,12 +45,14 @@ 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();
@ -73,6 +76,8 @@ impl ILabel for ScramblingText {
else {
return false
}
// Self::set_text(self, GString::from(self.original_text.clone().unwrap()))
}
@ -81,16 +86,22 @@ impl ILabel for ScramblingText {
self.original_text = Some(text.to_string());
}
//TODO: THIS IS RETARDED:::::: PLEASE FIX BRUHHH
fn process(&mut self, delta: f64) {
if self.scrambling {
let original_text = self.original_text.clone().unwrap();
let duration = self.duration;
let speed = self.speed;
// godot_print!("{}", Engine::singleton().is_editor_hint());
self.time_since_scramble += delta;
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;
}