exec .zenshell files + shell extensions
Co-authored-by: Tristan Poland (Trident_For_U) <tristanpoland@users.noreply.github.com>
This commit is contained in:
parent
acf22483a8
commit
7adf770d54
16 changed files with 494 additions and 37 deletions
11
plugins/player_lib/Cargo.toml
Normal file
11
plugins/player_lib/Cargo.toml
Normal file
|
@ -0,0 +1,11 @@
|
|||
[package]
|
||||
name = "player_lib"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
PebbleVault = "0.6.1"
|
||||
horizon-plugin-api = "0.1.13"
|
||||
horizon_data_types = "0.4.0"
|
||||
socketioxide = "0.15.1"
|
||||
parking_lot = "0.12.3"
|
36
plugins/player_lib/src/lib.rs
Normal file
36
plugins/player_lib/src/lib.rs
Normal file
|
@ -0,0 +1,36 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
pub use horizon_plugin_api::{LoadedPlugin, Plugin, Pluginstate};
|
||||
|
||||
// Define the trait properly
|
||||
pub trait PluginAPI {
|
||||
fn test(&self);
|
||||
}
|
||||
|
||||
pub trait PluginConstruct {
|
||||
fn get_structs(&self) -> Vec<&str>;
|
||||
// If you want default implementations, mark them with 'default'
|
||||
fn new(plugins: HashMap<String, (Pluginstate, Plugin)>) -> Plugin;
|
||||
}
|
||||
|
||||
// Implement constructor separately
|
||||
impl PluginConstruct for Plugin {
|
||||
fn new(plugins: HashMap<String, (Pluginstate, Plugin)>) -> Plugin {
|
||||
Plugin {}
|
||||
}
|
||||
|
||||
fn get_structs(&self) -> Vec<&str> {
|
||||
vec!["MyPlayer"]
|
||||
}
|
||||
}
|
||||
|
||||
// Implement the trait for Plugin
|
||||
impl PluginAPI for Plugin {
|
||||
fn test(&self) {
|
||||
println!("test");
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Plugin Implementation
|
||||
//-----------------------------------------------------------------------------
|
Loading…
Add table
Add a link
Reference in a new issue