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:
parent
9496b94752
commit
bfb2d8d8e5
2
external/solanaceae_bridge
vendored
2
external/solanaceae_bridge
vendored
@ -1 +1 @@
|
||||
Subproject commit c5bf212ab98492779392518ea4bc8c958ee45e46
|
||||
Subproject commit dd462b450e357fdccdd721d5b8d0d325622b33e3
|
2
external/solanaceae_contact
vendored
2
external/solanaceae_contact
vendored
@ -1 +1 @@
|
||||
Subproject commit e2917c497c91f91f8febcd1f43e462fad8359305
|
||||
Subproject commit 99d9633ff109321e78cf2817d3b8631d364a2483
|
2
external/solanaceae_crdtnotes
vendored
2
external/solanaceae_crdtnotes
vendored
@ -1 +1 @@
|
||||
Subproject commit 31c3ed4688de6f80bb160ce5d3168ac6b57cf318
|
||||
Subproject commit e7096ee20f8318550ef3fcfacab1170d27cae6ba
|
2
external/solanaceae_ircclient
vendored
2
external/solanaceae_ircclient
vendored
@ -1 +1 @@
|
||||
Subproject commit 3657634be5864620177504b5961308071991c43d
|
||||
Subproject commit 5ebeeef3c281460737132fffead5899cd3291edd
|
2
external/solanaceae_llama-cpp-web
vendored
2
external/solanaceae_llama-cpp-web
vendored
@ -1 +1 @@
|
||||
Subproject commit 31855cd1b13c7c70480b9df35060fd6f5254798a
|
||||
Subproject commit 7e1b424adb49e4267a138244030572c6f034dcee
|
2
external/solanaceae_message3
vendored
2
external/solanaceae_message3
vendored
@ -1 +1 @@
|
||||
Subproject commit e55fb46027f16a1bc078f797ae9fcc7609d15659
|
||||
Subproject commit 2a3828b30d7ec5fb9e7c8a8a82d1be66e040ea74
|
2
external/solanaceae_message_fragment_store
vendored
2
external/solanaceae_message_fragment_store
vendored
@ -1 +1 @@
|
||||
Subproject commit 50db703d78ceaaef43c82e2e4198500d23e1de7e
|
||||
Subproject commit 8603a22cbb4e074e4c4fad513c68a88a4dc58104
|
2
external/solanaceae_message_serializer
vendored
2
external/solanaceae_message_serializer
vendored
@ -1 +1 @@
|
||||
Subproject commit b1becb2128224fe63b7dff2218ecc66e9b92bc5b
|
||||
Subproject commit c284e0779e69618f0524acba67849801cbb5a5d7
|
2
external/solanaceae_ngc_ft1
vendored
2
external/solanaceae_ngc_ft1
vendored
@ -1 +1 @@
|
||||
Subproject commit 7a54552bd2756cb8e034f22ac8238edc20740302
|
||||
Subproject commit 246587e30d29489f35e23855432c784998ca94f4
|
2
external/solanaceae_object_store
vendored
2
external/solanaceae_object_store
vendored
@ -1 +1 @@
|
||||
Subproject commit e5b3546292c906da4680f838c235e3464476917b
|
||||
Subproject commit 241a0c0906f75555218a04b99259b51b0c0c25a4
|
2
external/solanaceae_tox
vendored
2
external/solanaceae_tox
vendored
@ -1 +1 @@
|
||||
Subproject commit dd7eb2702f3844085f3cd8495db1e1a087afd724
|
||||
Subproject commit 24bbf2a3381de3e2a7c06c035eb0b19467c2a6b5
|
2
external/solanaceae_tox_p2prng
vendored
2
external/solanaceae_tox_p2prng
vendored
@ -1 +1 @@
|
||||
Subproject commit dd6551ed27591cc8e3eabea2064798fb934eae8f
|
||||
Subproject commit 7397a0d02b190887d2e45e3eb2c225af72e46dd3
|
2
external/solanaceae_tox_upnp
vendored
2
external/solanaceae_tox_upnp
vendored
@ -1 +1 @@
|
||||
Subproject commit c3580d2c6f4f92f10258343b5c391d7c577ee56d
|
||||
Subproject commit 4df49c5be9309b952f327335e2480329f1eb2d0c
|
2
external/solanaceae_toxic_games
vendored
2
external/solanaceae_toxic_games
vendored
@ -1 +1 @@
|
||||
Subproject commit 5450233eb70715a31027b43b07c137252762d93a
|
||||
Subproject commit 7b7b3f4a9402d7ee7a599d1f4289a706a4633373
|
2
external/solanaceae_zox
vendored
2
external/solanaceae_zox
vendored
@ -1 +1 @@
|
||||
Subproject commit 2f0dba1044fc3578ea8e8954417f50d0df5970c1
|
||||
Subproject commit 399c27cc2b9b2e441c6a0183de774fb6d3a07ae6
|
2
external/totato
vendored
2
external/totato
vendored
@ -1 +1 @@
|
||||
Subproject commit e77e57fa78e7cf0c4301855c14b3a125348abfbd
|
||||
Subproject commit 9e42508428b8f10c1aa27e7441529a0b0517f735
|
@ -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>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user