diff --git a/src/application/code/core/Legacies/Empire/Controller/ShipyardController.php b/src/application/code/core/Legacies/Empire/Controller/ShipyardController.php index dd42c30..1af2ed7 100644 --- a/src/application/code/core/Legacies/Empire/Controller/ShipyardController.php +++ b/src/application/code/core/Legacies/Empire/Controller/ShipyardController.php @@ -31,7 +31,7 @@ class Legacies_Empire_Controller_ShipyardController public function buildAction() { if (!$this->getRequest()->isPost() || !is_array($shipList = $this->getRequest()->getPost('id'))) { - $this->_redirect('*/*/view'); + $this->_redirect('*/*/'); return; } diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab/Builder.php b/src/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab/Builder.php index e584a74..41be71d 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab/Builder.php +++ b/src/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab/Builder.php @@ -334,4 +334,4 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab_Builder return $this; } -} \ No newline at end of file +} diff --git a/src/application/code/core/Wootook/Core/Block/Html/Home.php b/src/application/code/core/Wootook/Core/Block/Html/Home.php new file mode 100644 index 0000000..ac43612 --- /dev/null +++ b/src/application/code/core/Wootook/Core/Block/Html/Home.php @@ -0,0 +1,22 @@ +getReadConnection(); - $select = $database->select('planets'); - $select - ->column('id') - ->where('galaxy=:galaxy') - ->where('system=:system') - ->where('planet=:position') - ->where('planet_type=:type') - ->limit(1) - ; - $statement = $database->prepare($select); + $collection = new Wootook_Empire_Resource_Planet_Collection('core_read'); + $collection->addCoordsToFilter($coords['galaxy'], $coords['system'], $coords['position'], $coords['type']) + ->setPage(1, 1); - if (!$statement->execute() || $statement->rowCount() <= 0) { - return new self(); + $planet = $collection->getFirstItem(); + if ($planet !== null) { + return $planet; } - $planetId = $statement->fetchCol(); - - return self::factory($planetId); + return new self; } public function __construct(Array $data = array(), Wootook_Player_Model_Entity $player = null) @@ -624,16 +615,16 @@ class Wootook_Empire_Model_Planet } if ($this->isDestroyed()) { - throw new Wootook_Empire_Model_Planet_Exception(Wootook::__('Planet is already destroyed.')); + throw new Wootook_Empire_Exception_Planet(Wootook::__('Planet is already destroyed.')); } if ($this->getFleetCollection()->count() > 0) { - throw new Wootook_Empire_Model_Planet_Exception(Wootook::__("Could not delete planet until fleets aten't retuned.")); + throw new Wootook_Empire_Exception_Planet(Wootook::__("Could not delete planet until fleets aten't retuned.")); } $player = $this->getPlayer(); if ($player->getHomePlanet()->getId() == $this->getId()) { - throw new Wootook_Empire_Model_Planet_Exception(Wootook::__("You can't destroy your home planet.")); + throw new Wootook_Empire_Exception_Planet(Wootook::__("You can't destroy your home planet.")); } if ($player->getCurrentPlanet()->getId() == $this->getId()) { @@ -763,12 +754,12 @@ class Wootook_Empire_Model_Planet /** * - * @return Wootook_Empire_Model_Planet_Builder + * @return Wootook_Empire_Model_Planet_Builder_Builder */ public function getBuildingQueue() { if ($this->_builder === null && $this->getPlayer()) { - $this->_builder = new Wootook_Empire_Model_Planet_Builder($this, $this->getPlayer()); + $this->_builder = new Wootook_Empire_Model_Planet_Builder_Builder($this, $this->getPlayer()); } return $this->_builder; } diff --git a/src/application/code/core/Wootook/Empire/Model/Planet/Builder.php b/src/application/code/core/Wootook/Empire/Model/Planet/Builder/Builder.php similarity index 97% rename from src/application/code/core/Wootook/Empire/Model/Planet/Builder.php rename to src/application/code/core/Wootook/Empire/Model/Planet/Builder/Builder.php index 9724142..38aaa62 100644 --- a/src/application/code/core/Wootook/Empire/Model/Planet/Builder.php +++ b/src/application/code/core/Wootook/Empire/Model/Planet/Builder/Builder.php @@ -34,7 +34,7 @@ * @author Greg * */ -class Wootook_Empire_Model_Planet_Builder +class Wootook_Empire_Model_Planet_Builder_Builder extends Wootook_Empire_Model_BuilderAbstract { const FIELD_SERIALIZED = 'b_building_id'; @@ -124,6 +124,7 @@ class Wootook_Empire_Model_Planet_Builder $levelTime = Math::sub($partialLevelTime, $firstLevelTime); $speedFactor = Wootook::getGameConfig('game/speed/general'); + if ($speedFactor == null) { $speedFactor = 1; } @@ -172,7 +173,7 @@ class Wootook_Empire_Model_Planet_Builder /** * Update the contruction queue. * - * @return Wootook_Empire_Model_Planet_Builder + * @return Wootook_Empire_Model_Planet_Builder_Builder */ public function updateQueue(Wootook_Core_DateTime $time) { @@ -231,7 +232,7 @@ class Wootook_Empire_Model_Planet_Builder * * @param int|string $buildingId * @param int $level - * @return Wootook_Empire_Model_Planet_Builder + * @return Wootook_Empire_Model_Planet_Builder_Builder */ public function appendQueue($buildingId, $level, Wootook_Core_DateTime $time) { @@ -281,7 +282,7 @@ class Wootook_Empire_Model_Planet_Builder * Dequeues the first item to build to the construction list and removes all * its successors of the same type. * - * @return Wootook_Empire_Model_Planet_Builder + * @return Wootook_Empire_Model_Planet_Builder_Builder */ public function dequeueFirstItem() { @@ -296,7 +297,7 @@ class Wootook_Empire_Model_Planet_Builder * successors of the same type. * * @param string $itemId - * @return Wootook_Empire_Model_Planet_Builder + * @return Wootook_Empire_Model_Planet_Builder_Builder */ public function dequeueItem($itemId) { @@ -329,4 +330,4 @@ class Wootook_Empire_Model_Planet_Builder return $this; } -} \ No newline at end of file +} diff --git a/src/application/code/core/Wootook/Empire/Model/Planet/Exception.php b/src/application/code/core/Wootook/Empire/Model/Planet/Exception.php deleted file mode 100644 index 206a600..0000000 --- a/src/application/code/core/Wootook/Empire/Model/Planet/Exception.php +++ /dev/null @@ -1,3 +0,0 @@ -addFieldToFilter('galaxy', $galaxy); + + return $this; + } + + public function addSystemToFilter($system) + { + $this->addFieldToFilter('system', $system); + + return $this; + } + + public function addPositionToFilter($position) + { + $this->addFieldToFilter('planet', $position); + + return $this; + } + public function addTypeToFilter($type) { $this->addFieldToFilter('planet_type', $type); return $this; } + + public function addCoordsToFilter($galaxy, $system = null, $position = null, $type = null) + { + $this->addGalaxyToFilter($galaxy); + + if ($system !== null) { + $this->addSystemToFilter($system); + + if ($position !== null) { + $this->addPositionToFilter($position); + + if ($type !== null) { + $this->addTypeToFilter($type); + } + } + } + + return $this; + } } diff --git a/src/application/configs/system.php b/src/application/configs/system.php index 9adcd29..f1c17e0 100644 --- a/src/application/configs/system.php +++ b/src/application/configs/system.php @@ -45,6 +45,15 @@ 'timezone' => 'Europe/Paris' ), ), + 'game' => array( + 'speed' => array( + 'general' => 1000 + ), + 'home' => array( + 'title' => 'Welcome on Wootook!', + 'formated-welcome-text' => '

Wootook make you an emperor.

Conquer outer space and master other players on Wootook.

' + ) + ) ), 'frontend' => array( 'layout' => array( @@ -59,4 +68,4 @@ 'admin' => 'admin.php' ), ) - ); \ No newline at end of file + ); diff --git a/src/application/design/frontend/base/default/layouts/page.xml b/src/application/design/frontend/base/default/layouts/page.xml index 02e472d..53a6c80 100644 --- a/src/application/design/frontend/base/default/layouts/page.xml +++ b/src/application/design/frontend/base/default/layouts/page.xml @@ -109,16 +109,19 @@ home + + public-form + - Home page + Welcome - + diff --git a/src/application/design/frontend/base/default/scripts/empire/planet/research-lab/item.phtml b/src/application/design/frontend/base/default/scripts/empire/planet/research-lab/item.phtml index de636cd..552f840 100644 --- a/src/application/design/frontend/base/default/scripts/empire/planet/research-lab/item.phtml +++ b/src/application/design/frontend/base/default/scripts/empire/planet/research-lab/item.phtml @@ -7,7 +7,7 @@
-

__('Build next level (%s)', $this->renderNumber($this->getNextLevel()))?>

+

__('Build next level (%s)', $this->renderNumber($this->getNextLevel()))?>

getDescription()?>

diff --git a/src/application/design/frontend/base/default/scripts/empire/planet/research-lab/queue/item.phtml b/src/application/design/frontend/base/default/scripts/empire/planet/research-lab/queue/item.phtml index d1ffa3f..ac60627 100644 --- a/src/application/design/frontend/base/default/scripts/empire/planet/research-lab/queue/item.phtml +++ b/src/application/design/frontend/base/default/scripts/empire/planet/research-lab/queue/item.phtml @@ -6,6 +6,6 @@

__('Lasts %s', $this->renderTime($this->getBuildingRemainingTime()))?>

diff --git a/src/application/design/frontend/base/default/scripts/empire/planet/shipyard.phtml b/src/application/design/frontend/base/default/scripts/empire/planet/shipyard.phtml index 835cf47..6b75a1a 100644 --- a/src/application/design/frontend/base/default/scripts/empire/planet/shipyard.phtml +++ b/src/application/design/frontend/base/default/scripts/empire/planet/shipyard.phtml @@ -1,6 +1,6 @@

__('Shipyard')?>

-
+ getPartial('item-list.items')->render()?>
diff --git a/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/item.phtml b/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/item.phtml index cf70c4d..3500700 100644 --- a/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/item.phtml +++ b/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/item.phtml @@ -7,7 +7,7 @@
-

+

@@ -31,4 +31,4 @@

__('Building time: %s', $this->renderTime($this->getBuildingTime(1), false))?>

-
\ No newline at end of file +
diff --git a/src/application/design/frontend/base/default/scripts/page/html/home.phtml b/src/application/design/frontend/base/default/scripts/page/html/home.phtml index 2a5f5be..2970804 100644 --- a/src/application/design/frontend/base/default/scripts/page/html/home.phtml +++ b/src/application/design/frontend/base/default/scripts/page/html/home.phtml @@ -1 +1,7 @@ + getLayout()->getMessagesBlock()->renderGroupedHtml()?> +
+

getTitle()?>

+

getFormatedWelcomeText()?>

+ +
diff --git a/src/skin/frontend/base/default/css/base.css b/src/skin/frontend/base/default/css/base.css index f642e29..e37fdb5 100644 --- a/src/skin/frontend/base/default/css/base.css +++ b/src/skin/frontend/base/default/css/base.css @@ -118,15 +118,14 @@ input[type=submit],input[type=button] {height:2em;border:#58939f 0 solid;border- */ body.public-form {width:100%;height:100%;} body.public-form .main-form {display:block;margin:0 auto;padding:0;width:300px;border-radius:5px;background:rgba(255,255,255,.8);border:5px solid #58939f;background-image:-moz-linear-gradient(top,#AAA 0,#FFF 100%);background-image:linear-gradient(top,#AAA 0,#FFF 100%);} -body.public-form #login-form {height:190px;} -body.public-form #lost-password-form {height:130px;} -body.public-form #register-form {height:350px;} +body.public-form #login-form {height:230px;} +body.public-form #lost-password-form {height:170px;} +body.public-form #register-form {height:390px;} body.public-form .main-form fieldset {border:none;margin:0;padding:0;} body.public-form #login-form fieldset legend, body.public-form #lost-password-form fieldset legend {display:block;width:280px;height:30px;background:#58939f;color:#FFF;font-weight:bold;font-size:2em;padding:0 10px;margin-bottom:10px;} body.public-form #register-form h1 {display:block;width:280px;height:30px;background:#58939f;color:#FFF;font-weight:bold;font-size:2em;padding:0 10px;margin:0 0 10px;} body.public-form #register-form fieldset legend {display:block;width:280px;height:15px;font-weight:bold;font-size:1.5em;padding:0 10px;margin:10px 0 5px;} -body.public-form .main-form input[type="submit"], body.public-form .main-form input[type="button"], body.public-form .main-form input[type="text"], body.public-form .main-form input[type="password"] {border-width:1px;} @@ -135,10 +134,10 @@ body.public-form .main-form p.lost-password {margin:0;padding:0;height:30px;widt body.public-form .main-form p.form label {margin:0;padding:0 10px;text-align:right;width:150px;height:30px;float:left;display:block;} body.public-form .main-form p.form input {margin:0;padding:0;width:120px;} body.public-form .main-form p.checkbox input {margin:0;padding:0;width:20px;} -body.public-form .main-form p.submit input {margin:0 100px;padding:0;width:100px;text-align:center;} -body.public-form #lost-password-form p.submit input {width:150px;margin:0 75px;} +body.public-form .main-form p.submit input {margin:0 100px;padding:0;text-align:center;} +body.public-form #lost-password-form p.submit input {margin:0 75px;} -body.public .content .public-topbar {background:#FF;border-bottom:5px solid #000;margin:0;height:30px;padding:0 10px;width:100%;background:rgba(0,0,0,.1);} +body.public .content .public-topbar {background:#FFF;border-bottom:5px solid #000;margin:0;height:30px;padding:0 10px;width:100%;background:rgba(0,0,0,.1);} body.public .content .public-topbar .container {margin:0 auto;width:780px;} body.public .content .public-topbar .container span {height:25px;padding:5px 15px 0;display:block;float:left;height:25px;margin:0 5px;font-size:1.5em;font-weight:bold;} body.public .content .public-topbar .container span:hover {background:rgba(94,175,239,0.3);border-radius:8px;} @@ -146,6 +145,13 @@ body.public .content .public-topbar .container span a:hover {color:#000;} body.public-form .content .public-topbar {margin-bottom:150px;} +body.public-form .main-form p.form input[type=submit], +button.register {height:45px;background:#F7A90F;border-radius:10px;font-weight:bold;font-family:Arial,sans-serif;font-variant:small-caps;font-style:oblique;border:2px solid #263D43;box-shadow:0 -8px 10px #D5640E inset, 0 2px 7px #58939F;color:#08335B;font-size:2em;text-align:center;} +button.register {margin:25px;margin-left:345px;width:400px;} +body.public-form .main-form p.form input[type=submit] {margin:10px 50px;width:200px;padding:5px 20px;} + +.global .content .home-block {width:740px;padding:10px 30px;margin:10px auto 0;background-color:rgba(255,255,255,.1);color:#FFF;border:10px solid rgba(88,147,159,.1);border-radius:10px;border-top-left-radius:30px;border-top-right-radius:30px;} + /** * Galaxy user name display colors */