Skip to content

Commit

Permalink
#22 Merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
Tombleron committed Apr 6, 2023
2 parents 53692cf + 0978449 commit f88dfa7
Show file tree
Hide file tree
Showing 44 changed files with 3,557 additions and 112 deletions.
Binary file added assets/gui/hands/hand_with_ring.glb
Binary file not shown.
32 changes: 32 additions & 0 deletions assets/gui/hands/hand_with_ring.glb.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[remap]

importer="scene"
importer_version=1
type="PackedScene"
uid="uid://dgd02lfeuf2qp"
path="res://.godot/imported/hand_with_ring.glb-299e18409236d459308a210e81f6c438.scn"

[deps]

source_file="res://assets/gui/hands/hand_with_ring.glb"
dest_files=["res://.godot/imported/hand_with_ring.glb-299e18409236d459308a210e81f6c438.scn"]

[params]

nodes/root_type="Node3D"
nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/embedded_image_handling=1
Binary file added assets/gui/hands/hand_with_ring_palette-inverse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions assets/gui/hands/hand_with_ring_palette-inverse.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cg4lxvis6ck58"
path="res://.godot/imported/hand_with_ring_palette-inverse.png-b2c187a96e6cfc0fc55d8d0ab3a082d0.ctex"
metadata={
"vram_texture": false
}
generator_parameters={}

[deps]

source_file="res://assets/gui/hands/hand_with_ring_palette-inverse.png"
dest_files=["res://.godot/imported/hand_with_ring_palette-inverse.png-b2c187a96e6cfc0fc55d8d0ab3a082d0.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0
Binary file added assets/gui/hands/hand_with_ring_palette.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions assets/gui/hands/hand_with_ring_palette.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cwug7slna75aw"
path="res://.godot/imported/hand_with_ring_palette.png-c17d52083d8471df78eaa60e45d355c7.ctex"
metadata={
"vram_texture": false
}
generator_parameters={}

[deps]

source_file="res://assets/gui/hands/hand_with_ring_palette.png"
dest_files=["res://.godot/imported/hand_with_ring_palette.png-c17d52083d8471df78eaa60e45d355c7.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0
Binary file added assets/gui/hands/hand_without_ring.glb
Binary file not shown.
32 changes: 32 additions & 0 deletions assets/gui/hands/hand_without_ring.glb.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[remap]

importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bpeb26q6eavsn"
path="res://.godot/imported/hand_without_ring.glb-0173d135b1670c8c9752db5a55e493ec.scn"

[deps]

source_file="res://assets/gui/hands/hand_without_ring.glb"
dest_files=["res://.godot/imported/hand_without_ring.glb-0173d135b1670c8c9752db5a55e493ec.scn"]

[params]

nodes/root_type="Node3D"
nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/embedded_image_handling=1
Binary file added assets/gui/hands/hand_without_ring_palette.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions assets/gui/hands/hand_without_ring_palette.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://784b5v7owmjn"
path="res://.godot/imported/hand_without_ring_palette.png-9d5b94e0bb973fcf3e2ea6d10184c6e9.ctex"
metadata={
"vram_texture": false
}
generator_parameters={}

[deps]

source_file="res://assets/gui/hands/hand_without_ring_palette.png"
dest_files=["res://.godot/imported/hand_without_ring_palette.png-9d5b94e0bb973fcf3e2ea6d10184c6e9.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0
9 changes: 0 additions & 9 deletions player/gui.tscn

This file was deleted.

71 changes: 71 additions & 0 deletions player/gui/book.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
extends Control

@onready var header_label: Label = $MarginContainer/VBoxContainer/Header
@onready var text_label: RichTextLabel = $MarginContainer/VBoxContainer/RichTextLabel


@export var show_last: bool = false # Show last added page

var list_sequence: Array = []
var current_page: int = 0


func _ready() -> void:
add_page("The Book", "It's a magic book of magic. Here you can write down all your spells that you can think of. But it's hard to think, so it would be better if someone wrote them for you. Any spells you find will be added to this book. You may open the book with the ★TAB★ key")
add_page("The Planes", "The whole world consists of two planes, the material and the cognitive. They duplicate each other, but with some peculiarities. The cognitive element is populated by the spirits of objects and beings, expressing certain traits of them.")
add_page("The Ring", "The ring allows you to move between worlds by pressing the ★Space★ key. The ring also allows you to cast spells, but unfortunately only in cognitive reality (plane). To cast a spell, press the ★C★ key.")

show_page(first_page())


func add_page(title: String, text: String):
list_sequence.push_back({"title": title, "text": text})
if show_last:
show_page(last_page())


func pages_total() -> int:
return list_sequence.size()


func first_page() -> Dictionary:
current_page = 0
return list_sequence[current_page]


func last_page() -> Dictionary:
current_page == pages_total() - 1
return list_sequence[current_page]


func next_page() -> Dictionary:
if current_page == pages_total() - 1:
current_page = 0
else:
current_page += 1

return list_sequence[current_page]


func previous_page() -> Dictionary:
if current_page == 0:
current_page = pages_total() - 1
else:
current_page -= 1

return list_sequence[current_page]


func show_page(page: Dictionary) -> void:
header_label.text = page["title"]
text_label.text = page["text"]


func _on_prev_page_button_pressed() -> void:
var page := previous_page()
show_page(page)


func _on_next_page_button_pressed() -> void:
var page := next_page()
show_page(page)
25 changes: 25 additions & 0 deletions player/gui/gui.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
extends Control

@onready var book: Control = $Book

enum GuiState {
DEFAULT,
PAUSE,
BOOK,
}

var state: GuiState = GuiState.DEFAULT


func _ready() -> void:
book.visible = false


func _input(event: InputEvent) -> void:
if event.is_action_pressed("book"):
if state == GuiState.BOOK:
book.visible = false
state = GuiState.DEFAULT
elif state == GuiState.DEFAULT:
book.visible = true
state = GuiState.BOOK
7 changes: 7 additions & 0 deletions player/gui/gui.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[gd_resource type="Theme" load_steps=2 format=3 uid="uid://cxpgf6x1ks3yb"]

[ext_resource type="FontFile" uid="uid://b0y85cnal68dw" path="res://assets/gui/Davida.ttf" id="1_yrwqw"]

[resource]
default_font = ExtResource("1_yrwqw")
default_font_size = 24
Loading

0 comments on commit f88dfa7

Please sign in to comment.