Skip to content

Commit

Permalink
fixed the return to hub function and added a customizable main menu
Browse files Browse the repository at this point in the history
  • Loading branch information
JenniBee committed Apr 23, 2017
1 parent b820975 commit 41220e2
Show file tree
Hide file tree
Showing 11 changed files with 114 additions and 74 deletions.
Binary file added art/concept-art.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added art/menu-wavingpeople-and-mythalore.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions globals/game.gd
Expand Up @@ -327,8 +327,8 @@ func _ready():
if fallbacks_path != "":
fallbacks = vm.compile(fallbacks_path)

click = get_node("click")
click_anim = get_node("click_anim")
#click = get_node("click")
#click_anim = get_node("click_anim")
#set_process_input(true)

camera = get_node("camera")
Expand Down
2 changes: 1 addition & 1 deletion globals/global_vm.gd
Expand Up @@ -414,7 +414,7 @@ func run():
while stack.size() > 0 && !(stack[stack.size()-1].break_stop):
stack.remove(stack.size()-1)
stack.remove(stack.size()-1)
root.set_input_catch(false)
#root.set_input_catch(false)
loading_game = false

func can_save():
Expand Down
4 changes: 2 additions & 2 deletions globals/player.gd
Expand Up @@ -196,8 +196,8 @@ func _get_dir_deg(deg):


func _notification(what):
if !get_tree() || !get_tree().is_editor_hint():
return
#if !get_tree() || !get_tree().is_editor_hint():
return

if what == CanvasItem.NOTIFICATION_TRANSFORM_CHANGED:
call_deferred("_editor_transform_changed")
Expand Down
29 changes: 21 additions & 8 deletions rooms/clock/clock.tscn
@@ -1,11 +1,12 @@
[gd_scene load_steps=8 format=1]
[gd_scene load_steps=9 format=1]

[ext_resource path="res://globals/scene.gd" type="Script" id=1]
[ext_resource path="res://rooms/clock/sprites/clock-bg-taekon.png" type="Texture" id=2]
[ext_resource path="res://globals/background.gd" type="Script" id=3]
[ext_resource path="res://globals/terrain.gd" type="Script" id=4]
[ext_resource path="res://rooms/clock/player.tscn" type="PackedScene" id=5]
[ext_resource path="res://globals/game.scn" type="PackedScene" id=6]
[ext_resource path="res://ui/hub_button.gd" type="Script" id=7]

[sub_resource type="NavigationPolygon" id=1]

Expand Down Expand Up @@ -33,8 +34,8 @@ size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 3.0
margin/top = 8.0
margin/right = 1797.0
margin/bottom = 882.0
margin/right = 1923.0
margin/bottom = 1088.0
texture = ExtResource( 2 )
stretch_mode = 0
script/script = ExtResource( 3 )
Expand Down Expand Up @@ -67,20 +68,32 @@ z/z = 732

[node name="game" parent="." instance=ExtResource( 6 )]

[node name="hub_button" type="Button" parent="."]
[node name="back_to_hub" type="Control" parent="."]

focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 12.0
margin/bottom = 20.0
disabled = true
margin/right = 40.0
margin/bottom = 40.0
script/script = ExtResource( 7 )

[node name="hub_button" type="TextureButton" parent="back_to_hub"]

focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 1661.0
margin/top = 425.0
margin/right = 1825.0
margin/bottom = 649.0
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
flat = false
params/resize_mode = 0
params/stretch_mode = 0


Binary file modified rooms/clock/sprites/clock-bg-taekon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 15 additions & 4 deletions rooms/doug/doug.tscn
@@ -1,4 +1,4 @@
[gd_scene load_steps=13 format=1]
[gd_scene load_steps=14 format=1]

[ext_resource path="res://globals/scene.gd" type="Script" id=1]
[ext_resource path="res://rooms/doug/sprites/doug-bg-jennibee.png" type="Texture" id=2]
Expand All @@ -10,7 +10,8 @@
[ext_resource path="res://rooms/doug/player.tscn" type="PackedScene" id=8]
[ext_resource path="res://globals/game.scn" type="PackedScene" id=9]
[ext_resource path="res://music/meadow-jennibee.ogg" type="AudioStream" id=10]
[ext_resource path="res://rooms/doug/sprites/hub-return-jennibee.png" type="Texture" id=11]
[ext_resource path="res://ui/hub_button.gd" type="Script" id=11]
[ext_resource path="res://rooms/doug/sprites/hub-return-jennibee.png" type="Texture" id=12]

