forked from team-sg/hero-mark-2
ThE GREAT SHATTERINGgit status! control.tscn is DEAD! LoNG LIVE CONTROL.TSCNgit statusgit status! MWAHAHAHAHAHAHAHA
This commit is contained in:
parent
6c22279e41
commit
c1a9ab7cdc
17 changed files with 253 additions and 270 deletions
|
@ -4,11 +4,9 @@ extends CanvasLayer
|
|||
#Const
|
||||
const ENTRY_SEQUENCE = ["4", "1", "5"]
|
||||
#Export
|
||||
export var max_lines: int = 10
|
||||
export var opacity: float = 0.5
|
||||
|
||||
#Onready
|
||||
onready var console = $Console
|
||||
onready var code_label = get_parent().get_node("Main/Control/ViewportContainer/Viewport/CheatLayer/CheatLabel")
|
||||
onready var code_label = $CheatLabel
|
||||
##Runtime
|
||||
var lines: int = 0
|
||||
var time: float = 0.0
|
||||
|
@ -27,33 +25,26 @@ var code = ""
|
|||
func _ready():
|
||||
#Auto do debug when playtesting
|
||||
if not OS.is_debug_build():
|
||||
console.visible = false
|
||||
debug = false
|
||||
else:
|
||||
console.visible = false
|
||||
debug = true
|
||||
$Console/Panel.modulate.a = opacity
|
||||
console.modulate.a = opacity
|
||||
|
||||
func _physics_process(delta):
|
||||
#DEBUG
|
||||
if debug == true && !entry && !entry_index > 0:
|
||||
#Show console
|
||||
if Input.is_action_just_pressed("debug_show"):
|
||||
console.visible = !console.visible
|
||||
#Move player to mouse
|
||||
if Input.is_action_pressed("debug_move_player"):
|
||||
var nodes = get_tree().get_nodes_in_group("player")
|
||||
if not nodes.empty():
|
||||
var player = nodes[0].get_parent()
|
||||
var mouse_position = Game.viewport.get_mouse_position() / Game.viewport_container.rect_scale
|
||||
var mouse_position = SceneManager.viewport.get_mouse_position() / SceneManager.viewport_container.rect_scale
|
||||
mouse_position.x = clamp(mouse_position.x, 8.0, Game.resolution.x - 8.0)
|
||||
mouse_position.y = clamp(mouse_position.y, 8.0, Game.resolution.y - 8.0)
|
||||
var world_position = mouse_position + Game.current_sector * Game.resolution
|
||||
player.position = world_position
|
||||
|
||||
# Game.get_map().get_node("Player").position = get_viewport().get_mouse_position()
|
||||
# Debug.print(get_viewport().get_mouse_position())
|
||||
# Console.print(get_viewport().get_mouse_position())
|
||||
#Test room
|
||||
if Input.is_action_just_pressed("debug_testroom"):
|
||||
Game.change_map(load("res://maps/test_room.tscn"))
|
||||
|
@ -64,25 +55,6 @@ func _physics_process(delta):
|
|||
if Input.is_action_just_pressed("debug_2"):
|
||||
Game.freeze_frame(1.0)
|
||||
|
||||
func print(text):
|
||||
lines += 1
|
||||
if lines > 1:
|
||||
console.text += "\n"
|
||||
if lines > 10:
|
||||
var n = console.text.find("\n")
|
||||
var t = console.text
|
||||
t.erase(0, n+1)
|
||||
lines -= 1
|
||||
console.text = t + str(text)
|
||||
else:
|
||||
console.text += str(text)
|
||||
|
||||
func _on_visible_toggled(button_pressed):
|
||||
if button_pressed:
|
||||
console.visible = true
|
||||
else:
|
||||
console.visible = false
|
||||
|
||||
func _input(event):
|
||||
if event is InputEventKey && event.is_pressed():
|
||||
var character = OS.get_scancode_string(event.scancode)
|
||||
|
@ -126,7 +98,7 @@ func _enter_code():
|
|||
"DGSTEEZY":
|
||||
debug = true
|
||||
"6DOUBLOONS":
|
||||
Debug.print(get_tree().get_nodes_in_group("gold").size())
|
||||
Console.print(get_tree().get_nodes_in_group("gold").size())
|
||||
"EVILSBANE":
|
||||
allow_sword = true
|
||||
Input.action_press("sword")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue