Skip to content

Commit

Permalink
added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
marci1175 committed Jul 29, 2024
1 parent 684d97a commit 78f935e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build_info.matthias_build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024.07.29. 10:22
2024.07.29. 12:35
6 changes: 3 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ impl eframe::App for backend::Application {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
/* TODOS:
TODO: Migrate to latest egui https://github.com/emilk/egui/issues/4306
TODO: add notfications
TODO: add egui notfications
TODO: Restructure files
TODO: Api docs
TODO: Implement callbacks
TODO: Create nice ui for voice calls
*/
*/

//Set global lua table before everything
//Slows down app
Expand Down
10 changes: 10 additions & 0 deletions src/app/lua.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,27 @@ pub fn execute_code(lua: &Lua, code: String) -> anyhow::Result<()> {
Ok(())
}

/// This struct holds all the information of an extension
#[derive(Clone, Default, Debug, serde::Deserialize, serde::Serialize)]
pub struct ExtensionProperties {
/// The contents of said extension (This is plain text as its a .lua script)
pub contents: String,

/// The name of the extension
pub name: String,

/// If the extension is running
pub is_running: bool,

/// The path to this extension
pub path_to_extension: PathBuf,

/// The buffer of the texteditor to this extension
pub text_edit_buffer: String,
}

impl ExtensionProperties {
/// Create a new instance of an extension
pub fn new(contents: String, path: PathBuf, name: String) -> Self {
Self {
text_edit_buffer: contents.clone(),
Expand All @@ -38,6 +45,8 @@ impl ExtensionProperties {
}
}

/// Write changes to the file
/// This writes the ```self.text_edit_buffer``` to the file itself
pub fn write_change_to_file(&mut self) -> anyhow::Result<()> {
fs::write(
self.path_to_extension.clone(),
Expand All @@ -50,6 +59,7 @@ impl ExtensionProperties {
}
}

/// This enum contains all the types of lua outputs
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
pub enum LuaOutput {
/// This enum type is used to report code panics (In the lua runtime)
Expand Down

0 comments on commit 78f935e

Please sign in to comment.