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

[ReactUI] Player items are not usable / playable #153

Closed
LaustinSpayce opened this issue Dec 31, 2022 · 11 comments · Fixed by #156
Closed

[ReactUI] Player items are not usable / playable #153

LaustinSpayce opened this issue Dec 31, 2022 · 11 comments · Fixed by #156
Assignees

Comments

@LaustinSpayce
Copy link
Member

image

The cognition nodes cannot be activated.

In the legacy client they can:
image

The item needs to be sent Action, actionDataOverride and borderColor params from BE so it can be rendered as active (and clickable).

@LaustinSpayce LaustinSpayce changed the title [ReactUI] Player items are not playable [ReactUI] Player items are not usable / playable Dec 31, 2022
@OotTheMonk
Copy link
Collaborator

I returned the data for the items, but it seems like there's still some issues. For one, it's showing the gem, where I don't think it's supposed to. The gem is sending back the right data element piece from the BE. Another is the border of the item when it's playable looks messed up. Also when you click the item, it seems like it doesn't actually activate the ability. Can you help me debug on the FE side?
image

@LaustinSpayce
Copy link
Member Author

LaustinSpayce commented Jan 6, 2023

So a few issues here:
Some CSS making the item out of alignment I'll make a new issue for and fix it.
image

Gem info is only shown on the FE if the BE sends gem info, some sample playerItems response from the BE:

{
	"playerItems": [
		{
			"cardNumber": "ARC010",
			"action": 10,
			"overlay": 0,
			"borderColor": 6,
			"counters": "0",
			"actionDataOverride": "",
			"controller": 2,
			"type": "A",
			"sType": "Item",
			"restriction": "",
			"countersMap": {
				"counters": "0"
			},
			"gem": "2"
		}
	]
}

You'll see the value of "gem" is 2. which means "display but inactive" So I guess that's what you mean? Then this is intended behaviour.
The response from BE also does not include an actionDataOverride so I am not sure what cardID I should be sending over. Would it be the index of the card? (so in this case, 0?)

@LaustinSpayce
Copy link
Member Author

LaustinSpayce commented Jan 6, 2023

Turns out, it is not the index and some other arbitrary value. When I tested with just one induction chamber. The induction chamber calls with cardID=0, adding another item (a plasma purifier), I would expect by index that would have cardID=1, instead in the current FE it is sending cardID=7 so we're going to require the BE to supply the required cardID (in the field actionDataOverride) so I can call the correct cardID.

@LaustinSpayce
Copy link
Member Author

value of playeritems from GetNextTurn:

{
	"playerItems": [
		{
			"cardNumber": "ARC010",
			"action": 10,
			"overlay": 0,
			"borderColor": 6,
			"counters": "1",
			"actionDataOverride": "",
			"controller": 2,
			"type": "A",
			"sType": "Item",
			"restriction": "",
			"countersMap": {
				"counters": 0,
				"steam": "1"
			},
			"gem": "2"
		},
		{
			"cardNumber": "CRU105",
			"action": 10,
			"overlay": 0,
			"borderColor": 6,
			"counters": "0",
			"actionDataOverride": "",
			"controller": 2,
			"type": "A",
			"sType": "Item",
			"restriction": "",
			"countersMap": {
				"counters": "0"
			},
			"gem": "2"
		},
		{
			"cardNumber": "ARC010",
			"action": 10,
			"overlay": 0,
			"borderColor": 6,
			"counters": "0",
			"actionDataOverride": "",
			"controller": 2,
			"type": "A",
			"sType": "Item",
			"restriction": "",
			"countersMap": {
				"counters": "0"
			},
			"gem": "2"
		}
	]
}

You can see all items are being told "gem" is 2 and there is no actionDataOverride to tell the FE what cardID to invoke so this information needs to be passed over

@LaustinSpayce
Copy link
Member Author

LaustinSpayce commented Jan 6, 2023

OK I'll submit a PR.
I think the gems are different enums depending if they're an equipment or not:
Where 0 means none
https://github.com/Talishar/Talishar/blob/beefd76776815018d09fad23fbc3143ed392d7a2/GetNextTurn2.php#L1202-L1207

Where 2 means none
https://github.com/Talishar/Talishar/blob/beefd76776815018d09fad23fbc3143ed392d7a2/GetNextTurn2.php#L1655-L1668

So these display correctly on the current FE but obviously I'm expecting on the FE for every card to be the same so there's no accounting for this being backwards as it is.

@Cellzor
Copy link

Cellzor commented Jan 7, 2023

Prisms auras with luminaris as weapon cannot attack in the new UI. Is this related or should it be registered as a new bug?

@LaustinSpayce
Copy link
Member Author

LaustinSpayce commented Jan 8, 2023

I think this is a related issue, someone would need to update the "rendering" logic for auras in GetNextTurn3.php to include actions, same as what I did for weapons n allies in the previous PR.

@LaustinSpayce
Copy link
Member Author

Auras we’re fixed in Talishar/Talishar#156 still awaiting @OotTheMonk to implement the gem fix, I suspect it’s quite an involved bug though

@OotTheMonk
Copy link
Collaborator

Note to self: this I believe is the gem fix mentioned above:
image

I thought I already fixed this, but maybe not. Need to verify and/or fix.

@OotTheMonk
Copy link
Collaborator

Part of the issue was the index of stuff wasn't being consistently returned; this is fixed in revision b36ecc90

@OotTheMonk
Copy link
Collaborator

Submitted FE pull request that gets the gems working, moving issue to FE #152

@OotTheMonk OotTheMonk transferred this issue from Talishar/Talishar Feb 16, 2023
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 a pull request may close this issue.

3 participants