Compare commits

...

6 Commits

Author SHA1 Message Date
zomo 262f3d59ec CHORE: go fmt 2026-04-16 00:26:53 -05:00
zomo e6329500b5 STYLE: improved logging output 2026-04-16 00:13:24 -05:00
zomo 219423f2b3 FEAT: reset layer frame count if missing layer image 2026-04-15 22:54:44 -05:00
zomo 1d5a891a71 updated user guide 2026-04-15 21:39:09 -05:00
zomo 5ddc2aaf7f updated readme to reflect ini parser update 2026-04-15 21:28:19 -05:00
zomo f9f0345c82 created user guide 2026-04-15 21:17:48 -05:00
9 changed files with 249 additions and 37 deletions
+22 -1
View File
@@ -2,4 +2,25 @@ module zomo.dev/bappackage
go 1.25.0 go 1.25.0
require gopkg.in/ini.v1 v1.67.0 // indirect require (
github.com/charmbracelet/lipgloss v1.1.0
github.com/charmbracelet/log v1.0.0
gopkg.in/ini.v1 v1.67.0
)
require (
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
github.com/charmbracelet/x/ansi v0.8.0 // indirect
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
github.com/charmbracelet/x/term v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.1 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/muesli/termenv v0.16.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/sys v0.30.0 // indirect
)
+44
View File
@@ -1,2 +1,46 @@
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc h1:4pZI35227imm7yK2bGPcfpFEmuY1gc2YSTShr4iJBfs=
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc/go.mod h1:X4/0JoqgTIPSFcRA/P6INZzIuyqdFY5rm8tb41s9okk=
github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY=
github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30=
github.com/charmbracelet/log v1.0.0 h1:HVVVMmfOorfj3BA9i8X8UL69Hoz9lI0PYwXfJvOdRc4=
github.com/charmbracelet/log v1.0.0/go.mod h1:uYgY3SmLpwJWxmlrPwXvzVYujxis1vAKRV/0VQB7yWA=
github.com/charmbracelet/x/ansi v0.8.0 h1:9GTq3xq9caJW8ZrBTe0LIe2fvfLR/bYXKTx2llXn7xE=
github.com/charmbracelet/x/ansi v0.8.0/go.mod h1:wdYl/ONOLHLIVmQaxbIYEC/cRKOQyjTkowiI4blgS9Q=
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd h1:vy0GVL4jeHEwG5YOXDmi86oYw2yuYUGqz6a8sLwg0X8=
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs=
github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-logfmt/logfmt v0.6.1 h1:4hvbpePJKnIzH1B+8OR/JPbTx37NktoI9LE2QZBBkvE=
github.com/go-logfmt/logfmt v0.6.1/go.mod h1:EV2pOAQoZaT1ZXZbqDl5hrymndi4SY9ED9/z6CO0XAk=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc=
github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+3 -2
View File
@@ -2,10 +2,11 @@ package main
import ( import (
"fmt" "fmt"
"log"
"os" "os"
"path/filepath" "path/filepath"
"slices" "slices"
"github.com/charmbracelet/log"
) )
type RoomFolder struct { type RoomFolder struct {
@@ -30,7 +31,7 @@ func LoadRoomFolders(roomspath string) ([]RoomFolder, error) {
entrypath := filepath.Join(roomspath, entry.Name()) entrypath := filepath.Join(roomspath, entry.Name())
roomfolder, err := loadRoom(entrypath) roomfolder, err := loadRoom(entrypath)
if err != nil { if err != nil {
log.Printf("ERROR: unable to load directory: %s: %v", entrypath, err) log.Errorf("unable to load directory: %s: %v", entrypath, err)
continue continue
} }
+3 -2
View File
@@ -2,7 +2,8 @@ package main
import ( import (
"flag" "flag"
"log"
"github.com/charmbracelet/log"
) )
func main() { func main() {
@@ -28,7 +29,7 @@ func mainErr() error {
err = CheckDuplicateRooms(roomFolders) err = CheckDuplicateRooms(roomFolders)
if err != nil { if err != nil {
log.Printf("Error in room assigmnents: %v", err) log.Errorf("Error in room assigmnents: %v", err)
return nil return nil
} }
+67 -21
View File
@@ -6,12 +6,14 @@ import (
"image" "image"
"image/color" "image/color"
"image/png" "image/png"
"log"
"os" "os"
"path" "path"
"path/filepath" "path/filepath"
"slices" "slices"
"strings" "strings"
"github.com/charmbracelet/lipgloss"
"github.com/charmbracelet/log"
) )
//go:embed silence.wav //go:embed silence.wav
@@ -19,6 +21,18 @@ var SILENCE_WAV []byte
const FILEPERM = 0644 const FILEPERM = 0644
var styleRedtext = lipgloss.NewStyle().
Foreground(lipgloss.Color("9"))
var styleYellowtext = lipgloss.NewStyle().
Foreground(lipgloss.Color("11"))
var styleGreentext = lipgloss.NewStyle().
Foreground(lipgloss.Color("10"))
var padd = lipgloss.NewStyle().
PaddingLeft(4)
// only deletes DATA/NIGHT_* folders and the CF.ini file // only deletes DATA/NIGHT_* folders and the CF.ini file
// will not touch TITLE or any game files // will not touch TITLE or any game files
// so this can be ran safely in your game's directory // so this can be ran safely in your game's directory
@@ -61,7 +75,9 @@ func emptyOutData(outpath string) error {
if len(name) >= len(nightprefix) && name[:len(nightprefix)] == nightprefix { if len(name) >= len(nightprefix) && name[:len(nightprefix)] == nightprefix {
nightpath := path.Join(datapath, entry.Name()) nightpath := path.Join(datapath, entry.Name())
log.Printf("INFO: removing %s", nightpath)
log.Info(Renderf(styleRedtext, "removing %s", nightpath))
err = os.RemoveAll(nightpath) err = os.RemoveAll(nightpath)
if err != nil { if err != nil {
return err return err
@@ -82,7 +98,7 @@ func emptyOutCredits(outpath string) error {
return nil return nil
} }
log.Printf("INFO: removing %s", cfpath) log.Info(Renderf(styleRedtext, "removing %s", cfpath))
return os.Remove(cfpath) return os.Remove(cfpath)
} }
@@ -96,7 +112,7 @@ func emptyOutCF(outpath string) error {
return nil return nil
} }
log.Printf("INFO: removing %s", cfpath) log.Info(Renderf(styleRedtext, "removing %s", cfpath))
return os.Remove(cfpath) return os.Remove(cfpath)
} }
@@ -110,26 +126,27 @@ Splash2len=%d
`, splash1len, splash2len) `, splash1len, splash2len)
// loop through folders // loop through folders
log.Info("")
roomcredits := []string{} roomcredits := []string{}
for _, roomFolder := range roomFolders { for _, roomFolder := range roomFolders {
err := copyFolder(roomFolder, outpath) err := copyFolder(&roomFolder, outpath)
if err != nil { if err != nil {
return fmt.Errorf("error copying folder %s: %+v", roomFolder.Path, err) return fmt.Errorf("error copying folder %s: %+v", roomFolder.Path, err)
} }
inistr.WriteString(roomFolder.Cfg.ToIni()) inistr.WriteString(roomFolder.Cfg.ToIni())
roomFolder, err = checkCredits(roomFolder); err = checkCredits(&roomFolder)
if err != nil { if err != nil {
return fmt.Errorf("error checking credits in folder %s: %+v", roomFolder.Path, err) return fmt.Errorf("error checking credits in folder %s: %+v", roomFolder.Path, err)
} }
roomcredits = append(roomcredits, roomFolder.Cfg.ToCredits()) roomcredits = append(roomcredits, roomFolder.Cfg.ToCredits())
log.Info("")
} }
// save ini file // save ini file
outini := filepath.Join(outpath, "CF.ini") outini := filepath.Join(outpath, "CF.ini")
log.Println("INFO:") log.Info(Renderf(styleGreentext, "Writing %s", outini))
log.Printf("INFO: Writing %s", outini)
if err := os.WriteFile(outini, []byte(inistr.String()), FILEPERM); err != nil { if err := os.WriteFile(outini, []byte(inistr.String()), FILEPERM); err != nil {
return err return err
@@ -139,28 +156,37 @@ Splash2len=%d
creditsstring := strings.Join(roomcredits, "\n") creditsstring := strings.Join(roomcredits, "\n")
outcredits := filepath.Join(outpath, "credits.txt") outcredits := filepath.Join(outpath, "credits.txt")
log.Println("INFO:") log.Info(Renderf(styleGreentext, "Writing %s", outcredits))
log.Printf("INFO: Writing %s", outcredits)
return os.WriteFile(outcredits, []byte(creditsstring), FILEPERM) return os.WriteFile(outcredits, []byte(creditsstring), FILEPERM)
} }
// doesn't error currently // doesn't error currently
func checkCredits(roomFolder RoomFolder) (RoomFolder, error) { func checkCredits(roomFolder *RoomFolder) error {
if roomFolder.Cfg.name == "" { if roomFolder.Cfg.name == "" {
log.Println("WARNING: room config has no name, defaulting to folder name") log.Warn(padd.Render(styleYellowtext.Render("room config has no name, defaulting to folder name")))
foldername := filepath.Base(roomFolder.Path) foldername := filepath.Base(roomFolder.Path)
roomFolder.Cfg.name = foldername roomFolder.Cfg.name = foldername
} }
if roomFolder.Cfg.credits == "" { if roomFolder.Cfg.credits == "" {
log.Println("WARNING: room config has no credits") log.Warn(padd.Render(styleYellowtext.Render("room config has no credits")))
} }
return roomFolder, nil return nil
} }
func copyFolder(roomFolder RoomFolder, outpath string) error { var styleTextRoom = lipgloss.NewStyle().
Bold(true).
Padding(0, 1).
Background(lipgloss.Color("10")).
Foreground(lipgloss.Color("0"))
var styleTextCopy = lipgloss.NewStyle().
Bold(true).
Foreground(lipgloss.Color("10"))
func copyFolder(roomFolder *RoomFolder, outpath string) error {
nightdir := fmt.Sprintf("NIGHT_%d", roomFolder.Cfg.night) nightdir := fmt.Sprintf("NIGHT_%d", roomFolder.Cfg.night)
roomdir := fmt.Sprintf("ROOM_%d", roomFolder.Cfg.room) roomdir := fmt.Sprintf("ROOM_%d", roomFolder.Cfg.room)
@@ -168,11 +194,25 @@ func copyFolder(roomFolder RoomFolder, outpath string) error {
os.MkdirAll(roomoutpath, FILEPERM) os.MkdirAll(roomoutpath, FILEPERM)
log.Println("INFO:") // print room info
log.Printf("INFO: Copying %s", roomFolder.Path) name := roomFolder.Cfg.name
log.Printf("INFO: to %s", roomoutpath) if name == "" {
name = "MISSING NAME"
}
textRoom := Renderf(styleTextRoom, "Room - %s", name)
log.Info(textRoom)
textCopy1 := styleTextCopy.Render("Copying From")
textCopy2 := styleTextCopy.Render(" To")
textCopy1Comb := fmt.Sprintf("%s %s", textCopy1, roomFolder.Path)
textCopy2Comb := fmt.Sprintf("%s %s", textCopy2, roomoutpath)
log.Info(padd.Render(textCopy1Comb))
log.Info(padd.Render(textCopy2Comb))
if roomFolder.IsDefaultCfg { if roomFolder.IsDefaultCfg {
log.Println("INFO: room.ini was not found, using default settings") log.Info(padd.Render(styleYellowtext.Render("room.ini was not found, using default settings")))
} }
entries, err := os.ReadDir(roomFolder.Path) entries, err := os.ReadDir(roomFolder.Path)
@@ -211,7 +251,7 @@ func copyFolder(roomFolder RoomFolder, outpath string) error {
} }
if len(extraRequiredImages) > 0 { if len(extraRequiredImages) > 0 {
log.Printf("INFO: necessary optional images will use a transparent file: %v", extraRequiredImages) log.Info(Renderf(padd, "necessary optional images will use a transparent file: %v", extraRequiredImages))
transparent := image.NewRGBA(image.Rectangle{image.Point{0, 0}, image.Point{1, 1}}) transparent := image.NewRGBA(image.Rectangle{image.Point{0, 0}, image.Point{1, 1}})
transparent.Set(0, 0, color.RGBA{0xff, 0xff, 0xff, 0x01}) transparent.Set(0, 0, color.RGBA{0xff, 0xff, 0xff, 0x01})
@@ -234,11 +274,17 @@ func copyFolder(roomFolder RoomFolder, outpath string) error {
} else { } else {
png.Encode(f, transparent) png.Encode(f, transparent)
} }
// ensure layer_frames is 1 if it's not included
if strings.ToUpper(imagename) == "LAYER" && roomFolder.Cfg.layerFrames != 1 {
log.Warn(padd.Render(Renderf(styleYellowtext, "room was configured to have %d layer frames, but no LAYER image exists: setting layer_frames=1", roomFolder.Cfg.layerFrames)))
roomFolder.Cfg.layerFrames = 1
}
} }
} }
if len(extraRequiredAudio) > 0 { if len(extraRequiredAudio) > 0 {
log.Printf("INFO: necessary optional audios will use a silent file: %v", extraRequiredAudio) log.Info(Renderf(padd, "necessary optional audios will use a silent file: %v", extraRequiredAudio))
for _, audioname := range extraRequiredAudio { for _, audioname := range extraRequiredAudio {
audiopath := path.Join(roomoutpath, audioname+".wav") audiopath := path.Join(roomoutpath, audioname+".wav")
+14 -4
View File
@@ -1,5 +1,7 @@
# bap-room-packager # bap-room-packager
**This is the guide for people who plan on working with or working on this program. [Click here for a guide if you want to submit a room.](userguide.md)**
This program will take a collection of [Bapalon](https://akuma-kira.itch.io/bap) rooms and automatically package them into BAP's directory format. This program will take a collection of [Bapalon](https://akuma-kira.itch.io/bap) rooms and automatically package them into BAP's directory format.
For a well developed example, see [SOUP ROOMS](https://kiteline.itch.io/soup-rooms). For a well developed example, see [SOUP ROOMS](https://kiteline.itch.io/soup-rooms).
@@ -25,6 +27,8 @@ If the following optional audios are not included, they will be automatically fi
- FOOT - FOOT
- MUSIC - MUSIC
### File Formats
Per BAP's readme file, here's a list of accepted file formats. Read BAP's readme file for engine limitations. Per BAP's readme file, here's a list of accepted file formats. Read BAP's readme file for engine limitations.
- image - image
@@ -39,14 +43,13 @@ Per BAP's readme file, here's a list of accepted file formats. Read BAP's readme
### Room Settings ### Room Settings
Each room's settings should be placed in a `ROOM.ini` (or `ROOM.txt`) file. Read BAP's readme file for more details of each setting. Each room's settings should be placed in a `ROOM.ini` (or `ROOM.txt`) file. Read BAP's readme file for more details about each setting.
The settings from each `ROOM.ini` file will be used to generate the final `CF.ini` file. The settings from each `ROOM.ini` file will be used to generate the final `CF.ini` file.
The following is an example `ROOM.ini` file. This is also the file's default settings, so any room with no `ROOM.ini`, or with missing settings from their `ROOM.ini` file, will use these values. The section title does not matter, in this case it's `example`. The following is an example `ROOM.ini` file. This is also the file's default settings, so any room with no `ROOM.ini`, or with missing settings from their `ROOM.ini` file, will use these values. Section titles (`[example]`) do not matter, they can be included or ommitted, the program searches all sections for all values.
```ini ```ini
[example]
size=1 size=1
speed=1 speed=1
FOV=55 FOV=55
@@ -56,6 +59,10 @@ Layer_Frames=1
Fog_Color=0 Fog_Color=0
Fog_End=-1 Fog_End=-1
Mini_speed=1 Mini_speed=1
name=<empty string>
credits=<empty string>
links=<empty string>
``` ```
## Usage ## Usage
@@ -108,7 +115,6 @@ Here is an example of the example `ROOM.ini` above but directly assigned to nigh
night=1 night=1
room=1 room=1
[example]
size=1 size=1
speed=1 speed=1
FOV=55 FOV=55
@@ -118,4 +124,8 @@ Layer_Frames=1
Fog_Color=0 Fog_Color=0
Fog_End=-1 Fog_End=-1
Mini_speed=1 Mini_speed=1
name=example
credits=zomo
links=https://example.com
``` ```
+81
View File
@@ -0,0 +1,81 @@
# Bap Room Packager User Guide
**This is the guide for people who plan on submitting a room. Your organizer must be using this tool for this guide to be applicable.**
[Click here to skip to the `ROOM.ini` file setup.](#room-settings)
This program will take a collection of [Bapalon](https://akuma-kira.itch.io/bap) rooms and automatically package them into BAP's directory format.
For a well developed example, see [SOUP ROOMS](https://kiteline.itch.io/soup-rooms).
## Room Folder Setup
Each room folder needs at least the following images. Every other file is optional.
- ART
- CREDIT
- FLOOR
- ROOF
- WALL
If the following optional images aren't included, they'll be automatically filled in with a transparent PNG file.
- MINI
- INTERACT
- LAYER
If the following optional audios aren't included, they'll be automatically filled in with a silent WAV file.
- FOOT
- MUSIC
You should also include the following file to configure your room. Information about this file is below.
- ROOM.INI
## File Formats
Per BAP's readme file, here's a list of accepted file formats. Read BAP's readme file for engine limitations.
- image
- PNG
- JPG
- BMP
- audio
- WAV
- MP3
- OGG
- MIDI
Important notes about file formats:
- audio
- for consistent results, use a WAV file for MUSIC
## Room Settings
You need to move the settings from BAP's `CF.ini` file into a new file called `ROOM.ini` in your room's folder. Read BAP's readme file for more details about each setting.
**You should also include your credits.** 3 options have been added:
- `name` is the name of your room
- `credits` is your name
- `links` is a link to you somewhere
Here's an example `ROOM.ini` file.
```ini
size=1
speed=1
fov=55
texture_repeat=3
room_height=350
layer_frames=1
fog_color=0
fog_end=-1
mini_speed=1
name=example
credits=zomo
links=https://example.com
```
+8
View File
@@ -2,10 +2,13 @@ package main
import ( import (
"errors" "errors"
"fmt"
"io/fs" "io/fs"
"os" "os"
"path" "path"
"strings" "strings"
"github.com/charmbracelet/lipgloss"
) )
func Exists(p ...string) (bool, error) { func Exists(p ...string) (bool, error) {
@@ -27,3 +30,8 @@ func SplitExt(filename string) (string, string) {
} }
return name, ext return name, ext
} }
func Renderf(style lipgloss.Style, format string, v ...any) string {
str := fmt.Sprintf(format, v...)
return style.Render(str)
}