Ejemplo n.º 1
0
    /**
     * Add javascripts, handle the removing of blueprints and show the blueprints list.
     *
     * @return void
     */
    public function process()
    {
        $this->getTemplate()->loadJs('addBlueprint');
        $this->getTemplate()->loadJs('jquery.materialSelect');
        $this->getTemplate()->loadJs('jquery.techniqueSelect');
        $this->getTemplate()->loadJs('jquery.blueprint');
        $this->getTemplate()->loadJs('showBlueprint');
        $this->getTemplate()->loadJsReadyScript('
			$(document).tooltip({
				content: function () {
					$(this).addClass("tooltip");
					return $(this).attr("title").replace(/(?:\\r\\n|\\r|\\n)/g, "<br />");
				}
			});
			$(".addTalentPoints").addTalentPoints();
		');
        $blueprintListing = \Listing\Blueprints::loadList();
        $itemListing = \Listing\Items::loadList();
        $itemTypeListing = \Listing\ItemTypes::loadList();
        $materialListing = \Listing\Materials::loadList();
        $techniqueListing = \Listing\Techniques::loadList();
        $moneyHelper = new \Helper\Money();
        if ($_GET['remove']) {
            $this->removeBlueprint($blueprintListing->getById($_GET['remove']));
        }
        $translator = \SmartWork\Translator::getInstance();
        $this->getTemplate()->assign('blueprintListing', $blueprintListing);
        $this->getTemplate()->assign('itemListing', $itemListing);
        $this->getTemplate()->assign('itemTypeListing', $itemTypeListing);
        $this->getTemplate()->assign('materialListing', $materialListing);
        $this->getTemplate()->assign('materialList', json_encode($materialListing->getAsArray()));
        $this->getTemplate()->assign('techniqueListing', $techniqueListing);
        $this->getTemplate()->assign('techniqueList', json_encode($techniqueListing->getAsArray()));
        $this->getTemplate()->assign('currencyList', $moneyHelper->getCurrencyList());
        $talentList = array('bowMaking' => $translator->gt('bowMaking'), 'precisionMechanics' => $translator->gt('precisionMechanics'), 'blacksmith' => $translator->gt('blacksmith'), 'woodworking' => $translator->gt('woodworking'), 'leatherworking' => $translator->gt('leatherworking'), 'tailoring' => $translator->gt('tailoring'));
        asort($talentList, SORT_NATURAL);
        $this->getTemplate()->assign('talentList', json_encode($talentList));
        $this->assign('columsPerItemType', array('meleeWeapon' => array('blueprint', 'item', 'itemType', 'damageType', 'materials', 'techniques', 'upgradeHitPoints', 'upgradeBreakFactor', 'upgradeInitiative', 'upgradeWeaponModificator'), 'rangedWeapon' => array('blueprint', 'item', 'itemType', 'damageType', 'materials', 'bonusRangedFightValue', 'reducePhysicalStrengthRequirement')));
    }
Ejemplo n.º 2
0
    /**
     * Add javascripts, handle the removing of craftings and show the list of undergoing and done
     * craftings.
     *
     * @return void
     */
    public function process()
    {
        $this->getTemplate()->loadJs('addCrafting');
        $this->getTemplate()->loadJs('jquery.blueprint');
        $this->getTemplate()->loadJs('showCrafting');
        $this->getTemplate()->loadJs('jquery.addTalentPoints');
        $this->getTemplate()->loadJsReadyScript('
			$(document).tooltip({
				content: function () {
					$(this).addClass("tooltip");
					return $(this).attr("title").replace(/(?:\\r\\n|\\r|\\n)/g, "<br />");
				}
			});
			$(".addTalentPoints").addTalentPoints();
		');
        $craftingsList = \Listing\Craftings::loadList();
        if ($_GET['remove']) {
            $this->removeCrafting($craftingsList->getById($_GET['remove']));
        }
        $this->getTemplate()->assign('blueprints', \Listing\Blueprints::loadList());
        $this->getTemplate()->assign('characters', \Listing\Characters::loadList());
        $this->getTemplate()->assign('craftings', $craftingsList);
    }