您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GUI_Mouse_Show_Safe函数代码示例

51自学网 2021-06-01 21:00:18
  C++
这篇教程C++ GUI_Mouse_Show_Safe函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GUI_Mouse_Show_Safe函数的典型用法代码示例。如果您正苦于以下问题:C++ GUI_Mouse_Show_Safe函数的具体用法?C++ GUI_Mouse_Show_Safe怎么用?C++ GUI_Mouse_Show_Safe使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GUI_Mouse_Show_Safe函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例13: 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,


示例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,


示例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,


示例16: 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,


示例17: 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,


示例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,


示例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,


示例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,


示例21: GameLoop_HandleEvents

//.........这里部分代码省略.........	old = props->fgColourBlink % (last + 1);	current = old;	result = 0xFFFF;	top = g_curWidgetYBase + props->yBase;	left = (g_curWidgetXBase + props->xBase) << 3;	lineHeight = g_fontCurrent->height;	minX = (g_curWidgetXBase << 3) + (g_fontCurrent->maxWidth * props->xBase);	minY = g_curWidgetYBase + props->yBase;	maxX = minX + (g_fontCurrent->maxWidth * props->width) - 1;	maxY = minY + (props->height * lineHeight) - 1;	fgColourNormal = props->fgColourNormal;	fgColourSelected = props->fgColourSelected;	key = 0;	if (Input_IsInputAvailable() != 0) {		key = Input_Wait() & 0x8FF;	}	if (g_var_7097 == 0) {		uint16 y = g_mouseY;		if (GameLoop_IsInRange(g_mouseX, y, minX, minY, maxX, maxY)) {			current = (y - minY) / lineHeight;		}	}	switch (key) {		case 0x60: /* NUMPAD 8 / ARROW UP */			if (current-- == 0) current = last;			break;		case 0x62: /* NUMPAD 2 / ARROW DOWN */			if (current++ == last) current = 0;			break;		case 0x5B: /* NUMPAD 7 / HOME */		case 0x65: /* NUMPAD 9 / PAGE UP */			current = 0;			break;		case 0x5D: /* NUMPAD 1 / END */		case 0x67: /* NUMPAD 3 / PAGE DOWN */			current = last;			break;		case 0x41: /* MOUSE LEFT BUTTON */		case 0x42: /* MOUSE RIGHT BUTTON */			if (GameLoop_IsInRange(g_mouseClickX, g_mouseClickY, minX, minY, maxX, maxY)) {				current = (g_mouseClickY - minY) / lineHeight;				result = current;			}			break;		case 0x2B: /* NUMPAD 5 / RETURN */		case 0x3D: /* SPACE */		case 0x61:			result = current;			break;		default: {			uint8 i;			for (i = 0; i < props->height; i++) {				char c1;				char c2;				c1 = toupper(*strings[i]);				c2 = toupper(Input_Keyboard_HandleKeys(key & 0xFF));				if (c1 == c2) {					result = i;					current = i;					break;				}			}		} break;	}	if (current != old) {		GUI_Mouse_Hide_Safe();		GUI_DrawText_Wrapper(strings[old], left, top + (old * lineHeight), fgColourNormal, 0, 0x22);		GUI_DrawText_Wrapper(strings[current], left, top + (current * lineHeight), fgColourSelected, 0, 0x22);		GUI_Mouse_Show_Safe();	}	props->fgColourBlink = current;	if (result == 0xFFFF) return 0xFFFF;	GUI_Mouse_Hide_Safe();	GameLoop_DrawText2(strings[result], left, top + (current * lineHeight), fgColourNormal, fgColourSelected, 0);	GUI_Mouse_Show_Safe();	return result;}
开发者ID:166MMX,项目名称:OpenDUNE,代码行数:101,


示例22: GUI_Purchase_ShowInvoice

