mehah / otclient

An alternative tibia client for otserv written in C++20 and Lua, made with a modular system that uses lua scripts for ingame interface and functionality, making otclient flexible and easy to customize
Other
260 stars 198 forks source link

Feat: Add StatsBars on bottom and refactor whole statsbars management #797

Closed matheussf closed 3 months ago

matheussf commented 3 months ago

Description

Just a brief on what's my idea here, since in my custom client I wanted to add stats bars on bottom (and maybe somewhere else in the future, who knows?) and it was a little complicated to understand the code and it would grown in a way that it will be hard to maintain in the future.

Refactored in a way that if someone forks this repo, it can customize in easier ways.

I've also fixed the height in otui for skills bar.

*I didn't mess with the skills options because I didn't feel like, things could break and would be a mess to fix. So if you want to customize bars with different widths/heights, there might be necessary some code change, but now its easier to do this.

Another disclaimer: the bottom stats bars in tibia global stays under the action bars, since I do not have experience with otui, I just made it above.

Type of change

How Has This Been Tested

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Test Configuration:

Screenshots:

Options menu:

image image

Bottom Stats bar:

image image

Top Stats bar:

image image

kokekanon commented 3 months ago

test in last commits : f8db2f8

image

panels:

modules.game_inventory.getIconsPanelOff()
modules.game_inventory.getIconsPanelOn()

image modules.game_inventory.getIconsPanelOn():

image modules.game_inventory.getIconsPanelOff(): image

Why did I add it there?

because I wanted to make only one onStatesChange.

if you want to delete it to make easier to maintain I suppose that, the most viable option is to put a new onStatesChange in game_inventary.

matheussf commented 3 months ago

@kokekanon Thanks for the review! This was actually an unintended removal when I was refactoring. This shouldn't be removed, updated the code with this addition, thanks!

Nottinghster commented 3 months ago

@kokekanon Thanks for the review! This was actually an unintended removal when I was refactoring. This shouldn't be removed, updated the code with this addition, thanks!

Ready to go or wip ?

matheussf commented 3 months ago

@kokekanon Thanks for the review! This was actually an unintended removal when I was refactoring. This shouldn't be removed, updated the code with this addition, thanks!

Ready to go or wip ?

Ready to go. I would like that you guys test if its behaviour is still the same as you guys want for this repo