From 016b69780fe0c8278fb0337e28b9c033a7d60a99 Mon Sep 17 00:00:00 2001 From: Tobi Date: Sat, 22 Nov 2014 22:40:06 +0100 Subject: [PATCH] basic version of questclass, however not able to integrate into compendium cuz of state sys. example for questclass is static, visible on the overview, thus can be generated via api already. fix parameters are embedded in the overviews php file. embedding though proves a goodie :(. --- mojotrollz/api/autoload.inc.php | 5 +- mojotrollz/api/quest/qq/GET_BASE_DATA.php | 13 +++++ .../quest/qq/GET_CREATURE_QUESTRELATION.php | 12 +++++ .../api/quest/qq/GET_ITEM_QUESTRELATION.php | 12 +++++ .../api/quest/qq/GET_OBJECT_QUESTRELATION.php | 12 +++++ mojotrollz/api/quest/quest.php | 52 +++++++++++++++++++ .../api/quest/tpl/creature_questrelation.tpl | 1 + .../api/quest/tpl/item_questrelation.tpl | 1 + .../api/quest/tpl/object_questrelation.tpl | 1 + mojotrollz/api/quest/tpl/quest.tpl | 51 ++++++++++++++++++ mojotrollz/page/page_mojotrollz.php | 5 ++ .../js/user_achievements_content.js | 7 +++ .../tpl/quest_element.tpl | 1 + .../user_achievements_content.php | 3 +- .../js/user_achievements_menu_sub.js | 12 ++++- mojotrollz/page/user_start/tpl/user_start.tpl | 4 ++ mojotrollz/page/user_start/user_start.php | 1 + system | 2 +- 18 files changed, 191 insertions(+), 4 deletions(-) create mode 100644 mojotrollz/api/quest/qq/GET_BASE_DATA.php create mode 100644 mojotrollz/api/quest/qq/GET_CREATURE_QUESTRELATION.php create mode 100644 mojotrollz/api/quest/qq/GET_ITEM_QUESTRELATION.php create mode 100644 mojotrollz/api/quest/qq/GET_OBJECT_QUESTRELATION.php create mode 100644 mojotrollz/api/quest/quest.php create mode 100644 mojotrollz/api/quest/tpl/creature_questrelation.tpl create mode 100644 mojotrollz/api/quest/tpl/item_questrelation.tpl create mode 100644 mojotrollz/api/quest/tpl/object_questrelation.tpl create mode 100644 mojotrollz/api/quest/tpl/quest.tpl create mode 100644 mojotrollz/page/user_achievements_content/js/user_achievements_content.js diff --git a/mojotrollz/api/autoload.inc.php b/mojotrollz/api/autoload.inc.php index 7235e6d..63e063a 100644 --- a/mojotrollz/api/autoload.inc.php +++ b/mojotrollz/api/autoload.inc.php @@ -6,4 +6,7 @@ SYSTEM\autoload::registerFolder(dirname(__FILE__).'/world',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/database',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/char',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/char/qq','DBD'); -SYSTEM\autoload::registerFolder(dirname(__FILE__).'/client',''); \ No newline at end of file +SYSTEM\autoload::registerFolder(dirname(__FILE__).'/client',''); + +SYSTEM\autoload::registerFolder(dirname(__FILE__).'/quest',''); +SYSTEM\autoload::registerFolder(dirname(__FILE__).'/quest/qq','DBD'); \ No newline at end of file diff --git a/mojotrollz/api/quest/qq/GET_BASE_DATA.php b/mojotrollz/api/quest/qq/GET_BASE_DATA.php new file mode 100644 index 0000000..3f03cb8 --- /dev/null +++ b/mojotrollz/api/quest/qq/GET_BASE_DATA.php @@ -0,0 +1,13 @@ +next()){ + $result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PAPI(),'quest/tpl/creature_questrelation.tpl'), $rel); + } + return $result; + } + + public static function get_item_questrelation($entry){ + $result = ''; + $questrelation = \DBD\GET_ITEM_QUESTRELATION::QQ(array($entry)); + while ($rel = $questrelation->next()){ + $result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PAPI(),'quest/tpl/item_questrelation.tpl'), $rel); + } + return $result; + } + + public static function get_object_questrelation($entry){ + $result = ''; + $questrelation = \DBD\GET_OBJECT_QUESTRELATION::QQ(array($entry)); + while ($rel = $questrelation->next()){ + $result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PAPI(),'quest/tpl/object_questrelation.tpl'), $rel); + } + return $result; + } + +} diff --git a/mojotrollz/api/quest/tpl/creature_questrelation.tpl b/mojotrollz/api/quest/tpl/creature_questrelation.tpl new file mode 100644 index 0000000..40780d2 --- /dev/null +++ b/mojotrollz/api/quest/tpl/creature_questrelation.tpl @@ -0,0 +1 @@ +${Name} \ No newline at end of file diff --git a/mojotrollz/api/quest/tpl/item_questrelation.tpl b/mojotrollz/api/quest/tpl/item_questrelation.tpl new file mode 100644 index 0000000..b82d5a9 --- /dev/null +++ b/mojotrollz/api/quest/tpl/item_questrelation.tpl @@ -0,0 +1 @@ +${name} \ No newline at end of file diff --git a/mojotrollz/api/quest/tpl/object_questrelation.tpl b/mojotrollz/api/quest/tpl/object_questrelation.tpl new file mode 100644 index 0000000..b82d5a9 --- /dev/null +++ b/mojotrollz/api/quest/tpl/object_questrelation.tpl @@ -0,0 +1 @@ +${name} \ No newline at end of file diff --git a/mojotrollz/api/quest/tpl/quest.tpl b/mojotrollz/api/quest/tpl/quest.tpl new file mode 100644 index 0000000..ae73deb --- /dev/null +++ b/mojotrollz/api/quest/tpl/quest.tpl @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + +
+

${Title}
+ No.${entry}

+

+ + +

+ min. Level:  ${MinLevel}
+ QuestLevel: ${QuestLevel} +

+
+

+ Obtainable from:
+ ${creature_questrelation} + ${item_questrelation} + ${object_questrelation} +

+
+ +
+

+ Details:
+ ${Details} +

+
+

+ Objectives:
+ ${Objectives} +

+
+ + diff --git a/mojotrollz/page/page_mojotrollz.php b/mojotrollz/page/page_mojotrollz.php index 1d126cf..a46ee30 100644 --- a/mojotrollz/page/page_mojotrollz.php +++ b/mojotrollz/page/page_mojotrollz.php @@ -83,6 +83,11 @@ class page_mojotrollz extends \SYSTEM\API\api_default { if(!\SYSTEM\SECURITY\Security::isLoggedIn()){ throw new ERROR("You need to be logged in to view this ressource.");} return new user_achievements_content($menu, $filter);} + + public static function page_user_achievements_content_quest($entry){ + if(!\SYSTEM\SECURITY\Security::isLoggedIn()){ + throw new ERROR("You need to be logged in to view this ressource.");} + return quest::test($entry);} public static function page_user_logout(){ if(!\SYSTEM\SECURITY\Security::isLoggedIn()){ diff --git a/mojotrollz/page/user_achievements_content/js/user_achievements_content.js b/mojotrollz/page/user_achievements_content/js/user_achievements_content.js new file mode 100644 index 0000000..6466483 --- /dev/null +++ b/mojotrollz/page/user_achievements_content/js/user_achievements_content.js @@ -0,0 +1,7 @@ +function init_user_achievements_content(){ + alert('init'); + console.log('init'); + $(".btn_quest_info").click(function(){ + $('#achievement_list').load('./?page=user_achievements_content_quest&entry=' + $(this).attr('entry')); + }); +} \ No newline at end of file diff --git a/mojotrollz/page/user_achievements_content/tpl/quest_element.tpl b/mojotrollz/page/user_achievements_content/tpl/quest_element.tpl index 1e2bf3d..8b4d00b 100644 --- a/mojotrollz/page/user_achievements_content/tpl/quest_element.tpl +++ b/mojotrollz/page/user_achievements_content/tpl/quest_element.tpl @@ -3,6 +3,7 @@ ${Title}

Min Lvl: ${MinLevel}
Quest Lvl: ${QuestLevel}

+ diff --git a/mojotrollz/page/user_achievements_content/user_achievements_content.php b/mojotrollz/page/user_achievements_content/user_achievements_content.php index ade1721..e9d9ab6 100644 --- a/mojotrollz/page/user_achievements_content/user_achievements_content.php +++ b/mojotrollz/page/user_achievements_content/user_achievements_content.php @@ -8,7 +8,7 @@ class user_achievements_content extends SYSTEM\PAGE\Page { $this->filter = $filter; } public static function js(){ - return array();} + return array( \SYSTEM\WEBPATH(new PPAGE(),'user_achievements_content/js/user_achievements_content.js'));} public static function css (){ return array();} @@ -346,6 +346,7 @@ class user_achievements_content extends SYSTEM\PAGE\Page { } public function html(){ + switch($this->menu){ case 1: return $this->menu_acc(); diff --git a/mojotrollz/page/user_achievements_menu_sub/js/user_achievements_menu_sub.js b/mojotrollz/page/user_achievements_menu_sub/js/user_achievements_menu_sub.js index 141b669..1568175 100644 --- a/mojotrollz/page/user_achievements_menu_sub/js/user_achievements_menu_sub.js +++ b/mojotrollz/page/user_achievements_menu_sub/js/user_achievements_menu_sub.js @@ -1,6 +1,16 @@ function init_user_achievements_menu_sub(){ console.log('init'); $(".btn_achieve_menu").click(function(){ + btn_info(); $('#achievement_list').load('./?page=user_achievements_content&menu=' + $(this).attr('menu') + '&filter=' + $(this).attr('filter')); + btn_info(); + }); -} \ No newline at end of file + + function btn_info(){ + $(".btn_quest_info").click(function(){ + alert('test'); + $('#achievement_list').load('./?page=user_achievements_content_quest&entry=' + $(this).attr('entry')); + }); + } +} diff --git a/mojotrollz/page/user_start/tpl/user_start.tpl b/mojotrollz/page/user_start/tpl/user_start.tpl index 3954810..0fe326f 100644 --- a/mojotrollz/page/user_start/tpl/user_start.tpl +++ b/mojotrollz/page/user_start/tpl/user_start.tpl @@ -67,5 +67,9 @@ + +
+ ${test} +
\ No newline at end of file diff --git a/mojotrollz/page/user_start/user_start.php b/mojotrollz/page/user_start/user_start.php index 65b80da..0c512b3 100644 --- a/mojotrollz/page/user_start/user_start.php +++ b/mojotrollz/page/user_start/user_start.php @@ -52,6 +52,7 @@ class user_start extends SYSTEM\PAGE\Page { $vars['guildcount'] = \DBD\COUNT_GUILDS::Q1()['count']; $vars['realm_status'] = realm::status(); $vars['world_status'] = world::status(); + $vars['test'] = quest::test(248); $vars['player_online'] = database::player_online(); $vars['factionbalance'] = $this->get_faction_balance(); $vars['role_balance'] =$this->get_role_balance(); diff --git a/system b/system index 69390d4..b3bf40d 160000 --- a/system +++ b/system @@ -1 +1 @@ -Subproject commit 69390d4c59bf3a2a3cd2add9f5b3bc3f571f1287 +Subproject commit b3bf40d17d3c707d7af17943b1f6ff147c0e71a6