clicks: small update, use scancode keys
git-svn-id: svn://kolibrios.org@6167 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
3e5852cee7
commit
0bf8ef743f
@ -89,8 +89,8 @@ void Draw_List()
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawBar(0, yyy, list[active].w, list[active].item_h, system.color.grab_button);
|
||||
if (i<list[active].count) WriteText(12,yyy+list[active].text_y,0x80,system.color.grab_button_text, #temp_filename);
|
||||
DrawBar(0, yyy, list[active].w, list[active].item_h, 0x94AECE);
|
||||
if (i<list[active].count) WriteText(12,yyy+list[active].text_y,0x80,0x000000, #temp_filename);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2,10 +2,18 @@
|
||||
#define INCLUDE_SYSTEM_H
|
||||
#print "[include <system.h>]\n"
|
||||
|
||||
:struct COLORS
|
||||
{
|
||||
dword frame,grab,grab_button,grab_button_text,grab_text,
|
||||
work,work_button,work_button_text,work_text,work_graph;
|
||||
:struct COLORS {
|
||||
dword
|
||||
nonset1,
|
||||
nonset2,
|
||||
work_light,
|
||||
work_dark,
|
||||
nonset3,
|
||||
work,
|
||||
work_button,
|
||||
work_button_text,
|
||||
work_text,
|
||||
work_graph;
|
||||
void get();
|
||||
};
|
||||
|
||||
@ -13,7 +21,7 @@
|
||||
{
|
||||
EAX = 48;
|
||||
EBX = 3;
|
||||
ECX = #frame;
|
||||
ECX = #nonset1;
|
||||
EDX = 40;
|
||||
$int 0x40
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ system_colors sc;
|
||||
|
||||
//óðîâíè ñëîæíîñòè
|
||||
int DIFFICULTY_LEVEL=1; //ïî-óìîë÷àíèþ ñðåäíåå ïîëå
|
||||
char *BOARD_SIZES[]={ "S", "M", "L", 0 };
|
||||
char *BOARD_SIZES[]={ "S\0", "M\0", "L\0", 0 };
|
||||
int DIFFICULTY_LEV_PARAMS[]={ 9, 12, 16 };
|
||||
|
||||
int BLOCKS_NUM; //êîëè÷åñòâî êâàäðàòèêîâ ïî Õ è ïî Y
|
||||
@ -18,14 +18,14 @@ int blocks_matrix[28*28]; //
|
||||
#define BLOCK_SIZE 21 //ðàçìåð êâàäðàòèêà
|
||||
#define MARKED 7
|
||||
#define DELETED_BLOCK 6
|
||||
#define HEADER "Just Clicks v2.1"
|
||||
#define HEADER "Just Clicks v2.2"
|
||||
|
||||
#ifndef AUTOBUILD
|
||||
#include "lang.h--"
|
||||
#endif
|
||||
|
||||
#ifdef LANG_RUS
|
||||
char NEW_GAME_TEXT[]=" ‡ ®¢® [F2]";
|
||||
char NEW_GAME_TEXT[]="‡ ®¢® [F2]";
|
||||
char REZULT_TEXT[]="<EFBFBD>¥§ã«ìâ â: ";
|
||||
#elif LANG_EST
|
||||
char NEW_GAME_TEXT[]="Uus mäng [F2]";
|
||||
@ -38,7 +38,7 @@ int blocks_matrix[28*28]; //
|
||||
|
||||
void main()
|
||||
{
|
||||
int key, id;
|
||||
int key_scancode, id;
|
||||
|
||||
BLOCKS_NUM=DIFFICULTY_LEV_PARAMS[DIFFICULTY_LEVEL];
|
||||
|
||||
@ -75,10 +75,10 @@ void main()
|
||||
}
|
||||
break;
|
||||
case evKey:
|
||||
key = GetKey();
|
||||
if (key==027) //Escape
|
||||
key_scancode = GetKeyScancode();
|
||||
if (key_scancode==001) //Escape
|
||||
ExitProcess();
|
||||
if (key==051) //F2
|
||||
if (key_scancode==060) //F2
|
||||
{
|
||||
_NEW_GAME_MARK:
|
||||
new_game();
|
||||
@ -181,14 +181,8 @@ void draw_window()
|
||||
|
||||
DrawBar(0,PANEL_Y, PANEL_Y, USER_PANEL_HEIGHT, sc.work); //ïàíåëü ñíèçó
|
||||
|
||||
//íîâàÿ èãðà
|
||||
DefineButton(10,PANEL_Y+7, 13*6+6, 20, 2,sc.work_button);
|
||||
WriteText(10+4,PANEL_Y+14,0x80,sc.work_button_text,#NEW_GAME_TEXT,0);
|
||||
|
||||
|
||||
//êíîïî÷êa âûáîðà óðîâíÿ ñëîæíîñòè
|
||||
DefineButton(95,PANEL_Y+7, 20,20, 10,sc.work_button);
|
||||
WriteText(95+8,PANEL_Y+14,0x80,sc.work_button_text,BOARD_SIZES[DIFFICULTY_LEVEL],0);
|
||||
DrawCaptButton(10, PANEL_Y+7, 90, 20, 2, sc.work_button, sc.work_button_text,#NEW_GAME_TEXT);
|
||||
DrawCaptButton(105,PANEL_Y+7, 20, 20, 10,sc.work_button, sc.work_button_text,BOARD_SIZES[DIFFICULTY_LEVEL]);
|
||||
|
||||
draw_field();
|
||||
|
||||
@ -272,7 +266,7 @@ void draw_field()
|
||||
else
|
||||
{
|
||||
DefineButton(j*BLOCK_SIZE,i*BLOCK_SIZE,BLOCK_SIZE-1,BLOCK_SIZE-1, current_id+100+BT_HIDE,0);
|
||||
PutImage(blocks_matrix[current_id]*1323+#img,21,21,j*BLOCK_SIZE,i*BLOCK_SIZE);
|
||||
PutImage(blocks_matrix[current_id]*1323+#block,21,21,j*BLOCK_SIZE,i*BLOCK_SIZE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,9 @@
|
||||
del lang.h--
|
||||
echo #define LANG_ENG 1 >lang.h--
|
||||
..\C--\C-- clicks.c
|
||||
del clicks
|
||||
rename clicks.com clicks
|
||||
del warning.txt
|
||||
del lang.h--
|
||||
pause
|
||||
@del lang.h--
|
||||
@echo #define LANG_ENG 1 >lang.h--
|
||||
C-- clicks.c
|
||||
@del clicks
|
||||
@rename clicks.com clicks
|
||||
@del warning.txt
|
||||
@del lang.h--
|
||||
@pause
|
||||
@kpack clicks
|
@ -1,8 +1,9 @@
|
||||
del lang.h--
|
||||
echo #define LANG_RUS 1 >lang.h--
|
||||
..\C--\C-- clicks.c
|
||||
del clicks
|
||||
rename clicks.com clicks
|
||||
del warning.txt
|
||||
del lang.h--
|
||||
pause
|
||||
@del lang.h--
|
||||
@echo #define LANG_RUS 1 >lang.h--
|
||||
c-- clicks.c
|
||||
@pause
|
||||
@del clicks
|
||||
@rename clicks.com clicks
|
||||
@del warning.txt
|
||||
@del lang.h--
|
||||
@kpack clicks
|
@ -1,4 +1,4 @@
|
||||
unsigned char img[6615] = {
|
||||
unsigned char block[6615] = {
|
||||
0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2,
|
||||
0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2,
|
||||
0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C,
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.0 KiB |
@ -45,8 +45,18 @@ inline fastcall void GetProcessInfo(dword EBX, ECX)
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
struct system_colors{
|
||||
dword frame,grab,grab_button,grab_button_text,grab_text,work,work_button,work_button_text,work_text,work_graph;
|
||||
struct system_colors {
|
||||
dword
|
||||
nonset1,
|
||||
nonset2,
|
||||
work_light,
|
||||
work_dark,
|
||||
nonset3,
|
||||
work,
|
||||
work_button,
|
||||
work_button_text,
|
||||
work_text,
|
||||
work_graph;
|
||||
void get();
|
||||
};
|
||||
|
||||
@ -55,7 +65,7 @@ void system_colors::get()
|
||||
$push ecx
|
||||
EAX = 48;
|
||||
EBX = 3;
|
||||
ECX = #frame;
|
||||
ECX = #nonset1;
|
||||
EDX = 40;
|
||||
$int 0x40
|
||||
$pop ecx
|
||||
@ -68,11 +78,12 @@ inline fastcall dword WaitEvent(){
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
|
||||
inline fastcall word GetKey(){
|
||||
EAX = 2; // just read it key from buffer
|
||||
$int 0x40
|
||||
EAX = EAX >> 8;
|
||||
int GetKeyScancode()
|
||||
{
|
||||
$mov eax,2
|
||||
$int 0x40
|
||||
$shr eax,16
|
||||
return AL;
|
||||
}
|
||||
|
||||
inline fastcall word GetButtonID(){
|
||||
@ -243,4 +254,12 @@ done:
|
||||
$int 0x40
|
||||
$pop ecx
|
||||
$pop ebx
|
||||
}
|
||||
}
|
||||
|
||||
void DrawCaptButton(dword x,y,w,h,id,color_b, color_t,text)
|
||||
{
|
||||
if (id>0) DefineButton(x,y,w,h,id,color_b);
|
||||
WriteText(-strlen(text)*6+w/2+x+1,h/2-3+y,0x80,color_t,text);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user