Skip to content

Commit

Permalink
examples: update
Browse files Browse the repository at this point in the history
  • Loading branch information
whtiehack committed Jun 28, 2024
1 parent 87d1561 commit d0fef52
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions examples/wowjump/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type Config struct {
editCharWaitTime *wingui.Edit `json:"-"`
btnCheckChangeChar *wingui.Button `json:"-"`
btnCheckLogoutFlash *wingui.Button `json:"-"`
flashHwnd win.HWND `json:"-"`
flashHwnd win.HWND `json:"-"`
}

var config = &Config{
Expand All @@ -52,7 +52,7 @@ func init() {
log.Println("解析配置文件成功", string(file))
}

//Save save config to file.
// Save save config to file.
func (c *Config) Save() {
config.EnterTime, _ = strconv.Atoi(c.editEnterTime.Text())
config.NormalTime, _ = strconv.Atoi(c.editNormaltime.Text())
Expand All @@ -66,7 +66,7 @@ func (c *Config) Save() {
ioutil.WriteFile(configDir+"/wowjump/wowjump_config.txt", file, 0777)
}

//InitVal put config val to edit.
// InitVal put config val to edit.
func (c *Config) InitVal() {
c.editEnterTime.SetText(strconv.Itoa(c.EnterTime))
c.editNormaltime.SetText(strconv.Itoa(c.NormalTime))
Expand All @@ -84,7 +84,7 @@ func (c *Config) InitVal() {
c.btnCheckLogoutFlash.SetCheck(state)
}

//EditEnable enable edits.
// EditEnable enable edits.
func (c *Config) EditEnable(enable bool) {
c.editEnterTime.SetEnabled(enable)
c.editNormaltime.SetEnabled(enable)
Expand Down
1 change: 1 addition & 0 deletions examples/wowjump/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func init() {
var btn *wingui.Button

// optional genereate resource IDs
//
//go:generate go run github.com/whtiehack/wingui/tools/genids -filename ui/resource.h -packagename main
func main() {
var err error
Expand Down
4 changes: 2 additions & 2 deletions examples/wowjump/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (s *Statistics) Stat(path string, title string) {
val, _ := url.ParseQuery(s.params.Encode())
val.Set("rnd", strconv.Itoa(int(rand.Int31())))
val.Set("sn", strconv.Itoa(int(time.Now().Unix()%65535)))
if s.lt != 0 && int(time.Now().Unix())-s.lt > 2592E3 {
if s.lt != 0 && int(time.Now().Unix())-s.lt > 2592e3 {
s.lt = int(time.Now().Unix())
}
if s.lt != 0 {
Expand Down Expand Up @@ -189,7 +189,7 @@ func (s *Statistics) Stat(path string, title string) {
val.Set("et", "0")
val.Set("ct", "!!")

if int(time.Now().Unix())-s.lt > 2592E3 {
if int(time.Now().Unix())-s.lt > 2592e3 {
s.lt = int(time.Now().Unix())
}
val.Set("lt", strconv.Itoa(s.lt))
Expand Down

0 comments on commit d0fef52

Please sign in to comment.