Skip to content

Commit

Permalink
final(?) adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
RenechCDDA committed Jun 9, 2024
1 parent 6e43d5a commit aa3ea01
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
26 changes: 14 additions & 12 deletions src/npctalk_rules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ void follower_rules_ui::draw_follower_rules_ui( npc *guy )
}

template<typename T>
void follower_rules_ui_impl::multi_rule_header( std::string id, T &rule,
std::map<T, std::string> rule_map, bool should_advance )
void follower_rules_ui_impl::multi_rule_header( const std::string &id, T &rule,
const std::map<T, std::string> &rule_map, bool should_advance )
{
if( ImGui::InvisibleButton( id.c_str(), ImVec2() ) || should_advance ) {
if( rule_map.upper_bound( rule ) == rule_map.end() ) {
Expand Down Expand Up @@ -154,21 +154,21 @@ void follower_rules_ui_impl::rules_transfer_popup( bool &exporting_rules, bool &
ImVec2( window_width, window_height ) ) ) {
// Missions selection is purposefully thinner than the description, it has less to convey.
ImGui::TableSetupColumn( _( "Name" ), ImGuiTableColumnFlags_WidthStretch,
window_width / 8 );
static_cast<float>( window_width / 8 ) );

Check failure on line 157 in src/npctalk_rules.cpp

View workflow job for this annotation

GitHub Actions / build (src)

result of integer division used in a floating point context; possible loss of precision [bugprone-integer-division,-warnings-as-errors]
ImGui::TableSetupColumn( _( "Behaviors" ), ImGuiTableColumnFlags_WidthStretch,
window_width / 8 );
static_cast<float>( window_width / 8 ) );

Check failure on line 159 in src/npctalk_rules.cpp

View workflow job for this annotation

GitHub Actions / build (src)

result of integer division used in a floating point context; possible loss of precision [bugprone-integer-division,-warnings-as-errors]
ImGui::TableSetupColumn( _( "Aiming" ), ImGuiTableColumnFlags_WidthStretch,
window_width / 8 );
static_cast<float>( window_width / 8 ) );

Check failure on line 161 in src/npctalk_rules.cpp

View workflow job for this annotation

GitHub Actions / build (src)

result of integer division used in a floating point context; possible loss of precision [bugprone-integer-division,-warnings-as-errors]
ImGui::TableSetupColumn( _( "Engagement" ), ImGuiTableColumnFlags_WidthStretch,
window_width / 8 );
static_cast<float>( window_width / 8 ) );

Check failure on line 163 in src/npctalk_rules.cpp

View workflow job for this annotation

GitHub Actions / build (src)

result of integer division used in a floating point context; possible loss of precision [bugprone-integer-division,-warnings-as-errors]
ImGui::TableSetupColumn( _( "CBM recharge" ), ImGuiTableColumnFlags_WidthStretch,
window_width / 8 );
static_cast<float>( window_width / 8 ) );

Check failure on line 165 in src/npctalk_rules.cpp

View workflow job for this annotation

GitHub Actions / build (src)

result of integer division used in a floating point context; possible loss of precision [bugprone-integer-division,-warnings-as-errors]
ImGui::TableSetupColumn( _( "CBM reserve" ), ImGuiTableColumnFlags_WidthStretch,
window_width / 8 );
static_cast<float>( window_width / 8 ) );

Check failure on line 167 in src/npctalk_rules.cpp

View workflow job for this annotation

GitHub Actions / build (src)

result of integer division used in a floating point context; possible loss of precision [bugprone-integer-division,-warnings-as-errors]
ImGui::TableSetupColumn( _( "Pickup list" ), ImGuiTableColumnFlags_WidthStretch,
window_width / 8 );
static_cast<float>( window_width / 8 ) );

Check failure on line 169 in src/npctalk_rules.cpp

View workflow job for this annotation

GitHub Actions / build (src)

result of integer division used in a floating point context; possible loss of precision [bugprone-integer-division,-warnings-as-errors]
ImGui::TableSetupColumn( _( "ALL" ), ImGuiTableColumnFlags_WidthStretch,
window_width / 8 );
static_cast<float>( window_width / 8 ) );

Check failure on line 171 in src/npctalk_rules.cpp

View workflow job for this annotation

GitHub Actions / build (src)

result of integer division used in a floating point context; possible loss of precision [bugprone-integer-division,-warnings-as-errors]
ImGui::TableHeadersRow();
int button_number = 0;
for( npc &role_model : g->all_npcs() ) {
Expand Down Expand Up @@ -335,8 +335,6 @@ void follower_rules_ui_impl::draw_controls()

draw_colored_text( string_format( _( "Rules for your follower, %s" ), guy->disp_name() ) );
ImGui::Separator();
draw_colored_text( _( "Hotkey:" ) );
ImGui::NewLine();

if( ImGui::Button( _( "Import settings from follower" ) ) ) {
exporting_rules = false;
Expand All @@ -349,6 +347,10 @@ void follower_rules_ui_impl::draw_controls()
return;
}

draw_colored_text( _( "Hotkey:" ) );
ImGui::NewLine();


print_hotkey( assigned_hotkey );
if( ImGui::Button( _( "Default ALL" ) ) || pressed_key == assigned_hotkey ) {
ImGui::SetKeyboardFocusHere( -1 );
Expand Down
2 changes: 1 addition & 1 deletion src/npctalk_rules.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class follower_rules_ui_impl : public cataimgui::window
// Prepares for a rule option with multiple valid selections. Advances and wraps through
// those options as the hotkey is pressed.
template<typename T>
void multi_rule_header( std::string id, T &rule, std::map<T, std::string> rule_map,
void multi_rule_header( const std::string &id, T &rule, const std::map<T, std::string> &rule_map,
bool should_advance );

protected:
Expand Down

0 comments on commit aa3ea01

Please sign in to comment.