addon/mg: Ridiculously quick and ugly proof-of-concept...
...for color-keyed add-on display Let's see how long until I either decide this sucks and needs to be reverted, or this rocks and needs to be adequately refactored.
This commit is contained in:
parent
5bc3e56266
commit
9ce00e9bd4
3 changed files with 25 additions and 4 deletions
|
@ -458,6 +458,7 @@ void show_addons_manager_dialog(display& disp, addons_client& client, addons_lis
|
|||
can_delete_ids.push_back(addon.id);
|
||||
}
|
||||
|
||||
const std::string& display_sep = sep + get_addon_status_gui1_color_markup(state);
|
||||
const std::string& display_size = size_display_string(addon.size);
|
||||
const std::string& display_type = addon.display_type();
|
||||
const std::string& display_down = str_cast(addon.downloads);
|
||||
|
@ -499,13 +500,13 @@ void show_addons_manager_dialog(display& disp, addons_client& client, addons_lis
|
|||
}
|
||||
|
||||
// NOTE: NULL_MARKUP used to escape abuse of formatting chars in add-on titles
|
||||
row = IMAGE_PREFIX + display_icon + sep + font::NULL_MARKUP + display_title + sep;
|
||||
row = IMAGE_PREFIX + display_icon + display_sep + font::NULL_MARKUP + display_title + display_sep;
|
||||
if(updates_only) {
|
||||
row += display_old_version + sep;
|
||||
row += display_old_version + display_sep;
|
||||
}
|
||||
row += display_version + sep + display_author + sep;
|
||||
row += display_version + display_sep + display_author + display_sep;
|
||||
if(!updates_only) {
|
||||
row += display_type + sep + display_down + sep;
|
||||
row += display_type + display_sep + display_down + display_sep;
|
||||
}
|
||||
row += display_size;
|
||||
|
||||
|
|
|
@ -52,3 +52,21 @@ addon_tracking_info get_addon_tracking_info(const addon_info& addon)
|
|||
|
||||
return t;
|
||||
}
|
||||
|
||||
std::string get_addon_status_gui1_color_markup(ADDON_STATUS status)
|
||||
{
|
||||
switch(status) {
|
||||
case ADDON_INSTALLED:
|
||||
return "@";
|
||||
case ADDON_INSTALLED_UPGRADABLE:
|
||||
return "<255,255,0>";
|
||||
case ADDON_INSTALLED_OUTDATED:
|
||||
return "<255,127,0>";
|
||||
case ADDON_INSTALLED_BROKEN:
|
||||
return "#";
|
||||
default:
|
||||
;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
|
|
@ -35,6 +35,8 @@ enum ADDON_STATUS {
|
|||
ADDON_NOT_TRACKED
|
||||
};
|
||||
|
||||
std::string get_addon_status_gui1_color_markup(ADDON_STATUS status);
|
||||
|
||||
/** Stores additional status information about add-ons. */
|
||||
struct addon_tracking_info
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue