Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Improve categories #507

Merged
merged 3 commits into from
Dec 1, 2018
Merged

Improve categories #507

merged 3 commits into from
Dec 1, 2018

Conversation

DaneelTrevize
Copy link
Contributor

@DaneelTrevize DaneelTrevize commented Nov 28, 2018

Disable PoB export button, so other changes can be accepted.
Reached feature parity with previous category approach.
Define an Item Wearable function, and use it to control PoB export button.
Remove old category name mappings.
Refactor around Item baseType, constants, function calls.
Don't draw a socket layer if there aren't any sockets.
Factor out some magic numbers. More intuitive painter image name.
Cleaner switch statements rather than recreate a small set of paths.
Add "Copy for Path of Building" button and grouping widget to UI.

Reached feature parity with previous category approach.
Actually define an Item Wearable function, and use it to control PoB export button.
Remove old category name mappings.
Refactor around Item baseType, constants, function calls.
Don't draw a socket layer if there aren't any sockets.
Factor out some magic numbers. More intuitive painter image name.
Cleaner switch statements rather than recreate a small set of paths.
Add "Copy for Path of Building" button and grouping widget to UI.
@DaneelTrevize DaneelTrevize changed the title Disable PoB export button, so other changes can be accepted. Improve categories Nov 28, 2018
Copy link
Owner

@xyzz xyzz left a comment

Choose a reason for hiding this comment

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

Please, follow the code style of surrounding code, for example, you have a lot of if( which should be if (, same for switch. Function calls also shouldn't have extra spaces like in ui->imageLabel->setPixmap( GenerateItemIcon(*current_item_, image_cache_->Get(icon)) ) it should be ui->imageLabel->setPixmap(GenerateItemIcon(*current_item_, image_cache_->Get(icon))) and if you feel there's too many levels of brackets, then the argument should be extracted to a variable, i.e. auto icon = GenerateItemIcon(...); ui->imageLabel->setPixmap(icon)

Also, the logic in CalculateCategories is pretty complicated, it definitely deserves a bunch of new tests.

src/item.cpp Outdated Show resolved Hide resolved
src/item.cpp Show resolved Hide resolved
src/item.cpp Outdated Show resolved Hide resolved
src/item.cpp Outdated Show resolved Hide resolved
src/util.cpp Outdated Show resolved Hide resolved
@DaneelTrevize
Copy link
Contributor Author

I'm used to different style guidelines w.r.t. using spaces to make things more human-friendly, and avoiding polluting scopes with used-once variables, but it's your codebase to maintain, and apologies where I slip between & mix the different styles as I either get into a flow or revert to referencing other sections.

Stop iterating over properties once the Map Tier is found.
Add unit tests for item category parsing.
Cleaner functions.
Cleaner range looping.
Remove ineffective legacy condition while there remains dedicated Gem Level and Map Tier attributes and search filters.
Test assumptions about Shaper & Elder attributes.
@DaneelTrevize
Copy link
Contributor Author

I'm not sure if you were already notified of the commit earlier that resolved your change requests, but this is to hopefully ping you that it's ready.

@xyzz
Copy link
Owner

xyzz commented Nov 30, 2018

there's still a bunch of if( that should be if (

@DaneelTrevize
Copy link
Contributor Author

DaneelTrevize commented Dec 1, 2018

Adjusted, as well as a last few for( s found elsewhere. I'm not touching the 8710 occurances of if( in sqlite3.c, naturally.

@xyzz xyzz merged commit 06e2f44 into xyzz:master Dec 1, 2018
@DaneelTrevize
Copy link
Contributor Author

FWIW, I asked a few questions around this icon path parsing approach to GGG, and had a response from Rory.

https://www.reddit.com/r/pathofexiledev/comments/a1jnoy/apiwebcdn_question_around_map_icons/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants