Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What are emojis doing in the global table ? #1309

Open
staviq opened this issue Feb 18, 2022 · 0 comments
Open

What are emojis doing in the global table ? #1309

staviq opened this issue Feb 18, 2022 · 0 comments

Comments

@staviq
Copy link

staviq commented Feb 18, 2022

I'm talking about this:
https://i.imgur.com/K5ZlSXd.png

This is the result of

for n in pairs(_G) do print(n) end

C++:

void SOCamera::init()
{
	static std::atomic< bool > isInitialized = false;
	if( !isInitialized ) [[unlikely]]
	{
		_controlScript.reset( new sol::state() );
		isInitialized = true;
	}
}

void SOCamera::setControlScript( std::string controlScript )
{

	_controlScript->open_libraries( sol::lib::base, sol::lib::math, sol::lib::string );
	_controlScript->require_file( "serpent", "data/serpent.lua" );

	auto script = _controlScript->load( controlScript );

	if( !script.valid() )
	{
		throw std::runtime_error( "Failed to load Camera control script." );
	}

	auto r = script();
	if( !r.valid() )
	{
		sol::error error = r;

		DBG( "SCRIPT: {}", r.valid() );
		DBG( "SCRIPT: {}", error.what() );
	}

	auto details		 = IOInputEventSubscription();
	details.mouse.button = GLFW_MOUSE_BUTTON_LEFT;
	IOInputQueue::subscribe( IOInputEventTypeMouseButtonPressed, details, []( std::shared_ptr< IOInputEvent > e ) { DBG( "MOUSE EVENT FROM SUBSCRIPTION" ); } );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant