Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void AvatarSelectClicked(Player player,UIElement PlayerSelectAvatarPanel, UIElement ClickedElement) throws SQLException{
- float r = 0;
- float g = 0.7f;
- float b = 0.2f;
- float a = 1;
- UIElement PlayerSelectAvatarAcceptButton = (UIElement)player.getAttribute("PlayerSelectAvatarAcceptButton");
- UIElement PlayerSelectAvatarHeader = (UIElement)player.getAttribute("PlayerSelectAvatarHeader");
- UIElement Avatar_one = (UIElement)player.getAttribute("1");
- UIElement Avatar_two = (UIElement)player.getAttribute("2");
- UIElement Avatar_three = (UIElement)player.getAttribute("3");
- UIElement Avatar_four = (UIElement)player.getAttribute("4");
- UIElement Avatar_five = (UIElement)player.getAttribute("5");
- UIElement Avatar_six = (UIElement)player.getAttribute("6");
- UIElement Avatar_seven = (UIElement)player.getAttribute("7");
- UIElement Avatar_eight = (UIElement)player.getAttribute("8");
- UIElement Avatar_nine = (UIElement)player.getAttribute("9");
- UIElement Avatar_ten = (UIElement)player.getAttribute("10");
- UIElement Avatar_eleven = (UIElement)player.getAttribute("11");
- UIElement Avatar_twelve = (UIElement)player.getAttribute("12");
- UIElement Avatar_thirteen = (UIElement)player.getAttribute("13");
- UIElement Avatar_fourteen = (UIElement)player.getAttribute("14");
- UIElement Avatar_fifteen = (UIElement)player.getAttribute("15");
- UIElement Avatar_sixteen = (UIElement)player.getAttribute("16");
- UIElement Avatar_seventeen = (UIElement)player.getAttribute("17");
- UIElement Avatar_eighteen = (UIElement)player.getAttribute("18");
- UIElement Avatar_nineteen = (UIElement)player.getAttribute("19");
- UIElement Avatar_twenty = (UIElement)player.getAttribute("20");
- UIElement Avatar_twentyone = (UIElement)player.getAttribute("21");
- UIElement Avatar_twentytwo = (UIElement)player.getAttribute("22");
- UIElement Avatar_twentythree = (UIElement)player.getAttribute("23");
- UIElement Avatar_twentyfour = (UIElement)player.getAttribute("24");
- UIElement Avatar_twentyfive = (UIElement)player.getAttribute("25");
- UIElement Avatar_twentysix = (UIElement)player.getAttribute("26");
- UIElement Avatar_twentyseven = (UIElement)player.getAttribute("27");
- UIElement Avatar_twentyeight = (UIElement)player.getAttribute("28");
- UIElement Avatar_twentynine = (UIElement)player.getAttribute("29");
- UIElement Avatar_thirty = (UIElement)player.getAttribute("30");
- UIElement Avatar_thirtyone = (UIElement)player.getAttribute("31");
- UIElement Avatar_thirtytwo = (UIElement)player.getAttribute("32");
- UIElement Avatar_thirtythree = (UIElement)player.getAttribute("33");
- UIElement Avatar_thirtyfour = (UIElement)player.getAttribute("34");
- UIElement Avatar_thirtyfive = (UIElement)player.getAttribute("35");
- UIElement Avatar_thirtysix = (UIElement)player.getAttribute("36");
- UIElement Avatar_thirtyseven = (UIElement)player.getAttribute("37");
- UIElement Avatar_thirtyeight = (UIElement)player.getAttribute("38");
- UIElement Avatar_thirtynine = (UIElement)player.getAttribute("39");
- UIElement Avatar_fourty = (UIElement)player.getAttribute("40");
- UIElement Avatar_fourtyone = (UIElement)player.getAttribute("41");
- UIElement Avatar_fourtytwo = (UIElement)player.getAttribute("42");
- UIElement Avatar_fourtythree = (UIElement)player.getAttribute("43");
- UIElement Avatar_fourtyfour = (UIElement)player.getAttribute("44");
- UIElement Avatar_fourtyfive = (UIElement)player.getAttribute("45");
- UIElement Avatar_fourtysix = (UIElement)player.getAttribute("46");
- UIElement Avatar_fourtyseven = (UIElement)player.getAttribute("47");
- UIElement Avatar_fourtyeight = (UIElement)player.getAttribute("48");
- UIElement Avatar_fourtynine = (UIElement)player.getAttribute("49");
- UIElement Avatar_fifty = (UIElement)player.getAttribute("50");
- List<UIElement> elementlist = (List<UIElement>)PlayerSelectAvatarPanel.getChilds();
- for(int i = 0; i<elementlist.size();i++){
- UIElement element = (UIElement)elementlist.get(i);
- if(element==PlayerSelectAvatarHeader||element==PlayerSelectAvatarAcceptButton){
- }else{
- element.setBackgroundColor(0, 0, 0, 1);
- }
- }
- if(ClickedElement==PlayerSelectAvatarAcceptButton){
- player.sendTextMessage("you selected "+String.valueOf(avatarid));
- PlayerSelectAvatarPanel.setVisible(false);
- player.setMouseCursorVisible(false);
- playerconfigdb.saveAvatar((Long)player.getAttribute("playerid"), avatarid);
- playerconfigdb.loadPlayersConfig(player);
- AvatarCleanup(player, PlayerSelectAvatarPanel);
- }if(ClickedElement==Avatar_one){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 1;
- }if(ClickedElement==Avatar_two){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 2;
- }if(ClickedElement==Avatar_three){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 3;
- }if(ClickedElement==Avatar_four){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 4;
- }if(ClickedElement==Avatar_five){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 5;
- }if(ClickedElement==Avatar_six){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 6;
- }if(ClickedElement==Avatar_seven){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 7;
- }if(ClickedElement==Avatar_eight){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 8;
- }if(ClickedElement==Avatar_nine){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 9;
- }if(ClickedElement==Avatar_ten){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 10;
- }if(ClickedElement==Avatar_eleven){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 11;
- }if(ClickedElement==Avatar_twelve){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 12;
- }if(ClickedElement==Avatar_thirteen){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 13;
- }if(ClickedElement==Avatar_fourteen){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 14;
- }if(ClickedElement==Avatar_fifteen){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 15;
- }if(ClickedElement==Avatar_sixteen){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 16;
- }if(ClickedElement==Avatar_seventeen){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 17;
- }if(ClickedElement==Avatar_eighteen){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 18;
- }if(ClickedElement==Avatar_nineteen){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 19;
- }if(ClickedElement==Avatar_twenty){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 20;
- }if(ClickedElement==Avatar_twentyone){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 21;
- }if(ClickedElement==Avatar_twentytwo){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 22;
- }if(ClickedElement==Avatar_twentythree){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 23;
- }if(ClickedElement==Avatar_twentyfour){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 24;
- }if(ClickedElement==Avatar_twentyfive){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 25;
- }if(ClickedElement==Avatar_twentysix){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 26;
- }if(ClickedElement==Avatar_twentyseven){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 27;
- }if(ClickedElement==Avatar_twentyeight){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 28;
- }if(ClickedElement==Avatar_twentynine){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 29;
- }if(ClickedElement==Avatar_thirty){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 30;
- }if(ClickedElement==Avatar_thirtyone){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 31;
- }if(ClickedElement==Avatar_thirtytwo){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 32;
- }if(ClickedElement==Avatar_thirtythree){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 33;
- }if(ClickedElement==Avatar_thirtyfour){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 34;
- }if(ClickedElement==Avatar_thirtyfive){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 35;
- }if(ClickedElement==Avatar_thirtysix){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 36;
- }if(ClickedElement==Avatar_thirtyseven){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 37;
- }if(ClickedElement==Avatar_thirtyeight){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 38;
- }if(ClickedElement==Avatar_thirtynine){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 39;
- }if(ClickedElement==Avatar_fourty){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 40;
- }if(ClickedElement==Avatar_fourtyone){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 41;
- }if(ClickedElement==Avatar_fourtytwo){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 42;
- }if(ClickedElement==Avatar_fourtythree){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 43;
- }if(ClickedElement==Avatar_fourtyfour){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 44;
- }if(ClickedElement==Avatar_fourtyfive){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 45;
- }if(ClickedElement==Avatar_fourtysix){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 46;
- }if(ClickedElement==Avatar_fourtyseven){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 47;
- }if(ClickedElement==Avatar_fourtyeight){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 48;
- }if(ClickedElement==Avatar_fourtynine){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 49;
- }if(ClickedElement==Avatar_fifty){
- ClickedElement.setBackgroundColor(r, g, b, a);
- avatarid = 50;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement