Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sounds for right-click #1188

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions src/figure/phrase.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#define SOUND_FILENAME_MAX 64

static const char FIGURE_SOUNDS[32][20][SOUND_FILENAME_MAX] = {
static const char FIGURE_SOUNDS[33][20][SOUND_FILENAME_MAX] = {
{ // 0
"wavs/vigils_starv1.wav", "wavs/vigils_nojob1.wav", "wavs/vigils_needjob1.wav", "wavs/vigils_nofun1.wav",
"wavs/vigils_relig1.wav", "wavs/vigils_great1.wav", "wavs/vigils_great2.wav", "wavs/vigils_exact1.wav",
Expand Down Expand Up @@ -244,7 +244,14 @@ static const char FIGURE_SOUNDS[32][20][SOUND_FILENAME_MAX] = {
"wavs/granboy_exact2.wav", "wavs/granboy_exact3.wav", "wavs/granboy_exact4.wav", "wavs/granboy_exact5.wav",
"wavs/granboy_exact6.wav", "wavs/granboy_exact7.wav", "wavs/granboy_exact8.wav", "wavs/granboy_exact9.wav",
"wavs/granboy_exact0.wav", "wavs/granboy_free1.wav", "wavs/granboy_free2.wav", "wavs/granboy_free3.wav"
}
},
{ // 32 FIGURE_DEPOT_CART_PUSHER = 91
"wavs/ox_starv1.wav", "wavs/ox_nojob1.wav", "wavs/ox_needjob1.wav", "wavs/ox_nofun1.wav",
"wavs/ox_relig1.wav", "wavs/ox_great1.wav", "wavs/ox_great2.wav", ASSETS_DIRECTORY "/Sounds/Ox.ogg",
"wavs/ox_exact2.wav", "wavs/ox_exact3.wav", "wavs/ox_exact4.wav", "wavs/ox_exact5.wav",
"wavs/ox_exact6.wav", "wavs/ox_exact7.wav", "wavs/ox_exact8.wav", "wavs/ox_exact9.wav",
"wavs/ox_exact0.wav", "wavs/ox_free1.wav", "wavs/ox_free2.wav", "wavs/ox_free3.wav"
},
};

static const int FIGURE_TYPE_TO_SOUND_TYPE[] = {
Expand All @@ -257,7 +264,7 @@ static const int FIGURE_TYPE_TO_SOUND_TYPE[] = {
-1, -1, -1, -1, 30, -1, 31, -1, -1, -1, // 60-69
-1, -1, -1, 19, 19, 2, 1, 19, 8, 11, // 70-79
11, -1, 1, -1, -1, 19, 20, 20, 19, 19, // 80-89
19, -1, -1, 22, 25, -1, -1, -1, -1, -1, // 90-99
19, 32, -1, 22, 25, -1, -1, -1, -1, -1, // 90-99
};

enum {
Expand Down Expand Up @@ -425,6 +432,14 @@ static int missionary_phrase(figure *f)
return 7 + f->phrase_sequence_exact;
}

static int ox_phrase(figure *f)
{
if (++f->phrase_sequence_exact >= 1) {
f->phrase_sequence_exact = 0;
}
return 7 + f->phrase_sequence_exact;
}

static int homeless_phrase(figure *f)
{
if (++f->phrase_sequence_exact >= 2) {
Expand Down Expand Up @@ -641,6 +656,8 @@ static int phrase_based_on_figure_state(figure *f)
return citizen_phrase(f);
case FIGURE_MISSIONARY:
return missionary_phrase(f);
case FIGURE_DEPOT_CART_PUSHER:
return ox_phrase(f);
case FIGURE_HOMELESS:
return homeless_phrase(f);
case FIGURE_IMMIGRANT:
Expand Down
4 changes: 3 additions & 1 deletion src/window/building/military.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "city/military.h"
#include "city/view.h"
#include "core/calc.h"
#include "core/dir.h"
#include "core/log.h"
#include "core/string.h"
#include "figure/formation_legion.h"
Expand Down Expand Up @@ -123,7 +124,8 @@ void window_building_draw_wall(building_info_context *c)
void window_building_draw_gatehouse(building_info_context *c)
{
c->help_id = 85;
window_building_play_sound(c, "wavs/gatehouse.wav");
window_building_play_sound(c, ASSETS_DIRECTORY "/Sounds/Road.ogg");
//window_building_play_sound(c, "wavs/gatehouse.wav");
outer_panel_draw(c->x_offset, c->y_offset, c->width_blocks, c->height_blocks);
lang_text_draw_centered(90, 0, c->x_offset, c->y_offset + 10, BLOCK_SIZE * c->width_blocks, FONT_LARGE_BLACK);
window_building_draw_description_at(c, BLOCK_SIZE * c->height_blocks - 158, 90, 1);
Expand Down
6 changes: 4 additions & 2 deletions src/window/building/utility.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ void window_building_roadblock_get_tooltip_walker_permissions(int *translation)
void window_building_draw_garden_gate(building_info_context *c)
{
c->help_id = 0;
window_building_play_sound(c, "wavs/garden.wav");
window_building_play_sound(c, ASSETS_DIRECTORY "/Sounds/Road.ogg");
//window_building_play_sound(c, "wavs/garden.wav");
outer_panel_draw(c->x_offset, c->y_offset, c->width_blocks, c->height_blocks);
text_draw_centered(translation_for(TR_BUILDING_GARDEN_WALL_GATE), c->x_offset, c->y_offset + 10, 16 * c->width_blocks, FONT_LARGE_BLACK, 0);
window_building_draw_description_at(c, 96, CUSTOM_TRANSLATION, TR_BUILDING_GARDEN_WALL_GATE_DESC);
Expand All @@ -242,7 +243,8 @@ void window_building_draw_garden_gate(building_info_context *c)
void window_building_draw_palisade_gate(building_info_context *c)
{
c->help_id = 0;
window_building_play_sound(c, "wavs/gatehouse.wav");
window_building_play_sound(c, ASSETS_DIRECTORY "/Sounds/Road.ogg");
//window_building_play_sound(c, "wavs/gatehouse.wav");
outer_panel_draw(c->x_offset, c->y_offset, c->width_blocks, c->height_blocks);
text_draw_centered(translation_for(TR_BUILDING_PALISADE_GATE), c->x_offset, c->y_offset + 10, 16 * c->width_blocks, FONT_LARGE_BLACK, 0);
window_building_draw_description_at(c, 96, CUSTOM_TRANSLATION, TR_BUILDING_PALISADE_GATE_DESC);
Expand Down
Loading