rail_gui.c
changeset 3776 1545763bfc75
parent 3567 24ef003de86a
child 3781 d93f51a199fd
equal deleted inserted replaced
3775:0fb5118536c3 3776:1545763bfc75
    18 #include "vehicle.h"
    18 #include "vehicle.h"
    19 #include "station.h"
    19 #include "station.h"
    20 #include "waypoint.h"
    20 #include "waypoint.h"
    21 #include "debug.h"
    21 #include "debug.h"
    22 #include "variables.h"
    22 #include "variables.h"
       
    23 #include "newgrf_callbacks.h"
       
    24 #include "newgrf_station.h"
    23 
    25 
    24 static RailType _cur_railtype;
    26 static RailType _cur_railtype;
    25 static bool _remove_button_clicked;
    27 static bool _remove_button_clicked;
    26 static DiagDirection _build_depot_direction;
    28 static DiagDirection _build_depot_direction;
    27 static byte _waypoint_count = 1;
    29 static byte _waypoint_count = 1;
    30 static struct {
    32 static struct {
    31 	byte orientation;
    33 	byte orientation;
    32 	byte numtracks;
    34 	byte numtracks;
    33 	byte platlength;
    35 	byte platlength;
    34 	bool dragdrop;
    36 	bool dragdrop;
       
    37 
       
    38 	bool newstations;
       
    39 	byte station_class;
       
    40 	byte station_type;
       
    41 	byte station_count;
    35 } _railstation;
    42 } _railstation;
    36 
    43 
    37 
    44 
    38 static void HandleStationPlacement(TileIndex start, TileIndex end);
    45 static void HandleStationPlacement(TileIndex start, TileIndex end);
    39 static void ShowBuildTrainDepotPicker(void);
    46 static void ShowBuildTrainDepotPicker(void);
   131 
   138 
   132 void CcStation(bool success, TileIndex tile, uint32 p1, uint32 p2)
   139 void CcStation(bool success, TileIndex tile, uint32 p1, uint32 p2)
   133 {
   140 {
   134 	if (success) {
   141 	if (success) {
   135 		SndPlayTileFx(SND_20_SPLAT_2, tile);
   142 		SndPlayTileFx(SND_20_SPLAT_2, tile);
   136 		ResetObjectToPlace();
   143 		/* Only close the station builder window if the default station is chosen. */
       
   144 		if (_railstation.station_class == STAT_CLASS_DFLT && _railstation.station_type == 0) ResetObjectToPlace();
   137 	}
   145 	}
   138 }
   146 }
   139 
   147 
   140 static void PlaceRail_Station(TileIndex tile)
   148 static void PlaceRail_Station(TileIndex tile)
   141 {
   149 {
   143 		DoCommandP(tile, 0, 0, CcPlaySound1E, CMD_REMOVE_FROM_RAILROAD_STATION | CMD_MSG(STR_CANT_REMOVE_PART_OF_STATION));
   151 		DoCommandP(tile, 0, 0, CcPlaySound1E, CMD_REMOVE_FROM_RAILROAD_STATION | CMD_MSG(STR_CANT_REMOVE_PART_OF_STATION));
   144 	else if (_railstation.dragdrop) {
   152 	else if (_railstation.dragdrop) {
   145 		VpStartPlaceSizing(tile, VPM_X_AND_Y_LIMITED);
   153 		VpStartPlaceSizing(tile, VPM_X_AND_Y_LIMITED);
   146 		VpSetPlaceSizingLimit(_patches.station_spread);
   154 		VpSetPlaceSizingLimit(_patches.station_spread);
   147 	} else {
   155 	} else {
   148 		// TODO: Custom station selector GUI.
   156 		DoCommandP(tile,
   149 		DoCommandP(tile, _railstation.orientation | (_railstation.numtracks<<8) | (_railstation.platlength<<16),_cur_railtype, CcStation,
   157 				_railstation.orientation | (_railstation.numtracks << 8) | (_railstation.platlength << 16),
       
   158 				_cur_railtype | (_railstation.station_class << 8) | (_railstation.station_type << 16), CcStation,
   150 				CMD_BUILD_RAILROAD_STATION | CMD_NO_WATER | CMD_AUTO | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION));
   159 				CMD_BUILD_RAILROAD_STATION | CMD_NO_WATER | CMD_AUTO | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION));
   151 	}
   160 	}
   152 }
   161 }
   153 
   162 
   154 static void GenericPlaceSignals(TileIndex tile)
   163 static void GenericPlaceSignals(TileIndex tile)
   595 	if (sy > ey) uintswap(sy,ey);
   604 	if (sy > ey) uintswap(sy,ey);
   596 	w = ex - sx + 1;
   605 	w = ex - sx + 1;
   597 	h = ey - sy + 1;
   606 	h = ey - sy + 1;
   598 	if (!_railstation.orientation) uintswap(w,h);
   607 	if (!_railstation.orientation) uintswap(w,h);
   599 
   608 
   600 	// TODO: Custom station selector GUI.
   609 	DoCommandP(TileXY(sx, sy),
   601 	DoCommandP(TileXY(sx, sy), _railstation.orientation | (w << 8) | (h << 16), _cur_railtype, CcStation,
   610 			_railstation.orientation | (w << 8) | (h << 16),
   602 		CMD_BUILD_RAILROAD_STATION | CMD_NO_WATER | CMD_AUTO | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION));
   611 			_cur_railtype | (_railstation.station_class << 8) | (_railstation.station_type << 16), CcStation,
       
   612 			CMD_BUILD_RAILROAD_STATION | CMD_NO_WATER | CMD_AUTO | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION));
   603 }
   613 }
   604 
   614 
   605 static void StationBuildWndProc(Window *w, WindowEvent *e)
   615 static void StationBuildWndProc(Window *w, WindowEvent *e)
   606 {
   616 {
   607 	switch (e->event) {
   617 	switch (e->event) {
   608 	case WE_PAINT: {
   618 	case WE_PAINT: {
   609 		int rad;
   619 		int rad;
   610 		uint bits;
   620 		uint bits;
       
   621 		bool newstations = _railstation.newstations;
       
   622 		int y_offset;
   611 
   623 
   612 		if (WP(w,def_d).close) return;
   624 		if (WP(w,def_d).close) return;
   613 
   625 
   614 		bits = (1<<3) << ( _railstation.orientation);
   626 		bits = (1<<3) << ( _railstation.orientation);
   615 		if (_railstation.dragdrop) {
   627 		if (_railstation.dragdrop) {
   641 		for (bits = _patches.station_spread; bits < 7; bits++) {
   653 		for (bits = _patches.station_spread; bits < 7; bits++) {
   642 			SETBIT(w->disabled_state, bits + 5);
   654 			SETBIT(w->disabled_state, bits + 5);
   643 			SETBIT(w->disabled_state, bits + 12);
   655 			SETBIT(w->disabled_state, bits + 12);
   644 		}
   656 		}
   645 
   657 
       
   658 		if (newstations) {
       
   659 			const StationSpec *statspec = GetCustomStationSpec(_railstation.station_class, _railstation.station_type);
       
   660 
       
   661 			if (statspec != NULL) {
       
   662 				for (bits = 0; bits < 7; bits++) {
       
   663 					if (HASBIT(statspec->disallowed_platforms, bits)) SETBIT(w->disabled_state, bits +  5);
       
   664 					if (HASBIT(statspec->disallowed_lengths,   bits)) SETBIT(w->disabled_state, bits + 12);
       
   665 				}
       
   666 			}
       
   667 		}
       
   668 
       
   669 		SetDParam(0, GetStationClassName(_railstation.station_class));
   646 		DrawWindowWidgets(w);
   670 		DrawWindowWidgets(w);
   647 
   671 
   648 		StationPickerDrawSprite(39, 42, _cur_railtype, 2);
   672 		y_offset = newstations ? 90 : 0;
   649 		StationPickerDrawSprite(107, 42, _cur_railtype, 3);
   673 
   650 
   674 		if (!DrawStationTile(39, 42 + y_offset, _cur_railtype, AXIS_X, _railstation.station_class, _railstation.station_type)) {
   651 		DrawStringCentered(74, 15, STR_3002_ORIENTATION, 0);
   675 			StationPickerDrawSprite(39, 42 + y_offset, _cur_railtype, 2);
   652 		DrawStringCentered(74, 76, STR_3003_NUMBER_OF_TRACKS, 0);
   676 		}
   653 		DrawStringCentered(74, 101, STR_3004_PLATFORM_LENGTH, 0);
   677 		if (!DrawStationTile(107, 42 + y_offset, _cur_railtype, AXIS_Y, _railstation.station_class, _railstation.station_type)) {
   654 		DrawStringCentered(74, 141, STR_3066_COVERAGE_AREA_HIGHLIGHT, 0);
   678 			StationPickerDrawSprite(107, 42 + y_offset, _cur_railtype, 3);
   655 
   679 		}
   656 		DrawStationCoverageAreaText(2, 166, (uint)-1, rad);
   680 
       
   681 		DrawStringCentered(74, 15 + y_offset, STR_3002_ORIENTATION, 0);
       
   682 		DrawStringCentered(74, 76 + y_offset, STR_3003_NUMBER_OF_TRACKS, 0);
       
   683 		DrawStringCentered(74, 101 + y_offset, STR_3004_PLATFORM_LENGTH, 0);
       
   684 		DrawStringCentered(74, 141 + y_offset, STR_3066_COVERAGE_AREA_HIGHLIGHT, 0);
       
   685 
       
   686 		DrawStationCoverageAreaText(2, 166 + y_offset, (uint)-1, rad);
       
   687 
       
   688 		if (newstations) {
       
   689 			uint i;
       
   690 			uint y = 35;
       
   691 
       
   692 			for (i = w->vscroll.pos; i < _railstation.station_count && i < w->vscroll.pos + w->vscroll.cap; i++) {
       
   693 				const StationSpec *statspec = GetCustomStationSpec(_railstation.station_class, i);
       
   694 
       
   695 				if (statspec != NULL && statspec->name != 0) {
       
   696 					if (HASBIT(statspec->callbackmask, CBM_STATION_AVAIL) && GetStationCallback(CBID_STATION_AVAILABILITY, 0, 0, statspec, NULL, INVALID_TILE) == 0) {
       
   697 						GfxFillRect(8, y - 2, 127, y + 10, PALETTE_MODIFIER_GREYOUT);
       
   698 					}
       
   699 
       
   700 					DrawStringTruncated(9, y, statspec->name, i == _railstation.station_type ? 12 : 16, 118);
       
   701 				} else {
       
   702 					DrawStringTruncated(9, y, STR_STAT_CLASS_DFLT, i == _railstation.station_type ? 12 : 16, 118);
       
   703 				}
       
   704 
       
   705 				y += 14;
       
   706 			}
       
   707 		}
   657 	} break;
   708 	} break;
   658 
   709 
   659 	case WE_CLICK: {
   710 	case WE_CLICK: {
   660 		switch (e->click.widget) {
   711 		switch (e->click.widget) {
   661 		case 3:
   712 		case 3:
   701 		case 21:
   752 		case 21:
   702 			_station_show_coverage = e->click.widget - 20;
   753 			_station_show_coverage = e->click.widget - 20;
   703 			SndPlayFx(SND_15_BEEP);
   754 			SndPlayFx(SND_15_BEEP);
   704 			SetWindowDirty(w);
   755 			SetWindowDirty(w);
   705 			break;
   756 			break;
       
   757 
       
   758 		case 23:
       
   759 			ShowDropDownMenu(w, BuildStationClassDropdown(), _railstation.station_class, 23, 0, 1 << STAT_CLASS_WAYP);
       
   760 			break;
       
   761 
       
   762 		case 24: {
       
   763 			const StationSpec *statspec;
       
   764 			int y = (e->click.pt.y - 32) / 14;
       
   765 
       
   766 			if (y >= w->vscroll.cap) return;
       
   767 			y += w->vscroll.pos;
       
   768 			if (y >= _railstation.station_count) return;
       
   769 
       
   770 			/* Check station availability callback */
       
   771 			statspec = GetCustomStationSpec(_railstation.station_class, y);
       
   772 			if (statspec != NULL &&
       
   773 				HASBIT(statspec->callbackmask, CBM_STATION_AVAIL) &&
       
   774 				GetStationCallback(CBID_STATION_AVAILABILITY, 0, 0, statspec, NULL, INVALID_TILE) == 0) return;
       
   775 
       
   776 			_railstation.station_type = y;
       
   777 			SndPlayFx(SND_15_BEEP);
       
   778 			SetWindowDirty(w);
       
   779 			break;
       
   780 		}
   706 		}
   781 		}
   707 	} break;
   782 	} break;
       
   783 
       
   784 	case WE_DROPDOWN_SELECT:
       
   785 		if (_railstation.station_class != e->dropdown.index) {
       
   786 			_railstation.station_class = e->dropdown.index;
       
   787 			_railstation.station_type  = 0;
       
   788 			_railstation.station_count = GetNumCustomStations(_railstation.station_class);
       
   789 
       
   790 			w->vscroll.count = _railstation.station_count;
       
   791 			w->vscroll.pos   = _railstation.station_type;
       
   792 		}
       
   793 
       
   794 		SndPlayFx(SND_15_BEEP);
       
   795 		SetWindowDirty(w);
       
   796 		break;
   708 
   797 
   709 	case WE_MOUSELOOP:
   798 	case WE_MOUSELOOP:
   710 		if (WP(w,def_d).close) {
   799 		if (WP(w,def_d).close) {
   711 			DeleteWindow(w);
   800 			DeleteWindow(w);
   712 			return;
   801 			return;
   747 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    14,    73,   152,   163, STR_02DB_OFF, STR_3065_DON_T_HIGHLIGHT_COVERAGE},
   836 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    14,    73,   152,   163, STR_02DB_OFF, STR_3065_DON_T_HIGHLIGHT_COVERAGE},
   748 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    74,   133,   152,   163, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA},
   837 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    74,   133,   152,   163, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA},
   749 {   WIDGETS_END},
   838 {   WIDGETS_END},
   750 };
   839 };
   751 
   840 
       
   841 static const Widget _newstation_builder_widgets[] = {
       
   842 {   WWT_CLOSEBOX,   RESIZE_NONE,     7,     0,    10,     0,    13, STR_00C5, STR_018B_CLOSE_WINDOW},
       
   843 {    WWT_CAPTION,   RESIZE_NONE,     7,    11,   147,     0,    13, STR_3000_RAIL_STATION_SELECTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
       
   844 {      WWT_PANEL,   RESIZE_NONE,     7,     0,   147,    14,   289, 0x0, STR_NULL},
       
   845 {      WWT_PANEL,   RESIZE_NONE,    14,     7,    72,   116,   163, 0x0, STR_304E_SELECT_RAILROAD_STATION},
       
   846 {      WWT_PANEL,   RESIZE_NONE,    14,    75,   140,   116,   163, 0x0, STR_304E_SELECT_RAILROAD_STATION},
       
   847 
       
   848 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    22,    36,   177,   188, STR_00CB_1, STR_304F_SELECT_NUMBER_OF_PLATFORMS},
       
   849 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    37,    51,   177,   188, STR_00CC_2, STR_304F_SELECT_NUMBER_OF_PLATFORMS},
       
   850 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    52,    66,   177,   188, STR_00CD_3, STR_304F_SELECT_NUMBER_OF_PLATFORMS},
       
   851 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    67,    81,   177,   188, STR_00CE_4, STR_304F_SELECT_NUMBER_OF_PLATFORMS},
       
   852 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    82,    96,   177,   188, STR_00CF_5, STR_304F_SELECT_NUMBER_OF_PLATFORMS},
       
   853 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    97,   111,   177,   188, STR_0335_6, STR_304F_SELECT_NUMBER_OF_PLATFORMS},
       
   854 {    WWT_TEXTBTN,   RESIZE_NONE,    14,   112,   126,   177,   188, STR_0336_7, STR_304F_SELECT_NUMBER_OF_PLATFORMS},
       
   855 
       
   856 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    22,    36,   202,   213, STR_00CB_1, STR_3050_SELECT_LENGTH_OF_RAILROAD},
       
   857 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    37,    51,   202,   213, STR_00CC_2, STR_3050_SELECT_LENGTH_OF_RAILROAD},
       
   858 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    52,    66,   202,   213, STR_00CD_3, STR_3050_SELECT_LENGTH_OF_RAILROAD},
       
   859 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    67,    81,   202,   213, STR_00CE_4, STR_3050_SELECT_LENGTH_OF_RAILROAD},
       
   860 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    82,    96,   202,   213, STR_00CF_5, STR_3050_SELECT_LENGTH_OF_RAILROAD},
       
   861 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    97,   111,   202,   213, STR_0335_6, STR_3050_SELECT_LENGTH_OF_RAILROAD},
       
   862 {    WWT_TEXTBTN,   RESIZE_NONE,    14,   112,   126,   202,   213, STR_0336_7, STR_3050_SELECT_LENGTH_OF_RAILROAD},
       
   863 
       
   864 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    37,   111,   216,   227, STR_DRAG_DROP, STR_STATION_DRAG_DROP},
       
   865 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    14,    73,   242,   253, STR_02DB_OFF, STR_3065_DON_T_HIGHLIGHT_COVERAGE},
       
   866 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    74,   133,   242,   253, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA},
       
   867 
       
   868 /* newstations gui additions */
       
   869 {          WWT_6,   RESIZE_NONE,    14,     7,   140,    17,    28, STR_02BD, STR_WAYPOINT_GRAPHICS_TIP},
       
   870 {    WWT_TEXTBTN,   RESIZE_NONE,    14,   129,   139,    18,    27, STR_0225, STR_WAYPOINT_GRAPHICS_TIP},
       
   871 {     WWT_MATRIX,   RESIZE_NONE,    14,     7,   128,    32,   102, 0x501,    STR_WAYPOINT_GRAPHICS_TIP},
       
   872 {  WWT_SCROLLBAR,   RESIZE_NONE,    14,   129,   140,    32,   102, 0x0,      STR_0190_SCROLL_BAR_SCROLLS_LIST},
       
   873 {   WIDGETS_END},
       
   874 };
       
   875 
   752 static const WindowDesc _station_builder_desc = {
   876 static const WindowDesc _station_builder_desc = {
   753 	-1, -1, 148, 200,
   877 	-1, -1, 148, 200,
   754 	WC_BUILD_STATION,WC_BUILD_TOOLBAR,
   878 	WC_BUILD_STATION,WC_BUILD_TOOLBAR,
   755 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
   879 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
   756 	_station_builder_widgets,
   880 	_station_builder_widgets,
   757 	StationBuildWndProc
   881 	StationBuildWndProc
   758 };
   882 };
   759 
   883 
       
   884 static const WindowDesc _newstation_builder_desc = {
       
   885 	-1, -1, 148, 290,
       
   886 	WC_BUILD_STATION,WC_BUILD_TOOLBAR,
       
   887 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
       
   888 	_newstation_builder_widgets,
       
   889 	StationBuildWndProc
       
   890 };
       
   891 
   760 static void ShowStationBuilder(void)
   892 static void ShowStationBuilder(void)
   761 {
   893 {
   762 	AllocateWindowDesc(&_station_builder_desc);
   894 	Window *w;
       
   895 	if (GetNumStationClasses() <= 2 && GetNumCustomStations(STAT_CLASS_DFLT) == 1) {
       
   896 		w = AllocateWindowDesc(&_station_builder_desc);
       
   897 		_railstation.newstations = false;
       
   898 	} else {
       
   899 		w = AllocateWindowDesc(&_newstation_builder_desc);
       
   900 		_railstation.newstations = true;
       
   901 		_railstation.station_count = GetNumCustomStations(_railstation.station_class);
       
   902 
       
   903 		w->vscroll.count = _railstation.station_count;
       
   904 		w->vscroll.cap   = 5;
       
   905 		w->vscroll.pos   = clamp(_railstation.station_type - 2, 0, w->vscroll.count - w->vscroll.cap);
       
   906 	}
   763 }
   907 }
   764 
   908 
   765 static void BuildTrainDepotWndProc(Window *w, WindowEvent *e)
   909 static void BuildTrainDepotWndProc(Window *w, WindowEvent *e)
   766 {
   910 {
   767 	switch (e->event) {
   911 	switch (e->event) {
   836 		w->click_state = (1 << 3) << (_cur_waypoint_type - w->hscroll.pos);
   980 		w->click_state = (1 << 3) << (_cur_waypoint_type - w->hscroll.pos);
   837 		DrawWindowWidgets(w);
   981 		DrawWindowWidgets(w);
   838 
   982 
   839 		for (i = 0; i < 5; i++) {
   983 		for (i = 0; i < 5; i++) {
   840 			if (w->hscroll.pos + i < _waypoint_count) {
   984 			if (w->hscroll.pos + i < _waypoint_count) {
       
   985 				const StationSpec *statspec = GetCustomStationSpec(STAT_CLASS_WAYP, w->hscroll.pos + i);
       
   986 
   841 				DrawWaypointSprite(2 + i * 68, 25, w->hscroll.pos + i, _cur_railtype);
   987 				DrawWaypointSprite(2 + i * 68, 25, w->hscroll.pos + i, _cur_railtype);
       
   988 
       
   989 				if (statspec != NULL &&
       
   990 						HASBIT(statspec->callbackmask, CBM_STATION_AVAIL) &&
       
   991 						GetStationCallback(CBID_STATION_AVAILABILITY, 0, 0, statspec, NULL, INVALID_TILE) == 0) {
       
   992 					GfxFillRect(4 + i * 68, 18, 67 + i * 68, 75, PALETTE_MODIFIER_GREYOUT);
       
   993 				}
   842 			}
   994 			}
   843 		}
   995 		}
   844 		break;
   996 		break;
   845 	}
   997 	}
   846 	case WE_CLICK: {
   998 	case WE_CLICK: {
   847 		switch (e->click.widget) {
   999 		switch (e->click.widget) {
   848 		case 3: case 4: case 5: case 6: case 7:
  1000 		case 3: case 4: case 5: case 6: case 7: {
   849 			_cur_waypoint_type = e->click.widget - 3 + w->hscroll.pos;
  1001 			byte type = e->click.widget - 3 + w->hscroll.pos;
       
  1002 
       
  1003 			/* Check station availability callback */
       
  1004 			const StationSpec *statspec = GetCustomStationSpec(STAT_CLASS_WAYP, type);
       
  1005 			if (statspec != NULL &&
       
  1006 					HASBIT(statspec->callbackmask, CBM_STATION_AVAIL) &&
       
  1007 					GetStationCallback(CBID_STATION_AVAILABILITY, 0, 0, statspec, NULL, INVALID_TILE) == 0) return;
       
  1008 
       
  1009 			_cur_waypoint_type = type;
   850 			SndPlayFx(SND_15_BEEP);
  1010 			SndPlayFx(SND_15_BEEP);
   851 			SetWindowDirty(w);
  1011 			SetWindowDirty(w);
   852 			break;
  1012 			break;
       
  1013 		}
   853 		}
  1014 		}
   854 		break;
  1015 		break;
   855 	}
  1016 	}
   856 
  1017 
   857 	case WE_MOUSELOOP:
  1018 	case WE_MOUSELOOP: