This commit is contained in:
Quentin
2023-07-02 00:59:02 +02:00
committed by GitHub
parent f96356960a
commit 3bdd0796f4
56 changed files with 2804 additions and 24 deletions

View File

@ -3,6 +3,10 @@
namespace lua::gui
{
// Lua API: Class
// Name: base_text_element
// Class representing a gui text element.
class base_text_element : public gui_element
{
protected:
@ -11,7 +15,16 @@ namespace lua::gui
public:
base_text_element(std::string text);
// Lua API: Function
// Class: base_text_element
// Name: set_text
// Param: new_text: string: The new text for that gui text element.
void set_text(std::string new_text);
// Lua API: Function
// Class: base_text_element
// Name: get_text
// Returns: string: Returns the current text for that gui text element.
std::string get_text();
};
}

View File

@ -4,6 +4,10 @@
namespace lua::gui
{
// Lua API: Class
// Name: button
// Inherit: base_text_element
// Class representing a gui button.
class button : public base_text_element
{
sol::function m_callback;

View File

@ -3,6 +3,10 @@
namespace lua::gui
{
// Lua API: Class
// Name: checkbox
// Inherit: base_text_element
// Class representing a gui checkbox.
class checkbox : public base_text_element
{
bool m_enabled = false;
@ -12,7 +16,16 @@ namespace lua::gui
void draw() override;
// Lua API: Function
// Class: checkbox
// Name: is_enabled
// Returns: boolean: Is the checkbox checked?
bool is_enabled();
// Lua API: Function
// Class: checkbox
// Name: set_enabled
// Param: enabled: boolean: The desired enabled state of the checkbox.
void set_enabled(bool enabled);
};
}

View File

@ -3,6 +3,10 @@
namespace lua::gui
{
// Lua API: Class
// Name: input_float
// Inherit: base_text_element
// Class for representing an input field for editing a float value within the GUI.
class input_float : public base_text_element
{
bool m_enabled = false;
@ -13,7 +17,16 @@ namespace lua::gui
void draw() override;
// Lua API: Function
// Class: input_float
// Name: get_value
// Returns: float: Get the value currently written inside the input field.
int get_value();
// Lua API: Function
// Class: input_float
// Name: set_value
// Param: val: float: Set the value currently written inside the input field.
void set_value(float val);
};
}

View File

@ -3,6 +3,10 @@
namespace lua::gui
{
// Lua API: Class
// Name: input_int
// Inherit: base_text_element
// Class for representing an input field for editing an integer value within the GUI.
class input_int : public base_text_element
{
bool m_enabled = false;
@ -13,7 +17,16 @@ namespace lua::gui
void draw() override;
// Lua API: Function
// Class: input_int
// Name: get_value
// Returns: integer: Get the value currently written inside the input field.
int get_value();
// Lua API: Function
// Class: input_int
// Name: set_value
// Param: val: integer: Set the value currently written inside the input field.
void set_value(int val);
};
}

View File

@ -3,6 +3,10 @@
namespace lua::gui
{
// Lua API: Class
// Name: input_string
// Inherit: base_text_element
// Class for representing an input field for editing a string value within the GUI.
class input_string : public base_text_element
{
bool m_enabled = false;
@ -13,7 +17,16 @@ namespace lua::gui
void draw() override;
// Lua API: Function
// Class: input_string
// Name: get_value
// Returns: string: Get the value currently written inside the input field.
std::string get_value();
// Lua API: Function
// Class: input_string
// Name: set_value
// Param: val: string: Set the value currently written inside the input field.
void set_value(std::string val);
};
}

View File

@ -3,6 +3,9 @@
namespace lua::gui
{
// Lua API: Class
// Name: sameline
// Class for ImGui::SameLine() - Puts a sameline between widgets or groups to layout them horizontally.
class sameline : public gui_element
{
public:

View File

@ -3,6 +3,9 @@
namespace lua::gui
{
// Lua API: Class
// Name: separator
// Class for ImGui::Separator() - separator, generally horizontal. Inside a menu bar or in horizontal layout mode, this becomes a vertical separator.
class separator : public gui_element
{
public:

View File

@ -4,6 +4,10 @@
namespace lua::gui
{
// Lua API: Class
// Name: text
// Inherit: base_text_element
// Class representing an imgui text element.
class text : public base_text_element
{
ImFont* m_font = nullptr;
@ -12,6 +16,11 @@ namespace lua::gui
text(std::string text);
void draw() override;
// Lua API: Function
// Class: text
// Name: set_font
// Param: font: string: The new font name for that imgui text element.
void set_font(std::string font);
};
}