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

Dynamic boost indicators #1692

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open

Conversation

Amx545
Copy link

@Amx545 Amx545 commented Jun 9, 2024

Dynamic position of booster icons depending on the order in which boosters are used.
boost_ic

Dynamic position of boost icons
@github-actions github-actions bot added UI Game assets A feature or an issue that involves gamedata change labels Jun 9, 2024
@Xottab-DUTY
Copy link
Member

@Amx545, man, this is awesome!

@Hrusteckiy, look!

@Hrusteckiy
Copy link
Contributor

Finally someone did that!

Added settings:
Distance from indicators
Vertical/horizontal alignment
Inversion insert
Maximum number of indicators in a row (column if vertical)
fix bug when level changing
Item->Show(false);
}
}
if(!influences.empty() || !m_ind_boost_pos.empty())
Copy link
Member

Choose a reason for hiding this comment

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

Make sure to put a space between an if and the parens.

Suggested change
if(!influences.empty() || !m_ind_boost_pos.empty())
if (!influences.empty() || !m_ind_boost_pos.empty())

flags |= LA_ONLYALPHA;
flags |= LA_TEXTURECOLOR;

for (const auto& [type, Item] : m_ind_boost_state)
Copy link
Member

Choose a reason for hiding this comment

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

Please, try to use other name. According to our code style, local variables should use camelCase (but snake_case is also allowed in some cases)
Some other local variables in your code also start with a capital letter, this needs to be fixed.

Comment on lines +5 to +13
CUIBoostStatesWnd::CUIBoostStatesWnd()
: CUIWindow(CUIBoostStatesWnd::GetDebugType())
{
bHorizontal = true;
bInverse = false;
dx = 0.f;
dy = 0.f;
maxItem = 8;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe more modern style is better:

Suggested change
CUIBoostStatesWnd::CUIBoostStatesWnd()
: CUIWindow(CUIBoostStatesWnd::GetDebugType())
{
bHorizontal = true;
bInverse = false;
dx = 0.f;
dy = 0.f;
maxItem = 8;
}
CUIBoostStatesWnd::CUIBoostStatesWnd()
: CUIWindow(CUIBoostStatesWnd::GetDebugType()),
bHorizontal(true),
bInverse(false),
dx(0.f),
dy(0.f),
maxItem(8)
{
}

actually in modern c++ it's recommended to initialize in declarations:

class CUIBoostStatesWnd final : public CUIWindow
{
// ...
private:
    bool bHorizontal{ true };
    bool bInverse{ false };
    float dx{ 0.0f };
    float dy{ 0.0f };
    u8 maxItem{ 8 };
    xr_vector<EBoostParams> indBoostPos;
    xr_map<EBoostParams, CUIStatic*> indBoostState;
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Game assets A feature or an issue that involves gamedata change UI
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

4 participants