05.05.2009, 14:53
game_place_command.tpl
game_place_confirm.tpl:
Ich weiß, game_place_confirm ist noch nicht fertig, aber ich habe die Tests ohne Rammbock/Katapult gemacht.
Code:
{if !empty($error)}
<div style="color:red; font-size:large">{$error}</div>
{/if}
<h3>Befehle erteilen</h3>
<form name="units" action="game.php?village={$village.id}&screen=place&try=confirm" method="post">
<table>
<tr>
{assign var=counter value=0}
{foreach from=$group_units key=group_name item=value}
<td width="150" valign="top">
<table class="vis" width="100%">
{foreach from=$group_units.$group_name item=dbname}
{* Counter um 1 erhöhren für den Tab für die Input Felder *}
{math assign=counter equation="x + y" x=$counter y=1}
<tr>
<td>
<a href="javascript:popup('popup_unit.php?unit={$dbname}', 520, 520)"><img src="graphic/unit/{$dbname}.png" title="{$cl_units->get_name($dbname)}" alt="" /></a> <input name="{$dbname}" type="text" size="5" tabindex="{$counter}" value="{$values.$dbname}" /> <a href="javascript:insertUnit(document.forms[0].{$dbname}, {$units.$dbname})">({$units.$dbname})</a>
</td>
</tr>
{/foreach}
</table>
</td>
{/foreach}
</tr>
</table>
<table>
<tr>
<td rowspan="2">
x: <input type="text" name="x" value="{$values.x}" size="5" />
y: <input type="text" name="y" value="{$values.y}" size="5" />
</td>
<td valign="top"></td>
<td valign="top"></td>
<td rowspan="2"><input class="attack" name="attack" type="submit" value="Angreifen" style="font-size: 10pt;" /></td>
<td rowspan="2"><input class="support" name="support" type="submit" value="Unterstützen" style="font-size: 10pt;" /></td>
<td rowspan="2"><input class="beleaguer" name="beleaguer" type="submit" value="Belagern" style="font-size: 10pt;" /></td>
</tr>
</table>
</form>
<h3>Truppenbewegungen</h3>
{* Eigene losgeschickte Angriffe *}
{if count($my_movements)>0}
<table class="vis">
<tr>
<th width="250">Deine Truppen</th>
<th width="160">Ankunft</th>
<th width="80">Ankunft in</th>
</tr>
{foreach from=$my_movements item=array}
<tr>
<td>
<a href="game.php?village={$village.id}&screen=info_command&id={$array.id}&type=own">
<img src="graphic/command/{$array.type}.png"> {$array.message}
</a>
</td>
<td>{$array.end_time|format_date}</td>
{if $array.arrival_in<0}
<td>{$array.arrival_in|format_time}</td>
{else}
<td><span class="timer">{$array.arrival_in|format_time}</span></td>
{/if}
{if $array.can_cancel}
<td><a href="game.php?village={$village.id}&screen=place&action=cancel&id={$array.id}&h={$hkey}">abbrechen</a></td>
{/if}
</tr>
{/foreach}
</table>
{/if}
{* Andere Angriffe auf das aktuelle Dorf *}
{if count($other_movements)>0}
<table class="vis">
<tr>
<th width="250">Ankommende Truppen</th>
<th width="160">Ankunft</th>
<th width="80">Ankunft in</th>
</tr>
{foreach from=$other_movements item=array}
<tr>
<td>
<a href="game.php?village={$village.id}&screen=info_command&id={$array.id}&type=other">
<img src="graphic/command/{$array.type}.png"> {$array.message}
</a>
</td>
<td>{$array.end_time|format_date}</td>
{if $array.arrival_in<0}
<td>{$array.arrival_in|format_time}</td>
{else}
<td><span class="timer">{$array.arrival_in|format_time}</span></td>
{/if}
</tr>
{/foreach}
</table>
{/if}
Code:
{if $type=="attack"}
<h2>Angriff</h2>
{elseif $type=="support"}
<h2>Unterstützung</h2>
{else}
<h2>Belagerung</h2>
{/if}
<form action="game.php?village={$village.id}&screen=place&action=command&h={$hkey}" method="post" onSubmit="this.submit.disabled=true;">
<input type="hidden" name="{$type}" value="true">
<input type="hidden" name="x" value="{$values.x}">
<input type="hidden" name="y" value="{$values.y}">
<table class="vis" width="300">
<tr><th colspan="2">Befehl</th></tr>
<tr><td>Ziel:</td><td><a href="game.php?village={$village.id}&screen=info_village&id={$info_village.id}">{$info_village.name} ({$values.x}|{$values.y}) K{$info_village.continent}</a></td></tr>
<tr><td>Spieler:</td><td><a href="game.php?village={$village.id}&screen=info_player&id={$info_village.userid}">{$info_user.username}</a></td></tr>
<tr><td>Dauer:</td><td>{$unit_runtime|format_time}</td></tr>
<tr><td>Ankunft:</td><td>{$arrival|format_date}</td></tr>
</table>
<br>
<table class="vis">
<tr>
{foreach from=$cl_units->get_array("dbname") item=dbname key=name}
<th width="50"><img src="graphic/unit/{$dbname}.png" title="{$name}" alt="" /></th>
{/foreach}
</tr>
<tr>
{foreach from=$cl_units->get_array("dbname") item=dbname key=name}
{if $send_units.$dbname>0}
<td>{$send_units.$dbname}</td>
{else}
<td class="hidden">0</td>
{/if}
{/foreach}
</tr>
</table>
<br />
{foreach from=$cl_units->get_array("dbname") item=dbname key=name}
<input type="hidden" name="{$dbname}" value="{$send_units.$dbname}">
{/foreach}
{* Falls auch Katapulte ausgewählt wurde *}
{if $send_units.unit_catapult>0 && $type!='support'}
<table class="vis">
<tr>
<th>Gebäude angreifen:</th>
<td>
<select name="building" size="1">
{foreach from=$cl_builds->get_array("dbname") item=dbname key=id}
{if !in_array("catapult_protection", $cl_builds->get_specials($dbname))}
<option label="{$cl_builds->get_name($dbname)}" value="{$dbname}">{$cl_builds->get_name($dbname)}</option>
{/if}
{/foreach}
</select>
</td>
</tr>
</table>
{/if}
{if $type=="beleaguer"}
{if $send_units.unit_catapult=0 OR $send_units.unit_ram=0}
Bitte Rammbock und/oder Katapult auswählen <a href="game.php?village={village.id}&screen=place">zurück</a>
{/if}
{/if}
<br />
<input name="submit" type="submit" onload="this.disabled=false;" value="OK" style="font-size: 10pt;">
</form>