Skip to content

Commit bb19141

Browse files
committed
Updated/added icons. Made some sections hidden by default.
1 parent 8a6c03d commit bb19141

File tree

6 files changed

+19
-7
lines changed

6 files changed

+19
-7
lines changed

gfx/icons.png

115 Bytes
Loading

src/gui.gloa

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,12 +1831,13 @@ local drawElement :: (state:State, el:Element) {
18311831
case Section:
18321832
local section = cast(Section) el
18331833
local hidden = app.hiddenSections[section.name]
1834+
local font = fontNormal--hidden ? fontSmall : fontNormal
18341835

18351836
if section.id == state.hoveredId {
18361837
local x = section.layoutX - SPACING
18371838
local y = section.layoutY - BUTTON_PADDING_Y
1838-
local w = fontNormal.getWidth!(section.label) + 2*SPACING
1839-
local h = fontNormal.getHeight!() + 2*BUTTON_PADDING_Y
1839+
local w = font.getWidth!(section.label) + 2*SPACING
1840+
local h = font.getHeight!() + 2*BUTTON_PADDING_Y
18401841
LG.setColor(1, 1, 1, .45)
18411842
LG.rectangle(LG.DrawMode.FILL, x, y, w, h, BUTTON_RADIUS)
18421843
}
@@ -1855,8 +1856,10 @@ local drawElement :: (state:State, el:Element) {
18551856
}
18561857

18571858
if section.label {
1859+
LG.setFont(font)
18581860
LG.setColor(1, 1, 1, TEXT_OPACITY)
18591861
LG.print(section.label, section.layoutX, section.layoutY)
1862+
LG.setFont(fontNormal)
18601863
}
18611864

18621865
if not hidden drawChildren(state, section)

src/guiSetup.gloa

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export setupGuiFrames :: () {
3535
guiState.separator!({ thick=true }),
3636

3737
guiState.vbox!({ name="projectSettings",
38-
guiState.section!({ --[[name="customDataProjectSection",]] label="Custom data",
38+
guiState.section!({ name="customDataProjectSection", label="Custom data", icon16="data",
3939
guiState.inputText!({ name="customDataProject" }),
4040
}),
4141

@@ -96,7 +96,7 @@ export setupGuiFrames :: () {
9696
guiState.tabs!({ name="systems", specialLastTab=true }),
9797

9898
guiState.scrollable!({
99-
guiState.section!({ --[[name="customDataSystemSection",]] label="Custom data",
99+
guiState.section!({ name="customDataSystemSection", label="Custom data", icon16="data",
100100
guiState.inputText!({ name="customDataSystem" }),
101101
}),
102102

@@ -105,7 +105,7 @@ export setupGuiFrames :: () {
105105
guiState.section!({ name="textureSection", label="Texture", icon16="texture",
106106
guiState.radio!({ name="textureName", labelLeft="preset" }),
107107
guiState.hbox!({
108-
guiState.inputText!({ name="texturePath", labelLeft="path", tooltip="Absolute path, or relative to the saved .hotparticles file (Right-click for recent)", weight=1 }),
108+
guiState.inputText!({ name="texturePath", labelLeft="path", tooltip="Absolute path, or relative to the .hotparticles file (Right-click for recent)", weight=1 }),
109109
guiState.buttons!({ buttons={
110110
{name="chooseTexture", image="iconFolder", tooltip="Browse files"},
111111
{name="reloadTexture", image="iconReload", tooltip="Reload texture"},
@@ -335,7 +335,7 @@ export setupGuiFrames :: () {
335335

336336
guiState.section!({ name="shaderSection", label="Shader", icon16="shader",
337337
guiState.hbox!({
338-
guiState.inputText!({ name="shaderPath", labelLeft="path", tooltip="Absolute path, or relative to the saved .hotparticles file", weight=1 }),
338+
guiState.inputText!({ name="shaderPath", labelLeft="path", tooltip="Absolute path, or relative to the .hotparticles file", weight=1 }),
339339
guiState.buttons!({ buttons={
340340
{name="chooseShader", image="iconFolder", tooltip="Browse files"},
341341
{name="reloadShader", image="iconReload", tooltip="Reload shader"},

src/icons.gloa

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,5 +232,13 @@ export generateIcons :: () {
232232
"shader",
233233
"scaleGlobal",
234234
-- 4
235+
"data",
236+
"",
237+
"",
238+
"",
239+
"",
240+
"",
241+
"",
242+
"",
235243
})
236244
}

src/main.gloa

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export App :: struct {
180180

181181
bookmarkedFolders: []string,
182182

183-
hiddenSections: struct { !key:string, !value:bool },
183+
hiddenSections: struct { !key:string, !value:bool } = {scaleGlobalSection=true, scaleAllSection=true, customDataProjectSection=true, customDataSystemSection=true},
184184

185185
gotWindowInfo = false, -- Load-time only.
186186
windowX = 0,

src/workspace.gloa

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ export loadWorkspace :: (path:string) -> (success:bool, gotError:bool, app:App)
515515
case "hiddenSections":
516516
local ^ok, ^ptr, names = readStringArray(version, line, cast(int)ptr) ; if not ok return parsingError(path, ln, "Bad value format: %s", line)
517517
if cast(int)ptr <= #line return parsingError(path, ln, "Garbage after values: %s", line)
518+
app.hiddenSections = {}
518519
for names app.hiddenSections[it] = true
519520

520521
case "window":

0 commit comments

Comments
 (0)