Commit c4a912b
authored
enhancement: confirmation dialogues when closing the client (#2788)
This commit restores original engine behavior that prevents accidental game exits and ensures players don't lose progress by accidentally pressing Alt+F4 or clicking the window close button,
especially during combat situations.
- Intercept OnExiting event to prevent immediate closure when player is in-game
- Show combat warning dialog if player is in combat, requiring confirmation to exit
- Show standard quit confirmation dialog if player is not in combat
- Add _isShowingExitConfirmation flag to prevent infinite OnExiting event loop
- Makes InputBox.Closed event to handle X button clicks on dialogs
- Add QuitTitle and QuitPrompt strings to General localization
- Normal cleanup continues if player is not logged in or not in-game
- replicated this logic for both, simplified and regular game menus when pressing the desktop option1 parent 533a806 commit c4a912b
File tree
4 files changed
+79
-42
lines changed- Intersect.Client.Core
- Interface
- Game
- Menu
- Localization
- MonoGame
4 files changed
+79
-42
lines changedLines changed: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
163 | 170 | | |
164 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
165 | 174 | | |
166 | 175 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
226 | 235 | | |
227 | 236 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1273 | 1273 | | |
1274 | 1274 | | |
1275 | 1275 | | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
1276 | 1282 | | |
1277 | 1283 | | |
1278 | 1284 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
339 | 341 | | |
340 | 342 | | |
341 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
342 | 351 | | |
343 | 352 | | |
344 | | - | |
| 353 | + | |
| 354 | + | |
345 | 355 | | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
| 356 | + | |
| 357 | + | |
353 | 358 | | |
354 | | - | |
355 | | - | |
| 359 | + | |
| 360 | + | |
356 | 361 | | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
| 362 | + | |
| 363 | + | |
364 | 364 | | |
365 | | - | |
| 365 | + | |
366 | 366 | | |
367 | | - | |
368 | | - | |
| 367 | + | |
| 368 | + | |
369 | 369 | | |
370 | | - | |
| 370 | + | |
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
| 374 | + | |
| 375 | + | |
379 | 376 | | |
380 | | - | |
| 377 | + | |
| 378 | + | |
381 | 379 | | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
| 380 | + | |
386 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
387 | 400 | | |
388 | 401 | | |
389 | 402 | | |
| |||
0 commit comments