modding simple imgui text editor

This commit is contained in:
2023-11-03 01:22:01 +01:00
parent 95a037ea35
commit b5de74578a
6 changed files with 135 additions and 10 deletions

View File

@ -31,11 +31,13 @@ SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_start(struct SolanaAPI* solana_api)
//ConfigModelI* conf = nullptr;
CRDTNotes* crdtn = nullptr;
Contact3Registry* cr = nullptr;
ImGuiContext* imguic = nullptr;
{ // make sure required types are loaded
//conf = RESOLVE_INSTANCE(ConfigModelI);
crdtn = RESOLVE_INSTANCE(CRDTNotes);
cr = RESOLVE_INSTANCE(Contact3Registry);
imguic = RESOLVE_INSTANCE(ImGuiContext);
//if (conf == nullptr) {
@ -48,6 +50,11 @@ SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_start(struct SolanaAPI* solana_api)
return 2;
}
if (cr == nullptr) {
std::cerr << "PLUGIN CRDTNIMGUI missing Contact3Registry\n";
return 2;
}
if (imguic == nullptr) {
std::cerr << "PLUGIN CRDTNIMGUI missing ImGuiContext\n";
return 2;
@ -58,7 +65,7 @@ SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_start(struct SolanaAPI* solana_api)
// static store, could be anywhere tho
// construct with fetched dependencies
g_crdtn_imgui = std::make_unique<CRDTNotesImGui>(*crdtn);
g_crdtn_imgui = std::make_unique<CRDTNotesImGui>(*crdtn, *cr);
// register types
PROVIDE_INSTANCE(CRDTNotesImGui, "CRDTNotesImGui", g_crdtn_imgui.get());