Skip to content

Feature: ThirdPartyDataref, for datarefs that might not be loaded yet #23

Description

@JDeeth

The plugins I write are often to enhance an existing aircraft and work that aircraft's custom datarefs. As such they're not guaranteed to be loaded as my plugin might be loaded first.

I've written a ThirdPartyDataref class here: https://github.com/JDeeth/nb_bn2_tweaks/blob/c8284ad96a6457c783a94372b2f92f680fdf2835/src/dataref_command.rs#L10-L50

enum ThirdPartyDataref {
    NotFound(String),
    Found(DataRef<u32, ReadWrite>),
}

It starts off as NotFound and holds the name of the dataref it should connect to. When trying to get/set the dataref, a NotFound will first search for the dataref and transform itself into a Found if successful.

Would something like this be worth polishing up and moving upstream into this crate?

(I tried to genericise it beyond <u32, ReadWrite> but ran into inexplicable errors that went beyond my limited Rust skills..!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions