Compare commits

..

24 Commits

Author SHA1 Message Date
Sanjay c6a68071d2
Merge pull request #68 from Sanjay-B/documentation-contrib-guide
Add Documentation Contributors Guide
2020-03-22 16:24:12 -04:00
Sanjay 2f6670f889
Merge pull request #65 from teverse/feature-round-theme-property
Round theme property / themer override
2020-03-22 16:23:58 -04:00
Sanjay 4110d0dfc1 Merge branch 'master' into documentation-contrib-guide 2020-03-22 16:15:10 -04:00
Sanjay a1cefc3ddc Merge remote-tracking branch 'upstream/master' 2020-03-22 16:14:35 -04:00
Sanjay Bhadra de8545ee49 Update Readme 2020-03-22 15:50:44 -04:00
Sanjay Bhadra 295c363a9f Fix spelling mistakes on contrib guide 2020-03-22 15:48:00 -04:00
Sanjay Bhadra 5e75bc8b4f Add contributors guide 2020-03-22 14:09:53 -04:00
Sanjay f652190ddd contrib start 2020-03-22 00:18:51 -04:00
Sanjay dd76af69e3
Merge pull request #64 from Sanjay-B/feature-round-theme-property
Feature round theme property / themer overrides
2020-03-21 01:27:34 -04:00
Sanjay af58910caa Remove random comment 2020-03-21 01:23:00 -04:00
Sanjay eebc40a117 Fixed non-zeros being assigned as nil themer bug 2020-03-21 01:22:09 -04:00
Sanjay a30e04495a Theme Property Overrides, add borderRadius override on theme page 2020-03-21 01:08:22 -04:00
Sanjay 0d0677fb30 Merge remote-tracking branch 'upstream/master' 2020-03-20 13:16:13 -04:00
Sanjay 6d1ae20efc docs stuff 2020-02-08 17:47:49 -05:00
Sanjay 64ae8ea6e3 Merge remote-tracking branch 'upstream/master' 2020-02-08 17:47:19 -05:00
Sanjay 9dd05de288 Merge remote-tracking branch 'upstream/master' 2020-01-24 18:26:48 -05:00
Sanjay 3e9a845bd9 Merge remote-tracking branch 'upstream/master' 2020-01-22 00:42:44 -05:00
Sanjay 383838b989 Merge remote-tracking branch 'upstream/master' 2020-01-16 19:33:41 -05:00
Sanjay 3b7ca838dd Merge branch 'master' of https://github.com/Sanjay-B/teverse 2020-01-14 22:47:07 -05:00
Sanjay 329472a88d Ignore notes.txt 2020-01-14 22:47:01 -05:00
Sanjay ec44060106
Deleted .DS_Store files in Workshop & UI Directory 2020-01-14 22:44:32 -05:00
Sanjay 4d39715a2f
Delete .DS_Store 2020-01-14 22:42:53 -05:00
Sanjay 61895527dc
Delete .DS_Store 2020-01-14 22:42:43 -05:00
Sanjay abce559f76
Delete .DS_Store 2020-01-14 22:40:34 -05:00
5 changed files with 163 additions and 19 deletions

View File

@ -1,7 +1,18 @@
# teverse
# Teverse
This repo contains open source components produced for Teverse.
[View Style Guide](/TEVERSE-STYLE.md)
# 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.
# Copyright

77
TEVERSE-CONTRIB.md Normal file
View File

@ -0,0 +1,77 @@
# 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.

View File

@ -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("undefined", nil, nil),
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'}),
},
events = {
stepped = event("undefined", {}),

View File

@ -5,6 +5,10 @@ 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)"},
@ -41,6 +45,7 @@ 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),
@ -93,6 +98,32 @@ 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),
@ -101,6 +132,7 @@ THISISTHERESETBUTTON = ui.create("guiButton", container, {
align = enums.align.middle,
visible = false
},"primaryVariant")
THISISTHERESETBUTTON:mouseLeftReleased(function()
exportInput.text = shared.workshop:getSettings("customTheme")
exportWindow.visible = true
@ -154,7 +186,7 @@ function generateEditor()
align = enums.align.middle,
backgroundColour = v,
textColour = cv > 0.5 and colour:black() or colour:white(),
borderRadius = 4,
borderRadius = radiusNum, -- override this
borderColour = colour:black(),
borderAlpha = 0.3
}, prop)
@ -207,11 +239,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)
themer.setTheme(theme,radiusNum)
themeReload()
else
shared.workshop:setSettings("themeType", presets[i][1])
themer.setThemePreset(require("tevgit:workshop/controllers/ui/themes/" .. presets[i][1] .. ".lua"))
themer.setThemePreset(require("tevgit:workshop/controllers/ui/themes/" .. presets[i][1] .. ".lua"),radiusNum)
themeReload()
end
makePresetMenu()

View File

@ -22,10 +22,16 @@ 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
@ -37,6 +43,9 @@ 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
@ -60,17 +69,27 @@ return {
themeriseGui = themeriseGui,
registerGui = function(gui, style)
registerGui = function(gui, style, ...)
-- set the gui's style and themerise it.
registeredGuis[gui] = style
themeriseGui(gui)
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
for gui,v in pairs(registeredGuis) do
themeriseGui(gui)
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
@ -90,11 +109,16 @@ return {
shared.workshop:setSettings("customTheme", null)
end,
setThemePreset = function(theme)
setThemePreset = function(theme,...)
-- change the current theme AND re-themerise all guis
currentTheme = theme
for gui,v in pairs(registeredGuis) do
themeriseGui(gui)
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)