Skip to content

Commit

Permalink
rm old code
Browse files Browse the repository at this point in the history
  • Loading branch information
GnuhViet committed Sep 16, 2023
1 parent 0c5769b commit cdd0ce6
Showing 1 changed file with 9 additions and 28 deletions.
37 changes: 9 additions & 28 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var (
selectedChampion Champion
stopChan chan bool
pickLocking = false
spam = true
)

var (
Expand Down Expand Up @@ -132,36 +133,11 @@ func InitUI(championNames []string) {
stopButton.Disable()
pickLockButton.Disable()

/* startButton.OnTapped = func() {
beeep.Alert("Cảnh báo", "Bắt đầu pick-lock", "pick-lock.ico")
startButton.Disable()
stopButton.Enable()
confirmButton.Disable()
selectEntry.Disable()
stopChan = make(chan bool)
go StartAcceptMatchPickLock(selectedChampion.ID)
}
stopButton.OnTapped = func() {
stopChan <- true // Gửi thông báo để kết thúc goroutine (nếu đang chạy).
<-stopChan // Đợi goroutine thực sự kết thúc.
stopButton.Disable()
startButton.Enable()
confirmButton.Enable()
selectEntry.Enable()
runningLabel.SetText("Chưa bắt đầu")
}*/

selectLanguage.OnChanged = func(vi string) {
uiText, alertText, messageText = utils.ReadEnv(selectLanguage.Selected)
ReloadUIText()
}

var spam = true

pickLockButton.OnTapped = func() {
if isInMatchMaking() == false {
if spam {
Expand Down Expand Up @@ -233,7 +209,10 @@ func InitUI(championNames []string) {
confirmButton.OnTapped = func() {
if selectedChampion.ID == -1 || selectedChampion.Name == "" {
resultLabel.SetText(messageText.NotSelectChamp)
beeep.Alert(alertText.Notification, alertText.NotSelectChamp, "pick-lock.ico")
err := beeep.Alert(alertText.Notification, alertText.NotSelectChamp, "pick-lock.ico")
if err != nil {
return
}
return
}

Expand Down Expand Up @@ -328,6 +307,8 @@ func StartPickLock(championID int) {
matchAccepted = true
}

// isMatchAccepted will return false if someone not accept matchmaking
// then we stop the routine
if matchAccepted {
if !isMatchAccepted() {
runningLabel.SetText(messageText.MatchCancelled)
Expand Down Expand Up @@ -357,7 +338,7 @@ func StartPickLock(championID int) {
}

////
// --------------------------------------------- API ----------------------------------------
// --------------------------------------------- LCU-API ----------------------------------------
////

func CallApi(api string, method string, data []byte) []byte {
Expand Down Expand Up @@ -437,7 +418,7 @@ func isMatchAccepted() bool {
}

var data map[string]interface{}
err := json.Unmarshal([]byte(body), &data)
err := json.Unmarshal(body, &data)
if err != nil {
return false
}
Expand Down

0 comments on commit cdd0ce6

Please sign in to comment.