rename color constants

This commit is contained in:
2026-03-11 21:14:56 +01:00
parent 2157425b24
commit 454e625ef3
11 changed files with 88 additions and 88 deletions

View File

@@ -16,12 +16,12 @@ func NewCatalogHandler() *CatalogHandler {
}
func (h *CatalogHandler) Handle(s *engine.Session) {
s.Printer.BoxHeader(s.Lang["CatTitle"], engine.YL)
s.Printer.Send(fmt.Sprintf(" %s%s%s\r\n", engine.GY, s.Lang["WikiLoading"], engine.R))
s.Printer.BoxHeader(s.Lang["CatTitle"], engine.COLOR_YELLOW)
s.Printer.Send(fmt.Sprintf(" %s%s%s\r\n", engine.COLOR_GRAY, s.Lang["WikiLoading"], engine.COLOR_RESET))
softwares, err := h.repo.fetchGames()
if err != nil {
s.Printer.Send(fmt.Sprintf("\r\n%s%s: %v%s\r\n", engine.RD, s.Lang["WikiConnError"], err, engine.R))
s.Printer.Send(fmt.Sprintf("\r\n%s%s: %v%s\r\n", engine.COLOR_RED, s.Lang["WikiConnError"], err, engine.COLOR_RESET))
s.Printer.Pause(s.Lang)
return
}
@@ -29,7 +29,7 @@ func (h *CatalogHandler) Handle(s *engine.Session) {
s.Printer.Send("\r\033[A\033[2K")
if len(softwares) == 0 {
s.Printer.Send(fmt.Sprintf(" %s%s%s\r\n", engine.GY, s.Lang["CatNoGames"], engine.R))
s.Printer.Send(fmt.Sprintf(" %s%s%s\r\n", engine.COLOR_GRAY, s.Lang["CatNoGames"], engine.COLOR_RESET))
s.Printer.Pause(s.Lang)
return
}
@@ -40,32 +40,32 @@ func (h *CatalogHandler) Handle(s *engine.Session) {
sw := entry.Software
lr := entry.LatestRelease
s.Printer.Send(fmt.Sprintf("\r\n %s%s%s\r\n", engine.YL, strings.Repeat("─", engine.W-4), engine.R))
s.Printer.Send(fmt.Sprintf("\r\n %s%s%s\r\n", engine.COLOR_YELLOW, strings.Repeat("─", engine.W-4), engine.COLOR_RESET))
s.Printer.Send(fmt.Sprintf(" %s%2d.%s %s%s%s%s %s[%s] by %s%s\r\n",
engine.YL, i+1, engine.R,
engine.WH, engine.B, sw.Title, engine.R,
engine.GY, sw.Platform, sw.Author, engine.R))
engine.COLOR_YELLOW, i+1, engine.COLOR_RESET,
engine.COLOR_WHITE, engine.COLOR_BOLD, sw.Title, engine.COLOR_RESET,
engine.COLOR_GREEN, sw.Platform, sw.Author, engine.COLOR_RESET))
if sw.Desc != "" {
wrappedDesc := s.Printer.Wrapped(sw.Desc, 7, 1000)
for _, line := range strings.Split(wrappedDesc, "\r\n") {
s.Printer.Send(fmt.Sprintf("%s%s\r\n", engine.GY, line))
s.Printer.Send(fmt.Sprintf("%s%s\r\n", engine.COLOR_GRAY, line))
}
}
if lr != nil {
badges := []string{}
if lr.HTMLFolderPath != "" {
badges = append(badges, fmt.Sprintf("%s[▶ Play]%s", engine.GR, engine.R))
badges = append(badges, fmt.Sprintf("%s[▶ Play]%s", engine.COLOR_GREEN, engine.COLOR_RESET))
}
if lr.CartridgePath != "" {
badges = append(badges, fmt.Sprintf("%s[⬇ Download]%s", engine.BL, engine.R))
badges = append(badges, fmt.Sprintf("%s[⬇ Download]%s", engine.COLOR_BLUE, engine.COLOR_RESET))
}
if lr.SourcePath != "" {
badges = append(badges, fmt.Sprintf("%s[Source]%s", engine.MG, engine.R))
badges = append(badges, fmt.Sprintf("%s[Source]%s", engine.COLOR_MAGENTA, engine.COLOR_RESET))
}
if lr.DocsFolderPath != "" {
badges = append(badges, fmt.Sprintf("%s[Docs]%s", engine.YL, engine.R))
badges = append(badges, fmt.Sprintf("%s[Docs]%s", engine.COLOR_YELLOW, engine.COLOR_RESET))
}
badgeStr := ""
@@ -73,19 +73,19 @@ func (h *CatalogHandler) Handle(s *engine.Session) {
badgeStr = strings.Join(badges, " ")
}
s.Printer.Send(fmt.Sprintf(" %s%s: v%s%s %s\r\n",
engine.GY, s.Lang["CatLatest"], lr.Version, engine.R, badgeStr))
engine.COLOR_GRAY, s.Lang["CatLatest"], lr.Version, engine.COLOR_RESET, badgeStr))
if lr.HTMLFolderPath != "" {
url := base + lr.HTMLFolderPath
s.Printer.Send(fmt.Sprintf(" %s▶ %s%s\r\n", engine.DIM, url, engine.R))
s.Printer.Send(fmt.Sprintf(" %s▶ %s%s\r\n", engine.COLOR_DIM, url, engine.COLOR_RESET))
}
}
s.Printer.Send(fmt.Sprintf(" %s%s%s\r\n",
engine.GY, fmt.Sprintf(s.Lang["CatVersions"], len(entry.Releases)), engine.R))
engine.COLOR_GRAY, fmt.Sprintf(s.Lang["CatVersions"], len(entry.Releases)), engine.COLOR_RESET))
}
s.Printer.HR("─", engine.YL)
s.Printer.HR("─", engine.COLOR_YELLOW)
s.Printer.Send("\r\n")
s.Printer.Send(fmt.Sprintf(" %s%s: %s%s\r\n", engine.GY, s.Lang["CatFull"], base, engine.R))
s.Printer.Send(fmt.Sprintf(" %s%s: %s%s\r\n", engine.COLOR_GREEN, s.Lang["CatFull"], base, engine.COLOR_RESET))
s.Printer.Pause(s.Lang)
}