Commit 1ef837d6 authored by Julia Santos's avatar Julia Santos

More edits on the new inventory, mostly dealing with bugs regarding selecting/deselecting items

parent 4a2608c5
......@@ -32,6 +32,7 @@ func getDialogue(sceneName):
sceneProgress = 0
hide()
dim.hide()
inventory.enable()
elif sceneName == "First Nana pass":
match sceneProgress:
0:
......@@ -53,10 +54,12 @@ func getDialogue(sceneName):
sceneProgress = 0
dim.hide()
hide()
inventory.enable()
elif sceneName == "Nana again":
dialogue = "Brodie: OF COURSE, ALWAYS."
get_parent().get_node("Neighbor").move()
inventory.remove_item_name("Nana")
dim.hide()
hide()
inventory.enable()
return dialogue
......@@ -76,7 +76,7 @@ func _groceries_put_away(): # when the groceries are put away
laundryArea.get_node("Laundry door").flavorText = "I think I'm still missing something..."
inventory.add_item("Oil", load("res://.import/Oil.png-29f84e969418d0f4084115c5ce859866.stex"))
inventory.add_item("Cleaning mat", load("res://.import/cleaning materials.png-9e1abb8a1d84afe3085c773f150c7347.stex"))
inventory.add_item("Laundry detergent",load("res://.import/laundry detergent.png-79948b488e3c228ce282a9186c4bcf0c.stex"))
inventory.add_item("Laundry detergent",load("res://.import/soap.png-93c3e5ae993592d84ef303c214def992.stex"))
func _eaten(): # completing first "Eat" quest
quests.finishQuest("Eat")
......@@ -161,19 +161,23 @@ func getPlungered():
return plungerUsed
# ----------------- Cutscene initiators -----------------
func _start_cutscene_1():
inventory.unselect_all()
cutsceneHandler.get_node("1").show()
cutsceneHandler.get_node("1/Scene control").start()
func _start_cutscene_2():
if !quests.hasQuest("Eat") and !quests.hasQuest("Do laundry"):
inventory.unselect_all()
cutsceneHandler.get_node("2").show()
cutsceneHandler.get_node("2/Scene control").start()
func _start_cutscene_2b():
inventory.unselect_all()
cutsceneHandler.get_node("2b").show()
cutsceneHandler.get_node("2b/Scene control").start()
func _start_cutscene_3():
inventory.unselect_all()
cutsceneHandler.get_node("3").show()
cutsceneHandler.get_node("3/Scene control").start()
......@@ -269,21 +273,25 @@ func _bathroom_enter(): # entering bathroom
bedroom.hide()
bathroom.show()
movementHandle.disableMovement()
inventory.unselect_all()
func _bathroom_exit(): # exiting bathroom
bathroom.hide()
bedroom.show()
movementHandle.enableMovement()
inventory.unselect_all()
func _balcony_enter(): # entering balcony
movementHandle.disableMovement()
balcony.show()
livingRoom.hide()
inventory.unselect_all()
func _balcony_exit(): # exiting balcony
movementHandle.enableMovement()
balcony.hide()
livingRoom.show()
inventory.unselect_all()
func _living_to_hallway(): # moving from living room to hallway, if there's a reason to
if ((inventory.hasItem("Trash") != -1) || foundBanana): # either Moxie has to take out the trash or has to look for Banana
......@@ -296,6 +304,7 @@ func _living_to_hallway(): # moving from living room to hallway, if there's a re
canFrontDoor = true
dialogue.text = "What is that noise? Sounds like my neighbor's trying to break down their walls."
dialogue.playText()
inventory.unselect_all()
else:
dialogue.text = "You know, my philosophy has always been, 'If there's no reason to leave my apartment, why leave?'"
dialogue.playText()
......@@ -304,26 +313,31 @@ func _hallway_to_living(): # moving from hallway to moxie's living room
movementHandle.enableMovement()
hallway.hide()
livingRoom.show()
inventory.unselect_all()
func _hallway_to_neighbor(): # moving from hallway to neighbor's living room
movementHandle.disableMovement()
hallway.hide()
neighborsRoom.show()
inventory.unselect_all()
func _neighbor_to_hallway(): # moving from neighbor's living room to the hallway
hallway.show()
neighborsRoom.hide()
movementHandle.checkRoom()
inventory.unselect_all()
func _neighbor_to_balcony(): # moving from neighbor's living room to their balcony
movementHandle.disableMovement()
neighborsRoom.hide()
neighborsBalcony.show()
inventory.unselect_all()
func _balcony_to_neighbor(): # moving from neighbor's balcony to their living room
neighborsRoom.show()
neighborsBalcony.hide()
movementHandle.checkRoom()
inventory.unselect_all()
# ----------------- Zooming in and out of specific views -----------------
func zoom_in(): # for close up perspectives without some UI
......@@ -333,6 +347,7 @@ func zoom_in(): # for close up perspectives without some UI
right.hide()
deselect.hide()
movementHandle.disableMovement()
inventory.unselect_all()
func zoom_out(): # for returning from close up perspectives
moxie.show()
......@@ -342,6 +357,7 @@ func zoom_out(): # for returning from close up perspectives
movementHandle.enableMovement()
deselect.show()
movementHandle.checkRoom()
inventory.unselect_all()
func _laundry_basket(): # looking at the laundry basket view
bedroom.hide()
......
......@@ -23,6 +23,7 @@ func remove_item_name(toRemove):
var index = hasItem(toRemove)
if index != -1:
remove_item(index)
UI.updateUI()
func remove_item(idx):
.remove_item(idx)
......@@ -36,3 +37,15 @@ func add_item(text, icon=null, selectable=true):
func updateUI():
UI.updateUI()
func unselect_all():
.unselect_all()
UI.unselect_all()
func disable():
unselect_all()
UI.disableAll()
func enable():
unselect_all()
UI.enableAll()
......@@ -111,6 +111,7 @@ __meta__ = {
}
[node name="h" type="CollisionShape2D" parent="Repotted plants"]
visible = false
position = Vector2( -16.8367, -2.11676 )
scale = Vector2( 5, 5 )
shape = SubResource( 3 )
......
......@@ -9,7 +9,7 @@
[ext_resource path="res://assets/Thesis Clickables/groceries.png" type="Texture" id=7]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 35.8254, 38.2746 )
extents = Vector2( 35.8254, 32.6971 )
[sub_resource type="StreamTexture" id=2]
flags = 4
......@@ -49,7 +49,7 @@ interactable = true
flavorText = "I can't get in there. These bags are in the way..."
[node name="Hitbox" type="CollisionShape2D" parent="Laundry door"]
position = Vector2( 5.806, -53.2112 )
position = Vector2( 9.22073, -81.6672 )
scale = Vector2( 5, 5 )
z_index = -1
shape = SubResource( 1 )
......
......@@ -10,7 +10,7 @@
[ext_resource path="res://assets/Thesis Clickables/soil (pour).png" type="Texture" id=9]
[ext_resource path="res://assets/Thesis Clickables/pot.png" type="Texture" id=12]
[sub_resource type="RectangleShape2D" id=7]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 26.4732, 26.6968 )
[sub_resource type="RectangleShape2D" id=2]
......@@ -70,7 +70,7 @@ texture = ExtResource( 12 )
visible = false
position = Vector2( -16.8367, -2.11676 )
scale = Vector2( 5, 5 )
shape = SubResource( 7 )
shape = SubResource( 1 )
disabled = true
[node name="Plant" type="StaticBody2D" parent="."]
......
......@@ -5,6 +5,7 @@ onready var current # index of the room Moxie is currently in
onready var left = get_parent().get_node("Left")
onready var right = get_parent().get_node("Right")
onready var moxiePath = get_parent().get_parent().get_node("Moxie/Path2D/PathFollow2D")
onready var inventory = get_parent().get_node("Inventory")
onready var tutorial = true
......@@ -23,6 +24,7 @@ func _pressedRight(): # when right arrow is clicked, move to the next adjacent s
if current >= 1:
left.show()
checkRoom()
inventory.unselect_all()
print("Currently in room " + str(current) + ": " + rooms[current].get_name())
func _pressedLeft(): # when left arrow is clicked, move to the next adjacent screen
......@@ -35,6 +37,7 @@ func _pressedLeft(): # when left arrow is clicked, move to the next adjacent scr
if current < rooms.size() - 1:
right.show()
checkRoom()
inventory.unselect_all()
print("Currently in room " + str(current) + ": " + rooms[current].get_name())
func check_arrows():
......
......@@ -569,7 +569,7 @@ anims/Dialogue = SubResource( 11 )
margin_left = 27.0
margin_top = 19.0
margin_right = 522.0
margin_bottom = 73.0
margin_bottom = 76.0
custom_fonts/normal_font = ExtResource( 37 )
visible_characters = 0
percent_visible = 0.0
......
......@@ -22,7 +22,6 @@ func objInteraction(selected): # when an object is used on it
dialogueBox.text = flavor
else:
dialogueBox.text = "No flavor text found" #can replace this later!
inventory.unselect_all() #unselect item
dialogueBox.playText()
func canEatGranola():
......
......@@ -13,7 +13,6 @@ func objInteraction(selected): # when an object is used on it
dialogueBox.text = flavor
else:
dialogueBox.text = "No flavor text found" #can replace this later!
inventory.unselect_all()
dialogueBox.playText()
if inventory.get_item_text(selected)=="Stool":
inventory.remove_item(selected)
......
......@@ -2,6 +2,8 @@ extends Control
onready var inventory = get_parent().get_node("Inventory")
onready var firstIndex = 0
onready var items = [get_node("1"), get_node("2"), get_node("3"), get_node("4"), get_node("5")]
onready var left = get_parent().get_node("Inventory control/Inventory left")
onready var right = get_parent().get_node("Inventory control/Inventory right")
# Called when the node enters the scene tree for the first time.
func _ready():
......@@ -39,6 +41,33 @@ func _on_Inventory_left_pressed():
firstIndex = firstIndex - 5
updateUI()
func disableAll():
var j = 0
while j < 5:
#items[j].set_pressed(false)
items[j].set_disabled(true)
j = j + 1
print("disabling inventory")
left.set_disabled(true)
right.set_disabled(true)
func enableAll():
var j = 0
while j < 5:
items[j].set_disabled(false)
items[j].set_pressed(false)
j = j + 1
print("enabling inventory")
left.set_disabled(false)
right.set_disabled(false)
func unselect_all():
var j = 0
while j < 5:
items[j].set_pressed(false) #unselects everything
j = j + 1
updateUI()
func disableRest(num):
var j = 0
while j < 5:
......
......@@ -25,5 +25,4 @@ func objInteraction(selected): # when an object is used on it
dialogueBox.text = "Brodie: Um... What are you doing?"
get_parent().get_node("Dialogue arrow").setScene("Intro")
get_parent().get_node("Dialogue arrow").show()
inventory.unselect_all() #unselect item
dialogueBox.playText()
......@@ -45,6 +45,5 @@ func objInteraction(selected): # when an object is used on it
else:
dialogueBox.text = "No flavor text found" #can replace this later!
dialogueBox.playText()
inventory.unselect_all() #unselect item
......@@ -30,7 +30,6 @@ func objInteraction(selected):
dialogueBox.text = flavor
else:
dialogueBox.text = "No flavor text found" #can replace this later!
inventory.unselect_all() #unselect item
dialogueBox.playText()
func mouseInteraction():
......
......@@ -39,7 +39,6 @@ func objInteraction(selected):
dialogueBox.text = flavor
else:
dialogueBox.text = "No flavor text found" #can replace this later!
inventory.unselect_all() #unselect item
dialogueBox.playText()
func gotNote(): # once lab note has been retrieved
......
......@@ -32,7 +32,6 @@ func objInteraction(selected): # when an object is used on it
dialogueBox.text = flavor
else:
dialogueBox.text = "No flavor text found" #can replace this later!
inventory.unselect_all() #unselect item
dialogueBox.playText()
func outerLock():
......
......@@ -32,5 +32,4 @@ func objInteraction(selected):
dialogueBox.text = "Food, you are now free from your prison. You're welcome."
unlocked = true
inventory.remove_item(selected)
inventory.unselect_all() #unselect item
dialogueBox.playText()
......@@ -23,14 +23,15 @@ func mouseInteraction():
func objInteraction(selected): # when an object is used on it
var flavor = control.interaction(inventory.get_item_text(selected), self.get_name())
if inventory.get_item_text(selected) == "Nana":
if !hadNana:
inventory.disable()
dialogueBox.text = "Moxie: Hey Brodie! Have you met Nana?"
dialogueArrow.setScene("First Nana pass")
dialogueArrow.show()
hadNana = true
else:
inventory.disable()
dialogueBox.text = "Moxie: Hey, could you hold Nana for me for a sec?"
dialogueArrow.setScene("Nana again")
dialogueArrow.show()
......@@ -39,7 +40,6 @@ func objInteraction(selected): # when an object is used on it
dialogueBox.text = flavor
else:
dialogueBox.text = "No flavor text found" #can replace this later!
inventory.unselect_all() #unselect item
dialogueBox.playText()
func doesHaveNana():
......
......@@ -16,6 +16,5 @@ func objInteraction(selected): # when an object is used on it
dialogueBox.text = flavor
else:
dialogueBox.text = "No flavor text found" #can replace this later!
inventory.unselect_all() #unselect item
dialogueBox.playText()
......@@ -20,5 +20,4 @@ func objInteraction(selected): # when an object is used on it
dialogueBox.text = flavor
else:
dialogueBox.text = "No flavor text found" #can replace this later!
inventory.unselect_all() #unselect item
dialogueBox.playText()
......@@ -37,4 +37,3 @@ func objInteraction(selected): # when an object is used on it
else:
dialogueBox.text = "No flavor text found" #can replace this later!
dialogueBox.playText()
inventory.unselect_all() #unselect item
......@@ -35,5 +35,4 @@ func objInteraction(selected):
dialogueBox.text = flavor
else:
dialogueBox.text = "No flavor text found" #can replace this later!
inventory.unselect_all() #unselect item
dialogueBox.playText()
......@@ -36,5 +36,4 @@ func objInteraction(selected): # when an object is used on it
dialogueBox.text = flavor
else:
dialogueBox.text = "No flavor text found" #can replace this later!
inventory.unselect_all() #unselect item
dialogueBox.playText()
......@@ -32,4 +32,3 @@ func objInteraction(selected): # when an object is used on it
else: # if they try to use the plunger on a clean toilet
dialogueBox.text = "I can't make it any LESS unclogged.."
dialogueBox.playText()
inventory.unselect_all() #unselect item
......@@ -20,6 +20,5 @@ func objInteraction(selected):
dialogueBox.text = flavor
else:
dialogueBox.text = "No flavor text found" #can replace this later!
inventory.unselect_all() #unselect item
dialogueBox.playText()
......@@ -23,7 +23,6 @@ func objInteraction(selected): # when an object is used on it
dialogueBox.text = flavor
else:
dialogueBox.text = "No flavor text found" #can replace this later!
inventory.unselect_all() #unselect item
dialogueBox.playText()
func canYoga():
......
......@@ -3,5 +3,5 @@
[ext_resource path="res://assets/Fonts/BeVietnamPro-Medium.ttf" type="DynamicFontData" id=1]
[resource]
size = 15
size = 14
font_data = ExtResource( 1 )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment