Add icons instead of text for input key hint bar
BIN
assets/ui/switch_button_a.png
Normal file
|
After Width: | Height: | Size: 491 B |
BIN
assets/ui/switch_button_b.png
Normal file
|
After Width: | Height: | Size: 465 B |
BIN
assets/ui/switch_button_l.png
Normal file
|
After Width: | Height: | Size: 308 B |
BIN
assets/ui/switch_button_r.png
Normal file
|
After Width: | Height: | Size: 362 B |
BIN
assets/ui/switch_button_x.png
Normal file
|
After Width: | Height: | Size: 512 B |
BIN
assets/ui/switch_button_y.png
Normal file
|
After Width: | Height: | Size: 475 B |
BIN
assets/ui/switch_button_zl.png
Normal file
|
After Width: | Height: | Size: 367 B |
BIN
assets/ui/switch_button_zr.png
Normal file
|
After Width: | Height: | Size: 411 B |
BIN
assets/ui/switch_dpad_down.png
Normal file
|
After Width: | Height: | Size: 467 B |
BIN
assets/ui/switch_dpad_left.png
Normal file
|
After Width: | Height: | Size: 471 B |
BIN
assets/ui/switch_dpad_right.png
Normal file
|
After Width: | Height: | Size: 475 B |
BIN
assets/ui/switch_dpad_up.png
Normal file
|
After Width: | Height: | Size: 464 B |
@ -31,16 +31,16 @@ constexpr float MIN_SUSTAIN_FALLBACK_SEC = 0.05f;
|
||||
constexpr float MIN_GLYPH_DURATION_SEC = 0.1f;
|
||||
|
||||
const int GAMEPAD_BUTTONS[LANE_COUNT] = {
|
||||
GAMEPAD_BUTTON_LEFT_FACE_LEFT, // Left
|
||||
GAMEPAD_BUTTON_LEFT_FACE_UP, // Up
|
||||
GAMEPAD_BUTTON_LEFT_FACE_RIGHT, // Right
|
||||
GAMEPAD_BUTTON_LEFT_FACE_DOWN, // Down
|
||||
GAMEPAD_BUTTON_RIGHT_FACE_LEFT, // X
|
||||
GAMEPAD_BUTTON_RIGHT_FACE_UP, // Y
|
||||
GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, // B
|
||||
GAMEPAD_BUTTON_RIGHT_FACE_DOWN, // A
|
||||
GAMEPAD_BUTTON_LEFT_TRIGGER_2, // LT
|
||||
GAMEPAD_BUTTON_LEFT_TRIGGER_1, // LB
|
||||
GAMEPAD_BUTTON_LEFT_FACE_LEFT, // Left
|
||||
GAMEPAD_BUTTON_LEFT_FACE_UP, // Up
|
||||
GAMEPAD_BUTTON_LEFT_FACE_DOWN, // Down
|
||||
GAMEPAD_BUTTON_LEFT_FACE_RIGHT, // Right
|
||||
GAMEPAD_BUTTON_RIGHT_FACE_LEFT, // X
|
||||
GAMEPAD_BUTTON_RIGHT_FACE_UP, // Y
|
||||
GAMEPAD_BUTTON_RIGHT_FACE_DOWN, // A
|
||||
GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, // B
|
||||
GAMEPAD_BUTTON_RIGHT_TRIGGER_1, // RB
|
||||
GAMEPAD_BUTTON_RIGHT_TRIGGER_2, // RT
|
||||
};
|
||||
@ -49,6 +49,21 @@ const char* const GAMEPAD_BUTTON_LABELS[LANE_COUNT] = {
|
||||
"<", "^", ">", "v", "X", "Y", "B", "A", "LT", "LB", "RB", "RT",
|
||||
};
|
||||
|
||||
const char* const GAMEPAD_BUTTON_ICONS[LANE_COUNT] = {
|
||||
"assets/ui/switch_button_zl.png",
|
||||
"assets/ui/switch_button_l.png",
|
||||
"assets/ui/switch_dpad_left.png",
|
||||
"assets/ui/switch_dpad_up.png",
|
||||
"assets/ui/switch_dpad_down.png",
|
||||
"assets/ui/switch_dpad_right.png",
|
||||
"assets/ui/switch_button_x.png",
|
||||
"assets/ui/switch_button_y.png",
|
||||
"assets/ui/switch_button_a.png",
|
||||
"assets/ui/switch_button_b.png",
|
||||
"assets/ui/switch_button_r.png",
|
||||
"assets/ui/switch_button_zr.png",
|
||||
};
|
||||
|
||||
constexpr int COMBO_TIER_COUNT = 20;
|
||||
constexpr int COMBO_DISPLAY_THRESHOLD = 5;
|
||||
constexpr int COMBO_NOTES_PER_TIER = 10;
|
||||
@ -59,21 +74,6 @@ const char* const COMBO_TIER_LABELS[COMBO_TIER_COUNT] = {
|
||||
"Stellar!", "Legendary!", "Epic!", "Divine!", "Godlike!",
|
||||
};
|
||||
|
||||
const int KEY_KEYS[LANE_COUNT] = {
|
||||
KEY_Q,
|
||||
KEY_W,
|
||||
KEY_E,
|
||||
KEY_R,
|
||||
KEY_A,
|
||||
KEY_S,
|
||||
KEY_D,
|
||||
KEY_F,
|
||||
KEY_Z,
|
||||
KEY_X,
|
||||
KEY_C,
|
||||
KEY_V,
|
||||
};
|
||||
|
||||
/* One color per track (track index % MAX_INSTRUMENT_TYPES). */
|
||||
const Color INSTRUMENT_COLORS[MAX_INSTRUMENT_TYPES] = {
|
||||
{220, 100, 100, 255}, // red
|
||||
@ -472,10 +472,6 @@ public:
|
||||
|
||||
bool is_lane_pressed(int lane) const
|
||||
{
|
||||
if (IsKeyPressed(KEY_KEYS[lane]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
for (int i = 0; i < MAX_GAMEPADS; i++)
|
||||
{
|
||||
if (IsGamepadAvailable(i) && IsGamepadButtonPressed(i, GAMEPAD_BUTTONS[lane]))
|
||||
@ -989,17 +985,17 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
const float button_label_font_size = 28.0f;
|
||||
float label_height = MeasureTextEx(font, "X", button_label_font_size, 1).y;
|
||||
float button_label_y = (upper_bar_y + hit_line_y) / 2.0f - label_height / 2.0f;
|
||||
const float button_icon_height = 50.0f;
|
||||
float button_icon_y = (upper_bar_y + hit_line_y) / 2.0f - button_icon_height / 2.0f;
|
||||
auto* tex_svc = get_service<TextureService>();
|
||||
for (int lane = 0; lane < LANE_COUNT; lane++)
|
||||
{
|
||||
const char* label = GAMEPAD_BUTTON_LABELS[lane];
|
||||
float label_w = MeasureTextEx(font, label, button_label_font_size, 1).x;
|
||||
Texture2D& tex = tex_svc->get_texture(GAMEPAD_BUTTON_ICONS[lane]);
|
||||
float scale = button_icon_height / static_cast<float>(tex.height);
|
||||
float w = static_cast<float>(tex.width) * scale;
|
||||
float cx = lane_center_x(lane);
|
||||
DrawTextEx(font, label,
|
||||
{cx - label_w / 2.0f, button_label_y},
|
||||
button_label_font_size, 1, Color{220, 220, 240, 255});
|
||||
DrawTextureEx(tex, {cx - w / 2.0f, button_icon_y}, 0.0f, scale,
|
||||
Color{220, 220, 240, 255});
|
||||
}
|
||||
|
||||
std::string score_text = "Score: " + std::to_string(score);
|
||||
|
||||