Line trails, ring on impact, colored shadowed numbers, subtler pitch, no digest rumble
This commit is contained in:
1 parent
4fac37b7f5
commit
ee3430d5cb
8 files changed
+33
-40
No files matched your search
+14
-12
@@ -25,11 +25,11 @@ constexpr float INDICATOR_SIZE = 0.35f;
|
||||
constexpr float INDICATOR_SPEED = 2;
|
||||
constexpr float ITEM_SIZE = 96;
|
||||
constexpr float ROUNDING = 10;
|
||||
constexpr ImVec4 CALORIES_COLOR = {1, 0.85f, 0.3f, 1};
|
||||
constexpr float BAR_EASE = 6;
|
||||
constexpr float BAR_SHAKE = 2;
|
||||
constexpr float BAR_SHAKE_SPEED = 40;
|
||||
constexpr float FLOATER_OUTLINE = 2;
|
||||
constexpr float FLOATER_SHADOW = 3;
|
||||
constexpr float FLOATER_SHADOW_ALPHA = 0.6f;
|
||||
constexpr float OVERSTUFFED_PULSE = 0.35f;
|
||||
constexpr float OVERSTUFFED_SPEED = 6;
|
||||
constexpr float STAR_WAIST = 0.3f;
|
||||
@@ -724,7 +724,8 @@ void Ui::text_draw(Play& play, ImVec2 screen)
|
||||
ImGui::PopFont();
|
||||
}
|
||||
|
||||
// The flourishes over the world: sparks, rising numbers (outlined so they read on anything), and the screen's flash.
|
||||
// The flourishes over the world: sparks, rising numbers (in the character's color, shadowed so they read on anything),
|
||||
// and the screen's flash.
|
||||
void Ui::effects_draw(Play& play, ImVec2 screen)
|
||||
{
|
||||
Effects& effects = play.effects;
|
||||
@@ -741,6 +742,12 @@ void Ui::effects_draw(Play& play, ImVec2 screen)
|
||||
drawList->AddCircleFilled({at.x, at.y}, size, color);
|
||||
continue;
|
||||
}
|
||||
if (spark.shape == SPARK_LINE)
|
||||
{
|
||||
Vec2 end = view * spark.end;
|
||||
drawList->AddLine({at.x, at.y}, {end.x, end.y}, color, size);
|
||||
continue;
|
||||
}
|
||||
float waist = size * STAR_WAIST;
|
||||
drawList->AddQuadFilled({at.x, at.y - size}, {at.x + waist, at.y}, {at.x, at.y + size}, {at.x - waist, at.y},
|
||||
color);
|
||||
@@ -754,18 +761,13 @@ void Ui::effects_draw(Play& play, ImVec2 screen)
|
||||
std::string text = floater.type == FLOATER_CALORIES ? text_format("+%.0f kcal", floater.value)
|
||||
: "+" + weight_format(floater.value, *measurement);
|
||||
float alpha = std::min(1.0f, (float)floater.life / (FLOATER_LIFE / 2));
|
||||
ImVec4 color = floater.type == FLOATER_CALORIES ? CALORIES_COLOR : ImGui::GetStyleColorVec4(ImGuiCol_PlotHistogram);
|
||||
color.w = alpha;
|
||||
Color tint = play.character->color;
|
||||
ImVec4 color = {tint.r, tint.g, tint.b, alpha};
|
||||
ImVec2 size = font->CalcTextSizeA(FONT_HEADER_2, FLT_MAX, 0, text.c_str());
|
||||
Vec2 at = view * floater.position;
|
||||
ImVec2 position = {at.x - size.x / 2, at.y - size.y / 2};
|
||||
ImU32 outline = ImGui::GetColorU32(ImVec4(0, 0, 0, alpha));
|
||||
for (int x = -1; x <= 1; x++)
|
||||
for (int y = -1; y <= 1; y++)
|
||||
if (x != 0 || y != 0)
|
||||
drawList->AddText(font, FONT_HEADER_2,
|
||||
{position.x + x * FLOATER_OUTLINE, position.y + y * FLOATER_OUTLINE}, outline,
|
||||
text.c_str());
|
||||
drawList->AddText(font, FONT_HEADER_2, {position.x + FLOATER_SHADOW, position.y + FLOATER_SHADOW},
|
||||
ImGui::GetColorU32(ImVec4(0, 0, 0, alpha * FLOATER_SHADOW_ALPHA)), text.c_str());
|
||||
drawList->AddText(font, FONT_HEADER_2, position, ImGui::GetColorU32(color), text.c_str());
|
||||
}
|
||||
if (effects.flash > 0)
|
||||
|
||||
Reference in new issue
Block a user