mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 16:18:19 -10:00
* read access to controls * Early draft of checking keypresses in scpui * detangle some code and prepare it for API usage * API access to the core methods required * move these checks into the UI methods * comment * fix bugs * be smarter * Need this stuff, too * some more presets work * unify func naming scheme * cleanup and clarifications * get detect keypress working * allow searching and creating new presets based on current controls * address feedback * return nil if no preset is matched * use the builtin methods which do the same thing, but slightly cleaner * typo
71 lines
1.6 KiB
C++
71 lines
1.6 KiB
C++
#pragma once
|
|
|
|
// Forward definition
|
|
namespace Rocket {
|
|
namespace Core {
|
|
class Context;
|
|
}
|
|
} // namespace Rocket
|
|
|
|
/**
|
|
* @brief Contains all functions and types related to the libRocket based UI system
|
|
*/
|
|
namespace scpui {
|
|
|
|
/**
|
|
* @brief Initialzes libRocket and the associated interfaces
|
|
*/
|
|
void initialize();
|
|
|
|
/**
|
|
* @brief Sets an offset by which the libRocket interface is moved by.
|
|
*
|
|
* @details This translates all drawing operations by the specified offset and transforms input events by the same
|
|
* offset to bring them back into the same frame of reference for libRocket.
|
|
*
|
|
* @param x The x-offset
|
|
* @param y The y-offset
|
|
*/
|
|
void setOffset(float x, float y);
|
|
|
|
/**
|
|
* @brief Reloads all libRocket contexts currently active
|
|
*
|
|
* This can be used to reload the active documents if the files contained documents.
|
|
*/
|
|
void reloadAllContexts();
|
|
|
|
/**
|
|
* @brief Returns the current context
|
|
*/
|
|
Rocket::Core::Context* getContext();
|
|
|
|
/**
|
|
* @brief Enables mouse and text input on the specified input
|
|
*
|
|
* If there was another context with input enabled then input will be disabled for that context before enabling input
|
|
* on this context.
|
|
*
|
|
* @param main_ctx The context ot enable input for
|
|
*/
|
|
void enableInput(Rocket::Core::Context* main_ctx);
|
|
|
|
/**
|
|
* @brief Disable all input handling
|
|
*/
|
|
void disableInput();
|
|
|
|
/**
|
|
* @brief Shutdown the scripting part of libRocket
|
|
*
|
|
* This needs to be called before the scripting state is destroyed so that all resources are deallocated properly.
|
|
*/
|
|
void shutdown_scripting();
|
|
|
|
/**
|
|
* @brief Frees all resources of the UI system
|
|
*/
|
|
void shutdown();
|
|
|
|
} // namespace scpui
|