867 SetFiosType(nd->map->type); |
867 SetFiosType(nd->map->type); |
868 _file_to_saveload.filetype = FT_SCENARIO; |
868 _file_to_saveload.filetype = FT_SCENARIO; |
869 ttd_strlcpy(_file_to_saveload.name, name, sizeof(_file_to_saveload.name)); |
869 ttd_strlcpy(_file_to_saveload.name, name, sizeof(_file_to_saveload.name)); |
870 ttd_strlcpy(_file_to_saveload.title, nd->map->title, sizeof(_file_to_saveload.title)); |
870 ttd_strlcpy(_file_to_saveload.title, nd->map->title, sizeof(_file_to_saveload.title)); |
871 |
871 |
872 DeleteWindow(w); |
872 delete w; |
873 SwitchMode(SM_START_SCENARIO); |
873 SwitchMode(SM_START_SCENARIO); |
874 } |
874 } |
875 } |
875 } |
876 break; |
876 break; |
877 |
877 |
878 case NSSW_LOAD: // Load game |
878 case NSSW_LOAD: // Load game |
879 _is_network_server = true; |
879 _is_network_server = true; |
880 /* XXX - WC_NETWORK_WINDOW (this window) should stay, but if it stays, it gets |
880 /* XXX - WC_NETWORK_WINDOW (this window) should stay, but if it stays, it gets |
881 * copied all the elements of 'load game' and upon closing that, it segfaults */ |
881 * copied all the elements of 'load game' and upon closing that, it segfaults */ |
882 DeleteWindow(w); |
882 delete w; |
883 ShowSaveLoadDialog(SLD_LOAD_GAME); |
883 ShowSaveLoadDialog(SLD_LOAD_GAME); |
884 break; |
884 break; |
885 } |
885 } |
886 break; |
886 break; |
887 |
887 |
1889 break; |
1889 break; |
1890 |
1890 |
1891 case 3: /* Send */ |
1891 case 3: /* Send */ |
1892 SendChat(WP(w, chatquerystr_d).text.buf, WP(w, chatquerystr_d).dtype, WP(w, chatquerystr_d).dest); |
1892 SendChat(WP(w, chatquerystr_d).text.buf, WP(w, chatquerystr_d).dtype, WP(w, chatquerystr_d).dest); |
1893 /* FALLTHROUGH */ |
1893 /* FALLTHROUGH */ |
1894 case 0: /* Cancel */ DeleteWindow(w); break; |
1894 case 0: /* Cancel */ delete w; break; |
1895 } |
1895 } |
1896 break; |
1896 break; |
1897 |
1897 |
1898 case WE_MOUSELOOP: |
1898 case WE_MOUSELOOP: |
1899 HandleEditBox(w, &WP(w, chatquerystr_d), 2); |
1899 HandleEditBox(w, &WP(w, chatquerystr_d), 2); |
1906 _chat_tab_completion_active = false; |
1906 _chat_tab_completion_active = false; |
1907 switch (HandleEditBoxKey(w, &WP(w, chatquerystr_d), 2, e)) { |
1907 switch (HandleEditBoxKey(w, &WP(w, chatquerystr_d), 2, e)) { |
1908 case 1: /* Return */ |
1908 case 1: /* Return */ |
1909 SendChat(WP(w, chatquerystr_d).text.buf, WP(w, chatquerystr_d).dtype, WP(w, chatquerystr_d).dest); |
1909 SendChat(WP(w, chatquerystr_d).text.buf, WP(w, chatquerystr_d).dtype, WP(w, chatquerystr_d).dest); |
1910 /* FALLTHROUGH */ |
1910 /* FALLTHROUGH */ |
1911 case 2: /* Escape */ DeleteWindow(w); break; |
1911 case 2: /* Escape */ delete w; break; |
1912 } |
1912 } |
1913 } |
1913 } |
1914 break; |
1914 break; |
1915 |
1915 |
1916 case WE_DESTROY: |
1916 case WE_DESTROY: |