Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: nft shape & open nft dialog #93

Merged
merged 17 commits into from
Nov 17, 2023
Merged

feat: nft shape & open nft dialog #93

merged 17 commits into from
Nov 17, 2023

Conversation

kuruk-mm
Copy link
Member

@kuruk-mm kuruk-mm commented Nov 14, 2023

Implements

  • NFT Shape
  • Open NFT Dialog
  • Fix: Now when the cursor is not captured, it doesn't triggers events in the World (UI issue)
  • Fix: The crosshair shows/hide correctly when the mouse gets captured/released
  • Add /reload command (it changes to the realm that you are)

@kuruk-mm kuruk-mm force-pushed the feat/nft-shape branch 4 times, most recently from 6e4d650 to 8a78888 Compare November 14, 2023 01:49
@codecov-commenter
Copy link

codecov-commenter commented Nov 14, 2023

Codecov Report

Attention: 148 lines in your changes are missing coverage. Please review.

Comparison is base (c79f288) 13.98% compared to head (4e082f6) 13.84%.

Files Patch % Lines
...godot-lib/src/scene_runner/components/nft_shape.rs 0.00% 46 Missing ⚠️
...cene_runner/rpc_calls/handle_restricted_actions.rs 0.00% 37 Missing ⚠️
...entraland-godot-lib/src/godot_classes/dcl_ether.rs 6.45% 29 Missing ⚠️
...traland-godot-lib/src/dcl/js/restricted_actions.rs 0.00% 17 Missing ⚠️
...t/decentraland-godot-lib/src/scene_runner/input.rs 0.00% 8 Missing ⚠️
...raland-godot-lib/src/scene_runner/rpc_calls/mod.rs 0.00% 4 Missing ⚠️
...t/decentraland-godot-lib/src/scene_runner/scene.rs 0.00% 3 Missing ⚠️
...rc/scene_runner/components/avatar_modifier_area.rs 0.00% 2 Missing ⚠️
...traland-godot-lib/src/scene_runner/update_scene.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #93      +/-   ##
==========================================
- Coverage   13.98%   13.84%   -0.14%     
==========================================
  Files         102      104       +2     
  Lines       12227    12365     +138     
==========================================
+ Hits         1710     1712       +2     
- Misses      10517    10653     +136     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kuruk-mm kuruk-mm marked this pull request as ready for review November 16, 2023 02:44
Copy link
Collaborator

@leanmendoza leanmendoza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks all good, just a few comments:

  • Why reimport all the assets? I see UI/emotes/empty-parcels stuff
  • Could we move ERC/Ether/bigNumber things to Rust? We already have these kinds of things there and we can reuse them

godot/src/utils/erc20.gd Outdated Show resolved Hide resolved
godot/src/utils/Ether.gd Outdated Show resolved Hide resolved
godot/src/ui/dialogs/nft_dialog.tscn Outdated Show resolved Hide resolved
@@ -289,6 +289,8 @@ func _on_line_edit_command_submit_message(message: String):
"[color=#ccc]> Trying to change to realm " + params[1] + "[/color]"
)
Global.realm.set_realm(params[1])
elif command_str == "/reload":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

godot/src/test/fetcher/opensea_fetch_3d.gd Show resolved Hide resolved
@@ -0,0 +1,32 @@
// Shader by Polysthetic (https://youtu.be/-c38gFbGO6U)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this material (and the scene) do? can you put some description?

Copy link
Member Author

@kuruk-mm kuruk-mm Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That shader was added without intention.
Anyway, the scene it's useful, at least for me. I renamed the scene to godot_animated_material, so basically, it's using a MeshInstance3D with a ShaderMaterial, and its texture is sprite sheet that is being animated (using UV and you have FPS, ROWS, COLS parameters in the shader).

It's more an example than a test... should I remove it? 🤔

godot/src/decentraland_components/nft_shape.gd Outdated Show resolved Hide resolved
"class": &"Math",
"icon": "",
"language": &"GDScript",
"path": "res://src/utils/Math.gd"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"path": "res://src/utils/Math.gd"

is src/utils/Math.gd in the project?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still seeing this class, maybe a Godot bug?

@kuruk-mm kuruk-mm requested a review from leanmendoza November 16, 2023 19:26
Copy link
Collaborator

@leanmendoza leanmendoza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

take a look at comments before merging but LGTM (and previous ones also)

  • add some pr desciption

"class": &"Math",
"icon": "",
"language": &"GDScript",
"path": "res://src/utils/Math.gd"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still seeing this class, maybe a Godot bug?

@@ -91,3 +94,11 @@ func print_node_tree(node: Node, prefix = ""):

func _process(_dt: float):
http_requester.poll()


func capture_mouse():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func capture_mouse():
# TODO: check this if there is a better approach for this
# e.g. when the test-runner runs, explorer node doesn't exist (and it shouldn't)
func capture_mouse():

add this todo comment or similar, good enough for now

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now I see the explorer implementation, it could be

Suggested change
func capture_mouse():
func capture_mouse():
var explorer = get_node_or_null("/root/explorer")
if is_instance_valid(explorer):
explorer.capture_mouse()
else:
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)

[node name="VBoxContainer2" type="VBoxContainer" parent="MainVContainer/BodyHContainer/InformationPanel/HBoxContainer"]
layout_mode = 2

[node name="LabelAvgPrice" type="Label" parent="MainVContainer/BodyHContainer/InformationPanel/HBoxContainer/VBoxContainer2"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[node name="LabelAvgPrice" type="Label" parent="MainVContainer/BodyHContainer/InformationPanel/HBoxContainer/VBoxContainer2"]
[node name="LabelAvgPrice" type="Label" parent="VBoxContainer_Main/HBoxContainer_Body/Panel_Information/HBoxContainer/VBoxContainer_Some?"]

don't do it if you don't want now, but the convention I was following is NodeType_Name => Button_Exit, Label_Info, Panel_TestWindow, etc

@kuruk-mm kuruk-mm changed the title feat: nft shape feat: nft shape & open nft dialog Nov 17, 2023
@kuruk-mm kuruk-mm merged commit 0b96b73 into main Nov 17, 2023
3 checks passed
@kuruk-mm kuruk-mm deleted the feat/nft-shape branch November 17, 2023 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants