add license, move folders

This commit is contained in:
Nordup 2024-05-04 00:14:24 +04:00
parent 185cc74060
commit 271c4a46a1
132 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,52 @@
extends Resource
class_name History
var history: Array[String]
var index := -1
func get_current() -> String:
if index == -1: return ""
return history[index]
func can_forw() -> bool:
return index + 1 < history.size()
func can_back() -> bool:
return index > -1
func add(url: String) -> void:
if url == get_current(): return
index += 1
history.resize(index)
history.push_back(url)
print_history()
func forw() -> String:
index += 1
print_history()
return history[index]
func back() -> String:
index -= 1
print_history()
if index == -1:
return ""
return history[index]
func clear() -> void:
index = -1
history.clear()
print_history()
func print_history() -> void:
# Debug.logclr("History: " + str(history) + " Current: " + str(index), Color.DIM_GRAY)
pass