12 lines
84 KiB
JavaScript
12 lines
84 KiB
JavaScript
|
|
/*
|
||
|
|
*-----------------------------------------
|
||
|
|
* Project: Habbo Avatar Generator
|
||
|
|
* Created by: Synt4x (Skype name: musecms)
|
||
|
|
* Project Started: 26/06/2016
|
||
|
|
* Project Ended: 27/06/2016
|
||
|
|
*
|
||
|
|
*/
|
||
|
|
!function(e){function l(){var l={hr:{color:"61",set:"831"},hd:{color:"2",set:"3092"},ch:{color:"110-1408",set:"3438"},lg:{color:"110",set:"3058"},sh:{color:"1408",set:"3089"},ha:{color:"",set:""},he:{color:"",set:""},ea:{color:"",set:""},fa:{color:"",set:""},ca:{color:"110",set:"3219"},wa:{color:"0",set:"2001"},cc:{color:"",set:""},cp:{color:"",set:""}},c={hr:{color:"33",set:"515"},hd:{color:"1",set:"600"},ch:{color:"70",set:"635"},lg:{color:"66-62",set:"716"},sh:{color:"68",set:"735"},ha:{color:"",set:""},he:{color:"",set:""},ea:{color:"",set:""},fa:{color:"",set:""},ca:{color:"",set:""},wa:{color:"",set:""},cc:{color:"",set:""},cp:{color:"",set:""}};this.getHabbo=function(){return l},this.gender="M",this.getGender=function(){return this.gender},this.switchGender=function(){this.gender="M"!==this.gender&&"F"!==this.gender||"F"==this.gender?"M":"F"},this.setPart=function(e,b,a){"M"==this.getGender()?l[e]={color:b,set:a}:c[e]={color:b,set:a}},this.unsetPart=function(e){"M"==this.getGender()?l[e]={set:""}:c[e]={set:""}},this.getPart=function(e){return"M"==this.getGender()?l[e]:c[e]};var b="hd";this.getCurrentSet=function(){return b},this.setCurrentSet=function(e){b=e};var a={palettes:{},sets:{}};this.getPalettes=function(){return a.palettes},this.getPalette=function(e){return a.palettes[e]},this.setPalettes=function(e){a.palettes=e},this.setTypes=function(e){a.sets=e},this.buildFigure=function(e){var b="";return jQuery.each("M"==this.getGender()?l:c,function(e,l){""!=l.set&&""!=l.color&&(b=b+"."+e+"-"+l.set+"-"+l.color)}),b.substring(1,b.length)},this.importFigure=function(e){var c=e.split(".");jQuery.each(c,function(e,c){var b=c.split("-");l[b[0]].set=b[1],l[b[0]].color=3 in b?b[2]+"-"+b[3]:b[2]})},this.filterByType=function(e){var l;return jQuery.each(a.sets,function(c,b){return b.type==e?(l=b,!1):void 0}),l},this.filterByHex=function(e,l){var c;return jQuery.each(a.palettes[e],function(e,b){return b.hex==l?(c=e,!1):void 0}),c},this.canRemove=function(e){return"hd"==e||"lg"==e?!1:!0},this.loadToClothes=function(l){var c=this,b=this.filterByType(l);if(e(r).html(""),this.canRemove(l)){var a=e('<a href="#" class="clothes-object removable" data-remove="true"></a>'),t=this.getPart(l);("undefined"==typeof t.set||""==t.set)&&a.addClass("selected"),e(r).append(a)}jQuery.each(b.sets,function(b,a){if(a.gender==c.gender&&1==a.selectable||"U"==a.gender&&1==a.selectable){var t=c.getPart(l),s=l+"-"+b+"-"+t.color,o=e('<a class="clothes-object '+l+'" data-clothing="'+b+'" href="#"></a>');b==t.set&&o.addClass("selected"),o.css("background-image","url( https://www.habbo.com.tr/habbo-imaging/avatarimage?figure="+s+"&gender="+c.gender+" )"),e(r).append(o)}})},this.loadToColors=function(l){var c=this.filterByType(l),b=this.getPalette(c.paletteid);e(t).html(""),jQuery.each(b,function(l,b){if(1==b.selectable){var a=e('<a href="#" class="color-object" style="background:#'+b.hex+'" data-palette="'+c.paletteid+'" data-color="'+b.hex+'"></a>');e(t).append(a)}})};var r;this.setClothesObject=function(e){r=e};var t;this.setColorsObject=function(e){t=e};var s;this.setCodeObject=function(e){s=e},this.updateAvatar=function(){var l="http://www.habbo.com.tr/habbo-imaging/avatarimage?head_direction=4&direction=4&size=l&figure="+this.buildFigure()+"&gender="+this.getGender();e("#myHabbo").attr("src",l),e(s).val(this.buildFigure()+"&gender="+this.getGender())}}var c=new l,b={1:{14:{index:0,club:0,selectable:1,hex:"F5DA88"},10:{index:1,club:0,selectable:1,hex:"FFDBC1"},1:{index:2,club:0,selectable:1,hex:"FFCB98"},8:{index:3,club:0,selectable:1,hex:"F4AC54"},12:{index:4,club:0,selectable:1,hex:"FF987F"},1369:{index:5,club:0,selectable:1,hex:"e0a9a9"},1370:{index:6,club:0,selectable:1,hex:"ca8154"},19:{index:7,club:0,selectable:1,hex:"B87560"},20:{index:8,club:0,selectable:1,hex:"9C543F"},1371:{index:9,club:0,selectable:1,hex:"904925"},30:{index:10,club:0,selectable:1,hex:"4C311E"},1372:{index:11,club:2,selectable:1,hex:"543d35"},1373:{index:12,club:2,selectable:1,hex:"653a1d"},21:{index:13,club:2,selectable:1,hex:"6E392C"},1374:{index:14,club:2,selectable:1,h
|
||
|
|
},3322:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3325:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3339:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3357:{gender:"M",club:0,colorable:1,selectable:1,preselectable:1},3369:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3370:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3377:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3386:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3393:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3396:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3436:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3468:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3499:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3516:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3519:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3520:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3525:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3531:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},9534:{gender:"F",club:2,colorable:1,selectable:1,preselectable:1},177:{gender:"M",club:0,colorable:0,selectable:0,preselectable:1},145:{gender:"M",club:0,colorable:1,selectable:1,preselectable:1},580:{gender:"F",club:0,colorable:0,selectable:0,preselectable:1},525:{gender:"F",club:0,colorable:1,selectable:0,preselectable:1},550:{gender:"F",club:0,colorable:1,selectable:1,preselectable:1},595:{gender:"F",club:0,colorable:0,selectable:0,preselectable:1},125:{gender:"M",club:0,colorable:1,selectable:1,preselectable:1},140:{gender:"M",club:0,colorable:1,selectable:0,preselectable:1},176:{gender:"M",club:0,colorable:0,selectable:0,preselectable:1},165:{gender:"M",club:0,colorable:1,selectable:1,preselectable:1},676:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},105:{gender:"M",club:0,colorable:1,selectable:1,preselectable:1},596:{gender:"F",club:0,colorable:0,selectable:1,preselectable:1},130:{gender:"M",club:0,colorable:1,selectable:0,preselectable:1},155:{gender:"M",club:0,colorable:1,selectable:1,preselectable:1},150:{gender:"M",club:0,colorable:1,selectable:0,preselectable:1},500:{gender:"F",club:0,colorable:1,selectable:1,preselectable:1},555:{gender:"F",club:0,colorable:1,selectable:1,preselectable:1},681:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},510:{gender:"F",club:0,colorable:1,selectable:1,preselectable:1},565:{gender:"F",club:0,colorable:1,selectable:0,preselectable:1},115:{gender:"M",club:0,colorable:1,selectable:1,preselectable:1},170:{gender:"M",club:0,colorable:1,selectable:1,preselectable:1},505:{gender:"F",club:0,colorable:1,selectable:1,preselectable:1},540:{gender:"F",club:0,colorable:1,selectable:1,preselectable:1},530:{gender:"F",club:0,colorable:1,selectable:1,preselectable:1},515:{gender:"F",club:0,colorable:1,selectable:1,preselectable:1},590:{gender:"F",club:0,colorable:0,selectable:0,preselectable:1},100:{gender:"M",club:0,colorable:0,selectable:1,preselectable:1},679:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},570:{gender:"F",club:0,colorable:1,selectable:0,preselectable:1},585:{gender:"F",club:0,colorable:0,selectable:0,preselectable:1},135:{gender:"M",club:0,colorable:1,selectable:1,preselectable:1},178:{gender:"M",club:0,colorable:0,selectable:0,preselectable:1},575:{gender:"F",club:0,colorable:1,selectable:1,preselectable:1},535:{gender:"F",club:0,colorable:1,selectable:0,preselectable:1},110:{gender:"M",club:0,colorable:1,selectable:1,preselectable:1},520:{gender:"F",club:0,colorable:1,selectable:1,preselectable:1},120:{gender:"M",club:0,colorable:0,selectable:0,preselectable:1},545:{gender:"F",club:0,colorable:1,selectable:1,preselectable:1},160:{gender:"M",club:0,colorable:1,selectable:0,preselectable:1},889:{gender:"M",club:0,colorable:1,selectable:1,preselectable:1},890:{gender:"F",club:0,colorable:1,selectable:1,preselectable:1},891:{gender:"U",club:0,colorable:1,selectabl
|
||
|
|
preselectable:1},3347:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3349:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3352:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3356:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3362:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3363:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3382:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3392:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3394:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3404:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3409:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3415:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3421:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3422:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3426:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3430:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3431:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3440:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3441:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3450:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3451:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3452:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3453:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3454:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3455:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3456:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3457:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3461:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3463:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3477:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3478:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3479:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3480:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3481:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3482:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3488:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3494:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3495:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3500:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3514:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3533:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3534:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},3535:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1}}},{paletteid:3,type:"he",sets:{1606:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},3069:{gender:"U",club:2,colorable:1,selectable:1,preselectable:1},3070:{gender:"U",club:2,colorable:1,selectable:1,preselectable:1},3071:{gender:"U",club:2,colorable:1,selectable:1,preselectable:1},3079:{gender:"U",club:2,colorable:1,selectable:1,preselectable:1},3081:{gender:"U",club:2,colorable:1,selectable:1,preselectable:1},3082:{gender:"U",club:2,colorable:1,selectable:1,preselectable:1},3146:{gender:"U",club:2,colorable:1,selectable:1,preselectable:1},3149:{gender:"U",club:2,colorable:1,selectable:1,preselectable:1},3155:{gender:"U",club:2,colorable:1,selectable:1,preselectable:1},3164:{gender:"U",club:2,colorable:1,selectable:1,preselectable:1},3181:{gender:"U",club:2,colorable:1,selectable:1,preselectable:1},1605:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},1602:{gender:"U",club:0,colorable:1,selectable:1,preselectable:1},1601:{gender:"U",club:0,colorable:0,selectable:1,preselectable:1},1607:{gender:"U",club:2,colorable:0,selectable:1,preselectable:1},1604:{gender:"U",club:2,colorable:0,selectable:1,preselectable:1},1603:{gender:"U",club:2,colorable:1,selectable:1,preselectable:1},1608:{gender:"U",
|