Geometry Nodes: new Bake node #115466
|
@ -2,6 +2,8 @@
|
|||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include "NOD_node_extra_info.hh"
|
||||
#include "NOD_rna_define.hh"
|
||||
#include "NOD_zone_socket_items.hh"
|
||||
|
@ -448,15 +450,10 @@ struct BakeDrawContext {
|
|||
|
||||
static std::string get_baked_string(const BakeDrawContext &ctx)
|
||||
{
|
||||
char str[64];
|
||||
if (ctx.bake_still && ctx.baked_range->size() == 1) {
|
||||
STRNCPY(str, N_("Baked Still"));
|
||||
return TIP_("Baked Still");
|
||||
}
|
||||
else {
|
||||
SNPRINTF(
|
||||
str, N_("Baked %d - %d"), int(ctx.baked_range->first()), int(ctx.baked_range->last()));
|
||||
}
|
||||
return str;
|
||||
return fmt::format(TIP_("Baked {} - {}"), ctx.baked_range->first(), ctx.baked_range->last());
|
||||
}
|
||||
JacquesLucke marked this conversation as resolved
Outdated
|
||||
|
||||
static void draw_bake_button(uiLayout *layout, const BakeDrawContext &ctx)
|
||||
|
|
Loading…
Reference in New Issue
N_
doesn't really make sense here. If it's translated later, that will include the numbers which will make the lookup fail.How about including
<fmt/format.h>
and usingreturn fmt::format(TIP_("Baked {} - {}"), ctx.baked_range->first(), ctx.baked_range->last());
Just replacing it with
TIP_
seems fine as well. Don't really want to start using<fmt/format.h>
here now, I haven't looked into it much yet.It's used in other similar places. It's a required dependency, and it's just a much nicer way to do that sort of formatting that's faster and doesn't require the temporary buffer.