no message

This commit is contained in:
BADIM-PC\Vadim 2017-12-13 17:09:25 +03:00
parent 9c50e5a135
commit 3ad2ff4a6b
2 changed files with 41 additions and 6 deletions

View File

@ -147,7 +147,8 @@ static struct
struct struct
{ {
bool show; bool show;
} banks; s32 index;
} bank;
struct struct
{ {
@ -256,9 +257,10 @@ static struct
.show = false, .show = false,
}, },
.banks = .bank =
{ {
.show = false, .show = false,
.index = 0,
}, },
.popup = .popup =
@ -534,6 +536,8 @@ const StudioConfig* getConfig()
static void drawBankIcon(s32 x, s32 y) static void drawBankIcon(s32 x, s32 y)
{ {
tic_mem* tic = studio.tic;
SDL_Rect rect = {x, y, TIC_FONT_WIDTH, TIC_FONT_HEIGHT}; SDL_Rect rect = {x, y, TIC_FONT_WIDTH, TIC_FONT_HEIGHT};
static const u8 Icon[] = static const u8 Icon[] =
@ -559,10 +563,41 @@ static void drawBankIcon(s32 x, s32 y)
showTooltip("SWITCH BANK"); showTooltip("SWITCH BANK");
if(checkMouseClick(&rect, SDL_BUTTON_LEFT)) if(checkMouseClick(&rect, SDL_BUTTON_LEFT))
studio.banks.show = !studio.banks.show; studio.bank.show = !studio.bank.show;
} }
drawBitIcon(x, y, Icon, over ? tic_color_blue : tic_color_cyan); if(studio.bank.show)
{
drawBitIcon(x, y, Icon, over ? tic_color_peach : tic_color_red);
enum{Size = TOOLBAR_SIZE};
for(s32 i = 0; i < TIC_BANKS; i++)
{
SDL_Rect rect = {x + 2 + (i+1)*Size, 0, Size, Size};
bool over = false;
if(checkMousePos(&rect))
{
setCursor(SDL_SYSTEM_CURSOR_HAND);
over = true;
if(checkMouseClick(&rect, SDL_BUTTON_LEFT))
studio.bank.index = i;
}
if(i == studio.bank.index)
{
tic->api.rect(tic, rect.x, rect.y, rect.w, rect.h, tic_color_red);
}
tic->api.draw_char(tic, '0' + i, rect.x+1, rect.y+1, i == studio.bank.index ? tic_color_white : over ? tic_color_red : tic_color_peach);
}
}
else
{
drawBitIcon(x, y, Icon, over ? tic_color_red : tic_color_peach);
}
} }
#endif #endif
@ -682,7 +717,7 @@ void drawToolbar(tic_mem* tic, u8 color, bool bg)
enum {TextOffset = (COUNT_OF(Modes) + 1) * Size}; enum {TextOffset = (COUNT_OF(Modes) + 1) * Size};
#endif #endif
if(mode >= 0 && !studio.banks.show) if(mode >= 0 && !studio.bank.show)
{ {
if(strlen(studio.tooltip.text)) if(strlen(studio.tooltip.text))
{ {

View File

@ -107,7 +107,7 @@
#define TIC_CODE_SIZE (0x10000) #define TIC_CODE_SIZE (0x10000)
#define TIC_BANKS 4 #define TIC_BANKS 8
#define SFX_NOTES {"C-", "C#", "D-", "D#", "E-", "F-", "F#", "G-", "G#", "A-", "A#", "B-"} #define SFX_NOTES {"C-", "C#", "D-", "D#", "E-", "F-", "F#", "G-", "G#", "A-", "A#", "B-"}