From 60ef641276ae71403b87222876dc5705f42d09b0 Mon Sep 17 00:00:00 2001 From: Insality Date: Sat, 2 Nov 2024 17:16:09 +0100 Subject: [PATCH] Update --- druid/editor_scripts/druid.editor_script | 23 ++++------------------- druid/extended/layout.lua | 5 +---- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/druid/editor_scripts/druid.editor_script b/druid/editor_scripts/druid.editor_script index 2f63c92..27d4adc 100644 --- a/druid/editor_scripts/druid.editor_script +++ b/druid/editor_scripts/druid.editor_script @@ -1,6 +1,3 @@ ---- @license MIT, Insality 2021 ---- @source https://github.com/Insality/druid - local M = {} @@ -27,18 +24,12 @@ function M.get_commands() return { { label = "Assign Layers", - - locations = {"Edit"}, - - query = { - selection = {type = "resource", cardinality = "one"} - }, - + locations = { "Edit" }, + query = { selection = {type = "resource", cardinality = "one"} }, active = function(opts) local path = editor.get(opts.selection, "path") return ends_with(path, ".gui") end, - run = function(opts) local file = opts.selection print("Run script for", editor.get(file, "path")) @@ -60,18 +51,12 @@ function M.get_commands() { label = "Create Druid Component", - - locations = {"Edit"}, - - query = { - selection = {type = "resource", cardinality = "one"} - }, - + locations = { "Edit", "Assets" }, + query = { selection = {type = "resource", cardinality = "one"} }, active = function(opts) local path = editor.get(opts.selection, "path") return ends_with(path, ".gui") end, - run = function(opts) local file = opts.selection print("Run script for", editor.get(file, "path")) diff --git a/druid/extended/layout.lua b/druid/extended/layout.lua index 4285746..457c17c 100644 --- a/druid/extended/layout.lua +++ b/druid/extended/layout.lua @@ -1,10 +1,7 @@ local helper = require("druid.helper") local component = require("druid.component") ----@alias druid.layout.mode ----| "horizontal" Elements are placed horizontally ----| "vertical" Elements are placed vertically ----| "horizontal_wrap" Elements are placed horizontally, but if the row width is greater than the parent width, the next row is created +---@alias druid.layout.mode "horizontal"|"vertical"|"horizontal_wrap" ---@class druid.layout.row_data ---@field width number