| 789 | #include "mem.h" |
| 790 | |
| 791 | void DoMultiAllowed(void) { |
| 792 | rendering_state rs; |
| 793 | rend_GetRenderState(&rs); |
| 794 | int cury = 30; |
| 795 | int i; |
| 796 | const char *p; |
| 797 | int objid; |
| 798 | int *index_to_id = NULL; |
| 799 | bool shipsallowed[MAX_SHIPS]; |
| 800 | bool objsallowed[MAX_OBJECTS]; |
| 801 | ConfigItem **ship_list = NULL; |
| 802 | size_t strMax = std::max(strlen(TXT_ALLOW), strlen(TXT_DISALLOW)) + 3; |
| 803 | char *str = (char *)mem_malloc(strMax); |
| 804 | |
| 805 | // Create Text Items and Window |
| 806 | UITextItem cancel_on_text(TXT_CANCEL, UICOL_HOTSPOT_HI); |
| 807 | UITextItem cancel_off_text(TXT_CANCEL, UICOL_HOTSPOT_LO); |
| 808 | |
| 809 | UITextItem exit_on_text(TXT_DONE, UICOL_HOTSPOT_HI); |
| 810 | UITextItem exit_off_text(TXT_DONE, UICOL_HOTSPOT_LO); |
| 811 | |
| 812 | snprintf(str, strMax, "\x18 %s", TXT_ALLOW); |
| 813 | UITextItem add_on(str, UICOL_HOTSPOT_HI); |
| 814 | UITextItem add_off(str, UICOL_HOTSPOT_LO); |
| 815 | |
| 816 | snprintf(str, strMax, "%s \x1a", TXT_DISALLOW); |
| 817 | UITextItem remove_on(str, UICOL_HOTSPOT_HI); |
| 818 | UITextItem remove_off(str, UICOL_HOTSPOT_LO); |
| 819 | mem_free(str); |
| 820 | |
| 821 | UITextItem allowed_ships(TXT_ALLOWEDSHIPS, UICOL_TEXT_NORMAL); |
| 822 | UITextItem banned_ships(TXT_DISALLOWDSHIPS, UICOL_TEXT_NORMAL); |
| 823 | |
| 824 | UITextItem allowed_gen(TXT_ALLOWEDITEMS, UICOL_TEXT_NORMAL); |
| 825 | UITextItem banned_gen(TXT_DISALLOWEDITEM, UICOL_TEXT_NORMAL); |
| 826 | |
| 827 | UITextItem obj_ti[MAX_OBJECT_IDS]; |
| 828 | UITextItem ship_ti[MAX_SHIPS]; |
| 829 | |
| 830 | NewUIWindow menu_wnd; |
| 831 | menu_wnd.Create(0, 0, rs.screen_width, rs.screen_height, UIF_PROCESS_ALL); |
| 832 | |
| 833 | int xcol1 = 110; |
| 834 | int yrow1 = 50; |
| 835 | int xcol2 = 374; |
| 836 | int yrow2 = 250; |
| 837 | int list_xsize = 160; |
| 838 | int list_ysize = 160; |
| 839 | |
| 840 | NewUIListBox lb_ships_allowed; |
| 841 | NewUIListBox lb_ships_banned; |
| 842 | |
| 843 | NewUIListBox lb_generic_allowed; |
| 844 | NewUIListBox lb_generic_banned; |
| 845 | UIHotspot exit_hs; |
| 846 | UIHotspot add_ship_hs; |
| 847 | UIHotspot remove_ship_hs; |
| 848 | UIHotspot add_gen_hs; |
no test coverage detected