[sub_resource type="NavigationPolygon" id=1]

Expand Down Expand Up @@ -151,7 +152,17 @@ stream/paused = false
stream/loop_restart_time = 0.0
stream/buffering_ms = 500

[node name="back_to_hub" type="Node2D" parent="."]
[node name="back_to_hub" type="Control" parent="."]

focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 0.0
margin/bottom = 0.0
script/script = ExtResource( 11 )

[node name="hub_button" type="TextureButton" parent="back_to_hub"]

Expand All @@ -166,7 +177,7 @@ margin/bottom = 913.0
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
textures/normal = ExtResource( 11 )
textures/normal = ExtResource( 12 )
params/resize_mode = 1
params/stretch_mode = 0

Expand Down
12 changes: 3 additions & 9 deletions ui/hub_button.gd
@@ -1,21 +1,16 @@
extends Control

var vm
var root

func button_clicked():
# play a clicking sound here?
pass

func hub_button_pressed():
button_clicked()
vm.load_file("res://game/hub.esc")

func close():
root.load_menu(Globals.get("ui/main_menu"))

func input(event):
if event.is_pressed() && !event.is_echo() && event.is_action("menu_request"):
if root.get_current_scene() extends preload("res://globals/scene.gd"):
close()
pass

func menu_collapsed():
close()
Expand All @@ -26,4 +21,3 @@ func _ready():
set_process_input(true)

root = get_node("/root/main")
root.menu_open(self)
86 changes: 51 additions & 35 deletions ui/opening_menu.tscn
@@ -1,13 +1,14 @@
[gd_scene load_steps=9 format=1]
[gd_scene load_steps=10 format=1]

[ext_resource path="res://ui/opening_menu.gd" type="Script" id=1]
[ext_resource path="res://rooms/hub/sprites/hub-timegentleman.png" type="Texture" id=2]
[ext_resource path="res://art/logo-wavingpeople-and-mythalore.png" type="Texture" id=3]
[ext_resource path="res://art/play-button-mythalore.png" type="Texture" id=4]
[ext_resource path="res://art/options-button-mythalore.png" type="Texture" id=5]
[ext_resource path="res://art/credits-button-mythalore.png" type="Texture" id=6]
[ext_resource path="res://art/quit-button-mythalore.png" type="Texture" id=7]
[ext_resource path="res://music/menu-of-amnesia-jennibee.ogg" type="AudioStream" id=8]
[ext_resource path="res://art/concept-art.png" type="Texture" id=2]
[ext_resource path="res://art/menu-wavingpeople-and-mythalore.png" type="Texture" id=3]
[ext_resource path="res://art/logo-wavingpeople-and-mythalore.png" type="Texture" id=4]
[ext_resource path="res://art/play-button-mythalore.png" type="Texture" id=5]
[ext_resource path="res://art/options-button-mythalore.png" type="Texture" id=6]
[ext_resource path="res://art/credits-button-mythalore.png" type="Texture" id=7]
[ext_resource path="res://art/quit-button-mythalore.png" type="Texture" id=8]
[ext_resource path="res://music/menu-of-amnesia-jennibee.ogg" type="AudioStream" id=9]

[node name="main_menu" type="Control"]

Expand All @@ -21,6 +22,20 @@ margin/right = 1930.0
margin/bottom = 1101.0
script/script = ExtResource( 1 )

[node name="concept-art" type="TextureFrame" parent="."]

visibility/behind_parent = true
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 40.0
margin/bottom = 40.0
texture = ExtResource( 2 )
stretch_mode = 0

[node name="background" type="TextureFrame" parent="."]

visibility/behind_parent = true
Expand All @@ -32,7 +47,7 @@ margin/left = 0.0
margin/top = 0.0
margin/right = 1920.0
margin/bottom = 1080.0
texture = ExtResource( 2 )
texture = ExtResource( 3 )
stretch_mode = 0

