diff --git a/mojotrollz/api/api_mojotrollz.php b/mojotrollz/api/api_mojotrollz.php index 9f28360..884a1aa 100644 --- a/mojotrollz/api/api_mojotrollz.php +++ b/mojotrollz/api/api_mojotrollz.php @@ -4,4 +4,6 @@ class api_mojotrollz extends \SYSTEM\API\api_system { public static function call_stats(){ $result = \DBD\ONLINE_STATS::QA(array('3600')); return \SYSTEM\LOG\JsonResult::toString($result);} + public static function call_charcreation($json=NULL){ + return charcreation::data($json);} } diff --git a/mojotrollz/api/autoload.inc.php b/mojotrollz/api/autoload.inc.php index cfd6daf..bda1015 100644 --- a/mojotrollz/api/autoload.inc.php +++ b/mojotrollz/api/autoload.inc.php @@ -2,4 +2,5 @@ SYSTEM\autoload::registerFolder(dirname(__FILE__),''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/realm',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/world',''); -SYSTEM\autoload::registerFolder(dirname(__FILE__).'/database',''); \ No newline at end of file +SYSTEM\autoload::registerFolder(dirname(__FILE__).'/database',''); +SYSTEM\autoload::registerFolder(dirname(__FILE__).'/charcreation',''); \ No newline at end of file diff --git a/mojotrollz/api/charcreation/cc_session.php b/mojotrollz/api/charcreation/cc_session.php new file mode 100644 index 0000000..6ed40bd --- /dev/null +++ b/mojotrollz/api/charcreation/cc_session.php @@ -0,0 +1,12 @@ +$value){ + if(method_exists('charcreation_validator',$key)){ + call_user_func('charcreation_validator::'.$key,$value);} + } + } + return JsonResult::toString(\SYSTEM\SECURITY\Security::load(self::MOJO_CC_SESSIONKEY)); + } +} + diff --git a/mojotrollz/api/charcreation/charcreation_validator.php b/mojotrollz/api/charcreation/charcreation_validator.php new file mode 100644 index 0000000..1fdbab8 --- /dev/null +++ b/mojotrollz/api/charcreation/charcreation_validator.php @@ -0,0 +1,28 @@ +char_name = $value; + \SYSTEM\SECURITY\Security::save(charcreation::MOJO_CC_SESSIONKEY,$data); + } + public static function char_gender($value){ + $data = \SYSTEM\SECURITY\Security::load(charcreation::MOJO_CC_SESSIONKEY); + $data->char_gender = $value; + \SYSTEM\SECURITY\Security::save(charcreation::MOJO_CC_SESSIONKEY,$data); + } + public static function char_race($value){ + $data = \SYSTEM\SECURITY\Security::load(charcreation::MOJO_CC_SESSIONKEY); + $data->char_race = $value; + \SYSTEM\SECURITY\Security::save(charcreation::MOJO_CC_SESSIONKEY,$data); + } + public static function char_class($value){ + $data = \SYSTEM\SECURITY\Security::load(charcreation::MOJO_CC_SESSIONKEY); + $data->char_class = $value; + \SYSTEM\SECURITY\Security::save(charcreation::MOJO_CC_SESSIONKEY,$data); + } + public static function char_appearance($value){} + public static function char_skill_tree($value){} + public static function char_equip($value){} + public static function char_guild($value){} + public static function char_spawn($value){} +} \ No newline at end of file diff --git a/mojotrollz/page/wizard_details/details.tpl b/mojotrollz/page/wizard_details/details.tpl index a4a099a..dba9af6 100644 --- a/mojotrollz/page/wizard_details/details.tpl +++ b/mojotrollz/page/wizard_details/details.tpl @@ -1,42 +1,44 @@

- - + +
- - - - + + + +
- - - - + + + +
- - - - + + + +
- - - - + + + +
- - + +
- - + +
- - + +
- - + + +
+
-
${default_page_toolbar}
+
${default_page_toolbar}
diff --git a/mojotrollz/page/wizard_details/js/wizard_details.js b/mojotrollz/page/wizard_details/js/wizard_details.js index 5363d5e..137b884 100644 --- a/mojotrollz/page/wizard_details/js/wizard_details.js +++ b/mojotrollz/page/wizard_details/js/wizard_details.js @@ -1,15 +1,27 @@ function wizard_details (){ + $('#charname').keyup(function(){ + $.get('./api.php?call=charcreation&json={"char_name" : "'+$(this).val()+'"}',function(){ + load_toolbar(); + }) + }) + $('#details_gender a').click(function(){ $('#details_gender a').removeClass('selected'); $('#details_race a').removeClass('selected'); $('#details_class a').removeClass('selected'); - $(this).addClass('selected'); + $(this).addClass('selected'); + $.get('./api.php?call=charcreation&json={"char_gender" : "'+$(this).attr('gender')+'"}',function(){ + load_toolbar(); + }) }); $('#details_race a').click(function(){ $('#details_race a').removeClass('selected'); - $(this).addClass('selected'); + $(this).addClass('selected'); + $.get('./api.php?call=charcreation&json={"char_race" : "'+$(this).attr('race')+'", "char_gender" : "'+$(this).attr('gender')+'"}',function(){ + load_toolbar(); + }) }); $('#details_class a').click(function(){ @@ -38,6 +50,11 @@ function wizard_details (){ if(!$('#details_race .selected').hasClass('fadein')){ $('#details_race .selected').removeClass('selected'); } + + $.get('./api.php?call=charcreation&json={"char_class" : "'+$(this).attr('cclass')+'"}',function(){ + load_toolbar(); + }) + }); $('#content .male').click(function (){ diff --git a/mojotrollz/page/wizard_toolbar/wizard_toolbar.php b/mojotrollz/page/wizard_toolbar/wizard_toolbar.php index c229fa2..7023e7e 100644 --- a/mojotrollz/page/wizard_toolbar/wizard_toolbar.php +++ b/mojotrollz/page/wizard_toolbar/wizard_toolbar.php @@ -1,14 +1,15 @@ js(); - $vars['css'] = $this->css(); + $vars = array('char_name' => 'Choose your name', 'char_class' => 'hunter', 'char_gender' => 'male', 'char_race' => 'human', 'char_class' => 'druid'); + if($data = \SYSTEM\SECURITY\Security::load(charcreation::MOJO_CC_SESSIONKEY)){ + $vars['char_name'] = $data->char_name; + $vars['char_class'] = $data->char_class; + $vars['char_gender'] = $data->char_gender; + $vars['char_race'] = $data->char_race; + $vars['char_class'] = $data->char_class; + } $vars['WOWICONS'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=wowicons&id='; //$vars['PICPATH'] = \SYSTEM\WEBPATH(new PPAGE(), 'wizard_toolbar/img/'); //$vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE)); diff --git a/mojotrollz/page/wizard_toolbar/wizard_toolbar.tpl b/mojotrollz/page/wizard_toolbar/wizard_toolbar.tpl index 1a6b9bf..9fc7d07 100644 --- a/mojotrollz/page/wizard_toolbar/wizard_toolbar.tpl +++ b/mojotrollz/page/wizard_toolbar/wizard_toolbar.tpl @@ -1,7 +1,7 @@ -Mein Charname - - +${char_name} + +