Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odd problem with getting command list through the API #89

Open
markcellis opened this issue Jan 28, 2022 · 0 comments
Open

Odd problem with getting command list through the API #89

markcellis opened this issue Jan 28, 2022 · 0 comments

Comments

@markcellis
Copy link

I'm running into a rather odd issue. X-Camera has some commands that are dynamically generated in code. One of the things I do is use the Plugin messaging to register these dynamical created commands with the dataref tool:

void registerDataRefToolCommand(const char cmd)
{
const intptr_t MSG_ADD_DATAREF = 0x01000000;
char tempBuffer[MAX_STR_LEN];
XPLMPluginID plugin_id = XPLMFindPluginBySignature("com.leecbaker.datareftool");
if (XPLM_NO_PLUGIN_ID != plugin_id)
{
XPLMSendMessageToPlugin(plugin_id, MSG_ADD_DATAREF, (void
)cmd);
}
}

The commands in questions are SRS/X-Camera/Momentary_Select_View_ID_1 through SRS/X-Camera/Momentary_Select_View_ID_50 as an example. There are actually more like this.

Now what is odd is I have a new plugin called X-keyPad that uses the new API to get the list of commands and datarefs from the dataref tool. If I never open the dataref tool's search UI those commands above will never be return with the new UI. However, if I open the dataref tools search and find those commands and THEN go back and try the API then they will be returned in the API.

It is almost like the list the API is using is not fully populated until after you have done a search in the dataref tool's UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant