mirror of
https://github.com/clockworkpi/LauncherGoDev.git
synced 2026-03-19 02:12:46 +01:00
about
This commit is contained in:
@@ -80,11 +80,7 @@ func NewIconItem() *IconItem {
|
||||
i.MyType = ICON_TYPES["EXE"]
|
||||
|
||||
i.Align = ALIGN["VCenter"]
|
||||
|
||||
l := NewLabel()
|
||||
|
||||
i.Label = l
|
||||
|
||||
|
||||
return i
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ var PC map[string]string
|
||||
|
||||
|
||||
func DefinePC() {
|
||||
PC["UP"] = "Up"
|
||||
PC["Up"] = "Up"
|
||||
PC["Down"] = "Down"
|
||||
PC["Left"] = "Left"
|
||||
PC["Right"] = "Right"
|
||||
@@ -30,7 +30,7 @@ func DefinePC() {
|
||||
}
|
||||
|
||||
func DefineGameShell() {
|
||||
GameShell["UP"] = "Up"
|
||||
GameShell["Up"] = "Up"
|
||||
GameShell["Down"] = "Down"
|
||||
GameShell["Left"] = "Left"
|
||||
GameShell["Right"] = "Right"
|
||||
|
||||
@@ -11,11 +11,15 @@ import (
|
||||
type ListItemInterface interface {
|
||||
|
||||
Init(text string)
|
||||
|
||||
Size() (int,int)
|
||||
NewSize(w,h int)
|
||||
Coord() (int,int)
|
||||
NewCoord(x,y int)
|
||||
|
||||
GetLinkObj() PluginInterface
|
||||
Draw()
|
||||
|
||||
}
|
||||
|
||||
type ListItem struct {
|
||||
@@ -61,10 +65,13 @@ func (self *ListItem) Size() (int,int) {
|
||||
}
|
||||
|
||||
|
||||
func (self *ListItem) GetLinkObj() PluginInterface {
|
||||
return self.LinkObj
|
||||
}
|
||||
|
||||
func (self *ListItem) Draw() {
|
||||
x_,_ := self.Labels["Text"].Coord()
|
||||
h_,_ := self.Labels["Text"].Size()
|
||||
_,h_ := self.Labels["Text"].Size()
|
||||
|
||||
self.Labels["Text"].NewCoord(x_, self.PosY+(self.Height - h_)/2)
|
||||
self.Labels["Text"].Draw()
|
||||
|
||||
@@ -751,7 +751,7 @@ func (self *Page) ResetPageSelector() {
|
||||
|
||||
func (self *Page) DrawPageSelector() {
|
||||
if self.Ps.GetOnShow() == true {
|
||||
fmt.Println("DrawPageSelector")
|
||||
// fmt.Println("DrawPageSelector")
|
||||
self.Ps.Draw()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@ import (
|
||||
"fmt"
|
||||
"bufio"
|
||||
"bytes"
|
||||
|
||||
"io"
|
||||
|
||||
"github.com/cuu/gogame/display"
|
||||
|
||||
"github.com/cuu/LauncherGo/sysgo"
|
||||
@@ -122,33 +123,34 @@ func SwapAndShow() {
|
||||
}
|
||||
|
||||
func ReadLines(path string)(lines [] string,err error){
|
||||
var (
|
||||
file *os.File
|
||||
part [] byte
|
||||
prefix bool
|
||||
)
|
||||
|
||||
if file, err = os.Open(path); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
reader := bufio.NewReader(file)
|
||||
buffer := bytes.NewBuffer(make([]byte,1024))
|
||||
|
||||
for {
|
||||
if part, prefix, err = reader.ReadLine();err != nil {
|
||||
break
|
||||
}
|
||||
buffer.Write(part)
|
||||
if !prefix {
|
||||
lines = append(lines,buffer.String())
|
||||
buffer.Reset()
|
||||
}
|
||||
}
|
||||
if err == io.EOF {
|
||||
err = nil
|
||||
}
|
||||
return
|
||||
var (
|
||||
file *os.File
|
||||
part [] byte
|
||||
prefix bool
|
||||
)
|
||||
|
||||
if file, err = os.Open(path); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
reader := bufio.NewReader(file)
|
||||
buffer := bytes.NewBuffer(make([]byte,0))
|
||||
|
||||
for {
|
||||
if part, prefix, err = reader.ReadLine();err != nil {
|
||||
break
|
||||
}
|
||||
buffer.Write(part)
|
||||
if !prefix {
|
||||
lines = append(lines,buffer.String())
|
||||
buffer.Reset()
|
||||
}
|
||||
}
|
||||
|
||||
if err == io.EOF {
|
||||
err = nil
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func WriteLines(lines [] string,path string)(err error){
|
||||
|
||||
Reference in New Issue
Block a user