⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 game_sub_menu.c

📁 智原mp3 SDK 开发包 与巨力 有mp3 wma ogg decoder
💻 C
字号:
/*********************************
 *    mp3_sub_menu.c
 *********************************/

#include <string.h>
#include "api.h"
#include "lcd.h"
#include "common.h"
#include "ap_common.h"
#include "display.h" 
#include "ui_menu.h"
#include "ui_pop_up_list.h"
#include "ui_slider.h"
#include "res.h"
#include "prefer.h"
#include "gameblock.h"


INT16U code main_text[4] ={GAMESTAR,GAMESPED,GAMEREP,GAMEEXIT};


static void speed_slider(void);


static void game_sub_action(UINT8 value)
{
	switch(value)
	{
		case 0:
			playGame = 1;    //start games
			menu_stop = 1;
			screen_map(SCREEN_GAME); 
			break;
		case 1:
			speed_slider();  //for game speed
			playGame = 0; 
			menu_stop = 1;	
			//screen_map(SCREEN_GAME);   		
			break;
		case 2:
			menu_stop = 1;
			playGame = 1; 
			screen_map(SCREEN_GAME);                     //restart games			
			break;
		case 3:
#ifdef dynamic_load
			api_vLoad(Code_USER1,1);
#else
			Print("Load Function\n");
#endif				
			break;
	}	
}


void game_sub_menu(void)
{
	globle_menu.total  = 3;
        globle_menu.title  = main_text;
        globle_menu.active = 0;
        globle_menu.action = game_sub_action; 
	gfx_set_bg(COLOR_WHITE);
	playGame = 0; 
	screen_map(SCREEN_MENU);
}


static void speed_action(UINT8 value)
{    	
	tUserPreference.game_speed = value;
	playGame = 1; 
    	screen_map(SCREEN_GAME);
}    	

static void speed_slider(void)
{    	
    	globle_slider.max = 5;
    	globle_slider.min = 1;
    	globle_slider.step = 1;
    	globle_slider.title=main_text[1];
    	globle_slider.value = tUserPreference.game_speed; //dark mode.
    	globle_slider.action = speed_action;
    	screen_map(SCREEN_SLIDER);
}    	


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -