@@ -1611,7 +1611,7 @@ void TopMenubar::Draw(float dt)
1611
1611
{
1612
1612
for (size_t i = 0 ; i < tuning_addonparts.size (); i++)
1613
1613
{
1614
- CacheEntryPtr& addonpart_entry = tuning_addonparts[i];
1614
+ const CacheEntryPtr& addonpart_entry = tuning_addonparts[i];
1615
1615
1616
1616
ImGui::PushID (addonpart_entry->fname .c_str ());
1617
1617
const bool conflict_w_hovered = tuning_hovered_addonpart
@@ -1660,11 +1660,19 @@ void TopMenubar::Draw(float dt)
1660
1660
{
1661
1661
tuning_hovered_addonpart = nullptr ;
1662
1662
}
1663
- // Reload button
1663
+ // Reload button (right-aligned)
1664
1664
ImGui::SameLine ();
1665
- ImGui::Dummy (ImVec2 (10 .f , 1 .f ));
1666
- ImGui::SameLine ();
1667
- if (ImGui::SmallButton (_LC (" Tuning" , " Reload" )))
1665
+ if (tuning_rwidget_cursorx_min < ImGui::GetCursorPosX ()) // Make sure button won't draw over save button
1666
+ tuning_rwidget_cursorx_min = ImGui::GetCursorPosX ();
1667
+ ImGui::AlignTextToFramePadding ();
1668
+ std::string reloadbtn_text = _LC (" Tuning" , " Reload" );
1669
+ float delbtn_w = ImGui::CalcTextSize (reloadbtn_text.c_str ()).x + ImGui::GetStyle ().FramePadding .x * 2 ;
1670
+ float delbtn_cursorx = ImGui::GetWindowContentRegionWidth () - delbtn_w;
1671
+ if (delbtn_cursorx < tuning_rwidget_cursorx_min)
1672
+ delbtn_cursorx = tuning_rwidget_cursorx_min;
1673
+ ImGui::SetCursorPosX (delbtn_cursorx);
1674
+ bool reloadbtn_pressed = ImGui::SmallButton (reloadbtn_text.c_str ());
1675
+ if (reloadbtn_pressed)
1668
1676
{
1669
1677
// Create spawn request while actor still exists
1670
1678
// Note we don't use `ActorModifyRequest::Type::RELOAD` because we don't need the bundle reloaded.
0 commit comments