From 444d8a0cbe9df84765553190808ea7d0a2d3190a Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 21 Sep 2025 14:19:03 +0300 Subject: [PATCH 01/18] make this a wally package --- aftman.toml | 7 +++++++ default.project.json | 6 ++++++ rotriever.toml | 9 +++++++++ src/{PludLayout.luau => init.luau} | 0 wally.toml | 12 ++++++++++++ 5 files changed, 34 insertions(+) create mode 100644 aftman.toml create mode 100644 default.project.json create mode 100644 rotriever.toml rename src/{PludLayout.luau => init.luau} (100%) create mode 100644 wally.toml diff --git a/aftman.toml b/aftman.toml new file mode 100644 index 0000000..5a42112 --- /dev/null +++ b/aftman.toml @@ -0,0 +1,7 @@ +# This file lists tools managed by Aftman, a cross-platform toolchain manager. +# For more information, see https://github.com/LPGhatguy/aftman + +# To add a new tool, add an entry to this table. +[tools] +wally = "Upliftgames/wally@0.3.2" +# rojo = "rojo-rbx/rojo@6.2.0" \ No newline at end of file diff --git a/default.project.json b/default.project.json new file mode 100644 index 0000000..efcc85c --- /dev/null +++ b/default.project.json @@ -0,0 +1,6 @@ +{ + "name": "PludLayout", + "tree": { + "$path": "src" + } +} \ No newline at end of file diff --git a/rotriever.toml b/rotriever.toml new file mode 100644 index 0000000..4cdd174 --- /dev/null +++ b/rotriever.toml @@ -0,0 +1,9 @@ +[package] +name = "PludLayout" +version = "0.1.0" +license = "MIT" +authors = ["22a", "al_ex427 (for rotriever package)"] +content_root = "src" + + +[dependencies] \ No newline at end of file diff --git a/src/PludLayout.luau b/src/init.luau similarity index 100% rename from src/PludLayout.luau rename to src/init.luau diff --git a/wally.toml b/wally.toml new file mode 100644 index 0000000..c8ab7be --- /dev/null +++ b/wally.toml @@ -0,0 +1,12 @@ +[package] +name = "22a/pludlayout" +description = "A better version and more customizable version of roblox's ui grid layouts" +license = "MIT" +authors = ["22a", "al_ex427 (for wally package)"] +version = "0.1.0" +registry = "https://github.com/UpliftGames/wally-index" +realm = "shared" +exclude = ["aftman.toml"] + + +[dependencies] \ No newline at end of file From deb17d71e25207f1738a2f81d37291752f7b6319 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 21 Sep 2025 14:21:41 +0300 Subject: [PATCH 02/18] have to do this --- wally.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wally.toml b/wally.toml index c8ab7be..b37a0ec 100644 --- a/wally.toml +++ b/wally.toml @@ -1,5 +1,5 @@ [package] -name = "22a/pludlayout" +name = "al-ex427/pludlayout" description = "A better version and more customizable version of roblox's ui grid layouts" license = "MIT" authors = ["22a", "al_ex427 (for wally package)"] From b6a28b10377a3e079c3c05344cfc273bba315827 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 25 Sep 2025 21:20:10 +0300 Subject: [PATCH 03/18] Update init.luau --- src/init.luau | 104 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 78 insertions(+), 26 deletions(-) diff --git a/src/init.luau b/src/init.luau index 536d5ce..d8c7088 100644 --- a/src/init.luau +++ b/src/init.luau @@ -5,9 +5,10 @@ export type Layout = { Size: UDim2; ConstantUpdates: boolean; SmoothUpdates: boolean; + TweenSize: boolean; UpdateTween: TweenInfo; -- only works with constant updates and smooth updates Linked: Frame; - Whitelisted: {}; + Whitelisted: {[Object]: {object: Instance, offset: UDim2, size_offset: UDim2, og_pos: UDim2, og_size: UDim2}}; Blacklisted: {[Object]: boolean}; Initialized: {[Object]: boolean}; } @@ -17,7 +18,6 @@ plud_layout.__index = plud_layout function plud_layout.create_layout(grid_data: Layout) local self: Layout = setmetatable({ - blacklisted = {}; whitelisted = {}; initialized = {}; }, plud_layout) @@ -27,14 +27,18 @@ function plud_layout.create_layout(grid_data: Layout) end self.Linked.ChildAdded:Connect(function(child) - --print(`New child: {child}`) + print(`New child: {child}`) self:whitelist(child) end) self.Linked.ChildRemoved:Connect(function(child) - --print(`Lost child: {child}`) + print(`Lost child: {child}`) self:blacklist(child) end) + + for _, child in self.Linked:GetChildren() do + self:whitelist(child) + end return self end @@ -43,17 +47,19 @@ function plud_layout:update() local cleaned = {} if self.ConstantUpdates then for _, obj in self.whitelisted do - if obj and obj.Parent and not table.find(self.blacklisted, obj) then + if obj.object and obj.object.Parent then table.insert(cleaned, obj) end end self.whitelisted = cleaned end - + local corrected_padding = math.max(.001, self.Padding.X.Scale) local cols = math.floor((1 + corrected_padding) / (math.max(.001, self.Size.X.Scale) + corrected_padding)) cols = math.max(1, cols) - for i, obj in self.whitelisted do + for i, obj_data in self.whitelisted do + local obj = obj_data.object + local col = (i-1) % cols local row = math.floor((i-1) / cols) @@ -61,21 +67,31 @@ function plud_layout:update() local cell_h = self.Size.Y.Scale local pad_x = self.Padding.X.Scale local pad_y = self.Padding.Y.Scale - + + local size = self.Size + obj_data.size_offset + local pos = UDim2.new( col * (cell_w + pad_x), self.Padding.X.Offset + col * (self.Size.X.Offset + self.Padding.X.Offset), row * (cell_h + pad_y), self.Padding.Y.Offset + row * (self.Size.Y.Offset + self.Padding.Y.Offset) ) - if obj.Position == pos and obj.Size == self.Size then continue end + local halfed_x = obj_data.og_size.X.Scale / 2 + local halfed_y = obj_data.og_size.Y.Scale / 2 + pos = (pos + obj_data.offset) + UDim2.new(halfed_x, 0, halfed_y, 0) + + if obj.Position == pos then continue end if self.SmoothUpdates and self.UpdateTween then - tween_service:Create(obj, self.UpdateTween, {Position = pos}):Play() - obj.Size = self.Size + local data = {Position = pos} + if self.TweenSize then + data.Size = size + end + tween_service:Create(obj, self.UpdateTween, data):Play() + obj.Size = size else obj.Position = pos - obj.Size = self.Size + obj.Size = size end self.initialized[obj] = true @@ -84,33 +100,69 @@ end function plud_layout:blacklist(obj: Object) if not obj then return end - self.blacklisted[obj] = true - - for i = 1, #self.whitelisted do - if self.whitelisted[i] == obj then - self.whitelisted[i] = nil - break - end - end - - self.initialized[obj] = false + self.whitelisted[obj] = nil + self.initialized[obj] = nil end -function plud_layout:whitelist(obj: Object) +function plud_layout:whitelist(obj: Object, p_offset, s_offset) + p_offset = p_offset or UDim2.new(0, 0, 0, 0) + s_offset = s_offset or UDim2.new(0, 0, 0, 0) if not obj then return end - self.blacklisted[obj] = nil + + local data = { + object = obj; + offset = p_offset; + size_offset = s_offset; + og_pos = obj.Position; + og_size = obj.Size; + } local slot_found = false for i = 1, #self.whitelisted do if self.whitelisted[i] == nil then - self.whitelisted[i] = obj + self.whitelisted[i] = data slot_found = true break end end if not slot_found then - table.insert(self.whitelisted, obj) + table.insert(self.whitelisted, data) + end +end + +--[[ + Offsets the position or size of the object by the specified offset and size offset relative to its current position and size +]] +function plud_layout:offset(obj, offset, size_offset) + for i, v in self.whitelisted do + if v.object == obj then + if offset ~= nil then + v.offset = offset + end + if size_offset ~= nil then + v.size_offset = size_offset + end + end + end +end + +--[[ + offset_type: "position" or "size", default is both + Resets the offset to 0 of the specified type +]] +function plud_layout:remove_offset(obj, offset_type: string) + for i, v in self.whitelisted do + if v.object == obj then + if offset_type == "position" then + v.offset = UDim2.new(0, 0, 0, 0) + elseif offset_type == "size" then + v.size_offset = UDim2.new(0, 0, 0, 0) + else + v.offset = UDim2.new(0, 0, 0, 0) + v.size_offset = UDim2.new(0, 0, 0, 0) + end + end end end From e6dfbd2354defd4afe48293b4f1db6f5ee5421ac Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 25 Sep 2025 21:24:07 +0300 Subject: [PATCH 04/18] Create build.yml --- .github/workflows/build.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..de8e9b3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "main" branch + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: ok-nick/setup-aftman@v0.4.2 + + + From 92013ac9dc4fb4ab9622fba35a3b3f3dff414f03 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 25 Sep 2025 21:29:36 +0300 Subject: [PATCH 05/18] Update build.yml --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index de8e9b3..2871aa3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,6 @@ # This is a basic workflow to help you get started with Actions -name: CI +name: Deploy # Controls when the workflow will run on: @@ -24,5 +24,7 @@ jobs: steps: - uses: ok-nick/setup-aftman@v0.4.2 - + - name: Check wally + run: wally --version + From 084704fb5540285bf69d7139a2663d783ec1658d Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 25 Sep 2025 21:34:05 +0300 Subject: [PATCH 06/18] Update build.yml --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2871aa3..c5926eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,8 @@ jobs: steps: - uses: ok-nick/setup-aftman@v0.4.2 - - name: Check wally - run: wally --version + - name: Check Rokit + run: rokit --version + From 4d184506dd9868066775667a8577cbbc05f6e3b4 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 25 Sep 2025 21:35:47 +0300 Subject: [PATCH 07/18] Update build.yml --- .github/workflows/build.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c5926eb..68e15aa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,17 +15,19 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on + install-tools: + name: Install tools runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job steps: - - uses: ok-nick/setup-aftman@v0.4.2 - - - name: Check Rokit - run: rokit --version - - + - name: Checkout code + uses: actions/checkout@v3.3.0 + - name: Set up Aftman + uses: ok-nick/setup-aftman@v0.4.2 + - name: Cache Aftman tools + uses: actions/cache@v3 + with: + path: ~/.aftman + key: aftman-${{ hashFiles('aftman.toml') }} + - name: Install Wally dependencies + run: wally install From 47440b37081a13ae9d76112b0ae70bfefe2ea52e Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 25 Sep 2025 21:38:26 +0300 Subject: [PATCH 08/18] Update build.yml --- .github/workflows/build.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 68e15aa..a3345d1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,6 +28,20 @@ jobs: with: path: ~/.aftman key: aftman-${{ hashFiles('aftman.toml') }} - - name: Install Wally dependencies - run: wally install + - name: Check wally version + run: wally --version + + deploy: + name: Deploy to wally + runs-on: ubuntu-latest + needs: [install-tools] + steps: + - name: Checkout code + uses: actions/checkout@v3.3.0 + - name: Restore cached Aftman tools + uses: actions/cache@v3 + with: + path: ~/.aftman + key: aftman-${{ hashFiles('aftman.toml') }} + From 0173e08e255829feb0a82d1772f8986b39b37015 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 25 Sep 2025 21:48:05 +0300 Subject: [PATCH 09/18] Update build.yml --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a3345d1..0392028 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,5 +43,8 @@ jobs: with: path: ~/.aftman key: aftman-${{ hashFiles('aftman.toml') }} + - name: Authentificate Wally + run: wally login --token "${{ secrets.GITHUB_TOKEN }}" + From 08183c1dd3c872aee44cb96b746b750bddce6fff Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 25 Sep 2025 21:51:06 +0300 Subject: [PATCH 10/18] whoever told me workflows were easy lied to me --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0392028..e7ad8e8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,6 +43,8 @@ jobs: with: path: ~/.aftman key: aftman-${{ hashFiles('aftman.toml') }} + - name: Reinstall tools + run: aftman install - name: Authentificate Wally run: wally login --token "${{ secrets.GITHUB_TOKEN }}" From 52a4e49d5d3f5d743559f88a6f3768634f38df7c Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 25 Sep 2025 21:52:30 +0300 Subject: [PATCH 11/18] fuck --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e7ad8e8..5282ec4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,15 +38,17 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3.3.0 + - name: Set up Aftman + uses: ok-nick/setup-aftman@v0.4.2 - name: Restore cached Aftman tools uses: actions/cache@v3 with: path: ~/.aftman key: aftman-${{ hashFiles('aftman.toml') }} - - name: Reinstall tools - run: aftman install - name: Authentificate Wally run: wally login --token "${{ secrets.GITHUB_TOKEN }}" + - name: Publish to wally + run: wally publish From 1cd4497b6e611375b535415a0f3ea9241df69130 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 25 Sep 2025 21:54:30 +0300 Subject: [PATCH 12/18] Update build.yml --- .github/workflows/build.yml | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5282ec4..7ba335c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,40 +15,23 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - install-tools: - name: Install tools + + deploy: + name: Deploy to wally runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3.3.0 - name: Set up Aftman uses: ok-nick/setup-aftman@v0.4.2 - - name: Cache Aftman tools - uses: actions/cache@v3 - with: - path: ~/.aftman - key: aftman-${{ hashFiles('aftman.toml') }} - name: Check wally version run: wally --version - deploy: - name: Deploy to wally - runs-on: ubuntu-latest - needs: [install-tools] - steps: - - name: Checkout code - uses: actions/checkout@v3.3.0 - - name: Set up Aftman - uses: ok-nick/setup-aftman@v0.4.2 - - name: Restore cached Aftman tools - uses: actions/cache@v3 - with: - path: ~/.aftman - key: aftman-${{ hashFiles('aftman.toml') }} - name: Authentificate Wally run: wally login --token "${{ secrets.GITHUB_TOKEN }}" + - name: Publish to wally - run: wally publish + run: wally publish --token "${{ secrets.GITHUB_TOKEN }}" From 5789dcca326a01f98dc7a990a90909c80144e5a8 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 25 Sep 2025 21:55:55 +0300 Subject: [PATCH 13/18] ts is taking me too long --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7ba335c..45717d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: run: wally login --token "${{ secrets.GITHUB_TOKEN }}" - name: Publish to wally - run: wally publish --token "${{ secrets.GITHUB_TOKEN }}" + run: wally publish From eb3d851197cb0d6f37d44435bed3e5c704f4226b Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 25 Sep 2025 22:00:15 +0300 Subject: [PATCH 14/18] fix token issue --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45717d2..816090d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: run: wally --version - name: Authentificate Wally - run: wally login --token "${{ secrets.GITHUB_TOKEN }}" + run: wally login --token "${{ secrets.WALLY_AUTHTOKEN }}" - name: Publish to wally run: wally publish From f4806a04fbe3241cdd1e842908d076c0ce910526 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 25 Sep 2025 22:04:44 +0300 Subject: [PATCH 15/18] Update build.yml --- .github/workflows/build.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 816090d..bbf82fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,19 +1,16 @@ -# This is a basic workflow to help you get started with Actions +# when will this work vro name: Deploy -# Controls when the workflow will run + on: - # Triggers the workflow on push or pull request events but only for the "main" branch push: branches: [ "main" ] pull_request: branches: [ "main" ] - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: deploy: @@ -26,11 +23,11 @@ jobs: uses: ok-nick/setup-aftman@v0.4.2 - name: Check wally version run: wally --version - - - name: Authentificate Wally - run: wally login --token "${{ secrets.WALLY_AUTHTOKEN }}" - - - name: Publish to wally + + + - name: Authentificate & Publish to wally + env: + GITHUB_TOKEN: ${{ secrets.WALLY_AUTHTOKEN }} run: wally publish From 7e9e6f50b4191a16a02edfebfeca940d2da25a28 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 25 Sep 2025 22:06:49 +0300 Subject: [PATCH 16/18] mf even chatgpt doesnt know --- .github/workflows/build.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bbf82fe..18f941f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,11 +23,14 @@ jobs: uses: ok-nick/setup-aftman@v0.4.2 - name: Check wally version run: wally --version - - - - name: Authentificate & Publish to wally + + - name: Authentificate wally env: GITHUB_TOKEN: ${{ secrets.WALLY_AUTHTOKEN }} + run: wally login --token "$GITHUB_TOKEN" + + - name: Publish to wally + run: wally publish From cea3599e35135d87f45f90734f0cf92158a0324b Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 25 Sep 2025 22:09:56 +0300 Subject: [PATCH 17/18] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 18f941f..75fa56e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,8 +26,8 @@ jobs: - name: Authentificate wally env: - GITHUB_TOKEN: ${{ secrets.WALLY_AUTHTOKEN }} - run: wally login --token "$GITHUB_TOKEN" + WALLY_AUTH_TOKEN: ${{ secrets.WALLY_AUTHTOKEN }} + run: wally login --token "$WALLY_AUTH_TOKEN" - name: Publish to wally From 0832191a5d38bbca5d003c9f6a053c86b7dcf083 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 26 Sep 2025 10:58:41 +0300 Subject: [PATCH 18/18] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 75fa56e..e4a077d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: - name: Authentificate wally env: - WALLY_AUTH_TOKEN: ${{ secrets.WALLY_AUTHTOKEN }} + WALLY_AUTH_TOKEN: ${{ secrets.GITH_TOKEN }} run: wally login --token "$WALLY_AUTH_TOKEN" - name: Publish to wally