Add tooltips for building buttons and module selection buttons
This commit is contained in:
@@ -23,6 +23,9 @@ struct BuildingDef
|
||||
// Output-buffer holding size for buildings without a recipe-driven buffer.
|
||||
// Only the Salvage Bay sets this (REQ-BLD-SALVAGE-BAY).
|
||||
std::optional<int> outputBufferCapacity;
|
||||
|
||||
// Optional hover-tooltip text for the build button (REQ-UI-BUILD-TOOLTIP).
|
||||
std::optional<std::string> tooltip;
|
||||
};
|
||||
|
||||
struct BuildingsConfig
|
||||
|
||||
@@ -343,6 +343,11 @@ BuildingsConfig ConfigLoader::loadBuildings(const std::string& path)
|
||||
requireInt(mt["output_buffer_capacity"], file, elemPath + ".output_buffer_capacity"));
|
||||
}
|
||||
|
||||
if (mt.contains("tooltip"))
|
||||
{
|
||||
def.tooltip = requireString(mt["tooltip"], file, elemPath + ".tooltip");
|
||||
}
|
||||
|
||||
const std::optional<BuildingType> parsedType = parseBuildingType(def.id);
|
||||
if (!parsedType)
|
||||
{
|
||||
@@ -603,6 +608,11 @@ ModulesConfig ConfigLoader::loadModules(const std::string& path)
|
||||
def.fillColor = requireString(mt["fill_color"], file, elemPath + ".fill_color");
|
||||
def.glyph = requireString(mt["glyph"], file, elemPath + ".glyph");
|
||||
|
||||
if (mt.contains("tooltip"))
|
||||
{
|
||||
def.tooltip = requireString(mt["tooltip"], file, elemPath + ".tooltip");
|
||||
}
|
||||
|
||||
// Materials
|
||||
{
|
||||
const toml::array& materials = requireArray(mt["materials"], file, elemPath + ".materials");
|
||||
|
||||
@@ -54,6 +54,10 @@ struct ModuleDef
|
||||
std::optional<ModuleWeaponCapability> weaponCapability;
|
||||
std::optional<ModuleSalvageCapability> salvageCapability;
|
||||
std::optional<ModuleRepairCapability> repairCapability;
|
||||
|
||||
// Optional hover-tooltip text for the module selection button
|
||||
// (REQ-MOD-UI-MODULE-TOOLTIP).
|
||||
std::optional<std::string> tooltip;
|
||||
};
|
||||
|
||||
struct ModulesConfig
|
||||
|
||||
Reference in New Issue
Block a user