mirror of
https://github.com/clockworkpi/LauncherGoDev.git
synced 2025-12-12 16:08:52 +01:00
fix code,sound,brightness,update
This commit is contained in:
parent
92417db7ad
commit
620ae33593
@ -3,6 +3,7 @@ package main
|
|||||||
import(
|
import(
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"io/ioutil"
|
||||||
"strconv"
|
"strconv"
|
||||||
"github.com/cuu/gogame/event"
|
"github.com/cuu/gogame/event"
|
||||||
"github.com/cuu/LauncherGoDev/sysgo"
|
"github.com/cuu/LauncherGoDev/sysgo"
|
||||||
@ -17,22 +18,22 @@ type SliderIcon struct {
|
|||||||
|
|
||||||
}
|
}
|
||||||
func NewSliderIcon() *SliderIcon {
|
func NewSliderIcon() *SliderIcon {
|
||||||
p := &UI.SliderIcon{}
|
p := &SliderIcon{}
|
||||||
p.MyType = ICON_TYPES["EXE"]
|
p.MyType = UI.ICON_TYPES["EXE"]
|
||||||
p.Align = ALIGN["VCenter"]
|
p.Align = UI.ALIGN["VCenter"]
|
||||||
|
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
type SliderMultiIcon struct {
|
type SliderMultiIcon struct {
|
||||||
UI.MultiIconItem
|
UI.MultiIconItem
|
||||||
Parent *SoundSlider
|
Parent *BSlider
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSliderMultiIcon() *SliderMultiIcon {
|
func NewSliderMultiIcon() *SliderMultiIcon {
|
||||||
p := &SliderMultiIcon{}
|
p := &SliderMultiIcon{}
|
||||||
p.MyType = ICON_TYPES["EXE"]
|
p.MyType = UI.ICON_TYPES["EXE"]
|
||||||
p.Align = ALIGN["VCenter"]
|
p.Align = UI.ALIGN["VCenter"]
|
||||||
|
|
||||||
p.IconIndex = 0
|
p.IconIndex = 0
|
||||||
p.IconWidth = 18
|
p.IconWidth = 18
|
||||||
@ -47,7 +48,7 @@ type BSlider struct {
|
|||||||
BGpng *SliderIcon
|
BGpng *SliderIcon
|
||||||
BGwidth int
|
BGwidth int
|
||||||
BGheight int
|
BGheight int
|
||||||
NeedleSurf
|
//NeedleSurf
|
||||||
Scale *SliderMultiIcon
|
Scale *SliderMultiIcon
|
||||||
Parent *BrightnessPage
|
Parent *BrightnessPage
|
||||||
|
|
||||||
@ -56,7 +57,7 @@ type BSlider struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewBSlider() *BSlider {
|
func NewBSlider() *BSlider {
|
||||||
p := &SoundSlider{}
|
p := &BSlider{}
|
||||||
p.Range = [2]int{0,255}
|
p.Range = [2]int{0,255}
|
||||||
p.Value = 0
|
p.Value = 0
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import(
|
import(
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/veandco/go-sdl2/sdl"
|
||||||
"github.com/cuu/gogame/event"
|
"github.com/cuu/gogame/event"
|
||||||
"github.com/cuu/LauncherGoDev/sysgo/UI"
|
"github.com/cuu/LauncherGoDev/sysgo/UI"
|
||||||
)
|
)
|
||||||
@ -15,8 +16,8 @@ type SliderIcon struct {
|
|||||||
}
|
}
|
||||||
func NewSliderIcon() *SliderIcon {
|
func NewSliderIcon() *SliderIcon {
|
||||||
p := &SliderIcon{}
|
p := &SliderIcon{}
|
||||||
p.MyType = ICON_TYPES["EXE"]
|
p.MyType = UI.ICON_TYPES["EXE"]
|
||||||
p.Align = ALIGN["VCenter"]
|
p.Align = UI.ALIGN["VCenter"]
|
||||||
|
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
@ -28,8 +29,8 @@ type SliderMultiIcon struct {
|
|||||||
|
|
||||||
func NewSliderMultiIcon() *SliderMultiIcon {
|
func NewSliderMultiIcon() *SliderMultiIcon {
|
||||||
p := &SliderMultiIcon{}
|
p := &SliderMultiIcon{}
|
||||||
p.MyType = ICON_TYPES["EXE"]
|
p.MyType = UI.ICON_TYPES["EXE"]
|
||||||
p.Align = ALIGN["VCenter"]
|
p.Align = UI.ALIGN["VCenter"]
|
||||||
|
|
||||||
p.IconIndex = 0
|
p.IconIndex = 0
|
||||||
p.IconWidth = 18
|
p.IconWidth = 18
|
||||||
@ -44,7 +45,7 @@ type SoundSlider struct {
|
|||||||
BGpng *SliderIcon
|
BGpng *SliderIcon
|
||||||
BGwidth int
|
BGwidth int
|
||||||
BGheight int
|
BGheight int
|
||||||
NeedleSurf
|
//NeedleSurf
|
||||||
Scale *SliderMultiIcon
|
Scale *SliderMultiIcon
|
||||||
Parent *SoundPage
|
Parent *SoundPage
|
||||||
|
|
||||||
@ -193,7 +194,7 @@ func (self *SoundPage) OnLoadCb() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self *SoundPage) WhenSliderDrag(val int) { //value 0 - 100
|
func (self *SoundPage) WhenSliderDrag(val int) { //value 0 - 100
|
||||||
if value <0 || value > 100 {
|
if val <0 || val > 100 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
import (
|
||||||
|
"github.com/cuu/LauncherGoDev/sysgo/UI"
|
||||||
|
)
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
type UpdatePlugin struct {
|
type UpdatePlugin struct {
|
||||||
UI.Plugin
|
UI.Plugin
|
||||||
|
|||||||
@ -12,10 +12,10 @@ import (
|
|||||||
"github.com/cuu/gogame/time"
|
"github.com/cuu/gogame/time"
|
||||||
// "github.com/cuu/gogame/surface"
|
// "github.com/cuu/gogame/surface"
|
||||||
"github.com/cuu/gogame/event"
|
"github.com/cuu/gogame/event"
|
||||||
"github.com/cuu/gogame/rect"
|
//"github.com/cuu/gogame/rect"
|
||||||
"github.com/cuu/gogame/color"
|
//"github.com/cuu/gogame/color"
|
||||||
// "github.com/cuu/gogame/font"
|
// "github.com/cuu/gogame/font"
|
||||||
"github.com/cuu/gogame/draw"
|
//"github.com/cuu/gogame/draw"
|
||||||
|
|
||||||
"github.com/cuu/LauncherGoDev/sysgo"
|
"github.com/cuu/LauncherGoDev/sysgo"
|
||||||
"github.com/cuu/LauncherGoDev/sysgo/UI"
|
"github.com/cuu/LauncherGoDev/sysgo/UI"
|
||||||
@ -40,18 +40,18 @@ func NewUpdateConfirmPage() *UpdateConfirmPage {
|
|||||||
p.FootMsg = [5]string{"Nav","","","Cancel","Yes"}
|
p.FootMsg = [5]string{"Nav","","","Cancel","Yes"}
|
||||||
p.ConfirmText = "Confirm Update?"
|
p.ConfirmText = "Confirm Update?"
|
||||||
|
|
||||||
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *UpdateConfirmPage) KeyDown(ev *event.Event) {
|
func (self *UpdateConfirmPage) KeyDown(ev *event.Event) {
|
||||||
|
|
||||||
if ev.Data["Key"] == CurKeys["A"] || ev.Data["Key"] == CurKeys["Menu"] {
|
if ev.Data["Key"] == UI.CurKeys["A"] || ev.Data["Key"] == UI.CurKeys["Menu"] {
|
||||||
self.ReturnToUpLevelPage()
|
self.ReturnToUpLevelPage()
|
||||||
self.Screen.Draw()
|
self.Screen.Draw()
|
||||||
self.Screen.SwapAndShow()
|
self.Screen.SwapAndShow()
|
||||||
}
|
}
|
||||||
|
|
||||||
if ev.Data["Key"] == CurKeys["B"] {
|
if ev.Data["Key"] == UI.CurKeys["B"] {
|
||||||
if self.GIT == true {
|
if self.GIT == true {
|
||||||
cmdpath := fmt.Sprintf("feh --bg-center %s/sys.go/gameshell/wallpaper/updating.png; cd %s ;git pull; git reset --hard %s ; feh --bg-center %s/sys.py/gameshell/wallpaper/loading.png ",
|
cmdpath := fmt.Sprintf("feh --bg-center %s/sys.go/gameshell/wallpaper/updating.png; cd %s ;git pull; git reset --hard %s ; feh --bg-center %s/sys.py/gameshell/wallpaper/loading.png ",
|
||||||
launchergo_path,
|
launchergo_path,
|
||||||
@ -95,7 +95,7 @@ func NewUpdatePage() *UpdatePage {
|
|||||||
p.SelectedIconTopOffset = 20
|
p.SelectedIconTopOffset = 20
|
||||||
p.EasingDur = 10
|
p.EasingDur = 10
|
||||||
|
|
||||||
p.Align = ALIGN["SLeft"]
|
p.Align = UI.ALIGN["SLeft"]
|
||||||
p.ListFontObj = UI.Fonts["varela15"]
|
p.ListFontObj = UI.Fonts["varela15"]
|
||||||
|
|
||||||
return p
|
return p
|
||||||
@ -249,6 +249,8 @@ func (self *UpdatePage) KeyDown(ev *event.Event) {
|
|||||||
|
|
||||||
func (self *UpdatePage) Draw() {
|
func (self *UpdatePage) Draw() {
|
||||||
self.ClearCanvas()
|
self.ClearCanvas()
|
||||||
for
|
for _,v := range self.MyList {
|
||||||
|
v.Draw()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
4
build.sh
4
build.sh
@ -21,11 +21,11 @@ go build -o wifi.so -buildmode=plugin
|
|||||||
cd -
|
cd -
|
||||||
|
|
||||||
cd Menu/GameShell/10_Settings/Sound
|
cd Menu/GameShell/10_Settings/Sound
|
||||||
go build --ldflags="-s -w" o sound.so -buildmode=plugin
|
go build -ldflags="-s -w" -o sound.so -buildmode=plugin
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
cd Menu/GameShell/10_Settings/Brightness
|
cd Menu/GameShell/10_Settings/Brightness
|
||||||
go build --ldflags="-s -w" o brightness.so -buildmode=plugin
|
go build -ldflags="-s -w" -o brightness.so -buildmode=plugin
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user