- [ONGOING] Implementant el menú de tecles, que jdes m'ha distret i m'he quedat a meitant
This commit is contained in:
38
source/m_menu_tecles.cpp
Normal file
38
source/m_menu_tecles.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#include "m_menu_tecles.h"
|
||||
#include "jdraw.h"
|
||||
|
||||
namespace modules
|
||||
{
|
||||
namespace menu_tecles
|
||||
{
|
||||
int selected_option = MENU_TECLES_AMUNT;
|
||||
|
||||
void init()
|
||||
{
|
||||
selected_option = MENU_TECLES_AMUNT;
|
||||
}
|
||||
|
||||
int loop()
|
||||
{
|
||||
draw::cls(2);
|
||||
draw::color(1);
|
||||
|
||||
draw::print2("REDEFINIR TECLES", 13, 3, YELLOW, FONT_ZOOM_VERTICAL);
|
||||
|
||||
int pos = 10;
|
||||
static char *textos[6] = { "AMUNT:", "AVALL:", "ESQUERRA:", "DRETA:", "BOTAR: ", "AGAFAR: " };
|
||||
|
||||
for (int i=0; i<6; ++i)
|
||||
{
|
||||
draw::print2(i==selected_option?"fg":"de", 13, pos, i==selected_option?YELLOW:TEAL, i==selected_option?FONT_ZOOM_VERTICAL:FONT_ZOOM_NONE);
|
||||
draw::print2(textos[i], 18, pos, i==selected_option?YELLOW:TEAL, i==selected_option?FONT_ZOOM_VERTICAL:FONT_ZOOM_NONE);
|
||||
|
||||
}
|
||||
|
||||
draw::print2("(C) JAILDOCTOR 2024", 11, 28, TEAL, FONT_ZOOM_NONE);
|
||||
|
||||
draw::render();
|
||||
return MENU_TECLES_NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
18
source/m_menu_tecles.h
Normal file
18
source/m_menu_tecles.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
namespace modules
|
||||
{
|
||||
namespace menu_tecles
|
||||
{
|
||||
#define MENU_TECLES_NONE -1
|
||||
#define MENU_TECLES_AMUNT 0
|
||||
#define MENU_TECLES_AVALL 1
|
||||
#define MENU_TECLES_ESQUERRA 2
|
||||
#define MENU_TECLES_DRETA 3
|
||||
#define MENU_TECLES_BOTAR 4
|
||||
#define MENU_TECLES_AGAFAR 5
|
||||
|
||||
void init();
|
||||
int loop();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user