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

Manual Content: Flexpanel needs note that reusing structs when creating nodes will modify the original struct rather than the flexpanel #8708

Closed
iampremo opened this issue Dec 16, 2024 — with GM Bug Reporter · 3 comments
Assignees
Labels
docs-bug GameMaker Manual Bugs documentation Improvements or additions to documentation are required by this issue project This issue has a sample project attached
Milestone

Comments

@iampremo
Copy link
Member

Description

If you create a flexpanel node from a variable that contains a struct, then edit the node, the original struct will have those changes.

The new node seems to use the struct to store its data so all nodes will use the same.

Steps To Reproduce

Debug sample
Notice that the 3 panels say "something else 3"
Pause debugger
Inspect "template_struct"
Notice that the data.text value is "something else 3"

Which version of GameMaker are you reporting this issue for?

IDE v2024.1100.0.711 Runtime v2024.1100.0.726

Which operating system(s) are you seeing the problem on?

Windows 10.0.22631.0

Which platform(s) are you seeing the problem on?

Windows

7b2df5ed-f41d-403a-be6d-a473c57f2ded

@iampremo iampremo added project This issue has a sample project attached runner-bug In-game bugs with the "GameMaker Studio 2" runtimes labels Dec 16, 2024
@stuckie stuckie moved this from Triage to Todo in Team Workload Dec 17, 2024
@stuckie stuckie added this to the 2024.13 milestone Dec 17, 2024
@rwkay
Copy link

rwkay commented Dec 18, 2024

This is not a bug in the engine but you need to ensure that the data struct from your template is unique for each node that is created from it - as it stands they will all point at the same struct.

you need to add this line after your flexpanel_create_node call

	flexpanel_node_set_data( _new_node, variable_clone( flexpanel_node_get_data(_new_node) ) );

@rwkay rwkay closed this as not planned Won't fix, can't repro, duplicate, stale Dec 18, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Team Workload Dec 18, 2024
@gurpreetsinghmatharoo gurpreetsinghmatharoo added the documentation Improvements or additions to documentation are required by this issue label Dec 23, 2024
@gurpreetsinghmatharoo gurpreetsinghmatharoo self-assigned this Jan 14, 2025
gurpreetsinghmatharoo added a commit to YoYoGames/GameMaker-Manual that referenced this issue Jan 14, 2025
@gurpreetsinghmatharoo gurpreetsinghmatharoo moved this from Done to Ready for QA in Team Workload Jan 14, 2025
@YYDan YYDan changed the title In-game: Flexpanel nodes created from structs will modify the original struct rather than the flexpanel In-Game: Flexpanel nodes created from structs will modify the original struct rather than the flexpanel Jan 16, 2025
@YYDan YYDan changed the title In-Game: Flexpanel nodes created from structs will modify the original struct rather than the flexpanel Manual Content: Flexpanel needs note that reusing structs when creating nodes will modify the original struct rather than the flexpanel Jan 16, 2025
@YYDan YYDan added docs-bug GameMaker Manual Bugs and removed runner-bug In-game bugs with the "GameMaker Studio 2" runtimes labels Jan 16, 2025
@YYDan
Copy link
Collaborator

YYDan commented Jan 16, 2025

We'll verify the manual changes.

@YYDan YYDan closed this as completed Jan 16, 2025
@github-project-automation github-project-automation bot moved this from Ready for QA to Done in Team Workload Jan 16, 2025
@YYDan
Copy link
Collaborator

YYDan commented Jan 16, 2025

Can see that the manual change documents the problem and the correct workaround to add into your code. All seems correct to me.

Verifying.

@YYDan YYDan moved this from Done to Verified in Team Workload Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-bug GameMaker Manual Bugs documentation Improvements or additions to documentation are required by this issue project This issue has a sample project attached
Projects
Status: Verified
Development

No branches or pull requests

5 participants