Planet mining settings interface
* Modified owned planet view to include a field which indicates whether mining settings are specific to the planet or come from the empire; modified "simple" game components accordingly * Modified stored procedures to only allow planet-specific mining settings updates when the planet actually uses planet-specific settings, and added a stored procedure which toggles the source of a planet's settings * Added corresponding parts to mining settings DAO and resources controller * Added session commands and server command handlers that toggle the source of the settings and that upload the settings * Split planet page template into multiple files for clarity and added the mining priorities form to the natural resources tab
This commit is contained in:
parent
51b529a09f
commit
e64f847ec3
25 changed files with 1009 additions and 152 deletions
legacyworlds-web-main/Content/Raw/WEB-INF/fm
|
@ -376,55 +376,8 @@
|
|||
|
||||
</#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 </@lv_column>
|
||||
<@lv_column width=100> 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")} </@lv_column>
|
||||
<@lv_column>/ ${resProv.capacity?string(",##0")}</@lv_column>
|
||||
<@lv_column centered=true>${resProv.difficulty} %</@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>
|
||||
|
||||
<#include "planet/natres.ftl" />
|
||||
<@RenderNaturalResources />
|
||||
</#if>
|
||||
|
||||
</@tabs>
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
<#macro RenderNaturalResources>
|
||||
<#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">
|
||||
<form action="planet-${data.id}-update-mset.action" method="POST">
|
||||
|
||||
<@listview>
|
||||
<@lv_line headers=true>
|
||||
<@lv_column width="x">Resource</@lv_column>
|
||||
<@lv_column width=100 right=true>Quantity </@lv_column>
|
||||
<@lv_column width=100> 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")} </@lv_column>
|
||||
<@lv_column>/ ${resProv.capacity?string(",##0")}</@lv_column>
|
||||
<@lv_column centered=true>${resProv.difficulty} %</@lv_column>
|
||||
<@lv_column centered=true>
|
||||
<#if data.own.ownMiningSettings>
|
||||
<select name="pms-${resource.identifier?xhtml}" class="input">
|
||||
<option style="padding: 0 5px" value="0" <#if resProv.priority = 0>selected="selected"</#if>>lowest</option>
|
||||
<option style="padding: 0 5px" value="1" <#if resProv.priority = 1>selected="selected"</#if>>low</option>
|
||||
<option style="padding: 0 5px" value="2" <#if resProv.priority = 2>selected="selected"</#if>>normal</option>
|
||||
<option style="padding: 0 5px" value="3" <#if resProv.priority = 3>selected="selected"</#if>>high</option>
|
||||
<option style="padding: 0 5px" value="4" <#if resProv.priority = 4>selected="selected"</#if>>highest</option>
|
||||
</select>
|
||||
<#else>
|
||||
<#switch resProv.priority>
|
||||
<#case 0>lowest<#break>
|
||||
<#case 1>low<#break>
|
||||
<#case 2>normal<#break>
|
||||
<#case 3>high<#break>
|
||||
<#case 4>highest<#break>
|
||||
</#switch>
|
||||
</#if>
|
||||
</@lv_column>
|
||||
</@lv_line>
|
||||
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
<@lv_line headers=true>
|
||||
<@lv_column width="x" colspan=5> </@lv_column>
|
||||
</@lv_line>
|
||||
<@lv_line>
|
||||
<@lv_column right=true colspan=5>
|
||||
<#if data.own.ownMiningSettings>
|
||||
Using planet-specific settings
|
||||
<input type="submit" name="toggle-settings" value="Use empire settings" class="input" style="margin: 15px 0 0 0" />
|
||||
<input type="submit" name="update-pms" value="Update priorities" class="input" style="margin: 15px 0 0 0" />
|
||||
<#else>
|
||||
<input type="submit" name="toggle-settings" value="Use specific settings" class="input" style="margin: 15px 0 0 0" />
|
||||
</#if>
|
||||
</@lv_column>
|
||||
</@lv_line>
|
||||
|
||||
</@listview>
|
||||
|
||||
</form>
|
||||
|
||||
</@tab>
|
||||
</#if>
|
||||
</#macro>
|
|
@ -374,54 +374,8 @@
|
|||
</@tab>
|
||||
</#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="Ressources naturelles">
|
||||
|
||||
<@listview>
|
||||
<@lv_line headers=true>
|
||||
<@lv_column width="x">Ressource</@lv_column>
|
||||
<@lv_column width=100 right=true>Quantité </@lv_column>
|
||||
<@lv_column width=100> Capacité</@lv_column>
|
||||
<@lv_column width=100 centered=true>Difficulté<br/>d'extraction</@lv_column>
|
||||
<@lv_column width=100 centered=true>Priorité</@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")} </@lv_column>
|
||||
<@lv_column>/ ${resProv.capacity?string(",##0")}</@lv_column>
|
||||
<@lv_column centered=true>${resProv.difficulty} %</@lv_column>
|
||||
<@lv_column centered=true>
|
||||
<#switch resProv.priority>
|
||||
<#case 0>très basse<#break>
|
||||
<#case 1>basse<#break>
|
||||
<#case 2>normale<#break>
|
||||
<#case 3>haute<#break>
|
||||
<#case 4>très haute<#break>
|
||||
</#switch>
|
||||
</@lv_column>
|
||||
</@lv_line>
|
||||
|
||||
</#if>
|
||||
</#list>
|
||||
</@listview>
|
||||
|
||||
</@tab>
|
||||
</#if>
|
||||
<#include "planet/natres.ftl" />
|
||||
<@RenderNaturalResources />
|
||||
|
||||
</#if>
|
||||
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
<#macro RenderNaturalResources>
|
||||
<#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="Ressources naturelles">
|
||||
<form action="planet-${data.id}-update-mset.action" method="POST">
|
||||
|
||||
<@listview>
|
||||
<@lv_line headers=true>
|
||||
<@lv_column width="x">Ressource</@lv_column>
|
||||
<@lv_column width=100 right=true>Quantité </@lv_column>
|
||||
<@lv_column width=100> Capacité</@lv_column>
|
||||
<@lv_column width=100 centered=true>Difficulté<br/>d'extraction</@lv_column>
|
||||
<@lv_column width=100 centered=true>Priorité</@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")} </@lv_column>
|
||||
<@lv_column>/ ${resProv.capacity?string(",##0")}</@lv_column>
|
||||
<@lv_column centered=true>${resProv.difficulty} %</@lv_column>
|
||||
<@lv_column centered=true>
|
||||
<#if data.own.ownMiningSettings>
|
||||
<select name="pms-${resource.identifier?xhtml}" class="input">
|
||||
<option style="padding: 0 5px" value="0" <#if resProv.priority = 0>selected="selected"</#if>>très basse</option>
|
||||
<option style="padding: 0 5px" value="1" <#if resProv.priority = 1>selected="selected"</#if>>basse</option>
|
||||
<option style="padding: 0 5px" value="2" <#if resProv.priority = 2>selected="selected"</#if>>normale</option>
|
||||
<option style="padding: 0 5px" value="3" <#if resProv.priority = 3>selected="selected"</#if>>haute</option>
|
||||
<option style="padding: 0 5px" value="4" <#if resProv.priority = 4>selected="selected"</#if>>très haute</option>
|
||||
</select>
|
||||
<#else>
|
||||
<#switch resProv.priority>
|
||||
<#case 0>très basse<#break>
|
||||
<#case 1>basse<#break>
|
||||
<#case 2>normale<#break>
|
||||
<#case 3>haute<#break>
|
||||
<#case 4>très haute<#break>
|
||||
</#switch>
|
||||
</#if>
|
||||
</@lv_column>
|
||||
</@lv_line>
|
||||
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
<@lv_line headers=true>
|
||||
<@lv_column width="x" colspan=5> </@lv_column>
|
||||
</@lv_line>
|
||||
<@lv_line>
|
||||
<@lv_column right=true colspan=5>
|
||||
<#if data.own.ownMiningSettings>
|
||||
Cette planète utilise des priorités d'extraction qui lui sont spécifiques.
|
||||
<input type="submit" name="toggle-settings" value="Utiliser les priorités de l'empire" class="input" style="margin: 15px 0 0 0" />
|
||||
<input type="submit" name="update-pms" value="Mettre à jour les priorités" class="input" style="margin: 15px 0 0 0" />
|
||||
<#else>
|
||||
Cette planète utilise les priorités d'extraction de l'empire.
|
||||
<input type="submit" name="toggle-settings" value="Utiliser des priorités spécifiques" class="input" style="margin: 15px 0 0 0" />
|
||||
</#if>
|
||||
</@lv_column>
|
||||
</@lv_line>
|
||||
|
||||
</@listview>
|
||||
|
||||
</form>
|
||||
|
||||
</@tab>
|
||||
</#if>
|
||||
</#macro>
|
Reference in a new issue