-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed intendation bugs in lambdas and match cases
- Loading branch information
Showing
40 changed files
with
512 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
extends PanelContainer | ||
class_name InventorySlot | ||
|
||
|
||
@export var type: InventoryItem.Type | ||
|
||
|
||
# Custom init function so that it doesn't error | ||
func init(t: InventoryItem.Type, cms: Vector2) -> void: | ||
type = t | ||
custom_minimum_size = cms | ||
|
||
|
||
# _at_position is not used because it doesn't matter where on the panel | ||
# the item is dropped | ||
func _can_drop_data(_at_position: Vector2, data: Variant) -> bool: | ||
if data is InventoryItem: | ||
#This is the text that displays uupon pulling an item out. | ||
%summary.text =( str("atk:" + str(data.physicalattack) +'\n' + data.lore)) | ||
if type == InventoryItem.Type.MAIN: | ||
if get_child_count() == 0: | ||
return true | ||
else: | ||
# Swap two items | ||
return get_child(0).type == data.type | ||
else: | ||
return data.type == type | ||
|
||
|
||
return false | ||
|
||
|
||
# _at_position is not used because it doesn't matter where on the panel | ||
# the item is dropped | ||
func _drop_data(_at_position: Vector2, data: Variant) -> void: | ||
if get_child_count() > 0: | ||
var item := get_child(0) | ||
if item == data: return | ||
remove_child(item) | ||
data.get_parent().add_child(item) | ||
data.get_parent().remove_child(data) | ||
add_child(data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.