contact4
Some checks are pending
ContinuousDelivery / linux-ubuntu (push) Waiting to run
ContinuousDelivery / windows (push) Waiting to run
ContinuousDelivery / release (push) Blocked by required conditions
ContinuousIntegration / linux (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Waiting to run
ContinuousIntegration / macos (push) Waiting to run
ContinuousIntegration / windows (push) Waiting to run
Some checks are pending
ContinuousDelivery / linux-ubuntu (push) Waiting to run
ContinuousDelivery / windows (push) Waiting to run
ContinuousDelivery / release (push) Blocked by required conditions
ContinuousIntegration / linux (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Waiting to run
ContinuousIntegration / macos (push) Waiting to run
ContinuousIntegration / windows (push) Waiting to run
This commit is contained in:
2
external/solanaceae_bridge
vendored
2
external/solanaceae_bridge
vendored
Submodule external/solanaceae_bridge updated: c5bf212ab9...dd462b450e
2
external/solanaceae_contact
vendored
2
external/solanaceae_contact
vendored
Submodule external/solanaceae_contact updated: e2917c497c...99d9633ff1
2
external/solanaceae_crdtnotes
vendored
2
external/solanaceae_crdtnotes
vendored
Submodule external/solanaceae_crdtnotes updated: 31c3ed4688...e7096ee20f
2
external/solanaceae_ircclient
vendored
2
external/solanaceae_ircclient
vendored
Submodule external/solanaceae_ircclient updated: 3657634be5...5ebeeef3c2
2
external/solanaceae_llama-cpp-web
vendored
2
external/solanaceae_llama-cpp-web
vendored
Submodule external/solanaceae_llama-cpp-web updated: 31855cd1b1...7e1b424adb
2
external/solanaceae_message3
vendored
2
external/solanaceae_message3
vendored
Submodule external/solanaceae_message3 updated: e55fb46027...2a3828b30d
2
external/solanaceae_message_fragment_store
vendored
2
external/solanaceae_message_fragment_store
vendored
Submodule external/solanaceae_message_fragment_store updated: 50db703d78...8603a22cbb
2
external/solanaceae_message_serializer
vendored
2
external/solanaceae_message_serializer
vendored
Submodule external/solanaceae_message_serializer updated: b1becb2128...c284e0779e
2
external/solanaceae_ngc_ft1
vendored
2
external/solanaceae_ngc_ft1
vendored
Submodule external/solanaceae_ngc_ft1 updated: 7a54552bd2...246587e30d
2
external/solanaceae_object_store
vendored
2
external/solanaceae_object_store
vendored
Submodule external/solanaceae_object_store updated: e5b3546292...241a0c0906
2
external/solanaceae_tox
vendored
2
external/solanaceae_tox
vendored
Submodule external/solanaceae_tox updated: dd7eb2702f...24bbf2a338
2
external/solanaceae_tox_p2prng
vendored
2
external/solanaceae_tox_p2prng
vendored
Submodule external/solanaceae_tox_p2prng updated: dd6551ed27...7397a0d02b
2
external/solanaceae_tox_upnp
vendored
2
external/solanaceae_tox_upnp
vendored
Submodule external/solanaceae_tox_upnp updated: c3580d2c6f...4df49c5be9
2
external/solanaceae_toxic_games
vendored
2
external/solanaceae_toxic_games
vendored
Submodule external/solanaceae_toxic_games updated: 5450233eb7...7b7b3f4a94
2
external/solanaceae_zox
vendored
2
external/solanaceae_zox
vendored
Submodule external/solanaceae_zox updated: 2f0dba1044...399c27cc2b
2
external/totato
vendored
2
external/totato
vendored
Submodule external/totato updated: e77e57fa78...9e42508428
@ -1,15 +1,18 @@
|
||||
#include "./dice_tool.hpp"
|
||||
|
||||
#include <solanaceae/contact/contact_store_i.hpp>
|
||||
#include <solanaceae/contact/components.hpp>
|
||||
|
||||
#include <imgui.h>
|
||||
|
||||
#include <entt/container/dense_set.hpp>
|
||||
#include <entt/entity/registry.hpp>
|
||||
#include <entt/entity/handle.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
|
||||
DiceTool::DiceTool(P2PRNGI& p2prng, Contact3Registry& cr) : _p2prng(p2prng), _cr(cr) {
|
||||
DiceTool::DiceTool(P2PRNGI& p2prng, ContactStore4I& cs) : _p2prng(p2prng), _cs(cs) {
|
||||
p2prng.subscribe(this, P2PRNG_Event::init);
|
||||
p2prng.subscribe(this, P2PRNG_Event::hmac);
|
||||
p2prng.subscribe(this, P2PRNG_Event::secret);
|
||||
@ -29,7 +32,7 @@ float DiceTool::render(float) {
|
||||
static uint16_t g_sides {6};
|
||||
ImGui::InputScalar("##sides", ImGuiDataType_U16, &g_sides);
|
||||
|
||||
static entt::dense_set<Contact3> peers;
|
||||
static entt::dense_set<Contact4> peers;
|
||||
|
||||
if (ImGui::CollapsingHeader("peers")) {
|
||||
ImGui::Indent();
|
||||
@ -43,7 +46,7 @@ float DiceTool::render(float) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Contact3Handle c {_cr, *it};
|
||||
ContactHandle4 c = _cs.contactHandle(*it);
|
||||
|
||||
const char* str_ptr = "<unk>";
|
||||
if (const auto* name_ptr = c.try_get<Contact::Components::Name>(); name_ptr != nullptr && !name_ptr->name.empty()) {
|
||||
@ -61,8 +64,8 @@ float DiceTool::render(float) {
|
||||
ImGui::OpenPopup("peer selector");
|
||||
}
|
||||
if (ImGui::BeginPopup("peer selector")) {
|
||||
for (const auto& [cv] : _cr.view<Contact::Components::TagBig>().each()) {
|
||||
Contact3Handle c {_cr, cv};
|
||||
for (const auto& [cv] : _cs.registry().view<Contact::Components::TagBig>().each()) {
|
||||
ContactHandle4 c = _cs.contactHandle(cv);
|
||||
|
||||
if (peers.contains(c)) {
|
||||
continue;
|
||||
@ -75,8 +78,8 @@ float DiceTool::render(float) {
|
||||
|
||||
if (c.all_of<Contact::Components::TagGroup, Contact::Components::ParentOf>()) {
|
||||
if (ImGui::BeginMenu(str_ptr)) {
|
||||
for (const Contact3 child_cv : c.get<Contact::Components::ParentOf>().subs) {
|
||||
Contact3Handle child_c {_cr, child_cv};
|
||||
for (const Contact4 child_cv : c.get<Contact::Components::ParentOf>().subs) {
|
||||
ContactHandle4 child_c = _cs.contactHandle(child_cv);
|
||||
|
||||
if (peers.contains(child_c)) {
|
||||
continue;
|
||||
@ -113,10 +116,10 @@ float DiceTool::render(float) {
|
||||
}
|
||||
|
||||
if (ImGui::Button("roll")) {
|
||||
//std::vector<Contact3Handle> c_vec{peers.cbegin(), peers.cend()};
|
||||
std::vector<Contact3Handle> c_vec;
|
||||
//std::vector<ContactHandle4> c_vec{peers.cbegin(), peers.cend()};
|
||||
std::vector<ContactHandle4> c_vec;
|
||||
for (const auto cv : peers) {
|
||||
c_vec.emplace_back(_cr, cv);
|
||||
c_vec.emplace_back(_cs.contactHandle(cv));
|
||||
}
|
||||
|
||||
std::vector<uint8_t> is {'D', 'I', 'C', 'E'};
|
||||
|
@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <solanaceae/tox_p2prng/p2prng.hpp>
|
||||
#include <solanaceae/contact/contact_model3.hpp>
|
||||
#include <solanaceae/contact/fwd.hpp>
|
||||
|
||||
#include <vector>
|
||||
|
||||
class DiceTool : public P2PRNGEventI {
|
||||
P2PRNGI& _p2prng;
|
||||
Contact3Registry& _cr;
|
||||
ContactStore4I& _cs;
|
||||
|
||||
struct Rolls {
|
||||
std::vector<uint8_t> id;
|
||||
@ -23,7 +23,7 @@ class DiceTool : public P2PRNGEventI {
|
||||
std::vector<Rolls> _rolls;
|
||||
|
||||
public:
|
||||
DiceTool(P2PRNGI& p2prng, Contact3Registry& cr);
|
||||
DiceTool(P2PRNGI& p2prng, ContactStore4I& cs);
|
||||
~DiceTool(void);
|
||||
|
||||
float render(float time_delta);
|
||||
|
@ -1,6 +1,9 @@
|
||||
#include <solanaceae/plugin/solana_plugin_v1.h>
|
||||
|
||||
#include <solanaceae/contact/contact_store_i.hpp>
|
||||
|
||||
#include "./dice_tool.hpp"
|
||||
|
||||
#include <imgui.h>
|
||||
|
||||
#include <entt/entt.hpp>
|
||||
@ -33,11 +36,11 @@ SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_start(struct SolanaAPI* solana_api)
|
||||
|
||||
try {
|
||||
auto* p2prng_i = PLUG_RESOLVE_INSTANCE(P2PRNGI);
|
||||
auto* cr = PLUG_RESOLVE_INSTANCE_VERSIONED(Contact3Registry, "1");
|
||||
auto* cs = PLUG_RESOLVE_INSTANCE(ContactStore4I);
|
||||
|
||||
// static store, could be anywhere tho
|
||||
// construct with fetched dependencies
|
||||
g_dt = std::make_unique<DiceTool>(*p2prng_i, *cr);
|
||||
g_dt = std::make_unique<DiceTool>(*p2prng_i, *cs);
|
||||
|
||||
auto* imguic = PLUG_RESOLVE_INSTANCE_VERSIONED(ImGuiContext, ImGui::GetVersion());
|
||||
auto* imguimemaf = PLUG_RESOLVE_INSTANCE_VERSIONED(ImGuiMemAllocFunc, ImGui::GetVersion());
|
||||
|
@ -1,8 +1,9 @@
|
||||
#include <solanaceae/plugin/solana_plugin_v1.h>
|
||||
|
||||
#include "./transfer_auto_accept.hpp"
|
||||
#include <solanaceae/util/config_model.hpp>
|
||||
|
||||
#include "./transfer_auto_accept.hpp"
|
||||
|
||||
#include <entt/entt.hpp>
|
||||
#include <entt/fwd.hpp>
|
||||
|
||||
|
Reference in New Issue
Block a user