aboutsummaryrefslogtreecommitdiff
path: root/utils/helper/effects.go
diff options
context:
space:
mode:
authorZhongheng Liu <z.liu@outlook.com.gr>2024-10-24 12:55:45 +0300
committerZhongheng Liu <z.liu@outlook.com.gr>2024-10-24 12:55:45 +0300
commit86195d0722d1bf785ed8a0e1566bf2d02034a262 (patch)
tree61f1781d7da56cb71057bf21eb5a72ced7b6e51d /utils/helper/effects.go
parenta225c6f632c1efb349edf2a86f0fe920a7c2fafe (diff)
downloadrulmarc-rpg-dev.tar.gz
rulmarc-rpg-dev.tar.bz2
rulmarc-rpg-dev.zip
chore: moved utils aroundrpg-dev
Diffstat (limited to 'utils/helper/effects.go')
-rw-r--r--utils/helper/effects.go54
1 files changed, 0 insertions, 54 deletions
diff --git a/utils/helper/effects.go b/utils/helper/effects.go
deleted file mode 100644
index ff9a93a..0000000
--- a/utils/helper/effects.go
+++ /dev/null
@@ -1,54 +0,0 @@
-package helper
-
-import (
- "fmt"
- "time"
-
- . "github.com/gbin/goncurses"
-)
-
-func BlinkCursorUntilInput(scr *Window, pos_y int, pos_x int, interval time.Duration) Key {
- scr.Move(pos_y, pos_x)
- var activation_key Key
- for {
- Cursor(2)
- scr.Timeout(int((interval / 3).Milliseconds()))
- activation_key = scr.GetChar()
- if activation_key != 0 {
- break
- }
- time.Sleep(interval / 3)
- Cursor(0)
- time.Sleep(interval / 3)
- }
- return activation_key
-}
-func BlinkCursorUntilDone(scr *Window, pos_y int, pos_x int, interval time.Duration, done <-chan bool) {
- scr.Move(pos_y, pos_x)
- for {
- Cursor(2)
- select {
- case is_done, ok := <-done:
- if ok && is_done {
- return
- } else {
- fmt.Println("Channel closed?")
- }
- default:
- time.Sleep(interval / 2)
- Cursor(0)
- time.Sleep(interval / 2)
-
- }
- }
-}
-func BlinkCursorWithTime(scr *Window, pos_y int, pos_x int, duration time.Duration, interval time.Duration) {
- scr.Move(pos_y, pos_x)
- n := duration / interval
- for i := 0; i < int(n); i++ {
- Cursor(2)
- time.Sleep(interval / 2)
- Cursor(0)
- time.Sleep(interval / 2)
- }
-}