/** * @brief Generates error dialogues used by several landing tabs. * @param name Name of the ship, outfit or commodity being acted upon. * @param type Type of action. */ int land_errDialogue( char* name, char* type ) { errorlist_ptr = NULL; if (strcmp(type,"tradeShip")==0) shipyard_canTrade( name ); else if (strcmp(type,"buyShip")==0) shipyard_canBuy( name, land_planet ); else if (strcmp(type,"swapEquipment")==0) can_swapEquipment( name ); else if (strcmp(type,"swap")==0) can_swap( name ); else if (strcmp(type,"sellShip")==0) can_sell( name ); else if (strcmp(type,"buyOutfit")==0) outfit_canBuy( name, land_planet ); else if (strcmp(type,"sellOutfit")==0) outfit_canSell( name ); else if (strcmp(type,"buyCommodity")==0) commodity_canBuy( name ); else if (strcmp(type,"sellCommodity")==0) commodity_canSell( name ); if (errorlist_ptr != NULL) { dialogue_alert( "%s", errorlist ); return 1; } return 0; }
/** * @brief Generates error dialogues used by several landing tabs. * @param shipname Ship being acted upon. * @param type Type of action. */ int land_errDialogue( char* shipname, char* type ) { errorlist_ptr = NULL; if (strcmp(type,"trade")==0) shipyard_canTrade( shipname ); else if (strcmp(type,"buy")==0) shipyard_canBuy( shipname ); else if (strcmp(type,"swapEquipment")==0) can_swapEquipment( shipname ); else if (strcmp(type,"swap")==0) can_swap( shipname ); else if (strcmp(type,"sell")==0) can_sell( shipname ); if (errorlist_ptr != NULL) { dialogue_alert( "%s", errorlist ); return 1; } return 0; }