/******************************************************************************************* * Graphics Section *******************************************************************************************/ ///////////////////////////////////////////////////////////////////////////////////////////// // Oggetti ///////////////////////////////////////////////////////////////////////////////////////////// class Freccina { Freccina(int rotazione, int x,int y, boolean contorno) { stroke(bianco); if(contorno==true) { strokeWeight(1); fill(bianco); } else { strokeWeight(1); noFill(); } //freccina su if(rotazione==1) { triangle(x+5,y,x,y+5,x+10,y+5); // freccina verso l'alto } if(rotazione==0) { triangle(x+5,y+5,x,y,x+10,y); // freccina vero il basso } if(rotazione==2) { triangle(x,y+5,x+5,y,x+5,y+10); // freccina vero sinistra } if(rotazione==3) { triangle(x,y,x+5,y+5,x,y+10); // freccina vero destra } } } ///////////////////////////////////////////////////////////////////////////////////////////// // Variabili x le immagini/testi e funzione x caricarle ///////////////////////////////////////////////////////////////////////////////////////////// // definisco le variabili per gli sfondi PImage bg_DEFAULT; PImage bg_pulsanti; PImage bg_ORGANIZZAcuisineIta; PImage bg_ORGANIZZAcuisineChi; PImage bg_ORGANIZZAcuisineJap; PImage bg_ORGANIZZAcuisineMex; PImage bg_ORGANIZZAcuisineGre; PImage SPLASHlogo; PImage photos; // freccine Freccina freccinaSuCuisine; Freccina freccinaGiuCuisine; Freccina freccinaSuTasks; Freccina freccinaGiuTasks; Freccina freccinaSuGuests; Freccina freccinaGiuGuests; Freccina freccinaSuUserslist; Freccina freccinaGiuUserslist; Freccina freccinaSxProfile; Freccina freccinaDxProfile; // definisco le variabili per le icone PImage ORGANIZZAcuisineIta; PImage ORGANIZZAcuisineChi; PImage ORGANIZZAcuisineJap; PImage ORGANIZZAcuisineMex; PImage ORGANIZZAcuisineGre; PImage ORGANIZZAtasksHost; PImage ORGANIZZAtasksCook; PImage ORGANIZZAtasksShop; PImage ORGANIZZAtasksClean; PImage ORGANIZZAguests3; PImage ORGANIZZAguests4; PImage ORGANIZZAguests5; PImage ORGANIZZAguests6; PImage ORGANIZZAguests7; PImage ORGANIZZAguests8; PImage ORGANIZZApopup; PImage SCELTAwc; PImage SCELTAgallery; PImage SCELTAuser; PImage SCELTAsearch; PImage SCELTAlogo; PImage USERSLIST_bg_20; PImage USERSLIST_bg_40; PImage USERSLIST_host; PImage USERSLIST_cook; PImage USERSLIST_shop; PImage USERSLIST_clean; PImage USERSLIST_m; PImage USERSLIST_f; PImage PROFILEPuccio; PImage PROFILEElvezia; PImage PROFILEArtemisia; PImage PROFILEGiuliano; PImage PROFILEValeria; PImage PROFILE_quadratino_20; PImage PROFILE_quadratino_40; PImage PROFILE_quadrato_20; PImage PROFILE_quadrato_40; PImage PROFILE_qualities; PImage PROFILE_qualities_page; PImage PROFILE_invite; PImage PROFILE_photo; PImage PROFILE_popup; PImage PROFILE_friends; PImage PROFILE_friends_page; PImage PROFILE_ban; PImage PROFILE_pm; PImage PROFILE_popup_pm; PImage MYPROFILE_edit; PImage MYPROFILE_no_invite; PImage MYPROFILE_button_lungo; PImage MYPROFILE_button_lungo_off; PImage MYPROFILE_button_corto; PImage MYPROFILE_button_corto_off; PImage PHOTOS_italian; PImage PHOTOS_chinese; PImage PHOTOS_japanese; PImage PHOTOS_mexican; PImage PHOTOS_greek; PImage PHOTOS_piu; PImage pictures00; PImage pictures01; PImage pictures02; PImage quadratone_20; PImage quadratone_40; PImage quadratino_20; PImage quadratino_40; PImage quadratinoSelected; PImage popup_pulsanteAttivo; PImage popup_pulsanteDisattivo; // definisco le variabili per i testi PFont TrebuchetMS_13; PFont TrebuchetMS_16; PFont TrebuchetMS_16_giallo; PFont TrebuchetMS_16_bold_giallo; PFont TrebuchetMS_16_bold_rosso; PFont TrebuchetMS_16_bold; PFont TrebuchetMS_16_bold_chiaro; PFont TrebuchetMS_18; PFont TrebuchetMS_24; PFont TrebuchetMS_24_bold; PFont TrebuchetMS_24_bold_rosso; // colori color bianco; color arancione; color arancioneChiaro; color rosso; color giallo; // testi String testoTasks; String testoCuisine; // funzione che mi preloada tutte le imgs void loadImages() { // bg_ORGANIZZAZIONE CENA //////////////////////////////////// // SFONDI bg_DEFAULT = loadImage("bg.png"); bg_pulsanti = loadImage("bg_pulsanti.png"); bg_ORGANIZZAcuisineIta = loadImage("bg_ORGANIZE_italian.png"); bg_ORGANIZZAcuisineChi = loadImage("bg_ORGANIZE_chinese.png"); bg_ORGANIZZAcuisineJap = loadImage("bg_ORGANIZE_japanese.png"); bg_ORGANIZZAcuisineMex = loadImage("bg_ORGANIZE_mexican.png"); bg_ORGANIZZAcuisineGre = loadImage("bg_ORGANIZE_greek.png"); // ICONE ORGANIZZAcuisineIta = loadImage("ORGANIZE_cuisine_italian.png"); ORGANIZZAcuisineChi = loadImage("ORGANIZE_cuisine_chinese.png"); ORGANIZZAcuisineJap = loadImage("ORGANIZE_cuisine_japanese.png"); ORGANIZZAcuisineMex = loadImage("ORGANIZE_cuisine_mexican.png"); ORGANIZZAcuisineGre = loadImage("ORGANIZE_cuisine_greek.png"); ORGANIZZAtasksHost = loadImage("ORGANIZE_tasks_host.png"); ORGANIZZAtasksCook = loadImage("ORGANIZE_tasks_cook.png"); ORGANIZZAtasksShop = loadImage("ORGANIZE_tasks_shop.png"); ORGANIZZAtasksClean = loadImage("ORGANIZE_tasks_clean.png"); ORGANIZZAguests3 = loadImage("ORGANIZE_guests_3.png"); ORGANIZZAguests4 = loadImage("ORGANIZE_guests_4.png"); ORGANIZZAguests5 = loadImage("ORGANIZE_guests_5.png"); ORGANIZZAguests6 = loadImage("ORGANIZE_guests_6.png"); ORGANIZZAguests7 = loadImage("ORGANIZE_guests_7.png"); ORGANIZZAguests8 = loadImage("ORGANIZE_guests_8.png"); ORGANIZZApopup = loadImage("ORGANIZE_popup.png"); SCELTAwc = loadImage("SCELTA_wc.png"); SCELTAgallery = loadImage("SCELTA_gallery.png"); SCELTAuser = loadImage("SCELTA_user.png"); SCELTAsearch = loadImage("SCELTA_search.png"); SCELTAlogo = loadImage("ORGANIZE_cuisine_greek.png"); quadratone_20 = loadImage("quadratone_bianco_20.png"); quadratone_40 = loadImage("quadratone_bianco_40.png"); quadratino_20 = loadImage("quadratino_bianco_20.png"); quadratino_40 = loadImage("quadratino_bianco_40.png"); quadratinoSelected = loadImage("quadratino_bianco_traccia.png"); popup_pulsanteAttivo = loadImage("popup_pulsante_attivo.png"); popup_pulsanteDisattivo = loadImage("popup_pulsante_disattivo.png"); USERSLIST_bg_20 = loadImage("USERSLIST_bg_20.png"); USERSLIST_bg_40 = loadImage("USERSLIST_bg_40.png"); USERSLIST_host = loadImage("USERSLIST_host.png"); USERSLIST_cook = loadImage("USERSLIST_cook.png"); USERSLIST_shop = loadImage("USERSLIST_shop.png"); USERSLIST_clean = loadImage("USERSLIST_clean.png"); USERSLIST_m = loadImage("USERSLIST_m.png"); USERSLIST_f = loadImage("USERSLIST_f.png"); PROFILEPuccio = loadImage("PROFILE_puccio.jpg"); PROFILEArtemisia = loadImage("PROFILE_artemisia.png"); PROFILEElvezia = loadImage("PROFILE_elvezia.jpg"); PROFILEGiuliano = loadImage("PROFILE_giuliano.png"); PROFILEValeria = loadImage("PROFILE_valeria.png"); PROFILE_qualities = loadImage("PROFILE_qualities.png"); PROFILE_quadratino_40 = loadImage("PROFILE_quadratino_40.png"); PROFILE_quadratino_20 = loadImage("PROFILE_quadratino_20.png"); PROFILE_quadrato_40 = loadImage("PROFILE_quadrato_40.png"); PROFILE_quadrato_20 = loadImage("PROFILE_quadrato_20.png"); PROFILE_invite = loadImage("PROFILE_invite.png"); PROFILE_photo = loadImage("PROFILE_photo.png"); PROFILE_friends = loadImage("PROFILE_friends.png"); PROFILE_ban = loadImage("PROFILE_ban.png"); PROFILE_pm = loadImage("PROFILE_pm.png"); PROFILE_popup_pm = loadImage("PROFILE_popup_pm.png"); PROFILE_popup = loadImage("PROFILE_popup.png"); PROFILE_qualities_page = loadImage("PROFILE_qualities_page.png"); PROFILE_friends_page = loadImage("PROFILE_friends_page.png"); MYPROFILE_edit = loadImage("MYPROFILE_edit.png"); MYPROFILE_no_invite = loadImage("MYPROFILE_no_invite.png"); MYPROFILE_button_lungo = loadImage("MYPROFILE_button_lungo.png"); MYPROFILE_button_lungo_off = loadImage("MYPROFILE_button_lungo_off.png"); MYPROFILE_button_corto = loadImage("MYPROFILE_button_corto.png"); MYPROFILE_button_corto_off = loadImage("MYPROFILE_button_corto_off.png"); PHOTOS_italian = loadImage("PHOTOS_italian.png"); PHOTOS_chinese = loadImage("PHOTOS_chinese.png"); PHOTOS_japanese = loadImage("PHOTOS_japanese.png"); PHOTOS_mexican = loadImage("PHOTOS_mexican.png"); PHOTOS_greek = loadImage("PHOTOS_greek.png"); PHOTOS_piu = loadImage("PHOTOS_+.png"); pictures00 = loadImage("pictures00.jpg"); pictures01 = loadImage("pictures01.jpg"); pictures02 = loadImage("pictures02.jpg"); SPLASHlogo = loadImage("SPLASH_logo.png"); photos = loadImage("strisciaperspalsh.png"); } void loadFonts() { TrebuchetMS_13 = loadFont("TrebuchetMS_13.mvlw", bianco); TrebuchetMS_16 = loadFont("TrebuchetMS_16.mvlw", bianco, arancione); TrebuchetMS_16_giallo = loadFont("TrebuchetMS_16.mvlw", giallo, arancione); TrebuchetMS_16_bold = loadFont("TrebuchetMS_16_bold.mvlw", bianco, arancione); TrebuchetMS_16_bold_giallo = loadFont("TrebuchetMS_16_bold.mvlw", giallo, arancione); TrebuchetMS_16_bold_rosso = loadFont("TrebuchetMS_16_bold.mvlw", rosso, arancioneChiaro); TrebuchetMS_16_bold_chiaro = loadFont("TrebuchetMS_16_bold.mvlw", bianco, arancioneChiaro); TrebuchetMS_18 = loadFont("TrebuchetMS_18.mvlw", bianco, arancione); TrebuchetMS_24 = loadFont("TrebuchetMS_24.mvlw", bianco, arancione); TrebuchetMS_24_bold = loadFont("TrebuchetMS_24_bold.mvlw", bianco, arancione); TrebuchetMS_24_bold_rosso = loadFont("TrebuchetMS_24_bold.mvlw", rosso, arancioneChiaro); } ///////////////////////////////////////////////////////////////////////////////////////////// // Disegno cose nello schermo ///////////////////////////////////////////////////////////////////////////////////////////// void drawPhoto(int whichPhoto, int x, int y) { image(photos, photoWidth * whichPhoto, 0, photoWidth, photos.height, x, y); } void drawMenu(int sezione, int sottoSezione, int focusCuisine, int focusTasks, int focusGuests) { image(bg_DEFAULT, 0, 0); // disegno lo sfondo di default textFont(TrebuchetMS_13); // imposta il testo textAlign(CENTER); /* SPLASH PAGE **************************************************/ if(sezione == SPLASH_SCREEN) { image(SPLASHlogo, 60, 230); if(animationCounter%150>=0 && animationCounter%150<30) { drawPhoto(0, 0, 20); drawPhoto(1, 65, 20); drawPhoto(2, 130, 20); drawPhoto(3, 195, 20); drawPhoto(4, 0, 85); drawPhoto(5, 65, 85); drawPhoto(6, 130, 85); drawPhoto(7, 195, 85); drawPhoto(8, 0, 150); drawPhoto(9, 65, 150); drawPhoto(10, 130, 150); drawPhoto(11, 195, 150); } else if(animationCounter%150>=30 && animationCounter%150<60){ drawPhoto(12, 0, 20); drawPhoto(11, 65, 20); drawPhoto(10, 130, 20); drawPhoto(9, 195, 20); drawPhoto(8, 0, 85); drawPhoto(7, 65, 85); drawPhoto(6, 130, 85); drawPhoto(5, 195, 85); drawPhoto(4, 0, 150); drawPhoto(3, 65, 150); drawPhoto(2, 130, 150); drawPhoto(1, 195, 150); } else if(animationCounter%150>=60 && animationCounter%150<90){ drawPhoto(12, 0, 20); drawPhoto(4, 65, 20); drawPhoto(10, 130, 20); drawPhoto(7, 195, 20); drawPhoto(8, 0, 85); drawPhoto(1, 65, 85); drawPhoto(6, 130, 85); drawPhoto(5, 195, 85); drawPhoto(4, 0, 150); drawPhoto(3, 65, 150); drawPhoto(2, 130, 150); drawPhoto(0, 195, 150); } else if(animationCounter%150>=90 && animationCounter%150<120){ drawPhoto(10, 0, 20); drawPhoto(1, 65, 20); drawPhoto(4, 130, 20); drawPhoto(7, 195, 20); drawPhoto(11, 0, 85); drawPhoto(2, 65, 85); drawPhoto(5, 130, 85); drawPhoto(8, 195, 85); drawPhoto(12, 0, 150); drawPhoto(3, 65, 150); drawPhoto(6, 130, 150); drawPhoto(9, 195, 150); } else if(animationCounter%150>=120 && animationCounter%150<150){ drawPhoto(3, 0, 20); drawPhoto(4, 65, 20); drawPhoto(5, 130, 20); drawPhoto(6, 195, 20); drawPhoto(1, 0, 85); drawPhoto(3, 65, 85); drawPhoto(8, 130, 85); drawPhoto(0, 195, 85); drawPhoto(12, 0, 150); drawPhoto(10, 65, 150); drawPhoto(2, 130, 150); drawPhoto(9, 195, 150); } } /* SEZIONE: Menu principale ************************************/ if(sezione == MENU_PRINCIPALE) { titolo = ""; // disegno i quadratini di sfondo alle icone if(sottoSezione == MODE_WC) image(quadratone_40, 80, 60); else image(quadratone_20, 80, 60); if(sottoSezione == MODE_GALLERY) image(quadratino_40, 20, 180); else image(quadratino_20, 20, 180); if(sottoSezione == MODE_USER) image(quadratino_40, 90, 180); else image(quadratino_20, 90, 180); if(sottoSezione == MODE_SEARCH) image(quadratino_40, 160, 180); else image(quadratino_20, 160, 180); // Disegno icone /////////////////////////// // icone e logo image(SCELTAwc,85,75 ); image(SCELTAgallery,25,186); image(SCELTAuser,100, 186 ); image(SCELTAsearch,169,183 ); // Disegno testo //////////////////////////// if(sottoSezione == MODE_WC) text("I'm starving!", 124 , 162); if(sottoSezione == MODE_GALLERY) text("See the photos!",64, 252); if(sottoSezione == MODE_USER) text("My profile", 117, 252); if(sottoSezione == MODE_SEARCH) text("Search other guests!", 157, 252); } /* SEZIONE: Organizza cena **********************************************/ if(sezione == SEZIONE_ORGANIZZA_CENA) { // TITOLO titolo = "What's for dinner?"; // Disegno lo sfondo if(focusCuisine == 0){ image(bg_ORGANIZZAcuisineIta, 0, 0); } else if(focusCuisine == 1){ image(bg_ORGANIZZAcuisineChi, 0, 0); } else if(focusCuisine == 2){ image(bg_ORGANIZZAcuisineJap, 0, 0); } else if(focusCuisine == 3){ image(bg_ORGANIZZAcuisineMex, 0, 0); } else if(focusCuisine == 4){ image(bg_ORGANIZZAcuisineGre, 0, 0); } // Disegno icone /////////////////////////// // disegno i quadratini di sfondo alle icone if(sottoSezione == MODE_CUISINE) image(quadratino_40, 23, 152); else image(quadratino_20, 23, 152); if(sottoSezione == MODE_TASKS) image(quadratino_40, 93, 152); else image(quadratino_20, 93, 152); if(sottoSezione == MODE_GUESTS) image(quadratino_40, 161, 152); else image(quadratino_20, 161, 152); // disegno i contornini per gli sfondi-icona già selezionati if(selectCuisine == true) image(quadratinoSelected, 23, 152); if(selectTasks == true) image(quadratinoSelected, 93, 152); if(selectGuests == true) image(quadratinoSelected, 161, 152); // Disegno le freccine ///////////////////// freccinaSuCuisine = new Freccina(1,44,142,premoSuCuisine); freccinaGiuCuisine = new Freccina(0,44,213,premoGiuCuisine); freccinaSuTasks = new Freccina(1,114,142,premoSuTasks); freccinaGiuTasks = new Freccina(0,114,213,premoGiuTasks); freccinaSuGuests = new Freccina(1,183,142,premoSuGuests); freccinaGiuGuests = new Freccina(0,183,213,premoGiuGuests); // icone CUISINE if(focusCuisine == 0){ image(ORGANIZZAcuisineIta, 27, 156); } else if(focusCuisine == 1){ image(ORGANIZZAcuisineChi, 27, 156); } else if(focusCuisine == 2){ image(ORGANIZZAcuisineJap, 26, 155); } else if(focusCuisine == 3){ image(ORGANIZZAcuisineMex, 27, 156); } else if(focusCuisine == 4){ image(ORGANIZZAcuisineGre, 27, 162); } // icone TASKS if(focusTasks == 0){ image(ORGANIZZAtasksHost, 97, 156); } else if(focusTasks == 1){ image(ORGANIZZAtasksCook, 97, 156); } else if(focusTasks == 2){ image(ORGANIZZAtasksShop, 97, 156); } else if(focusTasks == 3){ image(ORGANIZZAtasksClean, 97, 156); } // icone GUESTS if(focusGuests == 0){ image(ORGANIZZAguests3, 167, 159); } else if(focusGuests == 1){ image(ORGANIZZAguests4, 167, 159); } else if(focusGuests == 2){ image(ORGANIZZAguests5, 167, 159); } else if(focusGuests == 3){ image(ORGANIZZAguests6, 167, 159); } else if(focusGuests == 4){ image(ORGANIZZAguests7, 167, 158); } else if(focusGuests == 5){ image(ORGANIZZAguests8, 167, 159); } // Disegno testo //////////////////////////// textFont(TrebuchetMS_13); // imposta il testo textAlign(CENTER); if(sottoSezione == MODE_CUISINE) { if(focusCuisine == 0){ text("Italian", 50, 240); } else if(focusCuisine == 1){ text("Chinese", 50, 240); } else if(focusCuisine == 2){ text("Japanese", 50, 240); } else if(focusCuisine == 3){ text("Mexican", 50, 240); } else if(focusCuisine == 4){ text("Greek", 50, 240); } } if(sottoSezione == MODE_TASKS) { if(focusTasks == 0){ text("Hosting", 120, 240); } else if(focusTasks == 1){ text("Cooking", 120, 240); } else if(focusTasks == 2){ text("Shopping", 120, 240); } else if(focusTasks == 3){ text("Cleaning", 120, 240); } } if(sottoSezione == MODE_GUESTS) { if(focusGuests == 0){ text("3 Guests", 187, 240); } else if(focusGuests == 1){ text("4 Guests", 187, 240); } else if(focusGuests == 2){ text("5 Guests", 187, 240); } else if(focusGuests == 3){ text("6 Guests", 187, 240); } else if(focusGuests == 4){ text("7 Guests", 187, 240); } else if(focusGuests == 5){ text("8 Guests", 187, 240); } } // POP-UP //////////////////// if(sottoSezione == MODE_RESULTS) { // immagini image(ORGANIZZApopup, 20, 140); // pulsante YES if(buttonPopup == true) image(popup_pulsanteAttivo, 110, 230); else image(popup_pulsanteDisattivo, 110, 230); // pulsante NO if(buttonPopup == true) image(popup_pulsanteDisattivo, 160, 230); else image(popup_pulsanteAttivo, 160, 230); textAlign(LEFT); textFont(TrebuchetMS_16); // creo il testo da scrivere, a seconda della dinner che ho scelto if(focusCuisine==0) testoCuisine = "an italian "; if(focusCuisine==1) testoCuisine = "a chinese "; if(focusCuisine==2) testoCuisine = "a japanese "; if(focusCuisine==3) testoCuisine = "a mexican "; if(focusCuisine==4) testoCuisine = "a greek "; if(focusTasks==0) testoTasks = "host "; if(focusTasks==1) testoTasks = "cook "; if(focusTasks==2) testoTasks = "shop for "; if(focusTasks==3) testoTasks = "clean after "; testoPopup = "So... tonight you're gonna "+testoTasks+testoCuisine+"dinner for "+(focusGuests+3)+"?"; text(testoPopup, 35, 155, 170, 120); // tasi SI e NO textFont(TrebuchetMS_16_bold); text("Yes", 117, 248); text("No", 170, 248); } } /* SEZIONE: Users list *********************************************************************/ if(sezione == SEZIONE_USERSLIST) { titolo = "Choose your guests!"; freccinaSuUserslist = new Freccina(1,114,136,premoSuUserlist); freccinaGiuUserslist = new Freccina(0,114,269,premoGiuUserlist); textFont(TrebuchetMS_16_bold_chiaro); textAlign(LEFT); print(startElenco); for(int i=startElenco; i<=3; i=i+1) { if(utenteSelezionato == i) image(USERSLIST_bg_40, 23, 146+31*i); else image(USERSLIST_bg_20, 23, 146+31*i); // immagine tasks if(UtentiTasks[i] == "Host") image(USERSLIST_host, 185, 146+31*i); if(UtentiTasks[i] == "Cook") image(USERSLIST_cook, 185, 146+31*i); if(UtentiTasks[i] == "Shop") image(USERSLIST_shop, 185, 146+31*i); if(UtentiTasks[i] == "Clean") image(USERSLIST_clean, 185, 146+31*i); // icona utente if(UtentiGender[i] == "M") image(USERSLIST_m, 25, 147+31*i); if(UtentiGender[i] == "F") image(USERSLIST_f, 25, 147+31*i); text(Utenti[i], 65, 164+31*i); } } /* SEZIONE: Profilo utente ******************************************************/ if(sezione == SEZIONE_USERS_PROFILES) { titolo = ""; textAlign(LEFT); // SOLO se sto visualizzando la friends page... if(sottoSezione == MODE_FRIENDS_PAGE) { // FRIENDS PAGE textFont(TrebuchetMS_13); image(PROFILE_friends_page, 0, 0); text("You have 3 friends in common with "+PROFILEselected+"!", 124, 180, 100, 100); } else { // SOLO se non sto visualizzando una pagina interna... if(sottoSezione != MODE_QUALITIES_PAGE) { // disegno i quadratini di sfondo alle icone if(sottoSezione == MODE_QUALITIES) image(PROFILE_quadratino_40, 120, 109); else image(PROFILE_quadratino_20, 120, 109); if(sottoSezione == MODE_INVITE) image(PROFILE_quadrato_40, 20, 160); else image(PROFILE_quadrato_20, 20, 160); if(sottoSezione == MODE_PHOTO) image(PROFILE_quadrato_40, 70, 160); else image(PROFILE_quadrato_20, 70, 160); if(sottoSezione == MODE_FRIENDS) image(PROFILE_quadrato_40, 120, 160); else image(PROFILE_quadrato_20, 120, 160); if(sottoSezione == MODE_BAN) image(PROFILE_quadrato_40, 170, 160); else image(PROFILE_quadrato_20, 170, 160); textAlign(CENTER); textFont(TrebuchetMS_13); // testi if(sottoSezione == MODE_QUALITIES) text("Qualities", 181, 140); if(sottoSezione == MODE_INVITE) { if(utenteInvitato == PROFILEselected) text("Send PM", 40, 220); else text("Invite", 40, 220); } if(sottoSezione == MODE_PHOTO) text("Photos", 90, 220); if(sottoSezione == MODE_FRIENDS) text("Friends", 141, 220); if(sottoSezione == MODE_BAN) text("Report", 191, 220); // icone image(PROFILE_qualities, 122, 112); if(utenteInvitato == PROFILEselected) image(PROFILE_pm, 24, 163); else image(PROFILE_invite, 23, 168); image(PROFILE_photo, 73, 164); image(PROFILE_friends, 124, 163); image(PROFILE_ban, 174, 163); // testo what is he doing // creo il testo da scrivere, a seconda della dinner che ho scelto if(focusCuisine==0) testoCuisine = "an italian "; if(focusCuisine==1) testoCuisine = "a chinese "; if(focusCuisine==2) testoCuisine = "a japanese "; if(focusCuisine==3) testoCuisine = "a mexican "; if(focusCuisine==4) testoCuisine = "a greek "; if(PROFILETasks==0) { testoTasks = "host "; image(USERSLIST_host, 20, 240); } if(PROFILETasks==1) { testoTasks = "cook "; image(USERSLIST_cook, 20, 240); } if(PROFILETasks==2) { testoTasks = "shop for "; image(USERSLIST_shop, 20, 240); } if(PROFILETasks==3) { testoTasks = "clean after "; image(USERSLIST_clean, 20, 240); } textFont(TrebuchetMS_13); textAlign(LEFT); String testoPopup = PROFILEselected+"'s gonna "+testoTasks+testoCuisine+"dinner for "+(focusGuests+3)+"."; text(testoPopup, 48, 240, 170, 120); } if(mode == MODE_QUALITIES_PAGE) { textFont(TrebuchetMS_13); textAlign(LEFT); image(PROFILE_qualities_page, 120, 170); text("Cooking skills", 30, 182); text("Tidiness", 30, 205); text("Friendliness", 30, 228); text("Organization", 30, 251); } // Profili textAlign(LEFT); if(PROFILEselected == "Puccio") { image(PROFILEPuccio, 20, 45); textFont(TrebuchetMS_16_bold); text("Puccio", 120, 57); textFont(TrebuchetMS_16); for(int i=1; i<=3; i++) { text(Puccio[i], 120, 57+16*i); } PROFILETasks = 1; } if(PROFILEselected == "Giuliano") { image(PROFILEGiuliano, 20, 45); textFont(TrebuchetMS_16_bold); text("Giuliano", 120, 57); textFont(TrebuchetMS_16); for(int i=1; i<=3; i++) { text(Giuliano[i], 120, 57+16*i); } PROFILETasks = 2; } if(PROFILEselected == "Artemisia") { image(PROFILEArtemisia, 20, 45); textFont(TrebuchetMS_16_bold); text("Artemisia", 120, 57); textFont(TrebuchetMS_16); for(int i=1; i<=3; i++) { text(Artemisia[i], 120, 57+16*i); } PROFILETasks = 0; } if(PROFILEselected == "Elvezia") { image(PROFILEElvezia, 20, 45); textFont(TrebuchetMS_16_bold); text("Elvezia", 120, 57); textFont(TrebuchetMS_16); for(int i=1; i<=3; i++) { text(Elvezia[i], 120, 57+16*i); } PROFILETasks = 3; } // POP-UP //////////////////// if(sottoSezione == MODE_INVITE_POPUP) { // se non ho mai invitato questo utente ///////////////////////// if(utenteInvitato != PROFILEselected) { // immagini image(PROFILE_popup, 20, 150); // pulsante YES if(buttonPopup == true) image(popup_pulsanteAttivo, 110, 230); else image(popup_pulsanteDisattivo, 110, 230); // pulsante NO if(buttonPopup == true) image(popup_pulsanteDisattivo, 160, 230); else image(popup_pulsanteAttivo, 160, 230); textAlign(LEFT); textFont(TrebuchetMS_16); testoPopup = "Wanna invite "+PROFILEselected+" for dinner tonight?"; text(testoPopup, 35, 165, 170, 120); // tasi SI e NO textFont(TrebuchetMS_16_bold); text("Yes", 117, 248); text("No", 170, 248); } else { // immagini image(PROFILE_popup_pm, 20, 154); stroke(0); if(frameCounter%30>=0 && frameCounter%30<15) noStroke(); else strokeWeight(1); println(frameCounter%30); line(26,160,26,172); } } // POP-UP //////////////////// if(sottoSezione == MODE_BAN_POPUP) { // immagini image(PROFILE_popup, 20, 150); // pulsante YES if(buttonPopup == true) image(popup_pulsanteAttivo, 110, 230); else image(popup_pulsanteDisattivo, 110, 230); // pulsante NO if(buttonPopup == true) image(popup_pulsanteDisattivo, 160, 230); else image(popup_pulsanteAttivo, 160, 230); textAlign(LEFT); textFont(TrebuchetMS_16); testoPopup = "Do you want to report "+PROFILEselected+" for bad behaviour?"; text(testoPopup, 35, 165, 170, 120); // tasi SI e NO textFont(TrebuchetMS_16_bold); text("Yes", 117, 248); text("No", 170, 248); } } } /* SEZIONE: mio profilo ******************************************************/ if(sezione == SEZIONE_MY_PROFILE) { titolo = ""; textAlign(LEFT); textFont(TrebuchetMS_16_bold_giallo); text("My profile", 120, 57); // disegno i quadratini di sfondo alle icone if(sottoSezione == MODE_MESSAGES) image(PROFILE_quadrato_40, 20, 160); else image(PROFILE_quadrato_20, 20, 160); if(sottoSezione == MODE_MY_PHOTOS) image(PROFILE_quadrato_40, 70, 160); else image(PROFILE_quadrato_20, 70, 160); if(sottoSezione == MODE_SET_INVITES) image(PROFILE_quadrato_40, 120, 160); else image(PROFILE_quadrato_20, 120, 160); if(sottoSezione == MODE_EDIT) image(PROFILE_quadrato_40, 170, 160); else image(PROFILE_quadrato_20, 170, 160); textAlign(CENTER); textFont(TrebuchetMS_13); // testi if(sottoSezione == MODE_MESSAGES) text("Messages", 40, 220); if(sottoSezione == MODE_MY_PHOTOS) text("Photos", 90, 220); if(sottoSezione == MODE_SET_INVITES) { if(settaInviti == true) text("Stop invites", 141, 220); else text("Get invites", 141, 220); } if(sottoSezione == MODE_EDIT) text("Edit", 191, 220); // icone image(PROFILE_pm, 24, 166); textFont(TrebuchetMS_24_bold_rosso); text("3", 52, 180); image(PROFILE_photo, 73, 163); if(settaInviti == true) image(PROFILE_invite, 123, 168); else image(MYPROFILE_no_invite, 123, 164); image(MYPROFILE_edit, 174, 163); // testo what are u doing image(USERSLIST_clean, 20, 240); textFont(TrebuchetMS_13); textAlign(LEFT); String testoPopup = "You're gonna clean after an italian dinner for 6."; text(testoPopup, 48, 240, 170, 120); // Profilo textAlign(LEFT); image(PROFILEValeria, 20, 45); textFont(TrebuchetMS_16_bold); text("Valeria", 120, 88); textFont(TrebuchetMS_16); for(int i=1; i<=3; i++) { text(Valeria[i], 120, 88+16*i); } // MESSAGES //////////////////// if(sottoSezione == MODE_VIEW_MESSAGES) { //freccine freccinaSxProfile = new Freccina(2,10,205,premoSxProfile); freccinaDxProfile = new Freccina(3,220,205,premoDxProfile); if(leggiMessaggio==2) { image(PROFILE_popup, 20, 150); textAlign(LEFT); textFont(TrebuchetMS_16); testoPopup = "Artemisia has accepted your invite to an italian dinner for 6."; text(testoPopup, 35, 165, 170, 120); // bottone image(MYPROFILE_button_lungo, 47, 235); textFont(TrebuchetMS_16_bold); text("Go to her profile", 55, 253); } if(leggiMessaggio==1) { image(PROFILE_popup, 20, 150); textAlign(LEFT); textFont(TrebuchetMS_16); testoPopup = "Elvezia has invited you to a greek dinner for 5."; text(testoPopup, 35, 165, 175, 120); //testoPopup = "Valeria has invited you to an italian dinner for 3"; //text(testoPopup, 32, 165, 175, 120); textFont(TrebuchetMS_16_bold); // pulsante YES if(buttonPopupProfile == 0) image(MYPROFILE_button_corto, 46, 205); else image(MYPROFILE_button_corto_off, 46, 205); text("Accept", 54, 223); // pulsante NO if(buttonPopupProfile == 1) image(MYPROFILE_button_corto, 120, 205); else image(MYPROFILE_button_corto_off, 120, 205); text("Decline", 127, 223); // bottone if(buttonPopupProfile == 2) image(MYPROFILE_button_lungo, 47, 235); else image(MYPROFILE_button_lungo_off, 47, 235); text("Go to her profile", 55, 253); } if(leggiMessaggio==0) { image(PROFILE_popup, 20, 150); textAlign(LEFT); textFont(TrebuchetMS_13); testoPopup = "From Puccio:"; //testoPopup = "From Maria:"; text(testoPopup, 30, 160, 170, 120); textAlign(LEFT); textFont(TrebuchetMS_16); testoPopup = "Oh Valeriotta, ma ti fidi ad invitare Pera?"; //testoPopup = "Let's exchange our phone numbers to talk about it!! :D"; text(testoPopup, 35, 175, 170, 120); // bottone image(MYPROFILE_button_lungo, 47, 235); textFont(TrebuchetMS_16_bold); text("Go to his profile", 55, 253); } } } /* SEZIONE: Users list *********************************************************************/ if(sezione == SEZIONE_FOTOGALLERY) { if(mode == MODE_PHOTOMENU) { titolo = ""; if(focusPhoto == 0) image(PHOTOS_italian, 0, 0); if(focusPhoto == 1) image(PHOTOS_chinese, 0, 0); if(focusPhoto == 2) image(PHOTOS_japanese, 0, 0); if(focusPhoto == 3) image(PHOTOS_mexican, 0, 0); if(focusPhoto == 4) image(PHOTOS_greek, 0, 0); textFont(TrebuchetMS_24_bold); textAlign(RIGHT); text("Photogallery", 80, 46, 145, 70); } if(mode == MODE_PICTURES) { if(focusPicture == 0) image(pictures00, 45, 80); if(focusPicture == 1) image(pictures01, 45, 80); if(focusPicture == 2) image(pictures02, 45, 80); //button //if(buttonPopup == true) image(MYPROFILE_button_corto, 125, 45); //else image(MYPROFILE_button_corto_off, 160, 75); textFont(TrebuchetMS_16_bold); text("Details", 160, 63); // commenti stroke(arancioneChiaro); strokeWeight(1); noFill(); rect(25, 240, 155, 25); image(PHOTOS_piu, 185, 239); // commento if(frameCounter%300>=0 && frameCounter%300<100) { commento = "What a cool cook ;)"; } else if(frameCounter%300>=100 && frameCounter%300< 200) commento = "Wonderful dinner X3"; else if(frameCounter%300>=200 && frameCounter%300< 299) commento = "The food was so good *_*"; textFont(TrebuchetMS_13); textAlign(LEFT); text(commento, 28, 258); } //freccine freccinaSxProfile = new Freccina(2,25,160,premoSxProfile); freccinaDxProfile = new Freccina(3,205,160,premoDxProfile); } /* SEZIONE: cerca utenti *********************************************************************/ if(sezione == SEZIONE_SEARCH_USER) { titolo = "Search other guests!"; commento = "Write a guest's name to see his/her profile page."; textFont(TrebuchetMS_13); textAlign(LEFT); text(commento, 25, 160, 170, 70); // commenti stroke(arancione); strokeWeight(1); fill(giallo); rect(25, 190, 190, 25); //cursore stroke(0); if(frameCounter%30>=0 && frameCounter%30<15) noStroke(); else strokeWeight(1); line(29,194,29,212); } image(bg_pulsanti,0,0); textAlign(CENTER); textFont(TrebuchetMS_16_bold); text("Menu", 204, 311); framerate(24); frameCounter++; animationCounter++; } /******************************************************************************************* * Logic Section *******************************************************************************************/ ///////////////////////////////////////////////////////////////////////////////////////////// // Setup e librerie varie ///////////////////////////////////////////////////////////////////////////////////////////// import processing.phone.*; // import phone library to go fullscreen Phone myPhone; // named reference to phone instance void setup() // happens only once, when the program starts... { // go fullscreen myPhone = new Phone(this); // create new phone instance/controller myPhone.fullscreen(); // tell phone to go fullscreen bianco = color(255,255,255); arancione = color(255,135,0); arancioneChiaro = color(255,189,52); rosso = color(234,46,58); giallo = color(255,206,64); loadImages(); // load images loadFonts(); // load fonts int SPLASH_SCREEN = 0; int sezione = SPLASH_SCREEN; } ///////////////////////////////////////////////////////////////////////////////////////////// // Mode, Focus & Option Names (Constants) ///////////////////////////////////////////////////////////////////////////////////////////// // setto la sezione principale int MENU_PRINCIPALE = 1; int SPLASH_SCREEN = 0; int SEZIONE_ORGANIZZA_CENA = 2; int SEZIONE_FOTOGALLERY = 3; int SEZIONE_MY_PROFILE = 4; int SEZIONE_USERS_PROFILES = 5; int SEZIONE_USERSLIST = 6; int SEZIONE_SEARCH_USER = 7; // dò un nome ai vari MODEs (scegli la cucina, scegli il tasks, scegli il n° di guests) int MODE_WC = 0; int MODE_GALLERY = 1; int MODE_USER = 2; int MODE_SEARCH = 3; int MODE_CUISINE = 0; int MODE_TASKS = 1; int MODE_GUESTS = 2; int MODE_RESULTS = 3; int MODE_USERSLIST = 4; int MODE_QUALITIES = 0; int MODE_INVITE = 1; int MODE_PHOTO = 2; int MODE_FRIENDS = 3; int MODE_BAN = 4; int MODE_INVITE_POPUP = 5; int MODE_BAN_POPUP = 6; int MODE_QUALITIES_PAGE = 7; int MODE_FRIENDS_PAGE = 8; int MODE_MESSAGES = 0; int MODE_MY_PHOTOS = 1; int MODE_SET_INVITES = 2; int MODE_EDIT = 3; int MODE_VIEW_MESSAGES = 4; int MODE_PHOTOMENU = 0; int MODE_PICTURES = 1; String titolo; String testoPopup; String commento; int frameCounter; int animationCounter = 0; int whichPhoto = 0; int x = 0; int y = 0; boolean settaInviti = true; int vengoDa = SEZIONE_USERSLIST; // stato base delle freccine boolean premoSuCuisine = false; boolean premoGiuCuisine = false; boolean premoSuTasks = false; boolean premoGiuTasks = false; boolean premoSuGuests = false; boolean premoGiuGuests = false; boolean premoSuUserlist = false; boolean premoGiuUserlist = false; boolean premoSxProfile = false; boolean premoDxProfile = false; // stato base del contorno del retro-icona boolean selectCuisine = false; boolean selectTasks = false; boolean selectGuests = false; // stato base del popup boolean buttonPopup = true; int buttonPopupProfile = 0; // utenti int utenteSelezionato = 0; int startElenco = 0; String PROFILEselected; int PROFILETasks; String utenteInvitato; int leggiMessaggio = 2; String[] Utenti = { "Puccio", "Elvezia", "Artemisia", "Giuliano", "Pera", "Valeria"}; String[] UtentiGender = { "M", "F", "F", "M", "M", "F"}; String[] UtentiTasks = { "Cook", "Clean", "Host", "Shop", "Shop", "Cook"}; String[] Puccio = { "Puccio", "22 | Male", "Ca' Foscari", "Castello"}; String[] Elvezia = { "Elvezia", "24 | Female", "IUAV", "Dorsoduro"}; String[] Artemisia = { "Artemisia", "23 | Female", "IUAV", "Castello"}; String[] Giuliano = { "Giuliano", "27 | Male", "Ca' Foscari", "Cannaregio"}; String[] Valeria = { "Valeria", "24 | Female", "IUAV", "San Polo"}; ///////////////////////////////////////////////////////////////////////////////////////////// // State, Information Collected From Use (Variables) ///////////////////////////////////////////////////////////////////////////////////////////// // SEZIONE iniziale int sezione = MENU_PRINCIPALE; // MODE iniziale int mode = MODE_CUISINE; // FOCUSes iniziali int menuCuisineFocus = 0; // cucina: inizio con ITA int menuTasksFocus = 0; // tasks: inizio con HOSTING int menuGuestFocus = 0; // guests: inizio con 3 GUESTS int focusPhoto = 0; int focusPicture = 0; int photoWidth = 65; ///////////////////////////////////////////////////////////////////////////////////////////// // Draw ///////////////////////////////////////////////////////////////////////////////////////////// void draw() { drawMenu(sezione, mode, menuCuisineFocus, menuTasksFocus, menuGuestFocus); // disegna lo sfondo textFont(TrebuchetMS_24_bold); textAlign(RIGHT); text(titolo, 80, 66, 145, 70); } ///////////////////////////////////////////////////////////////////////////////////////////// // Keypad Event (User Input Capture & Interpretation) ///////////////////////////////////////////////////////////////////////////////////////////// // azioni al press (effettini vari) void keyPressed() { /* SEZIONE ORGANIZZA CENA ********************************************/ if(sezione == SEZIONE_ORGANIZZA_CENA) { // CUISINE //////////////// if(mode == MODE_CUISINE) { // browso tra i vari tipi di cucina... if(keyCode == DOWN){ premoGiuCuisine = true; } if(keyCode == UP){ premoSuCuisine = true; } } // TASKS //////////////// if(mode == MODE_TASKS) { // browso tra i vari tipi di cucina... if(keyCode == DOWN){ premoGiuTasks = true; } if(keyCode == UP){ premoSuTasks = true; } } // GUESTS //////////////// if(mode == MODE_GUESTS) { if(keyCode == DOWN){ premoGiuGuests = true; } if(keyCode == UP){ premoSuGuests = true; } } } /* SEZIONE USERSLIST ********************************************/ if(sezione == SEZIONE_USERSLIST) { if(keyCode == DOWN){ premoGiuUserlist = true; } if(keyCode == UP){ premoSuUserlist = true; } } /* SEZIONE MY PROFILE ********************************************/ if(sezione == SEZIONE_MY_PROFILE) { if(keyCode == LEFT){ premoSxProfile = true; } if(keyCode == RIGHT){ premoDxProfile = true; } } /* SEZIONE PHOTO ********************************************/ if(sezione == SEZIONE_FOTOGALLERY) { if(keyCode == LEFT){ premoSxProfile = true; } if(keyCode == RIGHT){ premoDxProfile = true; } } } // azioni al rilascio del tasto (azioni effettive) void keyReleased() { /* SEZIONE MENU PRINCIPALE ********************************************/ if(sezione == SPLASH_SCREEN) { if(keyCode == FIRE) { sezione = MENU_PRINCIPALE; mode = MODE_WC; } return; } if(sezione == MENU_PRINCIPALE) { if(keyCode == SOFTKEY1) { sezione = SPLASH_SCREEN; } // WC //////////////// if(mode == MODE_WC) { if(keyCode == RIGHT) { mode = MODE_GALLERY; } if(keyCode == LEFT) { mode = MODE_SEARCH; } if(keyCode == FIRE) { mode = MODE_CUISINE; sezione = SEZIONE_ORGANIZZA_CENA; } return; } // GALLERY //////////////// if(mode == MODE_GALLERY) { if(keyCode == LEFT) { mode = MODE_WC; } if(keyCode == RIGHT) { mode = MODE_USER; } if(keyCode == FIRE) { sezione = SEZIONE_FOTOGALLERY; mode = MODE_PHOTOMENU; } return; } // USER //////////////// if(mode == MODE_USER) { if(keyCode == LEFT) { mode = MODE_GALLERY; } if(keyCode == RIGHT) { mode = MODE_SEARCH; } if(keyCode == FIRE) { mode = MODE_MESSAGES; sezione = SEZIONE_MY_PROFILE; vengoDa = SEZIONE_MY_PROFILE; } return; } if(mode == MODE_SEARCH) { if(keyCode == LEFT) { mode = MODE_USER; } if(keyCode == RIGHT) { mode = MODE_WC; } if(keyCode == FIRE) { mode = MODE_CUISINE; sezione = SEZIONE_SEARCH_USER; } return; } } /* SEZIONE ORGANIZZA CENA ********************************************/ if(sezione == SEZIONE_ORGANIZZA_CENA) { // CUISINE //////////////// if(mode == MODE_CUISINE) { if(keyCode == SOFTKEY2) { sezione = MENU_PRINCIPALE; mode = MODE_WC; } // browso tra i vari tipi di cucina... if(keyCode == DOWN){ premoGiuCuisine = false; // spengo la freccina if(menuCuisineFocus >= 4) menuCuisineFocus = 0; else menuCuisineFocus = menuCuisineFocus+1; } if(keyCode == UP){ premoSuCuisine = false; // spengo la freccina if(menuCuisineFocus <= 0) menuCuisineFocus = 4; else menuCuisineFocus = menuCuisineFocus-1; } // mi sposto su un altro mode if(keyCode == RIGHT) { mode = MODE_TASKS; // print(mode); selectCuisine = true; } if(keyCode == FIRE) { mode = MODE_RESULTS; } if(keyCode == SOFTKEY1) { sezione = MENU_PRINCIPALE; } return; } // TASKS //////////////// if(mode == MODE_TASKS) { // browso tra i vari tasks... if(keyCode == DOWN){ premoGiuTasks = false; // spengo la freccina if(menuTasksFocus >= 3) menuTasksFocus = 0; else menuTasksFocus = menuTasksFocus+1; } if(keyCode == UP){ premoSuTasks = false; // spengo la freccina if(menuTasksFocus <= 0) menuTasksFocus = 3; else menuTasksFocus = menuTasksFocus-1; } // mi sposto su un altro mode if(keyCode == LEFT) { mode = MODE_CUISINE; selectTasks = true; } if(keyCode == RIGHT) { mode = MODE_GUESTS; selectTasks = true; } if(keyCode == FIRE) { mode = MODE_RESULTS; } if(keyCode == SOFTKEY1) { sezione = MENU_PRINCIPALE; } return; } // GUESTS //////////////// if(mode == MODE_GUESTS) { // browso tra i vari tipi di cucina... if(keyCode == DOWN){ premoGiuGuests = false; // spengo la freccina if(menuGuestFocus <= 0) menuGuestFocus = 0; else menuGuestFocus = menuGuestFocus-1; } if(keyCode == UP){ premoSuGuests = false; // spengo la freccina if(menuGuestFocus >= 5) menuGuestFocus = 5; else menuGuestFocus = menuGuestFocus+1; } // mi sposto su un altro mode if(keyCode == LEFT) { mode = MODE_TASKS; selectGuests = true; } if(keyCode == FIRE) { mode = MODE_RESULTS; } if(keyCode == SOFTKEY1) { sezione = MENU_PRINCIPALE; } return; } // POP-UP DI CONFERMA //////////////// if(mode == MODE_RESULTS) { if(buttonPopup == true) { if(keyCode == RIGHT) { buttonPopup = false; } if(keyCode == FIRE) { sezione = SEZIONE_USERSLIST; mode = MODE_USERSLIST; utenteSelezionato = 0; } } if(buttonPopup == false) { if(keyCode == LEFT) { buttonPopup = true; } if(keyCode == FIRE) { mode = MODE_CUISINE; buttonPopup = true; } } if(keyCode == SOFTKEY1) { mode = MODE_CUISINE; buttonPopup = true; } return; } } /* SEZIONE USERSLIST ********************************************/ if(sezione == SEZIONE_USERSLIST) { if(keyCode == SOFTKEY2) { sezione = MENU_PRINCIPALE; mode = MODE_WC; } if(keyCode == DOWN){ premoGiuUserlist = false; // spengo la freccina if(utenteSelezionato >= 3) utenteSelezionato = 3; else utenteSelezionato = utenteSelezionato+1; print(startElenco); } if(keyCode == UP){ premoSuUserlist = false; // spengo la freccina if(utenteSelezionato <= 0) utenteSelezionato = 0; else utenteSelezionato = utenteSelezionato-1; } if(keyCode == FIRE) { PROFILEselected = Utenti[utenteSelezionato]; sezione = SEZIONE_USERS_PROFILES; vengoDa = SEZIONE_USERS_PROFILES; mode = MODE_INVITE; } if(keyCode == SOFTKEY1) { mode = MODE_CUISINE; sezione = SEZIONE_ORGANIZZA_CENA; } return; } /* SEZIONE USER PROFILE ********************************************/ if(sezione == SEZIONE_USERS_PROFILES) { if(keyCode == SOFTKEY2) { sezione = MENU_PRINCIPALE; mode = MODE_WC; } if(mode == MODE_INVITE) { if(keyCode == LEFT) { mode = MODE_QUALITIES; } if(keyCode == RIGHT) { mode = MODE_PHOTO; } if(keyCode == SOFTKEY1) { if(vengoDa == SEZIONE_MY_PROFILE) { sezione = SEZIONE_MY_PROFILE; mode = MODE_MESSAGES; } else sezione = SEZIONE_USERSLIST; } if(keyCode == FIRE) { mode = MODE_INVITE_POPUP; return; } return; } if(mode == MODE_PHOTO) { if(keyCode == LEFT) { mode = MODE_INVITE; } if(keyCode == RIGHT) { mode = MODE_FRIENDS; } if(keyCode == SOFTKEY1) { if(vengoDa == SEZIONE_MY_PROFILE) { sezione = SEZIONE_MY_PROFILE; mode = MODE_MESSAGES; } else sezione = SEZIONE_USERSLIST; } return; } if(mode == MODE_FRIENDS) { if(keyCode == LEFT) { mode = MODE_PHOTO; } if(keyCode == RIGHT) { mode = MODE_BAN; } if(keyCode == SOFTKEY1) { if(vengoDa == SEZIONE_MY_PROFILE) { sezione = SEZIONE_MY_PROFILE; mode = MODE_MESSAGES; } else sezione = SEZIONE_USERSLIST; } if(keyCode == FIRE) { mode = MODE_FRIENDS_PAGE; } return; } if(mode == MODE_BAN) { if(keyCode == LEFT) { mode = MODE_FRIENDS; } if(keyCode == RIGHT) { mode = MODE_QUALITIES; } if(keyCode == SOFTKEY1) { if(vengoDa == SEZIONE_MY_PROFILE) { sezione = SEZIONE_MY_PROFILE; mode = MODE_MESSAGES; } else sezione = SEZIONE_USERSLIST; } if(keyCode == FIRE) { mode = MODE_BAN_POPUP; } return; } if(mode == MODE_QUALITIES) { if(keyCode == LEFT) { mode = MODE_BAN; } if(keyCode == RIGHT) { mode = MODE_INVITE; } if(keyCode == SOFTKEY1) { if(vengoDa == SEZIONE_MY_PROFILE) { sezione = SEZIONE_MY_PROFILE; mode = MODE_MESSAGES; } else sezione = SEZIONE_USERSLIST; } if(keyCode == FIRE) { mode = MODE_QUALITIES_PAGE; } return; } // POP-UP DI CONFERMA INVITO //////////////// if(mode == MODE_INVITE_POPUP) { if(buttonPopup == true) { if(keyCode == RIGHT) { buttonPopup = false; } if(keyCode == FIRE) { mode = MODE_INVITE; utenteInvitato = PROFILEselected; } } if(buttonPopup == false) { if(keyCode == LEFT) { buttonPopup = true; } if(keyCode == FIRE) { mode = MODE_INVITE; buttonPopup = true; } } if(keyCode == SOFTKEY1) { mode = MODE_INVITE; buttonPopup = true; } return; } if(mode == MODE_QUALITIES_PAGE) { if(keyCode == SOFTKEY1) { mode = MODE_QUALITIES; } if(keyCode == FIRE) { mode = MODE_QUALITIES; } return; } if(mode == MODE_FRIENDS_PAGE) { if(keyCode == SOFTKEY1) { mode = MODE_FRIENDS; } if(keyCode == FIRE) { mode = MODE_FRIENDS; } return; } // POP-UP PER IL BAN //////////////// if(mode == MODE_BAN_POPUP) { if(buttonPopup == true) { if(keyCode == RIGHT) { buttonPopup = false; } if(keyCode == FIRE) { mode = MODE_BAN; } } if(buttonPopup == false) { if(keyCode == LEFT) { buttonPopup = true; } if(keyCode == FIRE) { mode = MODE_BAN; buttonPopup = true; } } if(keyCode == SOFTKEY1) { mode = MODE_BAN; buttonPopup = true; } return; } } /* SEZIONE MIO PROFILO ********************************************/ if(sezione == SEZIONE_MY_PROFILE) { if(keyCode == SOFTKEY2) { sezione = MENU_PRINCIPALE; mode = MODE_WC; } if(mode == MODE_MESSAGES) { if(keyCode == LEFT) { mode = MODE_EDIT; } if(keyCode == RIGHT) { mode = MODE_MY_PHOTOS; } if(keyCode == SOFTKEY1) { sezione = MENU_PRINCIPALE; mode = MODE_WC; } if(keyCode == FIRE) { mode = MODE_VIEW_MESSAGES; return; } return; } if(mode == MODE_MY_PHOTOS) { if(keyCode == LEFT) { mode = MODE_MESSAGES; } if(keyCode == RIGHT) { mode = MODE_SET_INVITES; } if(keyCode == SOFTKEY1) { sezione = MENU_PRINCIPALE; mode = MODE_WC; } return; } if(mode == MODE_SET_INVITES) { if(keyCode == LEFT) { mode = MODE_MY_PHOTOS; } if(keyCode == RIGHT) { mode = MODE_EDIT; } if(keyCode == SOFTKEY1) { sezione = MENU_PRINCIPALE; mode = MODE_WC; } if(keyCode == FIRE) { if(settaInviti == true) settaInviti = false; else settaInviti = true; } return; } if(mode == MODE_EDIT) { if(keyCode == LEFT) { mode = MODE_SET_INVITES; } if(keyCode == RIGHT) { mode = MODE_MESSAGES; } if(keyCode == SOFTKEY1) { sezione = MENU_PRINCIPALE; mode = MODE_WC; } return; } // POP-UP MESSAGES //////////////// if(mode == MODE_VIEW_MESSAGES) { if(keyCode == RIGHT) { if(leggiMessaggio >= 2) leggiMessaggio = 0; else leggiMessaggio = leggiMessaggio+1; premoDxProfile = false; } if(keyCode == LEFT) { if(leggiMessaggio <= 0) leggiMessaggio = 2; else leggiMessaggio = leggiMessaggio-1; premoSxProfile = false; } if(keyCode == FIRE) { if(leggiMessaggio==1) { if(buttonPopupProfile == 0) { mode = MODE_MESSAGES; utenteInvitato = Utenti[leggiMessaggio]; } if(buttonPopupProfile == 1) mode = MODE_MESSAGES; if(buttonPopupProfile == 2) { sezione = SEZIONE_USERS_PROFILES; mode = MODE_INVITE; utenteSelezionato = leggiMessaggio; PROFILEselected = Utenti[leggiMessaggio]; } } else { sezione = SEZIONE_USERS_PROFILES; mode = MODE_INVITE; utenteSelezionato = leggiMessaggio; PROFILEselected = Utenti[leggiMessaggio]; } } if(keyCode == SOFTKEY1) { mode = MODE_MESSAGES; } if(leggiMessaggio==1) { if(keyCode == UP) { if(buttonPopupProfile <= 0) buttonPopupProfile = 2; else buttonPopupProfile = buttonPopupProfile-1; } if(keyCode == DOWN) { if(buttonPopupProfile >= 2) buttonPopupProfile = 0; else buttonPopupProfile = buttonPopupProfile+1; } } return; } } /* SEZIONE FOTOGALLERY ********************************************/ if(sezione == SEZIONE_FOTOGALLERY) { if(keyCode == SOFTKEY2) { sezione = MENU_PRINCIPALE; mode = MODE_WC; } if(mode == MODE_PHOTOMENU) { if(keyCode == RIGHT) { if(focusPhoto >= 4) focusPhoto = 0; else focusPhoto = focusPhoto+1; premoDxProfile = false; } if(keyCode == LEFT) { if(focusPhoto <= 0) focusPhoto = 4; else focusPhoto = focusPhoto-1; premoSxProfile = false; } if(keyCode == FIRE) { mode = MODE_PICTURES; } if(keyCode == SOFTKEY1) { sezione = MENU_PRINCIPALE; } } if(mode == MODE_PICTURES) { if(keyCode == RIGHT) { if(focusPicture >= 2) focusPicture = 0; else focusPicture = focusPicture+1; premoDxProfile = false; } if(keyCode == LEFT) { if(focusPicture <= 0) focusPicture = 2; else focusPicture = focusPicture-1; premoSxProfile = false; } if(keyCode == SOFTKEY1) { mode = MODE_PHOTOMENU; } } } /* SEZIONE FOTOGALLERY ********************************************/ if(sezione == SEZIONE_SEARCH_USER) { if(keyCode == SOFTKEY2) { sezione = MENU_PRINCIPALE; mode = MODE_WC; } if(keyCode == SOFTKEY1) { sezione = MENU_PRINCIPALE; } } }