File diff r2497:4f8fde59a2e8 → r2498:8dfa040ed505
ship_gui.c
Show inline comments
 
@@ -349,13 +349,13 @@ static void NewShipWndProc(Window *w, Wi
 
			const Engine* e = GetEngine(SHIP_ENGINES_INDEX);
 
			int x = 2;
 
			int y = 15;
 
			int sel = WP(w,buildtrain_d).sel_index;
 
			int pos = w->vscroll.pos;
 
			EngineID engine_id = SHIP_ENGINES_INDEX;
 
			int selected_id = -1;
 
			EngineID selected_id = INVALID_ENGINE;
 

	
 
			do {
 
				if (HASBIT(e->player_avail, _local_player)) {
 
					if (sel==0) selected_id = engine_id;
 
					if (IS_INT_INSIDE(--pos, -w->vscroll.cap, 0)) {
 
						DrawString(x+75, y+7, GetCustomEngineName(engine_id), sel==0 ? 0xC : 0x10);
 
@@ -365,13 +365,13 @@ static void NewShipWndProc(Window *w, Wi
 
					sel--;
 
				}
 
			} while (++engine_id, ++e,--num);
 

	
 
			WP(w,buildtrain_d).sel_engine = selected_id;
 

	
 
			if (selected_id != -1) {
 
			if (selected_id != INVALID_ENGINE) {
 
				DrawShipPurchaseInfo(2, w->widget[4].top + 1, selected_id);
 
			}
 
		}
 
		break;
 

	
 
	case WE_CLICK:
 
@@ -381,20 +381,20 @@ static void NewShipWndProc(Window *w, Wi
 
			if (i < w->vscroll.cap) {
 
				WP(w,buildtrain_d).sel_index = i + w->vscroll.pos;
 
				SetWindowDirty(w);
 
			}
 
		} break;
 
		case 5: { /* build */
 
			int sel_eng = WP(w,buildtrain_d).sel_engine;
 
			if (sel_eng != -1)
 
			EngineID sel_eng = WP(w,buildtrain_d).sel_engine;
 
			if (sel_eng != INVALID_ENGINE)
 
				DoCommandP(w->window_number, sel_eng, 0, CcBuildShip, CMD_BUILD_SHIP | CMD_MSG(STR_980D_CAN_T_BUILD_SHIP));
 
		} break;
 

	
 
		case 6:	{ /* rename */
 
			int sel_eng = WP(w,buildtrain_d).sel_engine;
 
			if (sel_eng != -1) {
 
			EngineID sel_eng = WP(w,buildtrain_d).sel_engine;
 
			if (sel_eng != INVALID_ENGINE) {
 
				WP(w,buildtrain_d).rename_engine = sel_eng;
 
				ShowQueryString(GetCustomEngineName(sel_eng),
 
					STR_9838_RENAME_SHIP_TYPE, 31, 160, w->window_class, w->window_number);
 
			}
 
		}	break;
 
		}