From d8b8c5bf76e625be41f6bc57f2b0bedab3ba9296 Mon Sep 17 00:00:00 2001 From: "Squishy (C6H12O6+NaCl+H2O)" <106439598+SweetSea-ButImNotSweet@users.noreply.github.com> Date: Fri, 17 May 2024 20:17:37 +0700 Subject: [PATCH] Add VCTRL.export (for saving feature) --- game/vctrl.lua | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/game/vctrl.lua b/game/vctrl.lua index e79b856..f0f837f 100644 --- a/game/vctrl.lua +++ b/game/vctrl.lua @@ -15,6 +15,7 @@ local function mDrawQ(obj,quad,x,y,a,k) love.graphics.draw(obj,quad,x,y,a,k,nil,w*.5,h*.5) end +ShowLoadingText('virtual key skin') local empty_quad -- A table containing quads used to draw icons for virtual control system. local virtual_quad=setmetatable((function() @@ -56,6 +57,19 @@ function control_type.button:new(data) quad=virtual_quad[data.key] },self) end +function control_type.button:export() + return { + show = self.show, + x = self.x, + y = self.y, + r = self.r, + shape = self.shape, + key = self.key, + iconSize = self.iconSize, + alpha = self.alpha, + quad = self.quad + } +end function control_type.button:reset() self.pressed=false self.lastPressTime=-1e99 @@ -194,4 +208,6 @@ function VCTRL.draw(forceLight) VCTRL[i]:draw(forceLight) end end -end \ No newline at end of file +end + +function VCTRL.export(K) return K:export() end \ No newline at end of file