| Line 314: |
Line 314: |
| | end | | end |
| | | | |
| − | function Formatting:format_remodel_level_and_item_cost(remodel_level, blueprint, catapult, report, gunmat, airmat, armament) | + | function Formatting:format_remodel_level_and_item_cost(remodel_level, blueprint, catapult, report, gunmat, airmat, armament, overseas) |
| − | local item_requirements = self:format_remodel_items(blueprint, catapult, report, gunmat, airmat, armament) | + | local item_requirements = self:format_remodel_items(blueprint, catapult, report, gunmat, airmat, armament, overseas) |
| | if remodel_level == nil then | | if remodel_level == nil then |
| | remodel_level = "??" | | remodel_level = "??" |
| Line 329: |
Line 329: |
| | local title = Formatting:format_resource_name(item) | | local title = Formatting:format_resource_name(item) |
| | return self:format_image{DataAsset[item], caption = title, link = title, size = "24px"} | | return self:format_image{DataAsset[item], caption = title, link = title, size = "24px"} |
| − | .. (value == nil and "?" or type(value) == "number" and "×" .. value or "")
| + | .. (value == nil and "×??" or type(value) == "number" and "×" .. value or "") |
| | end | | end |
| | | | |
| − | function Formatting:format_remodel_items(blueprint, catapult, report, gunmat, airmat, armament) | + | function Formatting:format_remodel_items(blueprint, catapult, report, gunmat, airmat, armament, overseas) |
| | local items = {} | | local items = {} |
| | -- explicit items | | -- explicit items |
| Line 354: |
Line 354: |
| | table.insert(items, self:format_remodel_item("new_model_armament_material_item", armament)) | | table.insert(items, self:format_remodel_item("new_model_armament_material_item", armament)) |
| | end | | end |
| | + | if overseas then |
| | + | table.insert(items, self:format_remodel_item("latest_overseas_warship_technology_item", overseas)) |
| | + | end |
| | return #items > 0 and table.concat(items, " ") or nil | | return #items > 0 and table.concat(items, " ") or nil |
| | end | | end |
| | | | |
| − | function Formatting:format_blueprint_requirement(blueprint, force) | + | function Formatting:format_item_requirement(item, value, show_false) |
| − | if force or (blueprint ~= false) then | + | return value == false and not show_false and "" or |
| − | local value | + | value == false and "❌" or value and self:format_remodel_item(item, value) or "??" |
| − | if blueprint == false then
| + | end |
| − | value = "❌"
| + | |
| − | elseif blueprint == true then
| + | function Formatting:format_blueprint_requirement(value, show_false) |
| − | value = self:format_image{DataAsset.blueprint_item, size = "24px", caption = Formatting:format_resource_name("blueprint")}
| + | return self:format_item_requirement("blueprint_item", value, show_false) |
| − | else
| |
| − | value = "??"
| |
| − | end
| |
| − | return value
| |
| − | end
| |
| − | return "" | |
| | end | | end |
| | | | |
| | Formatting.format_blueprint_requirement_simple = Formatting.format_blueprint_requirement | | Formatting.format_blueprint_requirement_simple = Formatting.format_blueprint_requirement |
| | | | |
| − | function Formatting:format_catapult_requirement(catapult, force) | + | function Formatting:format_catapult_requirement(value, show_false) |
| − | if force or (catapult ~= false) then | + | return self:format_item_requirement("prototype_deck_catapult_item", value, show_false) |
| − | local value
| |
| − | if catapult == false then
| |
| − | value = "❌"
| |
| − | elseif catapult == true then
| |
| − | value = self:format_image{DataAsset.prototype_deck_catapult_item, size = "24px", caption = Formatting:format_resource_name("prototype_deck_catapult_item")}
| |
| − | else
| |
| − | value = "??"
| |
| − | end
| |
| − | return value
| |
| − | end
| |
| − | return ""
| |
| | end | | end |
| | | | |
| Line 742: |
Line 728: |
| | new_model_armament_material = "New Model Armament Material", | | new_model_armament_material = "New Model Armament Material", |
| | new_model_armament_material_item = "New Model Armament Material", | | new_model_armament_material_item = "New Model Armament Material", |
| | + | latest_overseas_warship_technology = "Latest Overseas Warship Technology", |
| | + | latest_overseas_warship_technology_item = "Latest Overseas Warship Technology", |
| | }) | | }) |
| | | | |