equal
deleted
inserted
replaced
319 ShowDropDownMenu(w, num_inds, _opt_newgame.diff.number_industries, 14, 0, 0); |
319 ShowDropDownMenu(w, num_inds, _opt_newgame.diff.number_industries, 14, 0, 0); |
320 break; |
320 break; |
321 case 16: // Random seed |
321 case 16: // Random seed |
322 _patches_newgame.generation_seed = InteractiveRandom(); |
322 _patches_newgame.generation_seed = InteractiveRandom(); |
323 ttd_strlcpy(_edit_str_buf, str_fmt("%u", _patches_newgame.generation_seed), lengthof(_edit_str_buf)); |
323 ttd_strlcpy(_edit_str_buf, str_fmt("%u", _patches_newgame.generation_seed), lengthof(_edit_str_buf)); |
324 UpdateTextBufferSize(&((querystr_d *)&WP(w, querystr_d))->text); |
324 UpdateTextBufferSize(&WP(w, querystr_d).text); |
325 SetWindowDirty(w); |
325 SetWindowDirty(w); |
326 break; |
326 break; |
327 case 17: // Generate |
327 case 17: // Generate |
328 if (mode == GLWP_HEIGHTMAP && ( |
328 if (mode == GLWP_HEIGHTMAP && ( |
329 _heightmap_x * 2 < (1U << _patches_newgame.map_x) || _heightmap_x / 2 > (1U << _patches_newgame.map_x) || |
329 _heightmap_x * 2 < (1U << _patches_newgame.map_x) || _heightmap_x / 2 > (1U << _patches_newgame.map_x) || |
393 case WE_MOUSELOOP: |
393 case WE_MOUSELOOP: |
394 HandleEditBox(w, &WP(w, querystr_d), SEED_EDIT); |
394 HandleEditBox(w, &WP(w, querystr_d), SEED_EDIT); |
395 break; |
395 break; |
396 |
396 |
397 case WE_KEYPRESS: |
397 case WE_KEYPRESS: |
398 HandleEditBoxKey(w, &WP(w, querystr_d), SEED_EDIT, e, CS_NUMERAL); |
398 HandleEditBoxKey(w, &WP(w, querystr_d), SEED_EDIT, e); |
399 /* the seed is unsigned, therefore atoi cannot be used. |
399 /* the seed is unsigned, therefore atoi cannot be used. |
400 * As 2^32 - 1 (MAX_UVALUE(uint32)) is a 'magic' value |
400 * As 2^32 - 1 (MAX_UVALUE(uint32)) is a 'magic' value |
401 * (use random seed) it should not be possible to be |
401 * (use random seed) it should not be possible to be |
402 * entered into the input field; the generate seed |
402 * entered into the input field; the generate seed |
403 * button can be used instead. */ |
403 * button can be used instead. */ |
516 querystr->text.caret = true; |
516 querystr->text.caret = true; |
517 querystr->text.maxlength = lengthof(_edit_str_buf); |
517 querystr->text.maxlength = lengthof(_edit_str_buf); |
518 querystr->text.maxwidth = 120; |
518 querystr->text.maxwidth = 120; |
519 querystr->text.buf = _edit_str_buf; |
519 querystr->text.buf = _edit_str_buf; |
520 querystr->caption = STR_NULL; |
520 querystr->caption = STR_NULL; |
|
521 querystr->afilter = CS_NUMERAL; |
521 UpdateTextBufferSize(&querystr->text); |
522 UpdateTextBufferSize(&querystr->text); |
522 |
523 |
523 InvalidateWindow(WC_GENERATE_LANDSCAPE, mode); |
524 InvalidateWindow(WC_GENERATE_LANDSCAPE, mode); |
524 } |
525 } |
525 } |
526 } |