本文整理汇总了C++中GUI_Mouse_Hide_Safe函数的典型用法代码示例。如果您正苦于以下问题:C++ GUI_Mouse_Hide_Safe函数的具体用法?C++ GUI_Mouse_Hide_Safe怎么用?C++ GUI_Mouse_Hide_Safe使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GUI_Mouse_Hide_Safe函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GUI_FactoryWindow_FailScrollList
static void GUI_FactoryWindow_FailScrollList(int16 step)
{
uint16 i;
uint16 y = 32;
GUI_FactoryWindow_B495_0F30();
GUI_Mouse_Hide_Safe();
GUI_FactoryWindow_B495_0F30();
for (i = 0; i < 6; i++) {
y += step;
GFX_Screen_Copy2(72, y, 72, 16, 32, 136, SCREEN_1, SCREEN_0, false);
}
for (i = 0; i < 6; i++) {
y -= step;
GFX_Screen_Copy2(72, y, 72, 16, 32, 136, SCREEN_1, SCREEN_0, false);
}
GUI_Mouse_Show_Safe();
GUI_FactoryWindow_UpdateSelection(true);
}
开发者ID:Haozerk,项目名称:OpenDUNE,代码行数:25,代码来源:widget_click.c
示例2: GameLoop_DrawMenu
static void GameLoop_DrawMenu(const char **strings)
{
WidgetProperties *props;
uint16 left;
uint16 top;
uint8 i;
props = &g_widgetProperties[21];
top = g_curWidgetYBase + props->yBase;
left = (g_curWidgetXBase + props->xBase) << 3;
GUI_Mouse_Hide_Safe();
for (i = 0; i < props->height; i++) {
uint16 pos = top + g_fontCurrent->height * i;
if (i == props->fgColourBlink) {
GUI_DrawText_Wrapper(strings[i], left, pos, props->fgColourSelected, 0, 0x22);
} else {
GUI_DrawText_Wrapper(strings[i], left, pos, props->fgColourNormal, 0, 0x22);
}
}
GUI_Mouse_Show_Safe();
Input_History_Clear();
}
开发者ID:166MMX,项目名称:OpenDUNE,代码行数:27,代码来源:opendune.c
示例3: async_GUI_Mentat_ShowOpen
void async_GUI_Mentat_ShowOpen() {
Sprites_UnloadTiles();
GUI_Mentat_Display(asyncMentatShow.wsaFilename, g_playerHouseID);
GFX_Screen_SetActive(2);
Widget_SetAndPaintCurrentWidget(8);
if (asyncMentatShow.wsaFilename != NULL) {
void *wsa;
wsa = WSA_LoadFile(asyncMentatShow.wsaFilename, GFX_Screen_Get_ByIndex(5), GFX_Screen_GetSize_ByIndex(5), false);
WSA_DisplayFrame(wsa, 0, g_curWidgetXBase * 8, g_curWidgetYBase, 2);
WSA_Unload(wsa);
}
GUI_DrawSprite(2, g_sprites[397 + g_playerHouseID * 15], g_shoulderLeft, g_shoulderTop, 0, 0);
GFX_Screen_SetActive(0);
GUI_Mouse_Hide_Safe();
GUI_Screen_Copy(0, 0, 0, 0, SCREEN_WIDTH / 8, SCREEN_HEIGHT, 2, 0);
GUI_Mouse_Show_Safe();
GUI_SetPaletteAnimated(g_palette1, 15);
Async_GUI_Mentat_Loop(asyncMentatShow.wsaFilename, NULL, asyncMentatShow.stringBuffer, true, NULL);
Async_Storage_uint16(&asyncMentatShow.ret);
}
开发者ID:damajor,项目名称:play-dune,代码行数:29,代码来源:mentat.c
示例4: AsyncGUI_Mentat_ShowHelpList
/**
* Shows the Help window.
* @param proceed Display a "Proceed" button if true, "Exit" otherwise.
*/
static void AsyncGUI_Mentat_ShowHelpList(bool proceed)
{
GUI_Mentat_ShowHelpList_oldScreenID = GFX_Screen_SetActive(2);
Input_Flags_SetBits(INPUT_FLAG_KEY_REPEAT);
Input_History_Clear();
GUI_Mentat_Display(NULL, g_playerHouseID);
g_widgetMentatFirst = GUI_Widget_Allocate(1, GUI_Widget_GetShortcut(*String_Get_ByIndex(STR_EXIT)), 200, 168, proceed ? 379 : 377, 5);
g_widgetMentatFirst->shortcut2 = 'n';
GUI_Mentat_Create_HelpScreen_Widgets();
GUI_Mouse_Hide_Safe();
GUI_Screen_Copy(0, 0, 0, 0, SCREEN_WIDTH / 8, SCREEN_HEIGHT, 2, 0);
GUI_Mouse_Show_Safe();
GUI_Mentat_LoadHelpSubjects(true);
GUI_Mentat_Draw(true);
GFX_Screen_SetActive(0);
AsyncGUI_Mentat_HelpListLoop();
Async_InvokeAfterAsync(GUI_Mentat_ShowHelpList_Close);
}
开发者ID:damajor,项目名称:play-dune,代码行数:31,代码来源:mentat.c
示例5: GUI_Window_RestoreScreen
static void GUI_Window_RestoreScreen(WindowDesc *desc)
{
Widget_SetCurrentWidget(desc->index);
GUI_Mouse_Hide_Safe();
GFX_CopyFromBuffer(g_curWidgetXBase * 8, g_curWidgetYBase, g_curWidgetWidth * 8, g_curWidgetHeight, GFX_Screen_Get_ByIndex(SCREEN_2));
GUI_Mouse_Show_Safe();
}
开发者ID:Haozerk,项目名称:OpenDUNE,代码行数:8,代码来源:widget_click.c
示例6: GUI_Window_BackupScreen
static void GUI_Window_BackupScreen(WindowDesc *desc)
{
Widget_SetCurrentWidget(desc->index);
GUI_Mouse_Hide_Safe();
GFX_CopyToBuffer(g_curWidgetXBase * 8, g_curWidgetYBase, g_curWidgetWidth * 8, g_curWidgetHeight, GFX_Screen_Get_ByIndex(5));
GUI_Mouse_Show_Safe();
}
开发者ID:alex-game-of-2012,项目名称:opendune,代码行数:8,代码来源:widget_click.c
示例7: House_UpdateRadarState
/**
* Updates the radar state for the given house.
* @param h The house.
* @return True if and only if the radar has been activated.
*/
bool House_UpdateRadarState(House *h)
{
void *wsa;
uint16 frame;
uint16 frameCount;
bool activate;
if (h == NULL || h->index != g_playerHouseID) return false;
wsa = NULL;
activate = h->flags.radarActivated;
if (h->flags.radarActivated) {
/* Deactivate radar */
if ((h->structuresBuilt & (1 << STRUCTURE_OUTPOST)) == 0 || h->powerProduction < h->powerUsage) activate = false;
} else {
/* Activate radar */
if ((h->structuresBuilt & (1 << STRUCTURE_OUTPOST)) != 0 && h->powerProduction >= h->powerUsage) activate = true;
}
if (h->flags.radarActivated == activate) return false;
wsa = WSA_LoadFile("STATIC.WSA", GFX_Screen_Get_ByIndex(3), GFX_Screen_GetSize_ByIndex(3), true);
frameCount = WSA_GetFrameCount(wsa);
g_textDisplayNeedsUpdate = true;
GUI_Mouse_Hide_Safe();
while (Driver_Voice_IsPlaying()) sleepIdle();
Voice_Play(62);
Sound_Output_Feedback(activate ? 28 : 29);
frameCount = WSA_GetFrameCount(wsa);
for (frame = 0; frame < frameCount; frame++) {
WSA_DisplayFrame(wsa, activate ? frameCount - frame : frame, 256, 136, 0);
GUI_PaletteAnimate();
g_timerTimeout = 3;
while (g_timerTimeout != 0) sleepIdle();
}
h->flags.radarActivated = activate;
WSA_Unload(wsa);
g_viewport_forceRedraw = true;
GUI_Mouse_Show_Safe();
GUI_Widget_Viewport_RedrawMap(0);
return activate;
}
开发者ID:damajor,项目名称:play-dune,代码行数:63,代码来源:house.c
示例8: GUI_Mentat_Show
/**
* Show the Mentat screen.
* @param spriteBuffer The buffer of the strings.
* @param wsaFilename The WSA to show.
* @param w The widgets to handle. Can be NULL for no widgets.
* @param unknown A boolean.
* @return Return value of GUI_Widget_HandleEvents() or f__B4DA_0AB8_002A_AAB2() (latter when no widgets).
*/
uint16 GUI_Mentat_Show(char *stringBuffer, const char *wsaFilename, Widget *w, bool unknown)
{
uint16 ret;
Sprites_UnloadTiles();
GUI_Mentat_Display(wsaFilename, g_playerHouseID);
GFX_Screen_SetActive(SCREEN_1);
Widget_SetAndPaintCurrentWidget(8);
if (wsaFilename != NULL) {
void *wsa;
wsa = WSA_LoadFile(wsaFilename, GFX_Screen_Get_ByIndex(SCREEN_2), GFX_Screen_GetSize_ByIndex(SCREEN_2), false);
WSA_DisplayFrame(wsa, 0, g_curWidgetXBase * 8, g_curWidgetYBase, SCREEN_1);
WSA_Unload(wsa);
}
GUI_DrawSprite(SCREEN_1, g_sprites[397 + g_playerHouseID * 15], g_shoulderLeft, g_shoulderTop, 0, 0);
GFX_Screen_SetActive(SCREEN_0);
GUI_Mouse_Hide_Safe();
GUI_Screen_Copy(0, 0, 0, 0, SCREEN_WIDTH / 8, SCREEN_HEIGHT, SCREEN_1, SCREEN_0);
GUI_Mouse_Show_Safe();
GUI_SetPaletteAnimated(g_palette1, 15);
ret = GUI_Mentat_Loop(wsaFilename, NULL, stringBuffer, true, NULL);
if (w != NULL) {
do {
GUI_Widget_DrawAll(w);
ret = GUI_Widget_HandleEvents(w);
GUI_PaletteAnimate();
GUI_Mentat_Animation(0);
sleepIdle();
} while ((ret & 0x8000) == 0);
}
Input_History_Clear();
if (unknown) {
Load_Palette_Mercenaries();
Sprites_LoadTiles();
}
return ret;
}
开发者ID:gnaghi,项目名称:OpenDUNE,代码行数:60,代码来源:mentat.c
示例9: GameLoop_DrawText2
static void GameLoop_DrawText2(const char *string, uint16 left, uint16 top, uint8 fgColourNormal, uint8 fgColourSelected, uint8 bgColour)
{
uint8 i;
for (i = 0; i < 3; i++) {
GUI_Mouse_Hide_Safe();
GUI_DrawText_Wrapper(string, left, top, fgColourSelected, bgColour, 0x22);
Timer_Sleep(2);
GUI_DrawText_Wrapper(string, left, top, fgColourNormal, bgColour, 0x22);
GUI_Mouse_Show_Safe();
Timer_Sleep(2);
}
}
开发者ID:166MMX,项目名称:OpenDUNE,代码行数:15,代码来源:opendune.c
示例10: GUI_Mentat_ShowHelpList
/**
* Shows the Help window.
* @param proceed Display a "Proceed" button if true, "Exit" otherwise.
*/
static void GUI_Mentat_ShowHelpList(bool proceed)
{
Screen oldScreenID;
oldScreenID = GFX_Screen_SetActive(SCREEN_1);
/* ENHANCEMENT -- After visiting Mentat (the help) window, auto-repeat of keys gets disabled. */
if (!g_dune2_enhanced) Input_Flags_SetBits(INPUT_FLAG_KEY_REPEAT);
Input_History_Clear();
GUI_Mentat_Display(NULL, g_playerHouseID);
g_widgetMentatFirst = GUI_Widget_Allocate(1, GUI_Widget_GetShortcut(*String_Get_ByIndex(STR_EXIT)), 200, 168, proceed ? 379 : 377, 5);
g_widgetMentatFirst->shortcut2 = 'n';
GUI_Mentat_Create_HelpScreen_Widgets();
GUI_Mouse_Hide_Safe();
GUI_Screen_Copy(0, 0, 0, 0, SCREEN_WIDTH / 8, SCREEN_HEIGHT, SCREEN_1, SCREEN_0);
GUI_Mouse_Show_Safe();
GUI_Mentat_LoadHelpSubjects(true);
GUI_Mentat_Draw(true);
GFX_Screen_SetActive(SCREEN_0);
GUI_Mentat_HelpListLoop();
free(g_widgetMentatFirst);
g_widgetMentatFirst = NULL;
Load_Palette_Mercenaries();
GUI_Widget_Free_WithScrollbar(g_widgetMentatScrollbar);
g_widgetMentatScrollbar = NULL;
free(g_widgetMentatScrollUp);
g_widgetMentatScrollUp = NULL;
free(g_widgetMentatScrollDown);
g_widgetMentatScrollDown = NULL;
/* ENHANCEMENT -- After visiting Mentat (the help) window, auto-repeat of keys gets disabled. */
if (!g_dune2_enhanced) Input_Flags_ClearBits(INPUT_FLAG_KEY_REPEAT);
GFX_Screen_SetActive(oldScreenID);
}
开发者ID:gnaghi,项目名称:OpenDUNE,代码行数:51,代码来源:mentat.c
示例11: GUI_Mentat_ShowHelpList
/**
* Shows the Help window.
* @param proceed Display a "Proceed" button if true, "Exit" otherwise.
*/
static void GUI_Mentat_ShowHelpList(bool proceed)
{
uint16 oldScreenID;
oldScreenID = GFX_Screen_SetActive(2);
Input_Flags_SetBits(INPUT_FLAG_KEY_REPEAT);
Input_History_Clear();
GUI_Mentat_Display(NULL, g_playerHouseID);
g_widgetMentatFirst = GUI_Widget_Allocate(1, GUI_Widget_GetShortcut(*String_Get_ByIndex(STR_EXIT)), 200, 168, proceed ? 379 : 377, 5);
g_widgetMentatFirst->shortcut2 = 'n';
GUI_Mentat_Create_HelpScreen_Widgets();
GUI_Mouse_Hide_Safe();
GUI_Screen_Copy(0, 0, 0, 0, SCREEN_WIDTH / 8, SCREEN_HEIGHT, 2, 0);
GUI_Mouse_Show_Safe();
GUI_Mentat_LoadHelpSubjects(true);
GUI_Mentat_Draw(true);
GFX_Screen_SetActive(0);
GUI_Mentat_HelpListLoop();
free(g_widgetMentatFirst); g_widgetMentatFirst = NULL;
Load_Palette_Mercenaries();
GUI_Widget_Free_WithScrollbar(g_widgetMentatScrollbar);
g_widgetMentatScrollbar = NULL;
free(g_widgetMentatScrollUp); g_widgetMentatScrollUp = NULL;
free(g_widgetMentatScrollDown); g_widgetMentatScrollDown = NULL;
Input_Flags_ClearBits(INPUT_FLAG_KEY_REPEAT);
GFX_Screen_SetActive(oldScreenID);
}
开发者ID:alex-game-of-2012,项目名称:opendune,代码行数:46,代码来源:mentat.c
示例12: GUI_EditBox_BlinkCursor
/**
* Draw a blinking cursor, used inside the EditBox.
*
* @param positionX Where to draw the cursor on the X position.
* @param resetBlink If true, the blinking is reset and restarted.
*/
static void GUI_EditBox_BlinkCursor(uint16 positionX, bool resetBlink)
{
static uint32 tickEditBox = 0; /* Ticker for cursor blinking. */
static bool editBoxShowCursor = false; /* Cursor is active. */
if (resetBlink) {
tickEditBox = 0;
editBoxShowCursor = true;
}
if (tickEditBox > g_timerGUI) return;
if (!resetBlink) {
tickEditBox = g_timerGUI + 20;
}
editBoxShowCursor = !editBoxShowCursor;
GUI_Mouse_Hide_Safe();
GUI_DrawFilledRectangle(positionX, g_curWidgetYBase, positionX + Font_GetCharWidth('W'), g_curWidgetYBase + g_curWidgetHeight - 1, (editBoxShowCursor) ? g_curWidgetFGColourBlink : g_curWidgetFGColourNormal);
GUI_Mouse_Show_Safe();
}
开发者ID:166MMX,项目名称:OpenDUNE,代码行数:27,代码来源:editbox.c
示例13: GUI_Security_UndrawText
static void GUI_Security_UndrawText(void)
{
GUI_Mouse_Hide_Safe();
GUI_Screen_Copy(0, 160, 0, 0, SCREEN_WIDTH / 8, 40, SCREEN_2, SCREEN_0);
GUI_Mouse_Show_Safe();
}
开发者ID:gnaghi,项目名称:OpenDUNE,代码行数:6,代码来源:security.c
示例14: GUI_Mentat_Draw
static void GUI_Mentat_Draw(bool force)
{
static uint16 displayedHelpSubject = 0;
Screen oldScreenID;
Widget *line;
Widget *w = g_widgetMentatTail;
uint8 *helpSubjects = s_helpSubjects;
uint16 i;
if (!force && s_topHelpList == displayedHelpSubject) return;
displayedHelpSubject = s_topHelpList;
oldScreenID = GFX_Screen_SetActive(SCREEN_1);
Widget_SetAndPaintCurrentWidget(8);
GUI_DrawSprite(SCREEN_1, g_sprites[397 + g_playerHouseID * 15], g_shoulderLeft, g_shoulderTop, 0, 0);
GUI_DrawText_Wrapper(String_Get_ByIndex(STR_SELECT_SUBJECT), (g_curWidgetXBase << 3) + 16, g_curWidgetYBase + 2, 12, 0, 0x12);
GUI_DrawText_Wrapper(NULL, 0, 0, 0, 0, 0x11);
line = GUI_Widget_Get_ByIndex(w, 3);
for (i = 0; i < 11; i++) {
line->drawParameterDown.text = (char *)helpSubjects + 7;
line->drawParameterSelected.text = (char *)helpSubjects + 7;
line->drawParameterNormal.text = (char *)helpSubjects + 7;
if (helpSubjects[6] == '0') {
line->offsetX = 16;
line->fgColourSelected = 11;
line->fgColourDown = 11;
line->fgColourNormal = 11;
line->stringID = 0x30;
} else {
uint8 colour = (i == s_selectedHelpSubject) ? 8 : 15;
line->offsetX = 24;
line->fgColourSelected = colour;
line->fgColourDown = colour;
line->fgColourNormal = colour;
line->stringID = 0x31;
}
GUI_Widget_MakeNormal(line, false);
GUI_Widget_Draw(line);
line = GUI_Widget_GetNext(line);
helpSubjects = String_NextString(helpSubjects);
}
GUI_Widget_Scrollbar_Init(GUI_Widget_Get_ByIndex(w, 15), s_numberHelpSubjects, 11, s_topHelpList);
GUI_Widget_Draw(GUI_Widget_Get_ByIndex(w, 16));
GUI_Widget_Draw(GUI_Widget_Get_ByIndex(w, 17));
GUI_Mouse_Hide_Safe();
GUI_Screen_Copy(g_curWidgetXBase, g_curWidgetYBase, g_curWidgetXBase, g_curWidgetYBase, g_curWidgetWidth, g_curWidgetHeight, SCREEN_1, SCREEN_0);
GUI_Mouse_Show_Safe();
GFX_Screen_SetActive(oldScreenID);
}
开发者ID:gnaghi,项目名称:OpenDUNE,代码行数:61,代码来源:mentat.c
示例15: GUI_Widget_Savegame_Click
/**
* Handles Click event for savegame button.
*
* @param key The index of the clicked button.
* @return True if a game has been saved, False otherwise.
*/
static bool GUI_Widget_Savegame_Click(uint16 key)
{
WindowDesc *desc = &g_savegameNameWindowDesc;
bool loop;
char *saveDesc = g_savegameDesc[key];
uint16 loc08;
uint16 loc0A;
bool ret;
if (*saveDesc == '[') *saveDesc = 0;
GUI_Window_BackupScreen(desc);
GUI_Window_Create(desc);
ret = false;
loc08 = 1;
if (*saveDesc == '[') key = s_savegameCountOnDisk;
GFX_Screen_SetActive(SCREEN_0);
Widget_SetCurrentWidget(15);
GUI_Mouse_Hide_Safe();
GUI_DrawBorder((g_curWidgetXBase << 3) - 1, g_curWidgetYBase - 1, (g_curWidgetWidth << 3) + 2, g_curWidgetHeight + 2, 4, false);
GUI_Mouse_Show_Safe();
for (loop = true; loop; sleepIdle()) {
Widget *w = g_widgetLinkedListTail;
GUI_DrawText_Wrapper(NULL, 0, 0, 232, 235, 0x22);
loc0A = GUI_EditBox(saveDesc, 50, 15, g_widgetLinkedListTail, NULL, loc08);
loc08 = 2;
if ((loc0A & 0x8000) == 0) continue;
GUI_Widget_MakeNormal(GUI_Widget_Get_ByIndex(w, loc0A & 0x7FFF), false);
switch (loc0A & 0x7FFF) {
case 0x1E:
if (*saveDesc == 0) break;
SaveFile(GenerateSavegameFilename(s_savegameIndexBase - key), saveDesc);
loop = false;
ret = true;
break;
case 0x1F:
loop = false;
ret = false;
FillSavegameDesc(true);
break;
default: break;
}
}
GUI_Window_RestoreScreen(desc);
return ret;
}
开发者ID:Haozerk,项目名称:OpenDUNE,代码行数:69,代码来源:widget_click.c
示例16: GUI_Security_Show
/**
* Ask the security question to the user. Give him 3 times. If he fails,
* return false, otherwise true.
* @return True if and only if the user answered one of the three questions
* correct.
*/
bool GUI_Security_Show(void)
{
const char *wsaHouseFilename;
uint16 questionsCount;
uint16 oldCurrentWidget;
Screen oldScreenID;
uint16 i;
bool valid;
g_disableOtherMovement = true;
g_interrogation = true;
wsaHouseFilename = House_GetWSAHouseFilename(g_playerHouseID);
if (wsaHouseFilename == NULL) return true;
GUI_SetPaletteAnimated(g_palette2, 15);
GUI_Mentat_Display(wsaHouseFilename, g_playerHouseID);
GUI_Mouse_Hide_Safe();
GUI_Screen_Copy(0, 0, 0, 0, SCREEN_WIDTH / 8, SCREEN_HEIGHT, SCREEN_1, SCREEN_0);
GUI_Mouse_Show_Safe();
GUI_SetPaletteAnimated(g_palette1, 15);
strncpy(g_readBuffer, String_Get_ByIndex(STR_SECURITY_TEXT_HARKONNEN + g_playerHouseID * 3), g_readBufferSize);
GUI_Mentat_Loop(wsaHouseFilename, NULL, g_readBuffer, true, NULL);
questionsCount = atoi(String_Get_ByIndex(STR_SECURITY_COUNT));
oldCurrentWidget = Widget_SetCurrentWidget(8);
oldScreenID = GFX_Screen_SetActive(SCREEN_2);
for (i = 0, valid = false; i < 3 && !valid; i++) {
void *wsa;
uint16 questionIndex;
uint32 tickWaitTill;
char buffer[81];
questionIndex = Tools_RandomLCG_Range(0, questionsCount - 1) * 3 + STR_SECURITY_QUESTIONS;
Widget_SetCurrentWidget(8);
wsa = WSA_LoadFile(String_Get_ByIndex(questionIndex + 1), GFX_Screen_Get_ByIndex(SCREEN_1), GFX_Screen_GetSize_ByIndex(SCREEN_1), false);
WSA_DisplayFrame(wsa, 0, g_curWidgetXBase << 3, g_curWidgetYBase, SCREEN_2);
WSA_Unload(wsa);
GUI_DrawSprite(SCREEN_2, g_sprites[397 + g_playerHouseID * 15], g_shoulderLeft, g_shoulderTop, 0, 0);
GUI_Mouse_Hide_InWidget(g_curWidgetIndex);
GUI_Screen_Copy(g_curWidgetXBase, g_curWidgetYBase, g_curWidgetXBase, g_curWidgetYBase, g_curWidgetWidth, g_curWidgetHeight, SCREEN_2, SCREEN_0);
GUI_Mouse_Show_InWidget();
strncpy(g_readBuffer, String_Get_ByIndex(questionIndex), g_readBufferSize);
GUI_Security_DrawText(g_readBuffer);
g_interrogationTimer = g_timerGUI + (uint32)strlen(g_readBuffer) * 4;
Widget_SetCurrentWidget(9);
GUI_Mouse_Hide_Safe();
GUI_Screen_Copy(g_curWidgetXBase - 1, g_curWidgetYBase - 8, 0, 0, g_curWidgetWidth + 2, g_curWidgetHeight + 16, SCREEN_0, SCREEN_2);
GUI_Mouse_Show_Safe();
GFX_Screen_SetActive(SCREEN_0);
GUI_Mouse_Hide_Safe();
GUI_DrawBorder((g_curWidgetXBase << 3) - 6, g_curWidgetYBase - 6, (g_curWidgetWidth << 3) + 12, g_curWidgetHeight + 12, 1, true);
GUI_DrawBorder((g_curWidgetXBase << 3) - 2, g_curWidgetYBase - 2, (g_curWidgetWidth << 3) + 4, g_curWidgetHeight + 4, 2, false);
GUI_Mouse_Show_Safe();
Input_History_Clear();
buffer[0] = 0;
GUI_DrawText_Wrapper(NULL, 0, 0, 0, 0, 0x22);
GUI_EditBox(buffer, sizeof(buffer) - 1, 9, NULL, &GUI_Mentat_Tick, 0);
GUI_Security_UndrawText();
GUI_Mouse_Hide_Safe();
GUI_Screen_Copy(0, 0, g_curWidgetXBase - 1, g_curWidgetYBase - 8, g_curWidgetWidth + 2, g_curWidgetHeight + 16, SCREEN_2, SCREEN_0);
GUI_Mouse_Show_Safe();
GUI_Security_NormaliseText(buffer);
strncpy(g_readBuffer, String_Get_ByIndex(questionIndex + 2), g_readBufferSize);
GUI_Security_NormaliseText(g_readBuffer);
if (strcasecmp(g_readBuffer, buffer) != 0) {
strncpy(g_readBuffer, String_Get_ByIndex(STR_SECURITY_WRONG_HARKONNEN + g_playerHouseID * 3), g_readBufferSize);
} else {
//.........这里部分代码省略.........
开发者ID:gnaghi,项目名称:OpenDUNE,代码行数:101,代码来源:security.c
示例17: Mouse_SetMouseMode
void Mouse_SetMouseMode(uint8 mouseMode, const char *filename)
{
switch (mouseMode) {
default: break;
case INPUT_MOUSE_MODE_NORMAL:
g_mouseMode = mouseMode;
if (g_mouseFileID != 0xFF) {
Input_Flags_ClearBits(INPUT_FLAG_KEY_RELEASE);
File_Close(g_mouseFileID);
}
g_mouseFileID = 0xFF;
g_var_701B = true;
break;
case INPUT_MOUSE_MODE_RECORD:
if (g_mouseFileID != 0xFF) break;
File_Delete(filename);
File_Create(filename);
Tools_RandomLCG_Seed(0x21433412);
g_mouseFileID = File_Open(filename, 3);
g_mouseMode = mouseMode;
Input_Flags_SetBits(INPUT_FLAG_KEY_RELEASE);
Input_HandleInput(0x2D);
break;
case INPUT_MOUSE_MODE_PLAY:
if (g_mouseFileID == 0xFF) {
g_mouseFileID = File_Open(filename, 1);
Tools_RandomLCG_Seed(0x21433412);
}
g_var_701B = true;
File_Read(g_mouseFileID, &g_var_7013, 2);
if (File_Read(g_mouseFileID, &g_var_7015, 2) != 2) break;;
if ((g_var_7013 >= 0x41 && g_var_7013 <= 0x44) || g_var_7013 == 0x2D) {
File_Read(g_mouseFileID, &g_var_7017, 2);
if (File_Read(g_mouseFileID, &g_var_7019, 2) == 2) {
g_mouseX = g_var_7017;
g_mouseY = g_var_7019;
g_prevButtonState = 0;
GUI_Mouse_Hide_Safe();
GUI_Mouse_Show_Safe();
g_var_701B = false;
break;
}
g_var_701B = true;
break;
}
g_var_701B = false;
break;
}
g_timerInput = 0;
g_mouseMode = mouseMode;
}
开发者ID:HBTeun,项目名称:OpenDUNE,代码行数:67,代码来源:mouse.c
示例18: GameLoop_LevelEnd
/**
* Checks if the level comes to an end. If so, it shows all end-level stuff,
* and prepares for the next level.
*/
static void GameLoop_LevelEnd(void)
{
static uint32 levelEndTimer = 0;
if (levelEndTimer >= g_timerGame && !s_debugForceWin) return;
if (GameLoop_IsLevelFinished()) {
Music_Play(0);
g_cursorSpriteID = 0;
Sprites_SetMouseSprite(0, 0, g_sprites[0]);
Sound_Output_Feedback(0xFFFE);
GUI_ChangeSelectionType(SELECTIONTYPE_MENTAT);
if (GameLoop_IsLevelWon()) {
Sound_Output_Feedback(40);
GUI_DisplayModalMessage(String_Get_ByIndex(STR_YOU_HAVE_SUCCESSFULLY_COMPLETED_YOUR_MISSION), 0xFFFF);
GUI_Mentat_ShowWin();
Sprites_UnloadTiles();
g_campaignID++;
GUI_EndStats_Show(g_scenario.killedAllied, g_scenario.killedEnemy, g_scenario.destroyedAllied, g_scenario.destroyedEnemy, g_scenario.harvestedAllied, g_scenario.harvestedEnemy, g_scenario.score, g_playerHouseID);
if (g_campaignID == 9) {
GUI_Mouse_Hide_Safe();
GUI_SetPaletteAnimated(g_palette2, 15);
GUI_ClearScreen(SCREEN_0);
GameLoop_GameEndAnimation();
PrepareEnd();
exit(0);
}
GUI_Mouse_Hide_Safe();
GameLoop_LevelEndAnimation();
GUI_Mouse_Show_Safe();
File_ReadBlockFile("IBM.PAL", g_palette1, 256 * 3);
g_scenarioID = GUI_StrategicMap_Show(g_campaignID, true);
GUI_SetPaletteAnimated(g_palette2, 15);
if (g_campaignID == 1 || g_campaignID == 7) {
if (!GUI_Security_Show()) {
PrepareEnd();
exit(0);
}
}
} else {
Sound_Output_Feedback(41);
GUI_DisplayModalMessage(String_Get_ByIndex(STR_YOU_HAVE_FAILED_YOUR_MISSION), 0xFFFF);
GUI_Mentat_ShowLose();
Sprites_UnloadTiles();
g_scenarioID = GUI_StrategicMap_Show(g_campaignID, false);
}
g_playerHouse->flags.doneFullScaleAttack = false;
Sprites_LoadTiles();
g_gameMode = GM_RESTART;
s_debugForceWin = false;
}
levelEndTimer = g_timerGame + 300;
}
开发者ID:166MMX,项目名称:OpenDUNE,代码行数:82,代码来源:opendune.c
示例19: GUI_EditBox
/**
* Show an EditBox and handles the input.
* @param text The text to edit. Uses the pointer to make the modifications.
* @param maxLength The maximum length of the text.
* @param unknown1 Unknown.
* @param w The widget this editbox is attached to.
* @param tickProc The function to call every tick, for animation etc.
* @param unknown4 Unknown.
* @return Unknown.
*/
uint16 GUI_EditBox(char *text, uint16 maxLength, uint16 unknown1, Widget *w, uint16 (*tickProc)(void), uint16 unknown4)
{
Screen oldScreenID;
uint16 oldValue_07AE_0000;
uint16 positionX;
uint16 maxWidth;
uint16 textWidth;
uint16 textLength;
uint16 returnValue;
char *t;
/* Initialize */
{
Input_Flags_SetBits(INPUT_FLAG_NO_TRANSLATE);
Input_Flags_ClearBits(INPUT_FLAG_UNKNOWN_2000);
oldScreenID = GFX_Screen_SetActive(SCREEN_0);
oldValue_07AE_0000 = Widget_SetCurrentWidget(unknown1);
returnValue = 0x0;
}
positionX = g_curWidgetXBase << 3;
textWidth = 0;
textLength = 0;
maxWidth = (g_curWidgetWidth << 3) - Font_GetCharWidth('W') - 1;
t = text;
/* Calculate the length and width of the current string */
for (; *t != '\0'; t++) {
textWidth += Font_GetCharWidth(*t);
textLength++;
if (textWidth >= maxWidth) break;
}
*t = '\0';
if ((unknown4 & 0x1) != 0) {
unknown4 |= 0x4;
}
GUI_Mouse_Hide_Safe();
if ((unknown4 & 0x4) != 0) Widget_PaintCurrentWidget();
GUI_DrawText_Wrapper(text, positionX, g_curWidgetYBase, g_curWidgetFGColourBlink, g_curWidgetFGColourNormal, 0);
GUI_EditBox_BlinkCursor(positionX + textWidth, false);
GUI_Mouse_Show_Safe();
for (;; sleepIdle()) {
uint16 keyWidth;
uint16 key;
if (tickProc != NULL) {
returnValue = tickProc();
if (returnValue != 0) break;
}
key = GUI_Widget_HandleEvents(w);
GUI_EditBox_BlinkCursor(positionX + textWidth, false);
if (key == 0x0) continue;
if ((key & 0x8000) != 0) {
returnValue = key;
break;
}
if (key == 0x2B) {
returnValue = 0x2B;
break;
}
if (key == 0x6E) {
*t = '\0';
returnValue = 0x6B;
break;
}
/* Handle backspace */
if (key == 0x0F) {
if (textLength == 0) continue;
GUI_EditBox_BlinkCursor(positionX + textWidth, true);
textWidth -= Font_GetCharWidth(*(t - 1));
textLength--;
//.........这里部分代码省略.........
开发者ID:166MMX,项目名称:OpenDUNE,代码行数:101,代码来源:editbox.c
示例20: GameLoop_GameIntroAnimationMenu
/**
* Intro menu.
*/
static void GameLoop_GameIntroAnimationMenu(void)
{
static const uint16 mainMenuStrings[][6] = {
{STR_PLAY_A_GAME, STR_REPLAY_INTRODUCTION, STR_EXIT_GAME, STR_NULL, STR_NULL, STR_NULL}, /* Neither HOF nor save. */
{STR_PLAY_A_GAME, STR_REPLAY_INTRODUCTION, STR_LOAD_GAME, STR_EXIT_GAME, STR_NULL, STR_NULL}, /* Has a save game. */
{STR_PLAY_A_GAME, STR_REPLAY_INTRODUCTION, STR_EXIT_GAME, STR_HALL_OF_FAME, STR_NULL, STR_NULL}, /* Has a HOF. */
{STR_PLAY_A_GAME, STR_REPLAY_INTRODUCTION, STR_LOAD_GAME, STR_EXIT_GAME, STR_HALL_OF_FAME, STR_NULL} /* Has a HOF and a save game. */
};
bool loadGame = false;
static bool drawMenu = true;
static uint16 stringID = STR_REPLAY_INTRODUCTION;
uint16 maxWidth;
static bool hasSave = false;
static bool hasFame = false;
static const char *strings[6];
static uint16 index = 0xFFFF;
if (index == 0xFFFF) {
hasSave = File_Exists("_save000.dat");
hasFame = File_Exists("SAVEFAME.DAT");
index = (hasFame ? 2 : 0) + (hasSave ? 1 : 0);
}
if (hasSave || File_Exists("ONETIME.DAT")) g_canSkipIntro = true;
switch (stringID) {
case STR_REPLAY_INTRODUCTION:
Music_Play(0);
free(g_readBuffer);
g_readBufferSize = (g_enableVoices == 0) ? 12000 : 28000;
g_readBuffer = calloc(1, g_readBufferSize);
GUI_Mouse_Hide_Safe();
Driver_Music_FadeOut();
GameLoop_GameIntroAnimation();
Sound_Output_Feedback(0xFFFE);
File_ReadBlockFile("IBM.PAL", g_palette_998A, 256 * 3);
memmove(g_palette1, g_palette_998A, 256 * 3);
if (!g_canSkipIntro) {
File_Create("ONETIME.DAT");
g_canSkipIntro = true;
}
Music_Play(0);
free(g_readBuffer);
g_readBufferSize = (g_enableVoices == 0) ? 12000 : 20000;
g_readBuffer = calloc(1, g_readBufferSize);
GUI_Mouse_Show_Safe();
Music_Play(28);
drawMenu = true;
break;
case STR_EXIT_GAME:
g_running = false;
return;
case STR_HALL_OF_FAME:
GUI_HallOfFame_Show(0xFFFF);
GFX_SetPalette(g_palette2);
hasFame = File_Exists("SAVEFAME.DAT");
drawMenu = true;
break;
case STR_LOAD_GAME:
GUI_Mouse_Hide_Safe();
GUI_SetPaletteAnimated(g_palette2, 30);
GUI_ClearScreen(SCREEN_0);
GUI_Mouse_Show_Safe();
GFX_SetPalette(g_palette1);
if (GUI_Widget_SaveLoad_Click(false)) {
loadGame = true;
if (g_gameMode == GM_RESTART) break;
g_gameMode = GM_NORMAL;
} else {
GFX_SetPalette(g_palette2);
drawMenu = true;
}
break;
default: break;
}
//.........这里部分代码省略.........
开发者ID:166MMX,项目名称:OpenDUNE,代码行数:101,代码来源:opendune.c
注:本文中的GUI_Mouse_Hide_Safe函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论