Optimize ConnectProtocol
This commit is contained in:
parent
fe4bf5704d
commit
72e98f8bbb
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
ConnectProtocol::Container ConnectProtocol::ConnectContainer = { false, false, "" };
|
ConnectProtocol::Container ConnectProtocol::ConnectContainer = { false, "" };
|
||||||
|
|
||||||
bool ConnectProtocol::Evaluated()
|
bool ConnectProtocol::Evaluated()
|
||||||
{
|
{
|
||||||
@ -202,12 +202,10 @@ namespace Components
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Invocation handler
|
// Invocation handler
|
||||||
// TODO: Don't call it every frame, once is enough!
|
Renderer::Once([] ()
|
||||||
Renderer::OnFrame([] ()
|
|
||||||
{
|
{
|
||||||
if (!ConnectProtocol::ConnectContainer.Invoked && ConnectProtocol::Used())
|
if (ConnectProtocol::Used())
|
||||||
{
|
{
|
||||||
ConnectProtocol::ConnectContainer.Invoked = true;
|
|
||||||
Command::Execute(fmt::sprintf("connect %s", ConnectProtocol::ConnectContainer.ConnectString.data()), false);
|
Command::Execute(fmt::sprintf("connect %s", ConnectProtocol::ConnectContainer.ConnectString.data()), false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -14,7 +14,6 @@ namespace Components
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool Evaluated;
|
bool Evaluated;
|
||||||
bool Invoked;
|
|
||||||
std::string ConnectString;
|
std::string ConnectString;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user