This commit is contained in:
1 parent
ddf7942890
commit
8bb2c5c840
3 files changed
+29
-9
No files matched your search
+13
-2
@@ -30,15 +30,26 @@ split_offset = 642
|
|||||||
[node name="ImageFrame" type="Panel" parent="VSplitContainer" unique_id=1582351824]
|
[node name="ImageFrame" type="Panel" parent="VSplitContainer" unique_id=1582351824]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|
||||||
[node name="SlideImage" type="TextureRect" parent="VSplitContainer/ImageFrame" unique_id=720362532]
|
[node name="SlideContainer" type="HBoxContainer" parent="VSplitContainer/ImageFrame" unique_id=975465325]
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
grow_horizontal = 2
|
grow_horizontal = 2
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
|
alignment = 1
|
||||||
|
|
||||||
|
[node name="SlideImage" type="TextureRect" parent="VSplitContainer/ImageFrame/SlideContainer" unique_id=720362532]
|
||||||
|
layout_mode = 2
|
||||||
texture = ExtResource("2_puxm7")
|
texture = ExtResource("2_puxm7")
|
||||||
expand_mode = 1
|
expand_mode = 2
|
||||||
|
stretch_mode = 5
|
||||||
|
|
||||||
|
[node name="SlideImage2" type="TextureRect" parent="VSplitContainer/ImageFrame/SlideContainer" unique_id=746302187]
|
||||||
|
visible = false
|
||||||
|
layout_mode = 2
|
||||||
|
texture = ExtResource("2_puxm7")
|
||||||
|
expand_mode = 2
|
||||||
stretch_mode = 5
|
stretch_mode = 5
|
||||||
|
|
||||||
[node name="TextFrame" type="Panel" parent="VSplitContainer" unique_id=1381001186]
|
[node name="TextFrame" type="Panel" parent="VSplitContainer" unique_id=1381001186]
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ func _ready() -> void:
|
|||||||
"text": "Mr. Rhombini excitedly connects the antenna. The sarcophagus begins to hum." },
|
"text": "Mr. Rhombini excitedly connects the antenna. The sarcophagus begins to hum." },
|
||||||
{ "image": "Opensofar",
|
{ "image": "Opensofar",
|
||||||
"text": "The sarcophagus swings open to reveal, not a dead body, but an old computer. The computer begins to boot up, but an error message is visible on the main screen." },
|
"text": "The sarcophagus swings open to reveal, not a dead body, but an old computer. The computer begins to boot up, but an error message is visible on the main screen." },
|
||||||
{ "image": "PossessedbyOC",
|
{ "images": ["PossessedbyOC", "Power_source"],
|
||||||
"text": "However, Mr. Rhombini's attention is instantly grabbed by the other object inside the open sarcophagus." },
|
"text": "However, Mr. Rhombini's attention is instantly grabbed by the other object inside the open sarcophagus." },
|
||||||
{ "image": "Glow",
|
{ "image": "Glow",
|
||||||
"text": "The Pharaoh's jetpack! Mr. Rhombini wastes no time in putting it on." }
|
"text": "The Pharaoh's jetpack! Mr. Rhombini wastes no time in putting it on." }
|
||||||
|
|||||||
+15
-6
@@ -14,17 +14,26 @@ func play_slideshow(new_slides) -> void:
|
|||||||
slides = new_slides
|
slides = new_slides
|
||||||
play_slide(0)
|
play_slide(0)
|
||||||
|
|
||||||
|
func _make_image_path(image_name: String) -> String:
|
||||||
|
if image_name.begins_with("res://"):
|
||||||
|
return image_name
|
||||||
|
return "res://art/slides/%s.png" % image_name
|
||||||
|
|
||||||
func play_slide(index) -> bool:
|
func play_slide(index) -> bool:
|
||||||
if index < 0 or index >= len(slides):
|
if index < 0 or index >= len(slides):
|
||||||
return false
|
return false
|
||||||
|
|
||||||
slide = index
|
slide = index
|
||||||
var image_path: String = slides[index].image
|
var slide_object = slides[index]
|
||||||
if not image_path.begins_with("res://"):
|
$VSplitContainer/TextFrame/SlideText.text = slide_object.text
|
||||||
image_path = "res://art/slides/%s.png" % image_path
|
|
||||||
|
if "image" in slides[index]:
|
||||||
$VSplitContainer/TextFrame/SlideText.text = slides[index].text
|
$VSplitContainer/ImageFrame/SlideContainer/SlideImage.texture = load(_make_image_path(slide_object.image))
|
||||||
$VSplitContainer/ImageFrame/SlideImage.texture = load(image_path)
|
$VSplitContainer/ImageFrame/SlideContainer/SlideImage2.visible = false
|
||||||
|
else:
|
||||||
|
$VSplitContainer/ImageFrame/SlideContainer/SlideImage.texture = load(_make_image_path(slide_object.images[0]))
|
||||||
|
$VSplitContainer/ImageFrame/SlideContainer/SlideImage2.visible = true
|
||||||
|
$VSplitContainer/ImageFrame/SlideContainer/SlideImage2.texture = load(_make_image_path(slide_object.images[1]))
|
||||||
return true
|
return true
|
||||||
|
|
||||||
func next_slide() -> bool:
|
func next_slide() -> bool:
|
||||||
|
|||||||
Reference in new issue
Block a user