Skip to content

Commit

Permalink
Add support for log colours (#26)
Browse files Browse the repository at this point in the history
Adds support for log colours in logs based on changes in NorthstarLauncher
  • Loading branch information
catornot authored Oct 15, 2024
1 parent e1fe20f commit a1ca073
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
rrplug = "4.0.0"
rrplug = "=4.1.0"
discord-sdk = "0.3.2"
tokio = "1.26.0"
parking_lot = "0.12.1"
Expand Down
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

use discord_sdk::activity::Secrets;
use parking_lot::Mutex;
use rrplug::interfaces::manager::register_interface;
use rrplug::prelude::*;
use rrplug::{bindings::plugin_abi::PluginColor, interfaces::manager::register_interface};
use tokio::runtime::Runtime;

use crate::{
Expand Down Expand Up @@ -43,11 +43,16 @@ pub struct DiscordRpcPlugin {

#[deny(non_snake_case)]
impl Plugin for DiscordRpcPlugin {
const PLUGIN_INFO: PluginInfo = PluginInfo::new(
const PLUGIN_INFO: PluginInfo = PluginInfo::new_with_color(
c"DISCORDRPC",
c"DSCRD-RPC",
c"DISCORDRPC",
PluginContext::CLIENT,
PluginColor {
red: 114,
green: 137,
blue: 218,
},
);

fn new(_: bool) -> Self {
Expand Down
2 changes: 2 additions & 0 deletions src/presence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ pub fn run_presence_updates(sqvm: NonNull<HSquirrelVM>) {
};
}

// "Localize_001" is a thing

/// function to pull presence from the sqvm since in runframe it's impossibke to get the output of a function back
#[rrplug::sqfunction(VM = "UI | CLIENT", ExportName = "FetchPresence")]
pub fn fetch_presence() -> Result<(), String> {
Expand Down

0 comments on commit a1ca073

Please sign in to comment.