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