Index: lang/english.txt =================================================================== --- lang/english.txt (revision 4749) +++ lang/english.txt (working copy) @@ -2842,3 +2842,26 @@ STR_PURCHASE_INFO_COST_SPEED :{BLACK}Cost: {GOLD}{CURRENCY}{BLACK} Speed: {GOLD}{VELOCITY} STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}Capacity: {GOLD}{COMMA} passengers, {COMMA} bags of mail STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Powered Wagons: {GOLD}+{POWER}{BLACK} Weight: {GOLD}+{WEIGHT_S} + + +############ NEW FACE SCREEN +STR_FACE_CHIN :{BLACK}Chin +STR_FACE_CHIN_TIP :{BLACK}Select Chin +STR_FACE_EYES :{BLACK}Eyes +STR_FACE_EYES_TIP :{BLACK}Select Eyes +STR_FACE_MOUTH_NOSE :{BLACK}Mouth & Nose +STR_FACE_MOUTH_NOSE_TIP :{BLACK}Select Mouth & Nose +STR_FACE_HAIR :{BLACK}Hair +STR_FACE_HAIR_TIP :{BLACK}Select Hair +STR_FACE_SKIN :{BLACK}Skin Tone +STR_FACE_SKIN_TIP :{BLACK}Select Skin Tone +STR_FACE_CLOTHES :{BLACK}Outfit +STR_FACE_CLOTHES_TIP :{BLACK}Change Outfit +STR_FACE_GLASSES :{BLACK}Glasses +STR_FACE_GLASSES_TIP :{BLACK}Select Glasses +STR_FACE_GENDER :{BLACK}Male / Female +STR_FACE_GENDER_TIP :{BLACK}Select Gender +STR_FACE_RANDOMIZE_TIP :{BLACK}Choose a Random Face +STR_FACE_SAVEFACE :{BLACK}Set as Default +STR_FACE_SAVEFACE_TIP :{BLACK}Set as your default face +STR_FACE_SAVEFACE_DONE :{WHITE}The current face has been set as your default for new games Index: player_gui.c =================================================================== --- player_gui.c (revision 4749) +++ player_gui.c (working copy) @@ -323,7 +323,7 @@ switch (e->event) { case WE_PAINT: { Player *p; - w->click_state = (w->click_state & ~(1<<5|1<<6)) | ((1<<5) << WP(w,facesel_d).gender); + w->click_state = (w->click_state); DrawWindowWidgets(w); p = GetPlayer(w->window_number); DrawPlayerFace(WP(w,facesel_d).face, p->player_color, 2, 16); @@ -331,34 +331,81 @@ case WE_CLICK: switch (e->click.widget) { - case 3: DeleteWindow(w); break; + case 3: DeleteWindow(w); + break; case 4: /* ok click */ DoCommandP(0, 0, WP(w,facesel_d).face, NULL, CMD_SET_PLAYER_FACE); DeleteWindow(w); break; - case 5: /* male click */ - case 6: /* female click */ - WP(w,facesel_d).gender = e->click.widget - 5; + case 5: /* chin */ + WP(w,facesel_d).face = AB(WP(w,facesel_d).face, 4, 2, 1); SetWindowDirty(w); break; - case 7: - WP(w,facesel_d).face = (WP(w,facesel_d).gender << 31) + GB(InteractiveRandom(), 0, 31); + case 6: /* eyes */ + WP(w,facesel_d).face = AB(WP(w,facesel_d).face, 6, 4, 1); + WP(w,facesel_d).face = AB(WP(w,facesel_d).face,20,3,InteractiveRandom()); SetWindowDirty(w); break; + case 7: /* mouth and nose */ + WP(w,facesel_d).face = AB(WP(w,facesel_d).face, 10, 6, 1); + SetWindowDirty(w); + break; + case 8: /* hair */ + WP(w,facesel_d).face = AB(WP(w,facesel_d).face, 16, 4, 3); + SetWindowDirty(w); + break; + case 9: /* Skin - don't ask. but it works!*/ + AB(WP(w,facesel_d).face, 19, 1, 1); + SB(WP(w,facesel_d).face, 26, 1, GB(WP(w,facesel_d).face, 19, 1)); + SB(WP(w,facesel_d).face, 27, 1, GB(WP(w,facesel_d).face, 19, 1)); + SetWindowDirty(w); + break; + case 10: /* Clothes */ + WP(w,facesel_d).face = AB(WP(w,facesel_d).face, 23, 3, 1); + SetWindowDirty(w); + break; + case 11: /* Glasses */ + WP(w,facesel_d).face = AB(WP(w,facesel_d).face, 28, 2, 1); + WP(w,facesel_d).face = SB(WP(w,facesel_d).face, 30, 1, 0); + SetWindowDirty(w); + break; + case 12: /* Gender*/ + WP(w,facesel_d).face = AB(WP(w,facesel_d).face, 31, 1, 1); + SetWindowDirty(w); + break; + case 13: /* Randomize*/ + WP(w,facesel_d).face = Random(); + SetWindowDirty(w); + break; + case 14: + if (_player_face != WP(w,facesel_d).face) { + _player_face = WP(w,facesel_d).face; + ShowErrorMessage(INVALID_STRING_ID,STR_FACE_SAVEFACE_DONE, 0, 0); + } + break; } break; } } static const Widget _select_player_face_widgets[] = { -{ WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, +{ WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 189, 0, 13, STR_7043_FACE_SELECTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, -{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 189, 14, 136, 0x0, STR_NULL}, -{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 94, 137, 148, STR_012E_CANCEL, STR_7047_CANCEL_NEW_FACE_SELECTION}, -{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 95, 189, 137, 148, STR_012F_OK, STR_7048_ACCEPT_NEW_FACE_SELECTION}, -{ WWT_TEXTBTN, RESIZE_NONE, 14, 95, 187, 25, 36, STR_7044_MALE, STR_7049_SELECT_MALE_FACES}, -{ WWT_TEXTBTN, RESIZE_NONE, 14, 95, 187, 37, 48, STR_7045_FEMALE, STR_704A_SELECT_FEMALE_FACES}, -{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 95, 187, 79, 90, STR_7046_NEW_FACE, STR_704B_GENERATE_RANDOM_NEW_FACE}, +{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 189, 14, 136, 0x0, STR_NULL}, +{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 94, 137, 148, STR_012E_CANCEL, STR_7047_CANCEL_NEW_FACE_SELECTION}, +{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 95, 189, 137, 148, STR_012F_OK, STR_7048_ACCEPT_NEW_FACE_SELECTION}, +/* Modified Buttons 5-13*/ +{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 95, 187, 64, 75, STR_FACE_CHIN, STR_FACE_CHIN_TIP}, +{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 95, 187, 40, 51, STR_FACE_EYES, STR_FACE_EYES_TIP}, +{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 95, 187, 52, 63, STR_FACE_MOUTH_NOSE, STR_FACE_MOUTH_NOSE_TIP}, +{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 95, 187, 16, 27, STR_FACE_HAIR, STR_FACE_HAIR_TIP}, +{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 95, 187, 91, 102, STR_FACE_SKIN, STR_FACE_SKIN_TIP}, +{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 95, 187, 76, 87, STR_FACE_CLOTHES, STR_FACE_CLOTHES_TIP}, +{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 95, 187, 28, 39, STR_FACE_GLASSES, STR_FACE_GLASSES_TIP}, +{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 95, 187, 106, 117, STR_FACE_GENDER, STR_FACE_GENDER_TIP}, +{ WWT_IMGBTN, RESIZE_NONE, 14, 4, 92, 18, 133, 0x0, STR_FACE_RANDOMIZE_TIP}, +{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 95, 187, 121, 132, STR_FACE_SAVEFACE, STR_FACE_SAVEFACE_TIP}, { WIDGETS_END}, }; Index: players.c =================================================================== --- players.c (revision 4749) +++ players.c (working copy) @@ -496,8 +496,18 @@ p->avail_railtypes = GetPlayerRailtypes(p->index); p->inaugurated_year = _cur_year; - p->face = Random(); + // Set Player Default Face as from the cfg file + if (_player_face == 0) { + p->face = Random(); + } else { + p->face = _player_face; + } + /* Engine renewal settings */ p->engine_renew_list = NULL; p->renew_keep_length = false; Index: settings.c =================================================================== --- settings.c (revision 4749) +++ settings.c (working copy) @@ -1162,6 +1162,7 @@ SDTG_STR("screenshot_format",SLE_STRB, S, 0, _screenshot_format_name,NULL, STR_NULL, NULL), SDTG_STR("savegame_format", SLE_STRB, S, 0, _savegame_format, NULL, STR_NULL, NULL), SDTG_BOOL("rightclick_emulate", S, 0, _rightclick_emulate, false, STR_NULL, NULL), + SDTG_VAR("player_face", SLE_UINT32, S, 0, _player_face, 0,0, 4294836225,STR_NULL, NULL), SDTG_END() }; Index: variables.h =================================================================== --- variables.h (revision 4749) +++ variables.h (working copy) @@ -412,6 +412,7 @@ /* misc */ VARDEF char _screenshot_name[128]; VARDEF byte _vehicle_design_names; +VARDEF uint32 _player_face; /* Forking stuff */ VARDEF bool _dedicated_forks;