In-game resources views

* Added session records to carry resource information over to the
clients

* Added SQL support code for the various views

* Added interface and implementation of the resource information access
component

* Hooked resources information queries into both the empire and planet
management component

* Added resources display to planet and overview pages
This commit is contained in:
Emmanuel BENOîT 2012-02-04 10:43:12 +01:00
parent 56eddcc4f0
commit 597429fadf
45 changed files with 3211 additions and 52 deletions
legacyworlds-web-main/Content/Raw/WEB-INF/fm/en

View file

@ -63,4 +63,11 @@
</#macro>
<#macro abbr_bgc><abbr title="billion galactic credits">bgc</abbr></#macro>
<#macro abbr_st><abbr title="Server time">ST</abbr></#macro>
<#macro abbr_gt><abbr title="Time in the game universe">GT</abbr></#macro>
<#macro abbr_gt><abbr title="Time in the game universe">GT</abbr></#macro>
<#macro over_time title>
<#if data.page.useRLTime>
${title?xhtml} (for 12h)
<#else>
Monthly ${title?xhtml}
</#if>
</#macro>

View file

@ -61,7 +61,64 @@
</@right_column>
</@tab>
<@tab id="economy" title="Economy">
<@listview>
<@lv_line headers=true>
<@lv_column width=30>&nbsp;</@lv_column>
<@lv_column width="x">Resource</@lv_column>
<@lv_column width=100 centered=true><@over_time "Income" /></@lv_column>
<@lv_column width=100 centered=true><@over_time "Upkeep" /></@lv_column>
<@lv_column width=100 centered=true>Reserves</@lv_column>
<@lv_column width=100 centered=true>Mining priority</@lv_column>
</@lv_line>
<#list ov.economy as resource>
<#if previousCategory?has_content && !resource.category?has_content
|| resource.category?has_content && !previousCategory?has_content
|| resource.category?has_content && previousCategory?has_content
&& resource.category != previousCategory>
<@lv_line>
<#if resource.category?has_content>
<td colspan="5"><strong>${resource.category?xhtml}</strong></td>
<#else>
<td colspan="5"><hr /></td>
</#if>
</@lv_line>
<#local previousCategory=resource.category>
</#if>
<@lv_line>
<@lv_column>&nbsp;</@lv_column>
<@lv_column>${resource.title?xhtml}
<div class="auto-hide">${resource.description?xhtml}</div>
</@lv_column>
<@lv_column centered=true>${resource.income?string(",##0")}</@lv_column>
<@lv_column centered=true>${resource.upkeep?string(",##0")}</@lv_column>
<@lv_column centered=true>${resource.stockpiled?string(",##0")}</@lv_column>
<@lv_column centered=true>
<#if resource.miningPriority?has_content>
<#switch resource.miningPriority>
<#case 0>lowest<#break>
<#case 1>low<#break>
<#case 2>normal<#break>
<#case 3>high<#break>
<#case 4>highest<#break>
</#switch>
<#else>
N/A
</#if>
</@lv_column>
</@lv_line>
</#list>
</@listview>
</@tab>
<@tab id="research" title="Research">
<#if rs?size == 0>
<p>Our scientists are still settling in.</p>

View file

@ -108,6 +108,55 @@
</#if>
</@tab>
<#if data.own?has_content && data.own.resources?size gt 0>
<@tab id="resources" title="Economy">
<@listview>
<#local previousCategory="">
<@lv_line headers=true>
<@lv_column width=30>&nbsp;</@lv_column>
<@lv_column width="x">Resource</@lv_column>
<@lv_column width=100 centered=true><@over_time "Income" /></@lv_column>
<@lv_column width=100 centered=true><@over_time "Upkeep" /></@lv_column>
<@lv_column width=100 centered=true>Invested</@lv_column>
</@lv_line>
<#list data.own.resources as resource>
<#if previousCategory?has_content && !resource.category?has_content
|| resource.category?has_content && !previousCategory?has_content
|| resource.category?has_content && previousCategory?has_content
&& resource.category != previousCategory>
<@lv_line>
<#if resource.category?has_content>
<td colspan="5"><strong>${resource.category?xhtml}</strong></td>
<#else>
<td colspan="5"><hr /></td>
</#if>
</@lv_line>
<#local previousCategory=resource.category>
</#if>
<@lv_line>
<@lv_column>&nbsp;</@lv_column>
<@lv_column>${resource.title?xhtml}
<div class="auto-hide">${resource.description?xhtml}</div>
</@lv_column>
<@lv_column centered=true>${resource.income?string(",##0")}</@lv_column>
<@lv_column centered=true>${resource.upkeep?string(",##0")}</@lv_column>
<@lv_column centered=true>${resource.invested?string(",##0")}</@lv_column>
</@lv_line>
</#list>
</@listview>
</@tab>
</#if>
<#if data.orbit?has_content>
@ -143,6 +192,7 @@
<#case "DEF">defence<#break>
<#case "WORK">mil. output<#break>
<#case "POP">growth<#break>
<#case "MINE">res. extraction<#break>
</#switch>
</@lv_column>
<@lv_column centered=true>${building.jobs?string(",##0")}</@lv_column>
@ -189,6 +239,7 @@
<#case "DEF">defence<#break>
<#case "WORK">mil. output<#break>
<#case "POP">growth<#break>
<#case "MINE">res. extraction<#break>
</#switch>
</@dt_entry>
</@dt_main>
@ -251,6 +302,7 @@
</#if>
<#if data.own?has_content>
<@tab id="ships" title="Shipyards">
<#if data.page.special! != 'v'>
<#if data.own.milQueue.appendPossible>
@ -321,9 +373,60 @@
</@listview>
</#if>
</@tab>
</#if>
</#if>
</#if>
<#list data.own.resources as resource>
<#if resource.resourceProvider?has_content>
<#local showResources=true>
<#break>
</#if>
</#list>
<#if showResources?has_content>
<@tab id="natres" title="Natural resources">
<@listview>
<@lv_line headers=true>
<@lv_column width="x">Resource</@lv_column>
<@lv_column width=100 right=true>Quantity&nbsp;</@lv_column>
<@lv_column width=100>&nbsp;&nbsp;Capacity</@lv_column>
<@lv_column width=100 centered=true>Extraction<br/>difficulty</@lv_column>
<@lv_column width=100 centered=true>Priority</@lv_column>
</@lv_line>
<#list data.own.resources as resource>
<#if resource.resourceProvider?has_content>
<#local resProv=resource.resourceProvider>
<@lv_line>
<@lv_column>
${resource.title?xhtml}
<div class="auto-hide">${resource.description?xhtml}</div>
</@lv_column>
<@lv_column right=true>${resProv.quantity?string(",##0")}&nbsp;</@lv_column>
<@lv_column>/&nbsp;${resProv.capacity?string(",##0")}</@lv_column>
<@lv_column centered=true>${resProv.difficulty}&nbsp;%</@lv_column>
<@lv_column centered=true>
<#switch resProv.priority>
<#case 0>lowest<#break>
<#case 1>low<#break>
<#case 2>normal<#break>
<#case 3>high<#break>
<#case 4>highest<#break>
</#switch>
</@lv_column>
</@lv_line>
</#if>
</#list>
</@listview>
</@tab>
</#if>
</#if>
</@tabs>
</@page>
</#macro>