add icon, fix bug in dark theme
This commit is contained in:
parent
04293a74c5
commit
3c87663d02
|
@ -47,7 +47,10 @@ jobs:
|
||||||
env:
|
env:
|
||||||
REPO_KEY: ${{ secrets.REPO_KEY }}
|
REPO_KEY: ${{ secrets.REPO_KEY }}
|
||||||
|
|
||||||
- run: go get ./cmd/bedrocktool
|
- name: dependencies
|
||||||
|
run: |
|
||||||
|
go get ./cmd/bedrocktool
|
||||||
|
go install gioui.org/cmd/gogio@latest
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
id: build
|
id: build
|
||||||
|
|
|
@ -8,6 +8,7 @@ token.json
|
||||||
*.bmp
|
*.bmp
|
||||||
*.bin
|
*.bin
|
||||||
*.log
|
*.log
|
||||||
|
*.syso
|
||||||
|
|
||||||
/bedrocktool
|
/bedrocktool
|
||||||
/bedrocktool-*
|
/bedrocktool-*
|
||||||
|
|
204
build.py
204
build.py
|
@ -16,12 +16,10 @@ print(f"VER: {VER}")
|
||||||
print(f"TAG: {TAG}")
|
print(f"TAG: {TAG}")
|
||||||
|
|
||||||
GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT")
|
GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT")
|
||||||
|
|
||||||
if GITHUB_OUTPUT:
|
if GITHUB_OUTPUT:
|
||||||
with open(GITHUB_OUTPUT, "a") as f:
|
with open(GITHUB_OUTPUT, "a") as f:
|
||||||
f.write(f"release_tag=r{VER}\n")
|
f.write(f"release_tag=r{VER}\n")
|
||||||
|
|
||||||
|
|
||||||
with open("./subcommands/resourcepack-d/resourcepack-d.go", "rb") as f:
|
with open("./subcommands/resourcepack-d/resourcepack-d.go", "rb") as f:
|
||||||
PACK_SUPPORT = f.read(100).count(b"package ") > 0
|
PACK_SUPPORT = f.read(100).count(b"package ") > 0
|
||||||
print(f"Pack Support: {PACK_SUPPORT}")
|
print(f"Pack Support: {PACK_SUPPORT}")
|
||||||
|
@ -35,91 +33,149 @@ PLATFORMS = [
|
||||||
#("android", ["arm64"], ".apk")
|
#("android", ["arm64"], ".apk")
|
||||||
]
|
]
|
||||||
|
|
||||||
platform_filter = ""
|
|
||||||
arch_filter = ""
|
|
||||||
if len(sys.argv) > 1:
|
|
||||||
platform_filter = sys.argv[1]
|
|
||||||
|
|
||||||
if len(sys.argv) > 2:
|
def clean():
|
||||||
arch_filter = sys.argv[2]
|
if os.path.exists("./tmp"):
|
||||||
|
shutil.rmtree("./tmp")
|
||||||
|
if os.path.exists("./builds"):
|
||||||
|
shutil.rmtree("./builds")
|
||||||
|
if os.path.exists("./updates"):
|
||||||
|
shutil.rmtree("./updates")
|
||||||
|
for file in os.listdir("./cmd/bedrocktool"):
|
||||||
|
if file.endswith(".syso"):
|
||||||
|
os.remove(f"./cmd/bedrocktool/{file}")
|
||||||
|
|
||||||
if os.path.exists("./tmp"):
|
def make_dirs():
|
||||||
shutil.rmtree("./tmp")
|
os.mkdir("./tmp")
|
||||||
os.mkdir("./tmp")
|
os.mkdir("./builds")
|
||||||
|
os.mkdir("./updates")
|
||||||
|
|
||||||
if os.path.exists("./builds"):
|
|
||||||
shutil.rmtree("./builds")
|
|
||||||
os.mkdir("./builds")
|
|
||||||
|
|
||||||
if os.path.exists("./updates"):
|
def build_cli(platform: str, arch: str, env_in: dict[str,str], tags: list[str], compiled_path: str):
|
||||||
shutil.rmtree("./updates")
|
env = {}
|
||||||
os.mkdir("./updates")
|
env.update(env_in)
|
||||||
|
env.update({
|
||||||
|
"GOOS": platform,
|
||||||
|
"GOARCH": arch,
|
||||||
|
})
|
||||||
|
args = [
|
||||||
|
"go", "build",
|
||||||
|
"-ldflags", LDFLAGS,
|
||||||
|
"-trimpath",
|
||||||
|
"-tags", ",".join(tags),
|
||||||
|
"-o", compiled_path,
|
||||||
|
"-v"
|
||||||
|
]
|
||||||
|
args.append("./cmd/bedrocktool")
|
||||||
|
|
||||||
for (platform_name, archs, ext) in PLATFORMS:
|
env2 = os.environ.copy()
|
||||||
if platform_filter and platform_filter != platform_name:
|
env2.update(env)
|
||||||
continue
|
subprocess.run(args, env=env2).check_returncode()
|
||||||
archs = [a for a in archs if arch_filter == "" or a == arch_filter]
|
|
||||||
if len(archs) == 0:
|
|
||||||
continue
|
def build_gui(platform: str, arch: str, env, tags: list[str], compiled_path: str):
|
||||||
for GUI in [False, True]:
|
ldflags = LDFLAGS
|
||||||
if platform_name in ["android"] and not GUI:
|
if platform == "windows":
|
||||||
|
ldflags = "-H=windows " + ldflags
|
||||||
|
args = [
|
||||||
|
"gogio",
|
||||||
|
"-arch", arch,
|
||||||
|
"-target", platform,
|
||||||
|
"-icon", "icon.png",
|
||||||
|
"-tags", ",".join(tags),
|
||||||
|
"-ldflags", ldflags,
|
||||||
|
"-o", compiled_path,
|
||||||
|
"-x"
|
||||||
|
]
|
||||||
|
if platform in ["android", "ios"]:
|
||||||
|
args.extend(["-appid", APP_ID])
|
||||||
|
args.append("./cmd/bedrocktool")
|
||||||
|
|
||||||
|
env2 = os.environ.copy()
|
||||||
|
env2.update(env)
|
||||||
|
subprocess.run(args, env=env2).check_returncode()
|
||||||
|
|
||||||
|
|
||||||
|
def package(platform: str, arch: str, compiled_path: str, GUI: bool, ext: str):
|
||||||
|
SUB1 = '-gui' if GUI else ''
|
||||||
|
exe_out_path = f"./builds/{NAME}-{platform}-{arch}-{TAG}{SUB1}{ext}"
|
||||||
|
|
||||||
|
# create hash and copy
|
||||||
|
with open(compiled_path, "rb") as f:
|
||||||
|
exe_data = f.read()
|
||||||
|
sha = binascii.b2a_base64(hashlib.sha256(exe_data).digest()).decode("utf8").split("\n")[0]
|
||||||
|
shutil.copy(compiled_path, exe_out_path)
|
||||||
|
|
||||||
|
# create update
|
||||||
|
updates_dir = f"./updates/{NAME}{SUB1}"
|
||||||
|
os.makedirs(updates_dir, exist_ok=True)
|
||||||
|
with open(f"{updates_dir}/{platform}-{arch}.json", "w") as f:
|
||||||
|
f.write(json.dumps({
|
||||||
|
"Version": TAG,
|
||||||
|
"Sha256": sha,
|
||||||
|
}, indent=2))
|
||||||
|
|
||||||
|
# write update data
|
||||||
|
os.makedirs(f"{updates_dir}/{TAG}", exist_ok=True)
|
||||||
|
with gzip.open(f"{updates_dir}/{TAG}/{platform}-{arch}.gz", "wb") as f:
|
||||||
|
f.write(exe_data)
|
||||||
|
|
||||||
|
os.remove(compiled_path)
|
||||||
|
|
||||||
|
|
||||||
|
def build_all(platform_filter: str, arch_filter: str):
|
||||||
|
for (platform, archs, ext) in PLATFORMS:
|
||||||
|
if platform_filter and platform_filter != platform:
|
||||||
continue
|
continue
|
||||||
|
archs = [a for a in archs if arch_filter == "" or a == arch_filter]
|
||||||
|
if len(archs) == 0:
|
||||||
|
continue
|
||||||
|
for GUI in [False, True]:
|
||||||
|
if platform in ["android"] and not GUI:
|
||||||
|
continue
|
||||||
|
|
||||||
print(f"Building {platform_name} gui: {GUI}")
|
print(f"Building {platform} gui: {GUI}")
|
||||||
SUB1 = '-gui' if GUI else ''
|
SUB1 = '-gui' if GUI else ''
|
||||||
name = f"{NAME}{SUB1}"
|
name = f"{NAME}{SUB1}"
|
||||||
|
|
||||||
tags = []
|
tags = []
|
||||||
if PACK_SUPPORT:
|
if PACK_SUPPORT:
|
||||||
tags.append("packs")
|
tags.append("packs")
|
||||||
if GUI:
|
if GUI:
|
||||||
tags.append("gui")
|
tags.append("gui")
|
||||||
|
|
||||||
env = {
|
env = {
|
||||||
"GOVCS": "*:off"
|
"GOVCS": "*:off"
|
||||||
}
|
}
|
||||||
|
|
||||||
for arch in archs:
|
for arch in archs:
|
||||||
compiled_path = f"./tmp/{platform_name}-{arch}{SUB1}/{name}{ext}"
|
compiled_path = f"./tmp/{platform}-{arch}{SUB1}/{name}{ext}"
|
||||||
os.makedirs(os.path.dirname(compiled_path), exist_ok=True)
|
os.makedirs(os.path.dirname(compiled_path), exist_ok=True)
|
||||||
env.update({
|
|
||||||
"GOOS": platform_name,
|
|
||||||
"GOARCH": arch,
|
|
||||||
})
|
|
||||||
args = [
|
|
||||||
"go", "build",
|
|
||||||
"-ldflags", LDFLAGS,
|
|
||||||
"-trimpath",
|
|
||||||
"-tags", ",".join(tags),
|
|
||||||
"-v",
|
|
||||||
"-o", compiled_path,
|
|
||||||
]
|
|
||||||
args.append("./cmd/bedrocktool")
|
|
||||||
print(args)
|
|
||||||
|
|
||||||
env2 = os.environ.copy()
|
if GUI and platform != "linux":
|
||||||
env2.update(env)
|
build_gui(platform, arch, env, tags, compiled_path)
|
||||||
|
else:
|
||||||
|
build_cli(platform, arch, env, tags, compiled_path)
|
||||||
|
|
||||||
|
package(platform, arch, compiled_path, GUI, ext)
|
||||||
|
|
||||||
out = subprocess.run(args, env=env2)
|
|
||||||
out.check_returncode()
|
|
||||||
|
|
||||||
exe_out_path = f"./builds/{NAME}-{platform_name}-{arch}-{TAG}{SUB1}{ext}"
|
def main():
|
||||||
|
platform_filter = ""
|
||||||
|
arch_filter = ""
|
||||||
|
if len(sys.argv) > 1:
|
||||||
|
platform_filter = sys.argv[1]
|
||||||
|
|
||||||
with open(compiled_path, "rb") as f:
|
if len(sys.argv) > 2:
|
||||||
exe_data = f.read()
|
arch_filter = sys.argv[2]
|
||||||
sha = binascii.b2a_base64(hashlib.sha256(exe_data).digest()).decode("utf8").split("\n")[0]
|
|
||||||
shutil.copy(compiled_path, exe_out_path)
|
if platform_filter == "clean":
|
||||||
|
clean()
|
||||||
|
return
|
||||||
|
|
||||||
updates_dir = f"./updates/{NAME}{SUB1}"
|
clean()
|
||||||
os.makedirs(updates_dir, exist_ok=True)
|
make_dirs()
|
||||||
with open(f"{updates_dir}/{platform_name}-{arch}.json", "w") as f:
|
build_all(platform_filter, arch_filter)
|
||||||
f.write(json.dumps({
|
|
||||||
"Version": TAG,
|
|
||||||
"Sha256": sha,
|
|
||||||
}, indent=2))
|
|
||||||
|
|
||||||
os.makedirs(f"{updates_dir}/{TAG}", exist_ok=True)
|
|
||||||
with gzip.open(f"{updates_dir}/{TAG}/{platform_name}-{arch}.gz", "wb") as f:
|
|
||||||
f.write(exe_data)
|
|
||||||
|
|
||||||
os.remove(compiled_path)
|
|
||||||
|
main()
|
1
go.mod
1
go.mod
|
@ -39,6 +39,7 @@ require (
|
||||||
require (
|
require (
|
||||||
gioui.org/cpu v0.0.0-20210817075930-8d6a761490d2 // indirect
|
gioui.org/cpu v0.0.0-20210817075930-8d6a761490d2 // indirect
|
||||||
gioui.org/shader v1.0.6 // indirect
|
gioui.org/shader v1.0.6 // indirect
|
||||||
|
git.wow.st/gmp/jni v0.0.0-20210610011705-34026c7e22d0 // indirect
|
||||||
github.com/benoitkugler/textlayout v0.3.0 // indirect
|
github.com/benoitkugler/textlayout v0.3.0 // indirect
|
||||||
github.com/brentp/intintmap v0.0.0-20190211203843-30dc0ade9af9 // indirect
|
github.com/brentp/intintmap v0.0.0-20190211203843-30dc0ade9af9 // indirect
|
||||||
github.com/changkun/lockfree v0.0.1 // indirect
|
github.com/changkun/lockfree v0.0.1 // indirect
|
||||||
|
|
2
go.sum
2
go.sum
|
@ -8,6 +8,8 @@ gioui.org/shader v1.0.6 h1:cvZmU+eODFR2545X+/8XucgZdTtEjR3QWW6W65b0q5Y=
|
||||||
gioui.org/shader v1.0.6/go.mod h1:mWdiME581d/kV7/iEhLmUgUK5iZ09XR5XpduXzbePVM=
|
gioui.org/shader v1.0.6/go.mod h1:mWdiME581d/kV7/iEhLmUgUK5iZ09XR5XpduXzbePVM=
|
||||||
gioui.org/x v0.0.0-20230313161557-05b40af72ed0 h1:jjdcmnjM8R1yhiBBbPinm5TLNs6uRei25fjnvgYBTjU=
|
gioui.org/x v0.0.0-20230313161557-05b40af72ed0 h1:jjdcmnjM8R1yhiBBbPinm5TLNs6uRei25fjnvgYBTjU=
|
||||||
gioui.org/x v0.0.0-20230313161557-05b40af72ed0/go.mod h1:kmHRtak7XgGZYYuqFgDBJ42PbQjPrV/xOpw9FLx3eVY=
|
gioui.org/x v0.0.0-20230313161557-05b40af72ed0/go.mod h1:kmHRtak7XgGZYYuqFgDBJ42PbQjPrV/xOpw9FLx3eVY=
|
||||||
|
git.wow.st/gmp/jni v0.0.0-20210610011705-34026c7e22d0 h1:bGG/g4ypjrCJoSvFrP5hafr9PPB5aw8SjcOWWila7ZI=
|
||||||
|
git.wow.st/gmp/jni v0.0.0-20210610011705-34026c7e22d0/go.mod h1:+axXBRUTIDlCeE73IKeD/os7LoEnTKdkp8/gQOFjqyo=
|
||||||
github.com/BurntSushi/toml v1.0.0 h1:dtDWrepsVPfW9H/4y7dDgFc2MBUSeJhlaDtK13CxFlU=
|
github.com/BurntSushi/toml v1.0.0 h1:dtDWrepsVPfW9H/4y7dDgFc2MBUSeJhlaDtK13CxFlU=
|
||||||
github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
||||||
github.com/benoitkugler/pstokenizer v1.0.0/go.mod h1:l1G2Voirz0q/jj0TQfabNxVsa8HZXh/VMxFSRALWTiE=
|
github.com/benoitkugler/pstokenizer v1.0.0/go.mod h1:l1G2Voirz0q/jj0TQfabNxVsa8HZXh/VMxFSRALWTiE=
|
||||||
|
|
58
ui/gui.go
58
ui/gui.go
|
@ -32,6 +32,20 @@ func (g *GUI) Init() bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var paletteLight = material.Palette{
|
||||||
|
Bg: color.NRGBA{0xff, 0xff, 0xff, 0xff},
|
||||||
|
Fg: color.NRGBA{0x12, 0x12, 0x12, 0xff},
|
||||||
|
ContrastBg: color.NRGBA{0x7c, 0x00, 0xf8, 0xff},
|
||||||
|
ContrastFg: color.NRGBA{0x00, 0x00, 0x00, 0xff},
|
||||||
|
}
|
||||||
|
|
||||||
|
var paletteDark = material.Palette{
|
||||||
|
Bg: color.NRGBA{0x12, 0x12, 0x12, 0xff},
|
||||||
|
Fg: color.NRGBA{0xff, 0xff, 0xff, 0xff},
|
||||||
|
ContrastBg: color.NRGBA{0x7c, 0x00, 0xf8, 0xff},
|
||||||
|
ContrastFg: color.NRGBA{0xff, 0xff, 0xff, 0xff},
|
||||||
|
}
|
||||||
|
|
||||||
func (g *GUI) Start(ctx context.Context, cancel context.CancelFunc) (err error) {
|
func (g *GUI) Start(ctx context.Context, cancel context.CancelFunc) (err error) {
|
||||||
g.cancel = cancel
|
g.cancel = cancel
|
||||||
|
|
||||||
|
@ -39,7 +53,20 @@ func (g *GUI) Start(ctx context.Context, cancel context.CancelFunc) (err error)
|
||||||
app.Title("Bedrocktool"),
|
app.Title("Bedrocktool"),
|
||||||
)
|
)
|
||||||
|
|
||||||
g.router = pages.NewRouter(ctx, w.Invalidate)
|
th := material.NewTheme(gofont.Collection())
|
||||||
|
dark, err := theme.IsDarkMode()
|
||||||
|
if err != nil {
|
||||||
|
logrus.Warn(err)
|
||||||
|
}
|
||||||
|
if dark {
|
||||||
|
_th := th.WithPalette(paletteDark)
|
||||||
|
th = &_th
|
||||||
|
} else {
|
||||||
|
_th := th.WithPalette(paletteLight)
|
||||||
|
th = &_th
|
||||||
|
}
|
||||||
|
|
||||||
|
g.router = pages.NewRouter(ctx, w.Invalidate, th)
|
||||||
|
|
||||||
g.router.Register("Settings", settings.New(&g.router))
|
g.router.Register("Settings", settings.New(&g.router))
|
||||||
g.router.Register("worlds", worlds.New(&g.router))
|
g.router.Register("worlds", worlds.New(&g.router))
|
||||||
|
@ -59,34 +86,7 @@ func (g *GUI) Start(ctx context.Context, cancel context.CancelFunc) (err error)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
var paletteLight = material.Palette{
|
|
||||||
Bg: color.NRGBA{0xff, 0xff, 0xff, 0xff},
|
|
||||||
Fg: color.NRGBA{0x12, 0x12, 0x12, 0xff},
|
|
||||||
ContrastBg: color.NRGBA{0x7c, 0x00, 0xf8, 0xff},
|
|
||||||
ContrastFg: color.NRGBA{0x00, 0x00, 0x00, 0xff},
|
|
||||||
}
|
|
||||||
|
|
||||||
var paletteDark = material.Palette{
|
|
||||||
Bg: color.NRGBA{0x12, 0x12, 0x12, 0xff},
|
|
||||||
Fg: color.NRGBA{0xff, 0xff, 0xff, 0xff},
|
|
||||||
ContrastBg: color.NRGBA{0x7c, 0x00, 0xf8, 0xff},
|
|
||||||
ContrastFg: color.NRGBA{0xff, 0xff, 0xff, 0xff},
|
|
||||||
}
|
|
||||||
|
|
||||||
func (g *GUI) run(w *app.Window) error {
|
func (g *GUI) run(w *app.Window) error {
|
||||||
th := material.NewTheme(gofont.Collection())
|
|
||||||
dark, err := theme.IsDarkMode()
|
|
||||||
if err != nil {
|
|
||||||
logrus.Warn(err)
|
|
||||||
}
|
|
||||||
if dark {
|
|
||||||
_th := th.WithPalette(paletteDark)
|
|
||||||
th = &_th
|
|
||||||
} else {
|
|
||||||
_th := th.WithPalette(paletteLight)
|
|
||||||
th = &_th
|
|
||||||
}
|
|
||||||
|
|
||||||
var ops op.Ops
|
var ops op.Ops
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
|
@ -96,7 +96,7 @@ func (g *GUI) run(w *app.Window) error {
|
||||||
return e.Err
|
return e.Err
|
||||||
case system.FrameEvent:
|
case system.FrameEvent:
|
||||||
gtx := layout.NewContext(&ops, e)
|
gtx := layout.NewContext(&ops, e)
|
||||||
g.router.Layout(gtx, th)
|
g.router.Layout(gtx, g.router.Theme)
|
||||||
e.Frame(gtx.Ops)
|
e.Frame(gtx.Ops)
|
||||||
case *system.DestroyEvent:
|
case *system.DestroyEvent:
|
||||||
g.cancel()
|
g.cancel()
|
||||||
|
|
|
@ -30,6 +30,8 @@ type Router struct {
|
||||||
Wg sync.WaitGroup
|
Wg sync.WaitGroup
|
||||||
Invalidate func()
|
Invalidate func()
|
||||||
|
|
||||||
|
Theme *material.Theme
|
||||||
|
|
||||||
pages map[string]Page
|
pages map[string]Page
|
||||||
current string
|
current string
|
||||||
*component.ModalNavDrawer
|
*component.ModalNavDrawer
|
||||||
|
@ -39,7 +41,7 @@ type Router struct {
|
||||||
NonModalDrawer, BottomBar bool
|
NonModalDrawer, BottomBar bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewRouter(ctx context.Context, invalidate func()) Router {
|
func NewRouter(ctx context.Context, invalidate func(), th *material.Theme) Router {
|
||||||
modal := component.NewModal()
|
modal := component.NewModal()
|
||||||
|
|
||||||
nav := component.NewNav("Navigation Drawer", "This is an example.")
|
nav := component.NewNav("Navigation Drawer", "This is an example.")
|
||||||
|
@ -55,6 +57,7 @@ func NewRouter(ctx context.Context, invalidate func()) Router {
|
||||||
return Router{
|
return Router{
|
||||||
Ctx: ctx,
|
Ctx: ctx,
|
||||||
Invalidate: invalidate,
|
Invalidate: invalidate,
|
||||||
|
Theme: th,
|
||||||
pages: make(map[string]Page),
|
pages: make(map[string]Page),
|
||||||
ModalLayer: modal,
|
ModalLayer: modal,
|
||||||
ModalNavDrawer: modalNav,
|
ModalNavDrawer: modalNav,
|
||||||
|
|
|
@ -3,7 +3,6 @@ package settings
|
||||||
import (
|
import (
|
||||||
"image"
|
"image"
|
||||||
|
|
||||||
"gioui.org/font/gofont"
|
|
||||||
"gioui.org/layout"
|
"gioui.org/layout"
|
||||||
"gioui.org/unit"
|
"gioui.org/unit"
|
||||||
"gioui.org/widget"
|
"gioui.org/widget"
|
||||||
|
@ -40,20 +39,19 @@ func New(router *pages.Router) *Page {
|
||||||
startButton: widget.Clickable{},
|
startButton: widget.Clickable{},
|
||||||
}
|
}
|
||||||
|
|
||||||
th := material.NewTheme(gofont.Collection())
|
|
||||||
|
|
||||||
options := make([]func(layout.Context) layout.Dimensions, 0, len(utils.ValidCMDs))
|
options := make([]func(layout.Context) layout.Dimensions, 0, len(utils.ValidCMDs))
|
||||||
p.cmdMenu.items = make(map[string]*widget.Clickable, len(utils.ValidCMDs))
|
p.cmdMenu.items = make(map[string]*widget.Clickable, len(utils.ValidCMDs))
|
||||||
for k := range utils.ValidCMDs {
|
for k := range utils.ValidCMDs {
|
||||||
item := &widget.Clickable{}
|
item := &widget.Clickable{}
|
||||||
p.cmdMenu.items[k] = item
|
p.cmdMenu.items[k] = item
|
||||||
options = append(options, component.MenuItem(th, item, k).Layout)
|
options = append(options, component.MenuItem(router.Theme, item, k).Layout)
|
||||||
}
|
}
|
||||||
|
|
||||||
p.cmdMenu.state = &component.MenuState{
|
p.cmdMenu.state = &component.MenuState{
|
||||||
OptionList: layout.List{},
|
OptionList: layout.List{},
|
||||||
Options: options,
|
Options: options,
|
||||||
}
|
}
|
||||||
|
p.cmdMenu.selected = "worlds"
|
||||||
|
|
||||||
for _, su := range settings.Settings {
|
for _, su := range settings.Settings {
|
||||||
su.Init()
|
su.Init()
|
||||||
|
|
Loading…
Reference in New Issue