static void GUI_Purchase_ShowInvoice(void){	Widget *w = g_widgetInvoiceTail;	Screen oldScreenID;	uint16 y = 48;	uint16 total = 0;	uint16 x;	char textBuffer[12];	oldScreenID = GFX_Screen_SetActive(SCREEN_1);	GUI_DrawFilledRectangle(128, 48, 311, 159, 20);	GUI_DrawText_Wrapper(String_Get_ByIndex(STR_ITEM_NAME_QTY_TOTAL), 128, y, 12, 0, 0x11);	y += 7;	GUI_DrawLine(129, y, 310, y, 12);	y += 2;	if (g_factoryWindowOrdered != 0) {		uint16 i;		for (i = 0; i < g_factoryWindowTotal; i++) {			ObjectInfo *oi;			uint16 amount;			if (g_factoryWindowItems[i].amount == 0) continue;			amount = g_factoryWindowItems[i].amount * g_factoryWindowItems[i].credits;			total += amount;			snprintf(textBuffer, sizeof(textBuffer), "%02d %5d", g_factoryWindowItems[i].amount, amount);			oi = g_factoryWindowItems[i].objectInfo;			GUI_DrawText_Wrapper(String_Get_ByIndex(oi->stringID_full), 128, y, 8, 0, 0x11);			GUI_DrawText_Monospace(textBuffer, 311 - strlen(textBuffer) * 6, y, 15, 0, 6);			y += 8;		}	} else {		GUI_DrawText_Wrapper(String_Get_ByIndex(STR_NO_UNITS_ON_ORDER), 220, 99, 6, 0, 0x112);	}	GUI_DrawLine(129, 148, 310, 148, 12);	GUI_DrawLine(129, 150, 310, 150, 12);	snprintf(textBuffer, sizeof(textBuffer), "%d", total);	x = 311 - strlen(textBuffer) * 6;	/* "Total Cost :" */	GUI_DrawText_Wrapper(GUI_String_Get_ByIndex(STR_TOTAL_COST_), x - 3, 152, 11, 0, 0x211);	GUI_DrawText_Monospace(textBuffer, x, 152, 11, 0, 6);	GUI_Mouse_Hide_Safe();	GUI_Screen_Copy(16, 48, 16, 48, 23, 112, SCREEN_1, SCREEN_0);	GUI_Mouse_Show_Safe();	GFX_Screen_SetActive(SCREEN_0);	GUI_FactoryWindow_DrawCaption(String_Get_ByIndex(STR_INVOICE_OF_UNITS_ON_ORDER));	Input_History_Clear();	for (; GUI_Widget_HandleEvents(w) == 0; sleepIdle()) {		GUI_DrawCredits(g_playerHouseID, 0);		GUI_FactoryWindow_UpdateSelection(false);		GUI_PaletteAnimate();	}	GFX_Screen_SetActive(oldScreenID);	w = GUI_Widget_Get_ByIndex(w, 10);	if (w != NULL && Mouse_InsideRegion(w->offsetX, w->offsetY, w->offsetX + w->width, w->offsetY + w->height) != 0) {		while (Input_Test(0x41) != 0 || Input_Test(0x42) != 0) sleepIdle();		Input_History_Clear();	}	if (g_factoryWindowResult == FACTORY_CONTINUE) GUI_FactoryWindow_DrawDetails();}
开发者ID:Haozerk,项目名称:OpenDUNE,代码行数:86,


示例23: GameLoop_Main

