mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-25 14:17:29 -04:00
menu navigation done
This commit is contained in:
parent
c2e194d922
commit
a82a27b38f
3 changed files with 22 additions and 13 deletions
|
@ -241,7 +241,7 @@ focus_neighbor_right = NodePath("")
|
||||||
focus_neighbor_bottom = NodePath("")
|
focus_neighbor_bottom = NodePath("")
|
||||||
focus_next = NodePath("")
|
focus_next = NodePath("")
|
||||||
focus_previous = NodePath("")
|
focus_previous = NodePath("")
|
||||||
focus_mode = 2
|
focus_mode = 0
|
||||||
mouse_filter = 0
|
mouse_filter = 0
|
||||||
mouse_force_pass_scroll_events = true
|
mouse_force_pass_scroll_events = true
|
||||||
mouse_default_cursor_shape = 2
|
mouse_default_cursor_shape = 2
|
||||||
|
@ -310,7 +310,7 @@ focus_neighbor_right = NodePath("")
|
||||||
focus_neighbor_bottom = NodePath("")
|
focus_neighbor_bottom = NodePath("")
|
||||||
focus_next = NodePath("")
|
focus_next = NodePath("")
|
||||||
focus_previous = NodePath("")
|
focus_previous = NodePath("")
|
||||||
focus_mode = 2
|
focus_mode = 0
|
||||||
mouse_filter = 0
|
mouse_filter = 0
|
||||||
mouse_force_pass_scroll_events = true
|
mouse_force_pass_scroll_events = true
|
||||||
mouse_default_cursor_shape = 2
|
mouse_default_cursor_shape = 2
|
||||||
|
@ -377,7 +377,7 @@ focus_neighbor_right = NodePath("")
|
||||||
focus_neighbor_bottom = NodePath("")
|
focus_neighbor_bottom = NodePath("")
|
||||||
focus_next = NodePath("")
|
focus_next = NodePath("")
|
||||||
focus_previous = NodePath("")
|
focus_previous = NodePath("")
|
||||||
focus_mode = 2
|
focus_mode = 0
|
||||||
mouse_filter = 0
|
mouse_filter = 0
|
||||||
mouse_force_pass_scroll_events = true
|
mouse_force_pass_scroll_events = true
|
||||||
mouse_default_cursor_shape = 2
|
mouse_default_cursor_shape = 2
|
||||||
|
@ -449,7 +449,7 @@ focus_neighbor_right = NodePath("")
|
||||||
focus_neighbor_bottom = NodePath("")
|
focus_neighbor_bottom = NodePath("")
|
||||||
focus_next = NodePath("")
|
focus_next = NodePath("")
|
||||||
focus_previous = NodePath("")
|
focus_previous = NodePath("")
|
||||||
focus_mode = 2
|
focus_mode = 0
|
||||||
mouse_filter = 0
|
mouse_filter = 0
|
||||||
mouse_force_pass_scroll_events = true
|
mouse_force_pass_scroll_events = true
|
||||||
mouse_default_cursor_shape = 2
|
mouse_default_cursor_shape = 2
|
||||||
|
@ -530,7 +530,7 @@ focus_neighbor_right = NodePath("")
|
||||||
focus_neighbor_bottom = NodePath("")
|
focus_neighbor_bottom = NodePath("")
|
||||||
focus_next = NodePath("")
|
focus_next = NodePath("")
|
||||||
focus_previous = NodePath("")
|
focus_previous = NodePath("")
|
||||||
focus_mode = 2
|
focus_mode = 0
|
||||||
mouse_filter = 0
|
mouse_filter = 0
|
||||||
mouse_force_pass_scroll_events = true
|
mouse_force_pass_scroll_events = true
|
||||||
mouse_default_cursor_shape = 2
|
mouse_default_cursor_shape = 2
|
||||||
|
|
|
@ -24,18 +24,18 @@ func add(url: String) -> void:
|
||||||
index += 1
|
index += 1
|
||||||
history.resize(index)
|
history.resize(index)
|
||||||
history.push_back(url)
|
history.push_back(url)
|
||||||
print(str(history) + " " + str(index))
|
print_history()
|
||||||
|
|
||||||
|
|
||||||
func forw() -> String:
|
func forw() -> String:
|
||||||
index += 1
|
index += 1
|
||||||
print(str(history) + " " + str(index))
|
print_history()
|
||||||
return history[index]
|
return history[index]
|
||||||
|
|
||||||
|
|
||||||
func back() -> String:
|
func back() -> String:
|
||||||
index -= 1
|
index -= 1
|
||||||
print(str(history) + " " + str(index))
|
print_history()
|
||||||
if index == -1:
|
if index == -1:
|
||||||
return ""
|
return ""
|
||||||
return history[index]
|
return history[index]
|
||||||
|
@ -44,4 +44,8 @@ func back() -> String:
|
||||||
func clear() -> void:
|
func clear() -> void:
|
||||||
index = -1
|
index = -1
|
||||||
history.clear()
|
history.clear()
|
||||||
print(str(history) + " " + str(index))
|
print_history()
|
||||||
|
|
||||||
|
|
||||||
|
func print_history() -> void:
|
||||||
|
Debug.logclr("History: " + str(history) + " Current: " + str(index), Color.DIM_GRAY)
|
||||||
|
|
|
@ -23,15 +23,19 @@ func _ready() -> void:
|
||||||
func on_open_gate(url: String) -> void:
|
func on_open_gate(url: String) -> void:
|
||||||
history.add(url)
|
history.add(url)
|
||||||
enable([go_back, reload, home])
|
enable([go_back, reload, home])
|
||||||
|
if not history.can_forw():
|
||||||
|
disable([go_forw])
|
||||||
|
|
||||||
|
|
||||||
func on_go_back() -> void:
|
func on_go_back() -> void:
|
||||||
var url = history.back()
|
var url = history.back()
|
||||||
if url == "":
|
|
||||||
on_home()
|
|
||||||
else:
|
|
||||||
gate_events.open_gate_emit(url)
|
|
||||||
enable([go_forw])
|
enable([go_forw])
|
||||||
|
if history.can_back():
|
||||||
|
gate_events.open_gate_emit(url)
|
||||||
|
else:
|
||||||
|
disable([go_back, reload, home])
|
||||||
|
gate_events.exit_gate_emit()
|
||||||
|
|
||||||
|
|
||||||
func on_go_forw() -> void:
|
func on_go_forw() -> void:
|
||||||
|
@ -49,6 +53,7 @@ func on_reload() -> void:
|
||||||
|
|
||||||
|
|
||||||
func on_home() -> void:
|
func on_home() -> void:
|
||||||
|
history.clear()
|
||||||
disable([go_back, go_forw, reload, home])
|
disable([go_back, go_forw, reload, home])
|
||||||
gate_events.exit_gate_emit()
|
gate_events.exit_gate_emit()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue