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

Replays with "Point of view" is "Full map" don't ignore fog in some places #4134

Open
jostephd opened this issue Jun 22, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@jostephd
Copy link
Member

commented Jun 22, 2019

In addition to #3687 (comment) and #3687 (comment), both of which have been fixed by now, there are more places where shroud isn't ignored:

  • In the "Current Status" table (Alt+S) the information for all sides should be shown. This should involve some changes to the game_stats class, here:
    std::map<std::string, string_map> row_data_stats;
    string_map column_stats;
    const bool known = viewing_team_.knows_about_team(team.side() - 1);
    const bool enemy = viewing_team_.is_enemy(team.side());
    const team_data& data = team_data_[team.side() - 1];
    unit_const_ptr leader = get_leader(team.side());
    std::string leader_name;
    std::string leader_image;
    if(leader) {
    const bool visible = leader->is_visible_to_team(leader->get_location(), viewing_team_, board_, false);
    // Add leader image. If it's fogged/[hides], show only a random leader image.
    if(visible || known || game_config::debug) {
    leader_image = leader->absolute_image() + leader->image_mods();
    leader_name = leader->name();
    } else {
    leader_image = formatter() << "units/unknown-unit.png" << "~RC(magenta>" << team.color() << ")";
    leader_name = _("Unknown");
    }
    if(resources::controller) {
    if(resources::controller->get_classification().campaign_type == game_classification::CAMPAIGN_TYPE::MULTIPLAYER) {
    leader_name = team.side_name();
    }
    }
    leader_name = "<span color='" + team::get_side_highlight_pango(team.side() - 1) + "'>" + leader_name + "</span>";
    }
    //
    // Status list
    //
    column_stats["use_markup"] = "true";
    column_stats["label"] = leader_image;
    row_data_stats.emplace("team_leader_image", column_stats);
    column_stats["label"] = leader_name + "\n" + controller_name(team);
    row_data_stats.emplace("team_leader_name", column_stats);
    column_stats["label"] = data.teamname.empty() ? team.team_name() : data.teamname;
    row_data_stats.emplace("team_name", column_stats);
    // Only fill in the rest of the info if the side is known...
    if(known || game_config::debug) {
    std::string gold_str;
    if(game_config::debug || !enemy || !viewing_team_.uses_fog()) {
    gold_str = utils::half_signed_value(data.gold);
    }
    column_stats["label"] = data.gold < 0 ? "<span color='#ff0000'>" + gold_str + "</span>" : gold_str;
    row_data_stats.emplace("team_gold", column_stats);
    std::string village_count = std::to_string(data.villages);
    if(!viewing_team_.uses_fog() && !viewing_team_.uses_shroud()) {
    village_count += "/" + std::to_string(board_.map().villages().size());
    }
    column_stats["label"] = village_count;
    row_data_stats.emplace("team_villages", column_stats);
    column_stats["label"] = std::to_string(data.units);
    row_data_stats.emplace("team_units", column_stats);
    column_stats["label"] = std::to_string(data.upkeep);
    row_data_stats.emplace("team_upkeep", column_stats);
    const std::string income = utils::signed_value(data.net_income);
    column_stats["label"] = data.net_income < 0 ? "<span color='#ff0000'>" + income + "</span>" : income;
    row_data_stats.emplace("team_income", column_stats);
    }
    stats_list.add_row(row_data_stats);
  • In the "Damage versus" tooltip, the one that's shown when you mouseover the words "melee-blade" in the sidebar, units that are fogged aren't shown. The easiest way to see this is by loading any MP replay and looking at the leader on turn 1:
    2019-06-22-222622_175x193_scrot
@jostephd

This comment has been minimized.

Copy link
Member Author

commented Jun 22, 2019

Also, while we're about this - the fix to #3687 uses this check:

const bool see_all = gui_->show_everything() || (pc_.is_replay() && pc_.get_replay_controller()->see_all());
Should we change things so display::show_everything() would return true whenever replay_controller::see_all() does? (I think that's not the case right now) For example, maybe the replay controller should call display::set_team(..., true) whenever the viewpoint is changed to "Show everything"? And then menu_events.cpp, and the other places, would all have to check just display::show_everything?

@soliton-

This comment has been minimized.

Copy link
Member

commented Jun 24, 2019

Should we change things so display::show_everything() would return true whenever replay_controller::see_all() does? (I think that's not the case right now) For example, maybe the replay controller should call display::set_team(..., true) whenever the viewpoint is changed to "Show everything"? And then menu_events.cpp, and the other places, would all have to check just display::show_everything?

Sounds like a good idea to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.