@@ -810,20 +810,12 @@ function advanceViewSettings() {
810
810
* Sets the count
811
811
*/
812
812
function setSetting ( elem , id ) {
813
- switch ( id ) {
814
- case 10 :
815
- break ;
816
- case 9 :
817
- advanceViewSettings ( ) ;
818
- break ;
819
- default :
820
- g_numSettingElements [ id ] = elem ;
821
- setSettings ( { globals :{ fishSetting :id } } ) ;
822
- for ( var otherElem in g_numSettingElements ) {
823
- g_numSettingElements [ otherElem ] . style . color = "gray" ;
824
- }
825
- elem . style . color = "red" ;
813
+ g_numSettingElements [ id ] = elem ;
814
+ setSettings ( { globals :{ fishSetting :id } } ) ;
815
+ for ( var otherElem in g_numSettingElements ) {
816
+ g_numSettingElements [ otherElem ] . style . color = "gray" ;
826
817
}
818
+ elem . style . color = "red" ;
827
819
}
828
820
829
821
function getParameterByName ( name ) {
@@ -970,8 +962,48 @@ function initialize() {
970
962
Log ( "--Setup Laser----------------------------------------" ) ;
971
963
var laser = setupLaser ( ) ;
972
964
965
+ var num = [ 1 , 100 , 500 , 1000 , 5000 , 10000 , 15000 , 20000 , 25000 , 30000 ] ;
966
+ var changeViewElem = document . getElementById ( "setSettingChangeView" ) ;
967
+ var parentElem = changeViewElem . parentNode ;
968
+ for ( var i = 0 ; i < num . length ; ++ i ) {
969
+ var div = document . createElement ( "div" ) ;
970
+ div . className = "clickable" ;
971
+ div . id = "setSetting" + i ;
972
+ div . innerHTML = num [ i ] ;
973
+ parentElem . insertBefore ( div , changeViewElem ) ;
974
+ }
975
+
973
976
for ( var ff = 0 ; ff < g_fishTable . length ; ++ ff ) {
974
977
g_fishTable [ ff ] . fishData = [ ] ;
978
+ g_fishTable [ ff ] . num = [ ] ;
979
+ }
980
+
981
+ var type = [ "Big" , "Medium" , "Small" ] ;
982
+ for ( var i = 0 ; i < num . length ; ++ i ) {
983
+ var numLeft = num [ i ] ;
984
+ for ( var j = 0 ; j < type . length ; ++ j ) {
985
+ for ( var ff = 0 ; ff < g_fishTable . length ; ++ ff ) {
986
+ var fishInfo = g_fishTable [ ff ] ;
987
+ var fishName = fishInfo . name ;
988
+ if ( ! fishName . startsWith ( type [ j ] ) ) {
989
+ continue ;
990
+ }
991
+ var numType = numLeft ;
992
+ if ( type [ j ] == "Big" ) {
993
+ numType = Math . min ( numLeft , num [ i ] < 100 ? 1 : 2 ) ;
994
+ } else if ( type [ j ] == "Medium" ) {
995
+ if ( num [ i ] < 1000 ) {
996
+ numType = Math . min ( numLeft , num [ i ] / 10 | 0 ) ;
997
+ } else if ( num [ i ] < 10000 ) {
998
+ numType = Math . min ( numLeft , 80 ) ;
999
+ } else {
1000
+ numType = Math . min ( numLeft , 160 ) ;
1001
+ }
1002
+ }
1003
+ numLeft = numLeft - numType ;
1004
+ fishInfo . num . push ( numType ) ;
1005
+ }
1006
+ }
975
1007
}
976
1008
977
1009
var particleSystem = new tdl . particles . ParticleSystem (
@@ -1779,11 +1811,15 @@ function setupCountButtons() {
1779
1811
} else {
1780
1812
setSetting ( document . getElementById ( "setSetting2" ) , 2 ) ;
1781
1813
}
1782
- setSetting ( document . getElementById ( "setSetting9" ) , 9 ) ;
1783
1814
}
1784
1815
1785
1816
function initUIStuff ( ) {
1786
1817
setupCountButtons ( ) ;
1818
+ var elem = document . getElementById ( "setSettingChangeView" ) ;
1819
+ elem . onclick = function ( ) {
1820
+ advanceViewSettings ( ) ;
1821
+ } ;
1822
+ advanceViewSettings ( ) ;
1787
1823
1788
1824
if ( setFishCount ) {
1789
1825
setSetting ( document . getElementById ( "setSetting" + fishCountSetting ) , fishCountSetting ) ;
@@ -1864,7 +1900,7 @@ $(function(){
1864
1900
g . net . fovFudge = 1 ;
1865
1901
}
1866
1902
1867
- $ ( '#setSetting10 ' ) . click ( function ( ) {
1903
+ $ ( '#setSettingAdvanced ' ) . click ( function ( ) {
1868
1904
$ ( "#uiContainer" ) . toggle ( 'slow' ) ; return false ; } ) ;
1869
1905
$ ( "#uiContainer" ) . toggle ( ) ;
1870
1906
$ ( '#options' ) . click ( function ( ) {
0 commit comments