[node name="logo" type="TextureFrame" parent="."]
Expand All @@ -42,11 +57,12 @@ focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 282.0
margin/top = 41.0
margin/right = 2202.0
margin/bottom = 1121.0
texture = ExtResource( 3 )
margin/left = 345.0
margin/top = 36.0
margin/right = 1618.0
margin/bottom = 584.0
texture = ExtResource( 4 )
expand = true
stretch_mode = 0

[node name="new_game" type="TextureButton" parent="."]
Expand All @@ -55,14 +71,14 @@ focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 435.0
margin/top = 709.0
margin/right = 714.0
margin/bottom = 827.0
margin/left = 429.0
margin/top = 647.0
margin/right = 708.0
margin/bottom = 765.0
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
textures/normal = ExtResource( 4 )
textures/normal = ExtResource( 5 )
params/resize_mode = 0
params/stretch_mode = 0

Expand All @@ -72,14 +88,14 @@ focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 1152.0
margin/top = 715.0
margin/right = 1496.0
margin/bottom = 829.0
margin/left = 1225.0
margin/top = 628.0
margin/right = 1569.0
margin/bottom = 742.0
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
textures/normal = ExtResource( 5 )
textures/normal = ExtResource( 6 )
params/resize_mode = 0
params/stretch_mode = 0

Expand All @@ -89,14 +105,14 @@ focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 436.0
margin/top = 911.0
margin/right = 737.0
margin/bottom = 1025.0
margin/left = 423.0
margin/top = 777.0
margin/right = 724.0
margin/bottom = 891.0
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
textures/normal = ExtResource( 6 )
textures/normal = ExtResource( 7 )
params/resize_mode = 0
params/stretch_mode = 0

Expand All @@ -106,20 +122,20 @@ focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 1194.0
margin/top = 925.0
margin/right = 1457.0
margin/bottom = 1040.0
margin/left = 1268.0
margin/top = 747.0
margin/right = 1531.0
margin/bottom = 862.0
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
textures/normal = ExtResource( 7 )
textures/normal = ExtResource( 8 )
params/resize_mode = 0
params/stretch_mode = 0

[node name="StreamPlayer" type="StreamPlayer" parent="."]

stream/stream = ExtResource( 8 )
stream/stream = ExtResource( 9 )
stream/play = false
stream/loop = true
stream/volume_db = 0.0
Expand Down
32 changes: 19 additions & 13 deletions ui/settings.tscn
@@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=1]
[gd_scene load_steps=3 format=1]

[ext_resource path="res://ui/settings.gd" type="Script" id=1]
[ext_resource path="res://fonts/jenni.fnt" type="BitmapFont" id=2]

[node name="Panel" type="Panel"]

Expand All @@ -19,14 +20,16 @@ __meta__ = {

[node name="Label" type="Label" parent="."]

rect/scale = Vector2( 2, 2 )
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 172.0
margin/top = 52.0
margin/right = 772.0
margin/bottom = 89.0
margin/left = -120.0
margin/top = 71.0
margin/right = 480.0
margin/bottom = 108.0
custom_fonts/font = ExtResource( 2 )
text = "Options"
align = 1
percent_visible = 1.0
Expand All @@ -35,14 +38,16 @@ max_lines_visible = -1

[node name="Label1" type="Label" parent="."]

rect/scale = Vector2( 2, 2 )
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 178.0
margin/top = 260.0
margin/right = 778.0
margin/bottom = 297.0
margin/left = -120.0
margin/top = 285.0
margin/right = 480.0
margin/bottom = 322.0
custom_fonts/font = ExtResource( 2 )
text = "Options will go here."
align = 1
percent_visible = 1.0
Expand All @@ -51,15 +56,16 @@ max_lines_visible = -1

[node name="GoBack" type="Button" parent="."]

rect/scale = Vector2( 2, 2 )
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 3
size_flags/vertical = 3
size_flags/stretch_ratio = 44.0
margin/left = 448.0
margin/top = 544.0
margin/right = 513.0
margin/bottom = 599.0
margin/left = 428.0
margin/top = 511.0
margin/right = 478.0
margin/bottom = 541.0
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
Expand Down

0 comments on commit 41220e2

Please sign in to comment.