/** * Main game loop. */static void GameLoop_Main(void){	static uint32 l_timerNext = 0;	static uint32 l_timerUnitStatus = 0;	static int16  l_selectionState = -2;	uint16 key;	String_Init();	Sprites_Init();	Input_Flags_SetBits(INPUT_FLAG_KEY_REPEAT | INPUT_FLAG_UNKNOWN_0010 | INPUT_FLAG_UNKNOWN_0200 |	                    INPUT_FLAG_UNKNOWN_2000);	Input_Flags_ClearBits(INPUT_FLAG_KEY_RELEASE | INPUT_FLAG_UNKNOWN_0400 | INPUT_FLAG_UNKNOWN_0100 |	                      INPUT_FLAG_UNKNOWN_0080 | INPUT_FLAG_UNKNOWN_0040 | INPUT_FLAG_UNKNOWN_0020 |	                      INPUT_FLAG_UNKNOWN_0008 | INPUT_FLAG_UNKNOWN_0004 | INPUT_FLAG_NO_TRANSLATE);	Timer_SetTimer(TIMER_GAME, true);	Timer_SetTimer(TIMER_GUI, true);	g_campaignID = 0;	g_scenarioID = 1;	g_playerHouseID = HOUSE_INVALID;	g_debugScenario = false;	g_selectionType = SELECTIONTYPE_MENTAT;	g_selectionTypeNew = SELECTIONTYPE_MENTAT;	g_palette1 = calloc(1, 256 * 3);	g_palette2 = calloc(1, 256 * 3);	g_readBufferSize = 12000;	g_readBuffer = calloc(1, g_readBufferSize);	ReadProfileIni("PROFILE.INI");	free(g_readBuffer); g_readBuffer = NULL;	File_ReadBlockFile("IBM.PAL", g_palette_998A, 256 * 3);	memmove(g_palette1, g_palette_998A, 256 * 3);	GUI_ClearScreen(SCREEN_0);	Video_SetPalette(g_palette1, 0, 256);	GFX_SetPalette(g_palette1);	GFX_SetPalette(g_palette2);	g_paletteMapping1 = malloc(256);	g_paletteMapping2 = malloc(256);	GUI_Palette_CreateMapping(g_palette1, g_paletteMapping1, 0xC, 0x55);	g_paletteMapping1[0xFF] = 0xFF;	g_paletteMapping1[0xDF] = 0xDF;	g_paletteMapping1[0xEF] = 0xEF;	GUI_Palette_CreateMapping(g_palette1, g_paletteMapping2, 0xF, 0x55);	g_paletteMapping2[0xFF] = 0xFF;	g_paletteMapping2[0xDF] = 0xDF;	g_paletteMapping2[0xEF] = 0xEF;	Script_LoadFromFile("TEAM.EMC", g_scriptTeam, g_scriptFunctionsTeam, NULL);	Script_LoadFromFile("BUILD.EMC", g_scriptStructure, g_scriptFunctionsStructure, NULL);	GUI_Palette_CreateRemap(HOUSE_MERCENARY);	g_cursorSpriteID = 0;	Sprites_SetMouseSprite(0, 0, g_sprites[0]);	while (g_mouseHiddenDepth > 1) {		GUI_Mouse_Show_Safe();	}	Window_WidgetClick_Create();	GameOptions_Load();	Unit_Init();	Team_Init();	House_Init();	Structure_Init();	GUI_Mouse_Show_Safe();	if (g_debugSkipDialogs) {		Music_Play(0);		free(g_readBuffer);		g_readBufferSize = (g_enableVoices == 0) ? 12000 : 20000;		g_readBuffer = calloc(1, g_readBufferSize);		g_gameMode = GM_NORMAL;	}	for (;; sleepIdle()) {		if (g_gameMode == GM_MENU) {			GameLoop_GameIntroAnimationMenu();			if (!g_running) break;//.........这里部分代码省略.........
开发者ID:166MMX,项目名称:OpenDUNE,代码行数:101,


示例24: GUI_Window_Create

//.........这里部分代码省略.........	if (GUI_String_Get_ByIndex(desc->stringID) != NULL) {		GUI_DrawText_Wrapper(GUI_String_Get_ByIndex(desc->stringID), (g_curWidgetXBase << 3) + (g_curWidgetWidth << 2), g_curWidgetYBase + 6 + ((desc == &g_yesNoWindowDesc) ? 2 : 0), 238, 0, 0x122);	}	if (GUI_String_Get_ByIndex(desc->widgets[0].stringID) == NULL) {		GUI_DrawText_Wrapper(String_Get_ByIndex(STR_THERE_ARE_NO_SAVED_GAMES_TO_LOAD), (g_curWidgetXBase + 2) << 3, g_curWidgetYBase + 42, 232, 0, 0x22);	}	for (i = 0; i < desc->widgetCount; i++) {		Widget *w = &g_table_windowWidgets[i];		if (GUI_String_Get_ByIndex(desc->widgets[i].stringID) == NULL) continue;		w->next      = NULL;		w->offsetX   = desc->widgets[i].offsetX;		w->offsetY   = desc->widgets[i].offsetY;		w->width     = desc->widgets[i].width;		w->height    = desc->widgets[i].height;		w->shortcut  = 0;		w->shortcut2 = 0;		if (desc != &g_savegameNameWindowDesc) {			if (desc->widgets[i].labelStringId != STR_NULL) {				w->shortcut = GUI_Widget_GetShortcut(*GUI_String_Get_ByIndex(desc->widgets[i].labelStringId));			} else {				w->shortcut = GUI_Widget_GetShortcut(*GUI_String_Get_ByIndex(desc->widgets[i].stringID));			}		}		w->shortcut2 = desc->widgets[i].shortcut2;		if (w->shortcut == 0x1B) {			w->shortcut2 = 0x13;		}		w->stringID = desc->widgets[i].stringID;		w->drawModeNormal   = DRAW_MODE_CUSTOM_PROC;		w->drawModeSelected = DRAW_MODE_CUSTOM_PROC;		w->drawModeDown     = DRAW_MODE_CUSTOM_PROC;		w->drawParameterNormal.proc   = &GUI_Widget_TextButton_Draw;		w->drawParameterSelected.proc = &GUI_Widget_TextButton_Draw;		w->drawParameterDown.proc     = &GUI_Widget_TextButton_Draw;		w->parentID = desc->index;		memset(&w->state, 0, sizeof(w->state));		g_widgetLinkedListTail = GUI_Widget_Link(g_widgetLinkedListTail, w);		GUI_Widget_MakeVisible(w);		GUI_Widget_MakeNormal(w, false);		GUI_Widget_Draw(w);		if (desc->widgets[i].labelStringId == STR_NULL) continue;		if (g_config.language == LANGUAGE_FRENCH) {			GUI_DrawText_Wrapper(GUI_String_Get_ByIndex(desc->widgets[i].labelStringId), (g_widgetProperties[w->parentID].xBase << 3) + 40, w->offsetY + g_widgetProperties[w->parentID].yBase + 3, 232, 0, 0x22);		} else {			GUI_DrawText_Wrapper(GUI_String_Get_ByIndex(desc->widgets[i].labelStringId), w->offsetX + (g_widgetProperties[w->parentID].xBase << 3) - 10, w->offsetY + g_widgetProperties[w->parentID].yBase + 3, 232, 0, 0x222);		}	}	if (s_savegameCountOnDisk >= 5 && desc->addArrows) {		Widget *w = &g_table_windowWidgets[7];		w->drawParameterNormal.sprite   = g_sprites[59];		w->drawParameterSelected.sprite = g_sprites[60];		w->drawParameterDown.sprite     = g_sprites[60];		w->next             = NULL;		w->parentID         = desc->index;		GUI_Widget_MakeNormal(w, false);		GUI_Widget_MakeInvisible(w);		GUI_Widget_Undraw(w, 233);		g_widgetLinkedListTail = GUI_Widget_Link(g_widgetLinkedListTail, w);		w = &g_table_windowWidgets[8];		w->drawParameterNormal.sprite   = g_sprites[61];		w->drawParameterSelected.sprite = g_sprites[62];		w->drawParameterDown.sprite     = g_sprites[62];		w->next             = NULL;		w->parentID         = desc->index;		GUI_Widget_MakeNormal(w, false);		GUI_Widget_MakeInvisible(w);		GUI_Widget_Undraw(w, 233);		g_widgetLinkedListTail = GUI_Widget_Link(g_widgetLinkedListTail, w);	}	GUI_Mouse_Hide_Safe();	Widget_SetCurrentWidget(desc->index);	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(SCREEN_0);}
开发者ID:Haozerk,项目名称:OpenDUNE,代码行数:101,



注:本文中的GUI_Mouse_Show_Safe函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GUI_SetBkColor函数代码示例
C++ GUI_Mouse_Hide_Safe函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。