Update Proclamation selection
Moved selection keybinds: - Enter now saves - Space selects - Removed A Updated colors to be more readable and colorblind friendly. Cleaned up instructional text to be easier and more simple to read.
This commit is contained in:
@@ -24,6 +24,7 @@ type FlatItem struct {
|
|||||||
Label StringItem
|
Label StringItem
|
||||||
ID string
|
ID string
|
||||||
IsCategory bool
|
IsCategory bool
|
||||||
|
IsSubCategory bool
|
||||||
Depth int
|
Depth int
|
||||||
Expanded bool
|
Expanded bool
|
||||||
}
|
}
|
||||||
@@ -79,7 +80,7 @@ func (p *ProclamationOptions) Init(ctx *PageCtx) error {
|
|||||||
p.title, _ = NewStringItem("Proclamation Browser", p.font, colors.White)
|
p.title, _ = NewStringItem("Proclamation Browser", p.font, colors.White)
|
||||||
p.title.Scale(float32(64) / float32(ctx.CfgPtr.StandardFontSize))
|
p.title.Scale(float32(64) / float32(ctx.CfgPtr.StandardFontSize))
|
||||||
|
|
||||||
p.prompt, _ = NewStringItem("Arrows: Nav | Enter: Exp/Col | Space: Toggle | A: Accept | Back: Cancel", p.font, colors.White)
|
p.prompt, _ = NewStringItem("Arrows: Nav Space: Select/Expand Enter: Save Changes Back: Cancel", p.font, colors.White)
|
||||||
p.prompt.Scale(itemScale * 0.8)
|
p.prompt.Scale(itemScale * 0.8)
|
||||||
|
|
||||||
// Calculation for visible area
|
// Calculation for visible area
|
||||||
@@ -226,14 +227,14 @@ func (p *ProclamationOptions) HandleEvent(event *sdl.Event) error {
|
|||||||
p.scrollOffset = bottomIdx
|
p.scrollOffset = bottomIdx
|
||||||
p.highlightIndex = bottomIdx
|
p.highlightIndex = bottomIdx
|
||||||
case sdl.K_RETURN:
|
case sdl.K_RETURN:
|
||||||
p.toggleExpansion(p.highlightIndex)
|
p.acceptChanges()
|
||||||
case sdl.K_SPACE:
|
case sdl.K_SPACE:
|
||||||
item := p.allItems[p.highlightIndex]
|
item := p.allItems[p.highlightIndex]
|
||||||
if !item.IsCategory {
|
if !item.IsCategory {
|
||||||
p.activeMap[item.ID] = !p.activeMap[item.ID]
|
p.activeMap[item.ID] = !p.activeMap[item.ID]
|
||||||
|
} else {
|
||||||
|
p.toggleExpansion(p.highlightIndex)
|
||||||
}
|
}
|
||||||
case sdl.K_a:
|
|
||||||
p.acceptChanges()
|
|
||||||
case sdl.K_BACKSPACE, sdl.K_ESCAPE:
|
case sdl.K_BACKSPACE, sdl.K_ESCAPE:
|
||||||
p.Context.NavigateTo(SETTINGS)
|
p.Context.NavigateTo(SETTINGS)
|
||||||
}
|
}
|
||||||
@@ -256,7 +257,7 @@ func (p *ProclamationOptions) acceptChanges() {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
p.Context.NavigateTo(SETTINGS)
|
p.Context.NavigateTo(SCROLLER)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ProclamationOptions) Render() error {
|
func (p *ProclamationOptions) Render() error {
|
||||||
@@ -278,9 +279,9 @@ func (p *ProclamationOptions) Render() error {
|
|||||||
if i == p.highlightIndex {
|
if i == p.highlightIndex {
|
||||||
item.Label.Color = colors.Black
|
item.Label.Color = colors.Black
|
||||||
} else if item.IsCategory {
|
} else if item.IsCategory {
|
||||||
item.Label.Color = colors.Cyan
|
item.Label.Color = colors.DodgerBlue
|
||||||
} else if p.activeMap[item.ID] {
|
} else if p.activeMap[item.ID] {
|
||||||
item.Label.Color = colors.Green
|
item.Label.Color = colors.Orange
|
||||||
} else {
|
} else {
|
||||||
item.Label.Color = colors.White
|
item.Label.Color = colors.White
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user