MCPcopy Create free account
hub / github.com/diasurgical/devilution / UiProgressDialog

Function UiProgressDialog

SourceX/DiabloUI/progress.cpp:95–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95BOOL UiProgressDialog(HWND window, char *msg, int enable, int (*fnfunc)(), int rate)
96{
97 progress_Load(msg);
98 SetFadeLevel(256);
99
100 endMenu = false;
101 int progress = 0;
102
103 SDL_Event event;
104 while (!endMenu && progress < 100) {
105 progress = fnfunc();
106 progress_Render(progress);
107 DrawMouse();
108 RenderPresent();
109
110 while (SDL_PollEvent(&event)) {
111 switch (event.type) {
112 case SDL_KEYDOWN:
113 switch (event.key.keysym.sym) {
114 case SDLK_ESCAPE:
115 case SDLK_RETURN:
116 case SDLK_KP_ENTER:
117 case SDLK_SPACE:
118 break;
119 default:
120 continue;
121 }
122 endMenu = true;
123 break;
124 case SDL_MOUSEBUTTONDOWN:
125 endMenu = true;
126 break;
127 }
128 UiHandleEvents(&event);
129 }
130 }
131 progress_Free();
132
133 return progress == 100;
134}
135
136} // namespace dvl

Callers 1

msg_wait_resyncFunction · 0.85

Calls 7

progress_LoadFunction · 0.85
SetFadeLevelFunction · 0.85
progress_RenderFunction · 0.85
DrawMouseFunction · 0.85
RenderPresentFunction · 0.85
UiHandleEventsFunction · 0.85
progress_FreeFunction · 0.85

Tested by

no test coverage detected