cuu 1 year ago
parent
commit
2d18c23e89

+ 6 - 2
Menu/GameShell/97_MusicPlayer/music_player_page.go

@@ -2,6 +2,7 @@ package MusicPlayer
 
 import (
 	"fmt"
+	"path/filepath"
 	"log"
 	"github.com/cuu/gogame/event"
 	"github.com/cuu/gogame/rect"
@@ -128,8 +129,8 @@ func (self *MusicPlayerPage) SyncList() {
 				li.Init("NoName")
 			}
 		}
-		
-		li.Labels["Text"].PosX = 7
+		x,_ := li.Labels["Text"].Coord()	
+		li.Labels["Text"].NewCoord(x,7)
 		self.MyList = append(self.MyList, li)
 	}
 	
@@ -143,7 +144,10 @@ func (self *MusicPlayerPage) SyncPlaying() {
 		self.MyList[i].(*MusicPlayPageListItem).Active = false
 		self.MyList[i].(*MusicPlayPageListItem).PlayingProcess = 0
 	}
+	current_song,_ := conn.CurrentSong()
+	if len(current_song) > 0 {
 
+	}
 }
 
 func (self *MusicPlayerPage) Init() {

+ 8 - 7
Menu/GameShell/97_MusicPlayer/music_player_page_list_item.go

@@ -12,7 +12,7 @@ import (
 
         //"github.com/clockworkpi/LauncherGoDev/sysgo"
         "github.com/clockworkpi/LauncherGoDev/sysgo/UI"
-        "github.com/cuu/gogame/color"
+        //"github.com/cuu/gogame/color"
         "github.com/cuu/gogame/draw"
         //"github.com/cuu/gogame/event"
         //"github.com/cuu/gogame/rect"
@@ -46,26 +46,27 @@ func NewMusicPlayPageListItem() *MusicPlayPageListItem {
 func (self *MusicPlayPageListItem) Draw() {
 
         x, _ := self.Labels["Text"].Coord()
-        w, h := self.Labels["Text"].Size()
+        _, h := self.Labels["Text"].Size()
 
         self.Labels["Text"].NewCoord(x, self.PosY+(self.Height-h)/2)
 	
 
 	if self.MyType == UI.ICON_TYPES["DIR"] &&  self.Path != "[..]" {
 		sys_icon := self.Parent.(*MusicPlayerPage).Icons["sys"]
-		sys_icon.IconIndex = 0.
-		sys_icon.NewCoord(self.PosX+12,self.PosY + ( self.Height - sys_icon.Height)/2 + sys_icon.Height /2)
+		_,h := sys_icon.Size()
+		sys_icon.SetIconIndex(0)
+		sys_icon.NewCoord(self.PosX+12,self.PosY + ( self.Height - h)/2 + h/2)
                 sys_icon.Draw()		
 	}
 
 	if self.MyType == UI.ICON_TYPES["FILE"] {
 		sys_icon := self.Parent.(*MusicPlayerPage).Icons["sys"]
-		sys_icon.IconIndex = 1
-		sys_icon.NewCoord(self.PosX+12,self.PosY + ( self.Height - sys_icon.Height)/2 + sys_icon.Height /2)
+		_,h := sys_icon.Size()
+		sys_icon.SetIconIndex(1)
+		sys_icon.NewCoord(self.PosX+12,self.PosY + ( self.Height - h)/2 + h /2)
 		sys_icon.Draw()
 	}
 
-        self.Labels["Text"].Active = self.Active
 
 	self.Labels["Text"].NewCoord(x, self.PosY+(self.Height-h)/2)