mirror of
https://github.com/clockworkpi/LauncherGoDev.git
synced 2025-12-13 00:18:52 +01:00
remove all init() in UI, move into UI.Init()
This commit is contained in:
parent
003bb8f598
commit
4736ab131d
3
main.go
3
main.go
@ -269,7 +269,6 @@ func run() int {
|
|||||||
screen := display.SetMode(int32(UI.Width),int32(UI.Height),0,32)
|
screen := display.SetMode(int32(UI.Width),int32(UI.Height),0,32)
|
||||||
|
|
||||||
UI.Init()
|
UI.Init()
|
||||||
UI.MyIconPool.Init()
|
|
||||||
|
|
||||||
PreparationInAdv()
|
PreparationInAdv()
|
||||||
|
|
||||||
@ -449,6 +448,8 @@ func main() {
|
|||||||
|
|
||||||
var exitcode int
|
var exitcode int
|
||||||
|
|
||||||
|
runtime.GOMAXPROCS(1)
|
||||||
|
|
||||||
os.Setenv("SDL_VIDEO_CENTERED","1")
|
os.Setenv("SDL_VIDEO_CENTERED","1")
|
||||||
|
|
||||||
sdl.Main(func() {
|
sdl.Main(func() {
|
||||||
|
|||||||
@ -79,11 +79,14 @@ func Init() {
|
|||||||
keyname := fmt.Sprintf("notosanscjk%d",i)
|
keyname := fmt.Sprintf("notosanscjk%d",i)
|
||||||
Fonts[keyname] = font.Font(fonts_path["notocjk"],i)
|
Fonts[keyname] = font.Font(fonts_path["notocjk"],i)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
//
|
||||||
|
keys_def_init()
|
||||||
|
|
||||||
|
//// global variables Init
|
||||||
if MyIconPool == nil {
|
if MyIconPool == nil {
|
||||||
MyIconPool = NewIconPool()
|
MyIconPool = NewIconPool()
|
||||||
|
MyIconPool.Init()
|
||||||
}
|
}
|
||||||
if MyLangManager == nil {
|
if MyLangManager == nil {
|
||||||
|
|
||||||
@ -96,3 +99,5 @@ func init() {
|
|||||||
MySkinManager.Init()
|
MySkinManager.Init()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,8 @@ func DefineGameShell() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init(){
|
|
||||||
|
func keys_def_init(){
|
||||||
GameShell = make(map[string]string)
|
GameShell = make(map[string]string)
|
||||||
PC = make(map[string]string)
|
PC = make(map[string]string)
|
||||||
|
|
||||||
|
|||||||
@ -218,6 +218,7 @@ func CheckBattery() int {
|
|||||||
if FileExists(sysgo.Battery) == false {
|
if FileExists(sysgo.Battery) == false {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
batinfos,err := ReadLines(sysgo.Battery)
|
batinfos,err := ReadLines(sysgo.Battery)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
for _,v := range batinfos {
|
for _,v := range batinfos {
|
||||||
@ -236,9 +237,13 @@ func CheckBattery() int {
|
|||||||
}else{
|
}else{
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func System(cmd string) string {
|
func System(cmd string) string {
|
||||||
ret := ""
|
ret := ""
|
||||||
out,err := exec.Command("bash","-c",cmd).Output()
|
out,err := exec.Command("bash","-c",cmd).Output()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user