mirror of https://github.com/teverse/teverse
Compare commits
No commits in common. "c6a68071d2563b2d4a15038f985a144c3e035a86" and "f54e83acfbd945f185df5bf9dcc64043db621b17" have entirely different histories.
c6a68071d2
...
f54e83acfb
15
README.md
15
README.md
|
@ -1,18 +1,7 @@
|
|||
|
||||
# Teverse
|
||||
# teverse
|
||||
|
||||
This repo contains open source components produced for Teverse.
|
||||
|
||||
|
||||
# Contributing to Teverse
|
||||
|
||||
Teverse is a platform that enables developers with a simple, unified interface to create game and learn about game development.
|
||||
|
||||
As a platform, we pride ourselves on giving developers more control without little to no strings attached. As such, we allow contribution to be made by our community in order better our own platform.
|
||||
|
||||
Please see the [Contributing Guide](/TEVERSE-CONTRIB.md) and [View Style Guide](/TEVERSE-STYLE.md) for more details.
|
||||
|
||||
For those that have contributed, we thank you for your time and service to make this platform powerful.
|
||||
[View Style Guide](/TEVERSE-STYLE.md)
|
||||
|
||||
# Copyright
|
||||
|
||||
|
|
|
@ -1,77 +0,0 @@
|
|||
# Contributions
|
||||
|
||||
Everyone is welcome to contribute to Teverse. For Teverse to truly be for developers, we strongly encourage developers to take part in its development. Whether you're here to suggest, find bugs or build the next component to workshop, those efforts mean a lot to us and the community that we foster.
|
||||
|
||||
# Issues
|
||||
|
||||
Issues are a core component of development and help identify pitfalls (or improvement) in our design. Whether you're replying to a edge-case or helping to isolate the root cause of a bug, developers can benefit from the knowledge and expertise you bring.
|
||||
|
||||
We prefer that all feature requests and bug reports are to be redirected to our [Forum](https://forum.teverse.com) but, if you don't have an account (a teverse account is needed to post), feel free to open up an issue.
|
||||
|
||||
# Reporting
|
||||
|
||||
Reporting, suggesting features and feedback are essential to help improve Teverse. However, we ask that all reports (including issues) are to follow our format and guidelines.
|
||||
|
||||
> If a bug is breaking your workflow and causing serious issues for you and other developers, please label the issue under **Incident Reports** under the [Forum](https://forum.teverse.com) or **Critical** in the title of an opened issue.
|
||||
|
||||
When reporting, please include the following format:
|
||||
|
||||
* **Descriptive Title** - a title that explains the bug in simple terms; no full sentences
|
||||
|
||||
* **Version of Teverse** - the version that the bug started to become noticeable
|
||||
|
||||
* **Operating System Name & Version** - i.e. MacOS Catalina 10.15.1
|
||||
|
||||
* **Detailed Description** - a description of the bug in full detail
|
||||
|
||||
* **Issues caused by the the bug** - development setbacks, workflow disruption, etc
|
||||
|
||||
* **Steps that were tried to correct beforehand** - Steps you have taken in an effort to correct the issue.
|
||||
|
||||
* **Steps to reproduce the bug** - Steps that can be used to reproduce the bug; clear & concise
|
||||
|
||||
* **Additional files** - A video or screenshot of the bug
|
||||
|
||||
* **Log Files** - debug.log or any other files that may help to isolate the bug
|
||||
|
||||
> **Note:** If any information is missing or unknown, please leave an ``n/a`` for that section. Please do not skip or occlude the entire section.
|
||||
|
||||
> **Note:** If you do not follow the format above, it will be rejected and sent back to be corrected.
|
||||
|
||||
Teverse is under active development and bugs can be introduced or fixed by mistake. If this does occur, we'll let you know before closing your issue. If the issue is misplaced, please contact a staff member to reopen. If the issue is a duplicate, we'll refer you to the most recent related issue to prevent clutter.
|
||||
|
||||
# Contributing Code
|
||||
|
||||
Contributions in the form of new features, upgrading current features or fixing a bug is always welcome and we encourage the community to participate in the development of our platform. To keep this process streamlined, we ask that you follow the following format:
|
||||
|
||||
> **Note:** Commit messages should be clear and concise; there's no strict format but, keep it ethical and professional
|
||||
|
||||
* **Descriptive Title** - a title that explains the pull request in simple terms; no full sentences
|
||||
|
||||
* **Descriptive Body** - descriptive paragraph (or more) that explains the pull request in full detail
|
||||
|
||||
* **Current Version** - the version of Teverse used when developing this pull request
|
||||
|
||||
* **Tested** - a summary of how the pull request functioned when being tested; submit unit tests if used
|
||||
|
||||
* **Posted on the forum** - if posted on the forum and this pull request is your follow-up, please link the forum thread
|
||||
|
||||
> **Note:** If any information is missing or unknown, please leave an ``n/a`` for that section. Please do not skip or occlude the entire section.
|
||||
|
||||
> **Note:** If you do not follow the format above, it will be rejected and sent back to be corrected.
|
||||
|
||||
# Code Review
|
||||
|
||||
Once you've submitted a pull request and it's properly formatted, it will go through code review to verify accurate, efficiency and software quality / integrity.
|
||||
|
||||
* Code Reviews are conducted through Github comments and not our Forum
|
||||
|
||||
* All changes that have been pushed by the reviewer must be changed accordingly; we're not responsible for making changes, you are
|
||||
|
||||
We'll let you know what needs to be changed and you can request a reviewer to review your code whenever plausible.
|
||||
|
||||
> **Note:** Code Review can be an extensive process if our procedure is not followed or we get an influx of pull requests, please be patient
|
||||
|
||||
# Policies and Licensing
|
||||
|
||||
Contributions to Teverse must follow our [licensing](https://github.com/teverse/teverse/blob/master/LICENSE) and [coding standards](https://github.com/teverse/teverse/blob/master/TEVERSE-STYLE.md). In accordance, all work that has been used from other sources must include a credit line to their respective authors. If you pass copied code as your own with unethical intent, we'll deny your pull request and block your access to the repository. We take this seriously.
|
|
@ -723,9 +723,9 @@ addDocs("engine", {
|
|||
line = property("The default constructor for line"),
|
||||
},
|
||||
methods = {
|
||||
openUrl = method("Opens the default web browser", {['url'] = 'string'}, nil),
|
||||
construct = method("A generic constructor", {['parent'] = 'variant', ['properties'] = 'table', ['className'] = 'string'}, {'variant'}),
|
||||
isAuthenticated = method("Returns the internal isAuthenticated cache", nil, {'Table'}),
|
||||
openUrl = method("opens the default web browser", {['url'] = 'string'}, nil),
|
||||
construct = method("a generic constructor", {['parent'] = 'variant', ['properties'] = 'table', ['className'] = 'string'}, {'variant'}),
|
||||
isAuthenticated = method("undefined", nil, nil),
|
||||
},
|
||||
events = {
|
||||
stepped = event("undefined", {}),
|
||||
|
|
|
@ -5,10 +5,6 @@ ui = require("tevgit:workshop/controllers/ui/core/ui.lua")
|
|||
shared = require("tevgit:workshop/controllers/shared.lua")
|
||||
themer = require("tevgit:workshop/controllers/ui/core/themer.lua")
|
||||
colourPicker = require("tevgit:workshop/controllers/ui/components/colourPicker.lua")
|
||||
parseInputs = require("tevgit:workshop/controllers/ui/components/propertyEditor/parseInputs.lua")
|
||||
|
||||
-- Overrides
|
||||
local radiusNum = 0 -- defaults to flat
|
||||
|
||||
presets = {
|
||||
{"default", "Classic (default)"},
|
||||
|
@ -45,7 +41,6 @@ frame = ui.create("guiFrame", importWindow.content, {
|
|||
cropChildren = true,
|
||||
backgroundAlpha = 0
|
||||
})
|
||||
|
||||
importInput = ui.create("guiTextBox", frame, {
|
||||
size = guiCoord(1, 0, 1, 0),
|
||||
position = guiCoord(0, 0, 0, 0),
|
||||
|
@ -98,32 +93,6 @@ exportInput = ui.create("guiTextBox", eframe, {
|
|||
zIndex = 100
|
||||
}, "secondary")
|
||||
|
||||
ui.create("guiTextBox", container, {
|
||||
position = guiCoord(0.5, 10, 0, 80),
|
||||
size = guiCoord(0.5, -20, 0, 30),
|
||||
text = "Border Radius"
|
||||
}, "backgroundText")
|
||||
|
||||
local borderRadiusInput = ui.create("guiTextBox", container, {
|
||||
size = guiCoord(0.153, 0, 0.038, 0),
|
||||
position = guiCoord(0.79, 10, 0, 80),
|
||||
backgroundAlpha = 0.25,
|
||||
readOnly = false,
|
||||
multiline = false,
|
||||
name = "input",
|
||||
text = tostring(radiusNum),
|
||||
align = enums.align.middle
|
||||
}, "secondary")
|
||||
|
||||
borderRadiusInput:textInput(function(numText)
|
||||
num = tonumber(numText)
|
||||
if #numText == 0 then radiusNum = 0 return end
|
||||
if string.find(numText,"%a") or string.find(numText,"%s") then borderRadiusInput:setText("0") radiusNum = 0 return end
|
||||
if string.len(numText) > 5 then borderRadiusInput:setText(string.sub(numText,1,5)) radiusNum = 0 return end
|
||||
if num < 0 then borderRadiusInput:setText("0") return end
|
||||
radiusNum = tonumber(borderRadiusInput.text)
|
||||
end)
|
||||
|
||||
THISISTHERESETBUTTON = ui.create("guiButton", container, {
|
||||
size = guiCoord(0.5, -20, 0, 30),
|
||||
position = guiCoord(0.5, 10, 0, 80),
|
||||
|
@ -132,7 +101,6 @@ THISISTHERESETBUTTON = ui.create("guiButton", container, {
|
|||
align = enums.align.middle,
|
||||
visible = false
|
||||
},"primaryVariant")
|
||||
|
||||
THISISTHERESETBUTTON:mouseLeftReleased(function()
|
||||
exportInput.text = shared.workshop:getSettings("customTheme")
|
||||
exportWindow.visible = true
|
||||
|
@ -186,7 +154,7 @@ function generateEditor()
|
|||
align = enums.align.middle,
|
||||
backgroundColour = v,
|
||||
textColour = cv > 0.5 and colour:black() or colour:white(),
|
||||
borderRadius = radiusNum, -- override this
|
||||
borderRadius = 4,
|
||||
borderColour = colour:black(),
|
||||
borderAlpha = 0.3
|
||||
}, prop)
|
||||
|
@ -239,11 +207,11 @@ function makePresetMenu()
|
|||
if presets[i][1] == "custom" then
|
||||
shared.workshop:setSettings("themeType", presets[i][1])
|
||||
shared.workshop:setSettings("customTheme", engine.json:encodeWithTypes(theme))
|
||||
themer.setTheme(theme,radiusNum)
|
||||
themer.setTheme(theme)
|
||||
themeReload()
|
||||
else
|
||||
shared.workshop:setSettings("themeType", presets[i][1])
|
||||
themer.setThemePreset(require("tevgit:workshop/controllers/ui/themes/" .. presets[i][1] .. ".lua"),radiusNum)
|
||||
themer.setThemePreset(require("tevgit:workshop/controllers/ui/themes/" .. presets[i][1] .. ".lua"))
|
||||
themeReload()
|
||||
end
|
||||
makePresetMenu()
|
||||
|
|
|
@ -22,16 +22,10 @@ else
|
|||
shared.workshop:setSettings("themeType", "default")
|
||||
end
|
||||
|
||||
local function themeriseGui(gui,...)
|
||||
local function themeriseGui(gui)
|
||||
-- Grab the gui's style name set in the "registerGui" func
|
||||
local styleName = registeredGuis[gui]
|
||||
|
||||
local args = nil
|
||||
if #{...} > 0 then
|
||||
args = {...}
|
||||
args = args[1]
|
||||
end
|
||||
|
||||
-- get the style's properties from the current theme
|
||||
local style = currentTheme[styleName]
|
||||
if not style then
|
||||
|
@ -43,9 +37,6 @@ local function themeriseGui(gui,...)
|
|||
if gui[property] and gui[property] ~= value then
|
||||
gui[property] = value
|
||||
end
|
||||
if args then
|
||||
gui["borderRadius"] = args[1] or 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -69,28 +60,18 @@ return {
|
|||
|
||||
themeriseGui = themeriseGui,
|
||||
|
||||
registerGui = function(gui, style, ...)
|
||||
registerGui = function(gui, style)
|
||||
-- set the gui's style and themerise it.
|
||||
registeredGuis[gui] = style
|
||||
local args = {...} -- contains overrides
|
||||
if args then
|
||||
themeriseGui(gui,args)
|
||||
elseif not args then
|
||||
themeriseGui(gui)
|
||||
end
|
||||
end,
|
||||
|
||||
setTheme = function(theme,...)
|
||||
setTheme = function(theme)
|
||||
-- change the current theme AND re-themerise all guis
|
||||
currentTheme = theme
|
||||
args = {...} -- contains overrides
|
||||
for gui,v in pairs(registeredGuis) do
|
||||
if args then
|
||||
themeriseGui(gui,args)
|
||||
else
|
||||
themeriseGui(gui)
|
||||
end
|
||||
end
|
||||
|
||||
-- Save the theme
|
||||
shared.workshop:setSettings("themeType", "custom")
|
||||
|
@ -109,17 +90,12 @@ return {
|
|||
shared.workshop:setSettings("customTheme", null)
|
||||
end,
|
||||
|
||||
setThemePreset = function(theme,...)
|
||||
setThemePreset = function(theme)
|
||||
-- change the current theme AND re-themerise all guis
|
||||
currentTheme = theme
|
||||
local args = {...} -- contains overrides
|
||||
for gui,v in pairs(registeredGuis) do
|
||||
if args then
|
||||
themeriseGui(gui,args)
|
||||
elseif not args then
|
||||
themeriseGui(gui)
|
||||
end
|
||||
end
|
||||
|
||||
shared.workshop:setSettings("customTheme", null)
|
||||
end,
|
||||
|
|
Loading…
Reference in New Issue