示例#1
0
EFI_STATUS
MenuHeader(
    VOID
  )
/*++

Routine Description:

  create the menupage header.

--*/
{
    UINTN i, x;


    ClearArea(0,1,79,1, EFI_BLACK|EFI_BACKGROUND_LIGHTGRAY);
    x = 2;
  for(i=0; i<3; i++)
  {
    ST->ConOut->SetCursorPosition(ST->ConOut, x, 1);
    ST->ConOut->SetAttribute (ST->ConOut,EFI_BLACK|EFI_BACKGROUND_LIGHTGRAY);
    Print(menuItems[i]);

    ST->ConOut->SetCursorPosition(ST->ConOut, x, 1);
    ST->ConOut->SetAttribute (ST->ConOut,EFI_RED|EFI_BACKGROUND_LIGHTGRAY);
    Print(menuItemCapital[i]);

    x = x + StrLen(menuItems[i])+ StrLen(menuItemCapital[i]) +2;
  }

  return EFI_SUCCESS;

 }
示例#2
0
void CWarTower::MobKilled(int target, int conn, int PosX, int PosY)
{
	int GenerateID = pMob[target].GenerateIndex;

	if (GenerateID == GTORRE && GTorreState)
	{
		if (pMob[conn].MOB.Guild)
		{
			int Group = ServerGroup;
			int Server = pMob[conn].MOB.Guild / MAX_GUILD;
			int usGuild = pMob[conn].MOB.Guild;

			char guildname[256];

			BASE_GetGuildName(Group, usGuild, guildname);

			sprintf(temp, g_pMessageStringTable[_SS_BASEWORKILLTOWER], pMob[conn].MOB.MobName, guildname);
			SendNotice(temp);

			GTorreGuild = pMob[conn].MOB.Guild;
		}

		ClearArea(2445, 1850, 2546, 1920);

		GenerateMob(GTORRE, 0, 0);
	}
}
示例#3
0
文件: main.c 项目: ExAcler/Prizm
void Disp_FileNotFound()
{
    /*
	    显示“文件未找到”消息(界面绘制)
	*/

	//MsgBoxPush(4);
	
	beg:
	font16 = open_font("\\\\fls0\\24PX.hzk");
	select_font(font16);
	
	ClearArea(35, 45, 349, 141);
	print_chs_2(94, 71, 0,"文件未找到");
	
	print_chs_2(94, 119, 0, "按");
	locate_OS(8, 5);
	Print_OS(":[EXIT]", 0, 0);
	close_font(font16);
	
	while (1)
	{
	    int key;
	    GetKey(&key);
	    switch (key)
		{
		    case KEY_CTRL_EXIT:
				//MsgBoxPop();
				return; break;
	    }
	}
}
示例#4
0
文件: layer.c 项目: amade/screen
void LClearArea(Layer *l, int xs, int ys, int xe, int ye, int bce, int uself)
{
	int xs2, ys2, xe2, ye2;
	/* Check for zero-height window */
	if (ys < 0 || ye < ys)
		return;

	/* check for magic margin condition */
	if (xs >= l->l_width)
		xs = l->l_width - 1;
	if (xe >= l->l_width)
		xe = l->l_width - 1;
	if (l->l_pause.d)
		LayPauseUpdateRegion(l, xs, xe, ys, ye);
	for (Canvas *cv = l->l_cvlist; cv; cv = cv->c_lnext) {
		if (l->l_pause.d && cv->c_slorient)
			continue;
		display = cv->c_display;
		if (D_blocked)
			continue;
		for (Viewport *vp = cv->c_vplist; vp; vp = vp->v_next) {
			xs2 = xs + vp->v_xoff;
			xe2 = xe + vp->v_xoff;
			ys2 = ys + vp->v_yoff;
			ye2 = ye + vp->v_yoff;
			if (xs2 < vp->v_xs)
				xs2 = vp->v_xs;
			if (xe2 > vp->v_xe)
				xe2 = vp->v_xe;
			if (xs2 > vp->v_xe)
				ys2++;
			if (xe2 < vp->v_xs)
				ye2--;
			if (ys2 < vp->v_ys)
				ys2 = vp->v_ys;
			if (ye2 > vp->v_ye)
				ye2 = vp->v_ye;
			if (ys2 > ye2)
				continue;
			if (xs == 0 || ys2 != ys + vp->v_yoff)
				xs2 = vp->v_xs;
			if (xe == l->l_width - 1 || ye2 != ye + vp->v_yoff)
				xe2 = vp->v_xe;
			display = cv->c_display;
			ClearArea(xs2, ys2, vp->v_xs, vp->v_xe, xe2, ye2, bce, uself);
			if (xe == l->l_width - 1 && xe2 > vp->v_xoff + xe) {
				SetRendition(&mchar_blank);
				for (int y = ys2; y <= ye2; y++) {
					GotoPos(xe + vp->v_xoff + 1, y);
					PUTCHARLP('|');
				}
			}
		}
	}
}
示例#5
0
EFI_STATUS
Print_Menu()
{

    UINTN                     index;
    EFI_INPUT_KEY             Key;

    
  ST->ConOut->QueryMode (
                ST->ConOut,
                ST->ConOut->Mode->Mode,
                &mCols,
                &mRows
                );
    //
    //disable cursor
    //
    ST->ConOut->EnableCursor(ST->ConOut,FALSE);
    ST->ConOut->SetAttribute(ST->ConOut,EFI_WHITE|EFI_BACKGROUND_BLACK);
    ST->ConOut->ClearScreen(ST->ConOut);
    //PrintXY(0,0,NULL,NULL,L"Test Menu %d * %d, mode = %d", mCols, mRows, ST->ConOut->Mode->Mode);
    
    PrintTittle();
    MenuHeader();
    ClearArea(0,2, 79, 23, EFI_WHITE|EFI_BACKGROUND_BLUE);
    
    PrintTail();

    while(TRUE){

        BS->WaitForEvent(1, &ST->ConIn->WaitForKey, &index);
        ST->ConIn->ReadKeyStroke(ST->ConIn, &Key);
        switch(Key.ScanCode)
        {

            case SCAN_ESC:
            ST->ConOut->SetAttribute (ST->ConOut,EFI_WHITE|EFI_BACKGROUND_BLACK);
            ST->ConOut->ClearScreen (ST->ConOut);
            return EFI_SUCCESS;
            break;
            case SCAN_F1:
            PrintSubMenu();
            break;
            case SCAN_NULL:
            break;
            default:
            break;
        }

    }
    

}
示例#6
0
EFI_STATUS
PrintAbout()
{
    UINTN                 index;
    EFI_INPUT_KEY         Key;
    BOOLEAN subwait;

    ClearArea(20, 5, 20+30, 5+5, EFI_BLACK|EFI_BACKGROUND_LIGHTGRAY);
    DrawBOX(21, 6, 10, 49, EFI_BLACK|EFI_BACKGROUND_LIGHTGRAY);
    ST->ConOut->SetCursorPosition(ST->ConOut, 20+10, 5);
    ST->ConOut->SetAttribute (ST->ConOut,EFI_BLACK|EFI_BACKGROUND_LIGHTGRAY);
    Print(L"About");
    ST->ConOut->SetCursorPosition(ST->ConOut, 27, 8);
    Print(L"Test Menu V1.0");
    ST->ConOut->SetCursorPosition(ST->ConOut, 35, 9);
    Print(L"--by KurtQiao");

    subwait = TRUE;
    while(subwait){

        BS->WaitForEvent(1, &ST->ConIn->WaitForKey, &index);
        ST->ConIn->ReadKeyStroke(ST->ConIn, &Key);
        switch(Key.ScanCode)
        {
            case SCAN_ESC:
            subwait = FALSE;
            break;
            
            default:
            break;
        }
    }

    ClearArea(20, 5, 20+30, 5+5, EFI_BLACK|EFI_BACKGROUND_BLUE);
    return EFI_SUCCESS;
}
示例#7
0
EFI_STATUS
PrintTittle(
    VOID
  )
{

    ClearArea(0,0,79,0, EFI_YELLOW|EFI_BACKGROUND_BLACK);
    
    ST->ConOut->SetCursorPosition (ST->ConOut, 30, 0);
    Print(MENU_TITTLE);
    ST->ConOut->SetAttribute (ST->ConOut,EFI_LIGHTBLUE|EFI_BACKGROUND_BLACK);
    ST->ConOut->SetCursorPosition(ST->ConOut, 77-StrLen(MENU_COPYRIGHT), 0);
    Print(MENU_COPYRIGHT);


    return EFI_SUCCESS;

}
示例#8
0
void COverlayRenderer::ClearOverlay(const uint8_t plane)
{
  if (m_pPlanes[plane])
  {
    BD_OVERLAY ov;
    ov.x = 0;
    ov.y = 0;
    ov.w = m_pPlanes[plane]->width;
    ov.h = m_pPlanes[plane]->height;
    ov.plane = plane;

    ClearArea(m_pPlanesBackbuffer[plane], &ov);
  
    m_dirtyRect[plane].left = 0;
    m_dirtyRect[plane].top = 0;
    m_dirtyRect[plane].right = m_pPlanes[plane]->width;
    m_dirtyRect[plane].bottom = m_pPlanes[plane]->height;
  }
}
示例#9
0
文件: main.c 项目: ExAcler/Prizm
void Disp_About()
{
    /*
	    显示关于信息(界面绘制)
	*/

	beg:
	font16 = open_font("\\\\fls0\\24PX.hzk");
	select_font(font16);
	
	MsgBoxPush(5);
	
	ClearArea(35,45,349,166);
	locate_OS(3,2);
	Print_OS("iBooks Pro C",0,0);
	print_chs_2(38, 71, 0, "版本 ");
	locate_OS(7, 3);
	Print_OS("1.50", 0, 0);
	print_chs_2(38, 95, 0, "制作:清水视野工作室");
	print_chs_2(38, 119, 0, "本程序依");
	locate_OS(10, 5);
	Print_OS("GNU GPL v3",0,0);
	print_chs_2(38, 143, 0, "协议开放源代码。");
	close_font(font16);
	
	while (1)
	{
	    int key;
	    GetKey(&key);
	    switch (key)
		{
		    case KEY_CTRL_EXIT:
				MsgBoxPop();
				return;break;
	    }
	}
}
示例#10
0
文件: main.c 项目: ExAcler/Prizm
void Confirm_AllDivide(const char* fn)
{
    /*
	    尝试全部分页(界面绘制)
		参数说明:
		    fn: 当前打开文件的文件名
	*/

	beg:
	font16 = open_font("\\\\fls0\\24PX.hzk");
	select_font(font16);
	
	ClearArea(35,45,349,166);
	print_chs_2(38,47,0,"尝试全部分页可能需要");
	print_chs_2(38,71,0,"很长时间。");
	print_chs_2(38,95,0,"确定继续?");
	
	locate_OS(6,5);
	Print_OS("[F1]:",0,0);print_chs_2(181,119,0,"是");
	locate_OS(6,6);
	Print_OS("[F6]:",0,0);print_chs_2(181,143,0,"否");
	close_font(font16);
	
	while (1)
	{
	    int key;
	    GetKey(&key);
	    switch (key)
		{
		    case KEY_CTRL_F1:
			    divide_page(fn,9999-cached,0);    // 尝试分到 9999 页
				return;break;
			case KEY_CTRL_F6:
				return;break;
	    }
	}
}
示例#11
0
EFI_STATUS
PrintTail(
    VOID
  )
{

    UINTN x, i;

    ClearArea(0,23,79,23, EFI_WHITE|EFI_BACKGROUND_BLACK);
  x = 1;

  for(i=0; i<3; i++)
  {
    ST->ConOut->SetCursorPosition(ST->ConOut, x, 23);
    ST->ConOut->SetAttribute (ST->ConOut,EFI_WHITE|EFI_BACKGROUND_BLACK);
    Print(tailItemkeys[i]);
    x = x + StrLen(tailItemkeys[i]) + 2;
    ST->ConOut->SetCursorPosition(ST->ConOut, x, 23);
    ST->ConOut->SetAttribute (ST->ConOut,EFI_LIGHTGRAY|EFI_BACKGROUND_BLACK);
    Print(tailItems[i]);
    x = x + StrLen(tailItems[i]) +2;
  }
    return EFI_SUCCESS;
}
void WINAPI MainThread()
{
	while(1)
	{
		// Thread Principal da dll, chamada de 1 em 1 segundo. 
		// Usar para não sobrecarregar a ProcessMinTimer
		// Não cometer a negragem de dar break

		time_t rawnow = time(NULL);
		struct tm *now = localtime(&rawnow);

		if((DayOfWeek() == Terça  || DayOfWeek() == Quinta) && now->tm_hour == 21)
		{
			if(!now->tm_min && !now->tm_sec)
			{
				SendNotice("Entrada na GuildWar liberada, boa sorte !");

				//SendLog("system", "Entrada na GuildWar liberada.");

				for(int i = 0; i < 0xFFFF; i++)
					Guilds[i].WarPoints = 0;
			}

			if(now->tm_min == 30 && !now->tm_sec)
			{
				UINT16 Winner = DefineGuildWinner();

				char szMsg[120];

				if(Winner)
				{
					sprintf(szMsg, "Guild %s foi a vencedora da GuildWar, parabéns!", Guilds[Winner].GuildName);
					
					Guilds[Winner].FAME += 1000;
				}
				else
					sprintf(szMsg, "Não houve vencedores na GuildWar.");

				SendNotice(szMsg);
				//SendLog("system", szMsg);
			}
		}

		DecrementWaterTime();
		LettersTime();

		for(int z = 0; z < 0xFFFF; z++)
		{
			if(Guilds[z].confirmTransfer)
				Guilds[z].confirmTransfer--;
			if(!Guilds[z].confirmTransfer)
			{
				Guilds[z].transfer = false;

				strncpy(Guilds[z].NewLiderName, "", 16);
			}
		}

		if(!now->tm_hour && !now->tm_min && !now->tm_sec)// 0:00:00
		{
			if(DayOfWeek() == Sabado)
			{
				*(INT32*)0x008BF1814 = 1;
				SendNotice("++++ DOUBLE EXP ON ++++");
			}
			else if(DayOfWeek() == Segunda)
			{
				*(INT32*)0x008BF1814 = 0;
				SendNotice("++++ DOUBLE EXP OFF ++++");
			}
		}

		if(!now->tm_sec && (now->tm_min == 1 || now->tm_min == 16 || now->tm_min == 31 || now->tm_min == 46))
		{
			for(INT8 i = 0; i < 3; i++)
			{
				Pesa[i].TimeLeft = 840;

				for(INT8 e = 0; e < 3; e++)
				{
					for(INT8 j = 0; j < 13; j++)
					{
						if(Pesa[i].CIDS[e][j] < 0 || Pesa[i].CIDS[e][j] > 750)
							continue;
						else if(Users[Pesa[i].CIDS[e][j]].Status != 22)
							continue;

						SendClientSignalParm(Pesa[i].CIDS[e][j], 0x7530, 0x3A1, Pesa[i].TimeLeft);
					}
				}
			}
		}

		if((now->tm_min == 14 || now->tm_min == 29 || now->tm_min == 44 || now->tm_min == 59) && now->tm_sec == 59)
		{
			ClearArea(1150, 130, 1270, 220); // Pesa A
			ClearArea(1050, 260, 1135, 350); // Pesa M
			ClearArea(1295, 290, 1325, 365); // Pesa N

			for(int i = 0; i < sizeof(QuestList) / sizeof(Quests); i++)
			{
				ClearArea(MaxMinCoordsQuest[i][0], MaxMinCoordsQuest[i][1], MaxMinCoordsQuest[i][2], MaxMinCoordsQuest[i][3]);

				for(int z = 0; z < 40; z++)
					QuestList[i].CidID[z] = 0;
			}

			for(int i = 0; i < sizeof(Pesa) / sizeof(Pesas); i++)
			{
				Pesa[i].Status = false;
				Pesa[i].Groups = 0;
				Pesa[i].NpcsAlive = 0;

				for(int e = 0; e < 13; e++)
				{
					Pesa[i].CIDS[0][e] = 0;
					Pesa[i].CIDS[1][e] = 0;
					Pesa[i].CIDS[2][e] = 0;
				}
			}
		}

		if(!now->tm_sec && !now->tm_min && now->tm_hour == 21 && DayOfWeek() == Domingo)
		{
			INT64 BetValue[4][2];

			for(UINT32 I = 0; I < 0xFFFF; I++)
			{
				// Se não tiver nome, não é uma  guild ativa.
				if(!strcmp(Guilds[I].GuildName, ""))
					continue;

				// Coloca na struct da guerra os valores referentes a guilds apostantes
				for(int e = 0; e < 4; e++)
				{
					if(Guilds[I].BetValue[e] > BetValue[e][0])
					{
						BetValue[e][0] = Guilds[I].BetValue[e];
						War.BetIndex[e][0] = I;
					}
					else if(Guilds[I].BetValue[e] > BetValue[e][1])
					{
						BetValue[e][1] = Guilds[I].BetValue[e];
						War.BetIndex[e][1] = I;
					}

					Guilds[I].BetValue[e] = 0;
				}
			}

		    TeleportWar();
		}
		else if(now->tm_hour == 21 && DayOfWeek() == Domingo && now->tm_min == 3 && !now->tm_sec)
		{
			// Inicio real da pancadaria
			//SendLog("system", "Portões da Guerra abertos.");

			WarGate(1);
		}

		if(now->tm_hour == 21 && DayOfWeek() == Domingo)
		{
			for(int i = 0; i < 4; i++)
			{
				if(!War.Iniciada[i])
					continue;

				int OwnerAlive = GetTeamAlive(i, 0),
					DefyAlive  = GetTeamAlive(i, 1);

				if(!OwnerAlive)// Seta o desafiante como vencedor
					PutAsWinner(i, 1);
				else if(!DefyAlive)// Seta o defensor como vencedor
					PutAsWinner(i, 0);

				if(War.Finalizada[i])
					continue;

				for(int e = 0; e < 2; e++)
				{
					for(int j = 0; j < War.TeamCount[i][e]; j++)
					{
						INT16 cId = 0;

						if(!e)
							cId = War.OwnerTeam[i][j];
						else
							cId = War.DefyTeam[i][j];

						st_Mob *player = GetMobFromIndex(cId);

						if(player->Status.curHP <= 0)
						{
							if(wdBuffer[cId].Ingame.WarRestTime >= 1)
								wdBuffer[cId].Ingame.WarRestTime--;
							else
								wdBuffer[cId].Ingame.cantRessurect = false;
						}

						// Manda o score, não sei se vai funfar...
						NpcsAlive(cId, GetTeamAlive(i, 0), GetTeamAlive(i, 1));
					}
				}
			}
		}

		usersCount = 0;

		for(int i = 0; i < MAX_PLAYER; i++)
		{
			if(Users[i].Status != 22)
				continue;

			usersCount++;

			if(wdBuffer[i].Ingame.ChatGlobal > 0)
				wdBuffer[i].Ingame.ChatGlobal--;
			if(wdBuffer[i].Ingame.hasFailed > 0)
				wdBuffer[i].Ingame.hasFailed--;
			if(wdBuffer[i].Ingame.Grito > 0)
				wdBuffer[i].Ingame.Grito--;
			if(wdBuffer[i].Ingame.RetectItem)
				wdBuffer[i].Ingame.RetectItem--;

			st_Mob *tmpPlayer = GetMobFromIndex(i);

			if(tmpPlayer->Equip[0].EFV2 < HARDCORE && tmpPlayer->Equip[1].Index == 3505 && !wdBuffer[i].Ingame.isAdmin)
			{
				SendBan(Users[i].Username);

				char szNotice[120];

				sprintf(szNotice, "Jogador [%s] banido por uso de item irregular.", tmpPlayer->Name);

				//SendLog("banneds", szNotice);
				//SendNotice(szNotice);

				CloseUser(i);
			}

			for(int i = 0; i < *(DWORD*)(0x004C7BD8); i++) 
				memset((void*)(0x8B9E778), 0, 8);

			VerifyPesa(i);
			VerifyQuests(i);
			//VerifyWarArea(i);
		}

		Server.Seconds++;

		if(Server.Seconds >= 60)
		{
			Server.Seconds -= 60;
			Server.Minuts++;

			if(Server.Minuts >= 60)
			{
				Server.Minuts -= 60;
				Server.Hours++;

				if(Server.Hours >= 24)
				{
					Server.Days++;
					Server.Hours -= 24;
				}
			}
		}

		char szTitle[120];

		if(usersCount)
			sprintf(szTitle, "Secrets of Destiny [%d] Jogadores conectados. [%02d:%02d:%02d:%02d]", usersCount, Server.Days, Server.Hours, Server.Minuts, Server.Seconds);
		else
			sprintf(szTitle, "Secrets of Destiny [%02d:%02d:%02d:%02d]", Server.Days, Server.Hours, Server.Minuts, Server.Seconds);

		SetConsoleTitle(szTitle);

		if(!now->tm_min && !now->tm_sec)
		{
			// Funções executadas todo inicio de hora
			if(!Server.SombraNegra)
			{
				CreateMob("Sombra_Negra", 3819, 2880, "npc");

				Server.SombraNegra = TRUE;

				SendNotice("Sombra Negra acaba de nascer em Karden!");

				//SendLog("system", "Sombra Negra nasceu.");
			}
			else
				SendNotice("Sombra Negra ainda reina em Karden.");
			
			StartThread(PremiumDelivery);
		}

		Sleep(1000);
		// Não colocarei 1000 para termos margem de tempo
		// Para a execução das tarefas desta thread
	}	
}
示例#13
0
文件: main.c 项目: ExAcler/Prizm
int Subdir_Open(const char* fn)
{
    /*
	    子目录文件名输入(界面绘制)
		参数说明:
		    fn: 接收从键盘输入文件名的缓冲区
	*/

	FONTCHARACTER fname[64];
	char keybuff[32];    //  接受文件名的字符缓冲区
	int inspos = 0;
	
	memset(keybuff, 0, sizeof(keybuff));
	MsgBoxPush(4);
	
	beg:
	font16 = open_font("\\\\fls0\\24PX.hzk");
	select_font(font16);
	
	ClearArea(0, 192, 384, 216);
	draw_pic(0, 192, 61, 22, 0, Menu_Sub_Jump);
	
	ClearArea(35, 45, 349, 141);
	print_chs_2(38, 71, 0, "输入欲打开的文件名:");
		
	locate_OS(3, 4);
	Print_OS("[        ].txt", 0, 0);
	locate_OS(4, 4);
	Print_OS(keybuff, 0, 0);
	
	close_font(font16);
	
	while (1)
	{
	    int key;
	    GetKey(&key);
	    switch (key)
		{
			case KEY_CTRL_EXIT:
				MsgBoxPop();
			    return 0; break;
						
			case KEY_CTRL_DEL:
			    if (inspos > 0)
				{
					keybuff[--inspos] = 0;    // 最后一个字节置为 NULL,标识已删除
					goto beg;
				}
			    break;
			
			case KEY_CTRL_F1:
			case KEY_CTRL_EXE:
			    strcpy(fn, keybuff);
				//MsgBoxPop();
				return 1; break;
			
			default:
			    if (key >= 0x30 && key <= 0x39 || key >= 0x41 && key <= 0x5A || key >= 0x61 && key <= 0x7A)    // 输入数字 0~9 或英文字母 a-z、A-Z
				{
				    if (inspos <= 8)
					{
						keybuff[inspos++] = key;    // 最后一个字节添加输入
						goto beg;
					}
				}
		}
	}
}
示例#14
0
文件: main.c 项目: ExAcler/Prizm
void Page_Jump(const char* fn)
{
    /*
	    跳页(界面绘制)
		参数说明:
		    fn: 当前打开文件的文件名
	*/

	FONTCHARACTER fname[64];
	char tip[64],tmp[64];
	char keybuff[32];    //  接受页码的字符缓冲区
	int inspos=0,target;
	
	memset(keybuff, 0, sizeof(keybuff));
	MsgBoxPush(5);
	
	beg:
	font16 = open_font("\\\\fls0\\24PX.hzk");
	select_font(font16);
	
	ClearArea(0,192,384,216);
	draw_pic(0,192,61,22,0,Menu_Sub_Jump);
	draw_pic(63,192,61,22,0,Menu_Jump);
	
	ClearArea(35,45,349,166);
	
	print_chs_2(38,47,0,"当前页/已缓存页数:");
	
	locate_OS(3,3);
	memset(tmp,0,sizeof(tmp));memset(tip,0,sizeof(tip));
	itoa(page+1,tmp,10);strcat(tip,tmp);
    strcat(tip,"/");memset(tmp,0,sizeof(tmp));
	itoa(cached,tmp,10);strcat(tip,tmp);
	Print_OS(tip,0,0);
	
	print_chs_2(38,119,0,"输入目标页码:");
	locate_OS(3,6);
	Print_OS("[    ]",0,0);
	locate_OS(4,6);
	Print_OS(keybuff,0,0);
	
	close_font(font16);
	
	while (1)
	{
	    int key;
	    GetKey(&key);
	    switch (key)
		{
			case KEY_CTRL_EXIT:
				MsgBoxPop();
			    return;break;
			
			case KEY_CTRL_F2:
			    Confirm_AllDivide(fn);    // 尝试全部分页
				goto beg;break;
			
			case KEY_CTRL_DEL:
			    if (inspos>0)
				{
					keybuff[--inspos]=0;    // 最后一个字节置为 NULL,标识已删除
					goto beg;
				}
			    break;
			
			case KEY_CTRL_F1:
			case KEY_CTRL_EXE:
			    if (inspos==0) break;
				target=atoi(keybuff);
				if (target>cached)    // 如果目标位置超出已缓存页面数,尝试分页
				{
				    if (!divide_page(fn, target-cached, 1)) page = cached - 1;    // 若分页已达文件末尾,则将当前页面修正到最后一页
					else page=target-1;    // 否则修正当前页面为输入的目标位置
			    }
				else
				    page=target-1;    // 修正当前页面为输入的目标位置
				MsgBoxPop();
				return;break;
			
			default:
			    if (key>=0x30&&key<=0x39)    // 输入数字 0~9
				{
				    if (inspos<=3)
					{
					    if (key==0x30&&inspos==0) break;    // 尝试第一位输入 0 时跳出
						keybuff[inspos++]=key;    // 最后一个字节添加输入
						goto beg;
					}
				}
		}
	}
}
示例#15
0
文件: main.c 项目: ExAcler/Prizm
void Read_Bookmark(const char* fn,int* pages,int* n)
{
    /*
	    读取书签(界面绘制)
		参数说明:
		    fn: 当前打开文件的文件名
		    pages: 接受当前所在页码的缓冲区
		    n: 接受已缓存页面数的缓冲区
	*/

    int handle,_n=0,_page=*pages;
	int i,sel=0;
	FONTCHARACTER fname[64];
	char tip[64],tmp[64];
	
	MsgBoxPush(5);
	
	beg:
	font16 = open_font("\\\\fls0\\24PX.hzk");
	select_font(font16);
	
	ClearArea(0,192,384,216);
	draw_pic(0,192,61,22,0,Menu_ReadB);
	
	ClearArea(35,49,349,166);
	print_chs_2(38,47,0,"读取书签");
	
	close_font(font16);
	for (i=0;i<4;++i)
	{
	    memset(tmp,0,sizeof(tmp));memset(tip,0,sizeof(tip));
	    strcat(tip,"[");
	    itoa(i+1,tmp,10);strcat(tip,tmp);
		strcat(tip,"]");
        if (bookmark[i])
		{
		    strcat(tip,"     Page ");
		    memset(tmp,0,sizeof(tmp));
		    itoa(bookmark[i],tmp,10);strcat(tip,tmp);
		}
		else strcat(tip,"     Empty");
		locate_OS(3,3+i);
		Print_OS(tip,0,0);
	}

	Bdisp_AreaReverseVRAM(35,72+sel*24,349,94+sel*24);
	
	while (1)
	{
	    int key;
	    GetKey(&key);
	    switch (key)
		{
		    case KEY_CTRL_UP:
			    if (sel>0) --sel;
				goto beg;break;
				
			case KEY_CTRL_DOWN:
			    if (sel<3) ++sel;
				goto beg;break;
				
	        case KEY_CTRL_EXE:
			    if (bookmark[sel])
				{
			        *pages=bookmark[sel]-1;    // 读取书签
					MsgBoxPop();
			        return;
				}
				else goto beg;break;
			
			case KEY_CTRL_F1:
			case KEY_CTRL_EXIT:
			    *pages=_page;
				MsgBoxPop();
			    return;break;
		}
	}
}
示例#16
0
文件: main.c 项目: ExAcler/Prizm
void Save_Bookmark(const char* fn,unsigned int pages,int n)
{
    /*
	    存储书签(界面绘制)
		参数说明:
		    fn: 当前打开文件的文件名
		    pages: 当前所在页码
		    n: 已缓存页面数
	*/

    int handle,size,i=0;
	int sel=0,flag;
	char tip[64],tmp[64];
	
	MsgBoxPush(5);
	
	beg:
	flag=0;
	
	font16 = open_font("\\\\fls0\\24PX.hzk");
	select_font(font16);
	
	ClearArea(0,192,384,216);
	draw_pic(0,192,124,22,0,Menu_PutB);
	
	ClearArea(35,49,349,166);
	print_chs_2(38,47,0,"存储书签");
	
	close_font(font16);
	for (i=0;i<4;++i)
	{
	    memset(tmp,0,sizeof(tmp));memset(tip,0,sizeof(tip));
	    strcat(tip,"[");
	    itoa(i+1,tmp,10);strcat(tip,tmp);
		strcat(tip,"]");
        if (bookmark[i])
		{
		    strcat(tip,"     Page ");
		    memset(tmp,0,sizeof(tmp));
		    itoa(bookmark[i],tmp,10);strcat(tip,tmp);
		}
		else strcat(tip,"     Empty");
		locate_OS(3,3+i);
		Print_OS(tip,0,0);
	}

	Bdisp_AreaReverseVRAM(35,72+sel*24,349,94+sel*24);
	
	while (1)
	{
	    int key;
	    GetKey(&key);
	    switch (key)
		{
		    case KEY_CTRL_UP:
			    if (sel>0) --sel;
				goto beg;break;
				
			case KEY_CTRL_DOWN:
			    if (sel<3) ++sel;
				goto beg;break;
			
			case KEY_CTRL_F1:
	        case KEY_CTRL_EXE:
				bookmark[sel]=pages+1;    // 存储书签
			    goto prg;break;
			
			case KEY_CTRL_F2:
			case KEY_CTRL_DEL:
			    bookmark[sel]=0;flag=1;goto prg;break;    // 删除书签
			
			case KEY_CTRL_EXIT:
				MsgBoxPop();
			    return;
		}
	}
	
	prg:
	Save_Config(fn,n);
	
	if (flag) goto beg;
	MsgBoxPop();
}
示例#17
0
void COverlayRenderer::ProcessOverlay(const BD_OVERLAY* pOv)
{
  if (!pOv)
  {
    CloseOverlay(BD_OVERLAY_IG);
    CloseOverlay(BD_OVERLAY_PG);
    return;
  }
  else if (pOv->plane > BD_OVERLAY_IG)
    return;

  LogCommand(pOv);

  switch (pOv->cmd)
  {
    case BD_OVERLAY_INIT:
      ASSERT(m_overlayType[pOv->plane] == NONE);
      OpenOverlay(pOv);
      m_overlayType[pOv->plane] = NORMAL_OVERLAY;
      return;

    case BD_OVERLAY_CLOSE:
      ASSERT(m_overlayType[pOv->plane] == NORMAL_OVERLAY);
      CloseOverlay(pOv->plane);
      FreeOverlayQueue(pOv->plane);
      m_overlayType[pOv->plane] = NONE;
      return;
  }

  OSDTexture* plane = m_pPlanesBackbuffer[pOv->plane];

  // Workaround for some BDs that wont issue BD_OVERLAY_INIT after BD_OVERLAY_CLOSE
  if (!plane) 
  {
    OpenOverlay(pOv);
    plane = m_pPlanesBackbuffer[pOv->plane];

    if (!plane)
      return;
  }

  switch (pOv->cmd) 
  {
    case BD_OVERLAY_DRAW:
      DrawBitmap(plane, pOv);
      break;

    case BD_OVERLAY_WIPE:
      ClearArea(plane, pOv);
      break;

    case BD_OVERLAY_CLEAR:
      ClearOverlay(pOv->plane);
      break;

    case BD_OVERLAY_HIDE: // TODO
      break;

    case BD_OVERLAY_FLUSH:
    {
      CopyToFrontBuffer(pOv->plane);
      
      OSDTexture* plane = m_pPlanes[pOv->plane];
      m_pLib->HandleOSDUpdate(*plane);
      break;
    }

    default:
      break;
  }
}
示例#18
0
void CWarTower::GuildProcess(tm *timeinfo)
{
	if (NewbieEventServer == 1 && timeinfo->tm_wday != 0 && timeinfo->tm_wday != 6 && timeinfo->tm_hour == GTorreHour)
	{
		if (GTorreState == 0 && timeinfo->tm_min <= 5)
		{
			sprintf(temp, g_pMessageStringTable[_DN_CHANNELWAR_BEGIN], 5);
			SendNotice(temp);
			GTorreState = 1;
			GTorreGuild = 0;
		}

		if (GTorreState == 1 && timeinfo->tm_min >= 6)
		{
			ClearArea(2445, 1850, 2546, 1920);

			GenerateMob(GTORRE, 0, 0);

			SendNotice(g_pMessageStringTable[_DN_BASEWORSTART]);
			GTorreState = 2;
		}

		//A Guerra acabou a guilda que está defendendo a torre recebe 50 de fama.
		if (GTorreState == 2 && timeinfo->tm_min == 59)
		{
			ClearArea(2445, 1850, 2546, 1920);

			for (int i = MAX_USER; i < MAX_MOB; i++)
			{
				if (pMob[i].GenerateIndex == GTORRE)
				{
					if (pMob[i].MOB.Guild)
					{
						int Group = ServerGroup;
						int Server = pMob[i].MOB.Guild / MAX_GUILD;
						int usGuild = pMob[i].MOB.Guild;

						char guildname[256];

						BASE_GetGuildName(Group, usGuild, guildname);

						MSG_GuildInfo sm;

						sm.Type = _MSG_GuildInfo;
						sm.Size = sizeof(MSG_GuildInfo);
						sm.ID = 0;

						sm.Guild = usGuild;
						GuildInfo[usGuild].Fame += 100;

						sm.GuildInfo = GuildInfo[usGuild];

						DBServerSocket.SendOneMessage((char*)&sm, sizeof(MSG_GuildInfo));

						sprintf(temp, "etc,war_tower1 guild:%d guild_fame:%d", usGuild, GuildInfo[usGuild].Fame);
						Log(temp, "-system", 0);
					}

					DeleteMob(i, 1);
				}
			}

			GTorreState = 0;
			GTorreGuild = 0;
		}
	}
}
示例#19
0
EFI_STATUS
PrintSubMenu()
{
    UINTN i,x,y;
    BOOLEAN subwait;
    UINTN                 index;
    EFI_INPUT_KEY         Key;

    ClearArea(1, 2, 10, 5, EFI_BLACK|EFI_BACKGROUND_LIGHTGRAY);
    DrawBOX(1, 2, 5, 10, EFI_BLACK|EFI_BACKGROUND_LIGHTGRAY);

    x=2;
    y=3;
    for(i=0;i<2;i++)
    {
        ST->ConOut->SetCursorPosition(ST->ConOut, x, y+i);
        Print(subMenu[i]);
    }
    //highlight submenu
    i = 0;
    
    subwait = TRUE;
    while(subwait){

        ST->ConOut->SetCursorPosition(ST->ConOut, x, y);
        ST->ConOut->SetAttribute (ST->ConOut,EFI_WHITE|EFI_BACKGROUND_BLACK);
        Print(subMenu[i]);

        BS->WaitForEvent(1, &ST->ConIn->WaitForKey, &index);
        ST->ConIn->ReadKeyStroke(ST->ConIn, &Key);

        ST->ConOut->SetCursorPosition(ST->ConOut, x, y);
        ST->ConOut->SetAttribute (ST->ConOut,EFI_BLACK|EFI_BACKGROUND_LIGHTGRAY);
        Print(subMenu[i]);

        switch(Key.ScanCode)
        {
            case SCAN_ESC:
            subwait = FALSE;
            break;
            case SCAN_DOWN:
            case SCAN_PAGE_DOWN:
                y++;
                i++;
                if (y > 4)
                {    y = 4; i = 1;}
            break;
            case SCAN_UP:
            case SCAN_PAGE_UP:
                y--;
                i--;
                if (y < 3)
                {    y = 3; i = 0;}
            break;
            case SCAN_NULL:
            switch(Key.UnicodeChar) {
              case CHAR_CARRIAGE_RETURN:
                if (i == 1)
                {    ClearArea(1, 2, 10, 5, EFI_BLACK|EFI_BACKGROUND_BLUE);
                    PrintAbout();
                    subwait = FALSE;
                }
                break;
              //case CHAR_TAB:
              //  break;
              default:
                break;
            }
            break;
            default:
            break;
        }

    }

    ClearArea(1, 2, 10, 5, EFI_BLACK|EFI_BACKGROUND_BLUE);

    return EFI_SUCCESS;

}