|
|
@ -40,7 +40,9 @@ DFhackCExport command_result plugin_init (Core *c, std::vector <PluginCommand> &
|
|
|
|
"rename", "Rename various things.", rename, false,
|
|
|
|
"rename", "Rename various things.", rename, false,
|
|
|
|
" rename squad <index> \"name\"\n"
|
|
|
|
" rename squad <index> \"name\"\n"
|
|
|
|
" rename hotkey <index> \"name\"\n"
|
|
|
|
" rename hotkey <index> \"name\"\n"
|
|
|
|
|
|
|
|
" (identified by ordinal index)\n"
|
|
|
|
" rename unit \"nickname\"\n"
|
|
|
|
" rename unit \"nickname\"\n"
|
|
|
|
|
|
|
|
" rename unit-profession \"custom profession\"\n"
|
|
|
|
" (a unit must be highlighted in the ui)\n"
|
|
|
|
" (a unit must be highlighted in the ui)\n"
|
|
|
|
));
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -123,6 +125,17 @@ static command_result rename(Core * c, vector <string> ¶meters)
|
|
|
|
if (figure)
|
|
|
|
if (figure)
|
|
|
|
set_nickname(&figure->name, parameters[1]);
|
|
|
|
set_nickname(&figure->name, parameters[1]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (cmd == "unit-profession")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (parameters.size() != 2)
|
|
|
|
|
|
|
|
return CR_WRONG_USAGE;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
df::unit *unit = getSelectedUnit(c);
|
|
|
|
|
|
|
|
if (!unit)
|
|
|
|
|
|
|
|
return CR_WRONG_USAGE;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unit->custom_profession = parameters[1];
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!parameters.empty() && cmd != "?")
|
|
|
|
if (!parameters.empty() && cmd != "?")
|
|
|
|