Newer
Older
Radon / core / schemas.lua
@Alyssa May Alyssa May on 9 Jan 2023 7 KB Config editor

local configSchema = {
    branding = {
        title = "string"
    },
    settings = {
        hideUnavailableProducts = "boolean",
        pollFrequency = "number",
        categoryCycleFrequency = "number",
        activityTimeout = "number",
        dropDirection = "enum<'forward' | 'up' | 'down' | 'north' | 'south' | 'east' | 'west'>: direction",
        smallTextKristPayCompatability = "boolean",
        playSounds = "boolean",
        showFooter = "boolean"
    },
    lang = {
        footer = "string",
        footerNoName = "string?",
        refundRemaining = "string",
        refundOutOfStock = "string",
        refundAtLeastOne = "string",
        refundInvalidProduct = "string",
        refundNoProduct = "string",
        refundError = "string"
    },
    theme = {
        formatting = {
            headerAlign = "enum<'left' | 'center' | 'right'>: alignment",
            footerAlign = "enum<'left' | 'center' | 'right'>: alignment",
            footerSize = "enum<'small' | 'medium' | 'large' | 'auto'>: size",
            productNameAlign = "enum<'left' | 'center' | 'right'>: alignment",
            layout = "enum<'small' | 'medium' | 'large' | 'auto' | 'custom'>: layout",
            layoutFile = "file?"
        },
        colors = {
            bgColor = "color",
            headerBgColor = "color",
            headerColor = "color",
            footerBgColor = "color",
            footerColor = "color",
            productBgColors = {
                __type = "array",
                __min = 1,
                __entry = "color"
            },
            outOfStockQtyColor = "color",
            lowQtyColor = "color",
            warningQtyColor = "color",
            normalQtyColor = "color",
            productNameColor = "color",
            outOfStockNameColor = "color",
            priceColor = "color",
            addressColor = "color",
            currencyTextColor = "color",
            currencyBgColors = {
                __type = "array",
                __min = 1,
                __entry = "color"
            },
            catagoryTextColor = "color",
            categoryBgColors = {
                __type = "array",
                __min = 1,
                __entry = "color"
            },
            activeCategoryColor = "color",
        },
        palette = {
            [colors.black] = "number",
            [colors.blue] = "number",
            [colors.purple] = "number",
            [colors.green] = "number",
            [colors.brown] = "number",
            [colors.gray] = "number",
            [colors.lightGray] = "number",
            [colors.red] = "number",
            [colors.orange] = "number",
            [colors.yellow] = "number",
            [colors.lime] = "number",
            [colors.cyan] = "number",
            [colors.magenta] = "number",
            [colors.pink] = "number",
            [colors.lightBlue] = "number",
            [colors.white] = "number"
        }
    },
    terminalTheme = {
        colors = {
            titleTextColor = "color",
            titleBgColor = "color",
            bgColor = "color",
            catagoryTextColor = "color",
            catagoryBgColor = "color",
            activeCatagoryBgColor = "color",
            logTextColor = "color",
            configEditor = {
                bgColor = "color",
                textColor = "color",
                buttonColor = "color",
                buttonTextColor = "color",
                inactiveButtonColor = "color",
                inactiveButtonTextColor = "color",
                scrollbarBgColor = "color",
                scrollbarColor = "color",
                inputBgColor = "color",
                inputTextColor = "color",
                errorBgColor = "color",
                errorTextColor = "color",
                toggleColor = "color",
                toggleBgColor = "color",
                toggleOnColor = "color",
                toggleOffColor = "color",
                unsavedChangesColor = "color",
                unsavedChangesTextColor = "color",
                modalBgColor = "color",
                modalTextColor = "color",
                modalBorderColor = "color",
            },
            productsEditor = {
                bgColor = "color",
                textColor = "color",
                buttonColor = "color",
                buttonTextColor = "color",
                inactiveButtonColor = "color",
                inactiveButtonTextColor = "color",
                scrollbarBgColor = "color",
                scrollbarColor = "color",
                inputBgColor = "color",
                inputTextColor = "color",
                errorBgColor = "color",
                errorTextColor = "color",
                toggleColor = "color",
                toggleBgColor = "color",
                toggleOnColor = "color",
                toggleOffColor = "color",
                unsavedChangesColor = "color",
                unsavedChangesTextColor = "color",
                modalBgColor = "color",
                modalTextColor = "color",
                modalBorderColor = "color",
            }
        },
        palette = {
            [colors.black] = "number",
            [colors.blue] = "number",
            [colors.purple] = "number",
            [colors.green] = "number",
            [colors.brown] = "number",
            [colors.gray] = "number",
            [colors.lightGray] = "number",
            [colors.red] = "number",
            [colors.orange] = "number",
            [colors.yellow] = "number",
            [colors.lime] = "number",
            [colors.cyan] = "number",
            [colors.magenta] = "number",
            [colors.pink] = "number",
            [colors.lightBlue] = "number",
            [colors.white] = "number"
        }
    },
    sounds = {
        button = "sound",
        purchase = "sound",
    },
    currencies = {
        __type = "array",
        __min = 1,
        __entry = {
            id = "string",
            node = "string?",
            name = "string?",
            pkey = "string",
            pkeyFormat = "enum<'raw' | 'kristwallet'>: pkey format",
            value = "number?"
        }
    },
    peripherals = {
        monitor = "string?",
        speaker = "speaker?",
        modem = "modem?",
        shopSyncModem = "modem?",
        blinker = "enum<'left' | 'right' | 'front' | 'back' | 'top' | 'bottom'>?: side",
        exchangeChest = "chest?",
        outputChest = "chest",
    },
    hooks = {
        start = "function?",
        prePurchase = "function?",
        purchase = "function?",
        failedPurchase = "function?",
        programError = "function?",
        blink = "function?",
    },
    shopSync = {
        enabled = "boolean?",
        name = "string?",
        description = "string?",
        owner = "string?",
        location = {
            coordinates = {
                __type = "array?",
                __min = 3,
                __max = 3,
                __entry = "number"
            },
            description = "string?",
            dimension = "enum<'overworld' | 'nether' | 'end'>?: dimension"
        }
    },
    exchange = {
        enabled = "boolean",
        node = "string"
    }
}

local productsSchema = {
    __type = "array",
    __entry = {
        modid = "string",
        name = "string?",
        address = "string",
        category = "string?",
        price = "number",
        priceOverrides = {
            __type = "array?",
            __entry = {
                currency = "string",
                price = "number"
            }
        },
        predicate = "table?"
    }
}

local soundSchema = {
    name = "string",
    volume = "number",
    pitch = "number"
}

return {
    configSchema = configSchema,
    productsSchema = productsSchema,
    soundSchema = soundSchema
}