summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjussi2024-10-02 13:02:13 +0300
committerjussi2024-10-02 13:02:13 +0300
commit30c7a5eda27ef0e424bf7948e3cd37a1cf5a52ef (patch)
treefef0f62ff4206c2fc9548a12e4745ace3e7967d3
parentd3202073a72b4ff0f98c29cdb096e2747dbaaae8 (diff)
downloadreilua-enhanced-30c7a5eda27ef0e424bf7948e3cd37a1cf5a52ef.tar.gz
reilua-enhanced-30c7a5eda27ef0e424bf7948e3cd37a1cf5a52ef.tar.bz2
reilua-enhanced-30c7a5eda27ef0e424bf7948e3cd37a1cf5a52ef.zip
GuiSetSliderDragging, GuiGetSliderDragging, GuiSetSliderActive and GuiGetSliderActive.
-rw-r--r--API.md28
-rw-r--r--ReiLua_API.lua18
-rw-r--r--changelog1
-rw-r--r--include/raygui.h25
-rw-r--r--include/rgui.h4
-rw-r--r--src/lua_core.c4
-rw-r--r--src/rgui.c53
7 files changed, 132 insertions, 1 deletions
diff --git a/API.md b/API.md
index d98251d..c5d5248 100644
--- a/API.md
+++ b/API.md
@@ -9391,6 +9391,34 @@ Get gui state (global state)
---
+> RL.GuiSetSliderDragging()
+
+Set guiSliderDragging
+
+---
+
+> isSliderDragging = RL.GuiGetSliderDragging()
+
+Get guiSliderDragging
+
+- Success return bool
+
+---
+
+> RL.GuiSetSliderActive()
+
+Set guiSliderActive
+
+---
+
+> isSliderDragging = RL.GuiGetSliderActive()
+
+Get guiSliderActive
+
+- Success return Rectangle
+
+---
+
## Gui - Font set/get functions
---
diff --git a/ReiLua_API.lua b/ReiLua_API.lua
index db2c766..b519248 100644
--- a/ReiLua_API.lua
+++ b/ReiLua_API.lua
@@ -6325,6 +6325,24 @@ function RL.GuiSetState( state ) end
---@return any state
function RL.GuiGetState() end
+---Set guiSliderDragging
+---@return any RL.GuiSetSliderDragging
+function RL.GuiSetSliderDragging() end
+
+---Get guiSliderDragging
+---- Success return bool
+---@return any isSliderDragging
+function RL.GuiGetSliderDragging() end
+
+---Set guiSliderActive
+---@return any RL.GuiSetSliderActive
+function RL.GuiSetSliderActive() end
+
+---Get guiSliderActive
+---- Success return Rectangle
+---@return any isSliderDragging
+function RL.GuiGetSliderActive() end
+
-- Gui - Font set/get functions
---Set gui custom font (global state)
diff --git a/changelog b/changelog
index 0b2b60f..f197550 100644
--- a/changelog
+++ b/changelog
@@ -74,6 +74,7 @@ DETAILED CHANGES:
- FIXED: rlSetVertexAttribute takes pointer as Buffer.
- CHANGE: UnloadMaterial can also optionally free textures and shader.
- ADDED: FontCopy.
+ - ADDED: GuiSetSliderDragging, GuiGetSliderDragging, GuiSetSliderActive and GuiGetSliderActive.
------------------------------------------------------------------------
Release: ReiLua version 0.7.0 Using Raylib 5.0 and Forked Raygui 4.0
diff --git a/include/raygui.h b/include/raygui.h
index 5c7ac49..e4d50b1 100644
--- a/include/raygui.h
+++ b/include/raygui.h
@@ -671,6 +671,11 @@ RAYGUIAPI bool GuiIsLocked(void); // Check if gui
RAYGUIAPI void GuiSetAlpha(float alpha); // Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f
RAYGUIAPI void GuiSetState(int state); // Set gui state (global state)
RAYGUIAPI int GuiGetState(void); // Get gui state (global state)
+/* Addition. */
+RAYGUIAPI void GuiSetSliderDragging(bool dragging); // Set guiSliderDragging
+RAYGUIAPI bool GuiGetSliderDragging(void); // Get guiSliderDragging
+RAYGUIAPI void GuiSetSliderActive(Rectangle rect); // Set guiSliderActive
+RAYGUIAPI Rectangle GuiGetSliderActive(void); // Get guiSliderActive
// Font set/get functions
RAYGUIAPI void GuiSetFont(Font font); // Set gui custom font (global state)
@@ -1515,6 +1520,26 @@ void GuiSetState(int state) { guiState = (GuiState)state; }
// Get gui state (global state)
int GuiGetState(void) { return guiState; }
+// Set guiSliderDragging
+void GuiSetSliderDragging( bool dragging ) {
+ guiSliderDragging = dragging;
+}
+
+// Get guiSliderDragging
+bool GuiGetSliderDragging( void ) {
+ return guiSliderDragging;
+}
+
+// Set guiSliderActive
+RAYGUIAPI void GuiSetSliderActive( Rectangle rect ) {
+ guiSliderActive = rect;
+}
+
+// Get guiSliderActive
+RAYGUIAPI Rectangle GuiGetSliderActive( void ) {
+ return guiSliderActive;
+}
+
// Set custom gui font
// NOTE: Font loading/unloading is external to raygui
void GuiSetFont(Font font)
diff --git a/include/rgui.h b/include/rgui.h
index b947b89..823bcfb 100644
--- a/include/rgui.h
+++ b/include/rgui.h
@@ -9,6 +9,10 @@ int lguiGuiIsLocked( lua_State* L );
int lguiGuiSetAlpha( lua_State* L );
int lguiGuiSetState( lua_State* L );
int lguiGuiGetState( lua_State* L );
+int lguiGuiSetSliderDragging( lua_State* L );
+int lguiGuiGetSliderDragging( lua_State* L );
+int lguiGuiSetSliderActive( lua_State* L );
+int lguiGuiGetSliderActive( lua_State* L );
/* Font set/get functions. */
int lguiGuiSetFont( lua_State* L );
int lguiGuiGetFont( lua_State* L );
diff --git a/src/lua_core.c b/src/lua_core.c
index 508158d..94c2134 100644
--- a/src/lua_core.c
+++ b/src/lua_core.c
@@ -2075,6 +2075,10 @@ void luaRegister() {
assingGlobalFunction( "GuiSetAlpha", lguiGuiSetAlpha );
assingGlobalFunction( "GuiSetState", lguiGuiSetState );
assingGlobalFunction( "GuiGetState", lguiGuiGetState );
+ assingGlobalFunction( "GuiSetSliderDragging", lguiGuiSetSliderDragging );
+ assingGlobalFunction( "GuiGetSliderDragging", lguiGuiGetSliderDragging );
+ assingGlobalFunction( "GuiSetSliderActive", lguiGuiSetSliderActive );
+ assingGlobalFunction( "GuiGetSliderActive", lguiGuiGetSliderActive );
/* Font set/get functions. */
assingGlobalFunction( "GuiSetFont", lguiGuiSetFont );
assingGlobalFunction( "GuiGetFont", lguiGuiGetFont );
diff --git a/src/rgui.c b/src/rgui.c
index 106180e..f1532a3 100644
--- a/src/rgui.c
+++ b/src/rgui.c
@@ -117,6 +117,58 @@ int lguiGuiGetState( lua_State* L ) {
}
/*
+> RL.GuiSetSliderDragging()
+
+Set guiSliderDragging
+*/
+int lguiGuiSetSliderDragging( lua_State* L ) {
+ bool dragging = lua_toboolean( L, 1 );
+
+ GuiSetSliderDragging( dragging );
+
+ return 0;
+}
+
+/*
+> isSliderDragging = RL.GuiGetSliderDragging()
+
+Get guiSliderDragging
+
+- Success return bool
+*/
+int lguiGuiGetSliderDragging( lua_State* L ) {
+ lua_pushboolean( L, GuiGetSliderDragging() );
+
+ return 1;
+}
+
+/*
+> RL.GuiSetSliderActive()
+
+Set guiSliderActive
+*/
+int lguiGuiSetSliderActive( lua_State* L ) {
+ Rectangle rect = uluaGetRectangle( L, 1 );
+
+ GuiSetSliderActive( rect );
+
+ return 0;
+}
+
+/*
+> isSliderDragging = RL.GuiGetSliderActive()
+
+Get guiSliderActive
+
+- Success return Rectangle
+*/
+int lguiGuiGetSliderActive( lua_State* L ) {
+ uluaPushRectangle( L, GuiGetSliderActive() );
+
+ return 1;
+}
+
+/*
## Gui - Font set/get functions
*/
@@ -203,7 +255,6 @@ int lguiGuiLoadStyle( lua_State* L ) {
return 1;
}
- // state->guiFont = GuiGetFont();
TraceLog( state->logLevelInvalid, "Invalid file '%s'", lua_tostring( L, 1 ) );
lua_pushnil( L );