enigma-dev / RadialGM

A native IDE for ENIGMA written in C++ using the Qt Framework.
GNU General Public License v3.0
46 stars 22 forks source link

Fix for naming index bug #223 #226

Closed KartikShrivastava closed 2 years ago

KartikShrivastava commented 2 years ago

A small fix for #223 which involves addition of resourceMap->AddResource(...) call after resource name creation resourceMap->CreateResourceName. This call helps to increment index counter when another resource of same type is created.

fundies commented 2 years ago

A small fix for #223 which involves addition of resourceMap->AddResource(...) call after resource name creation resourceMap->CreateResourceName. This call helps to increment index counter when another resource of same type is created.

Did you check if other cases like rename and delete are properly updating that map?

KartikShrivastava commented 2 years ago

Did you check if other cases like rename and delete are properly updating that map?

Hi, I just checked for delete and indeed _resources in ResourceModelMap is not updating properly. Here is what happens right now: After creating sprite0, sprite1 and sprite2, if I delete sprite1 and create another sprite, it is named sprite3. Which ig means that sprite1 is still there in _resources[sprite].

Rename is working properly.

I'll fix delete and make sure to test properly before creating new PRs.

KartikShrivastava commented 2 years ago

Hi, I've tested correctness of resource name with proper index by both deleting and renaming resources for 3-4 resource types. It's working fine in both cases.