Changeset a601a209df9b4408f6e4d2c5aec8338dc800efd6

Show
Ignore:
Timestamp:
03/18/07 16:12:54 (2 years ago)
Author:
Christopher Jung <bktheg@web.de>
git-committer:
Christopher Jung <bktheg@web.de> 1174230774 +0100
git-parent:

[b3a64df57d5dfede4e5ee521f62db1c9ec91c3c1]

git-author:
Christopher Jung <bktheg@web.de> 1174230774 +0100
Message:

Werft-GUI leicht ueberarbeitet

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/net/driftingsouls/ds2/server/werften/WerftGUI.java

    r7cc6d49 ra601a20  
    110110                        this.out_werftbuilding( werft, conf ); 
    111111                }  
    112                 else if( !werft.isBuilding() ) { 
    113                         //Resourcenliste 
    114                         this.out_ResourceList( werft ); 
    115                  
     112                else if( !werft.isBuilding() ) {                 
     113                        SQLResultRow[] shipdata = werft.getBuildShipList(); 
     114                         
     115                        // Resourcenliste 
     116                        Cargo costs = new Cargo(); 
     117                        for( int i=0; i < shipdata.length; i++ ) { 
     118                                costs.addCargo((Cargo)shipdata[i].get("costs")); 
     119                        } 
     120                         
     121                        this.out_ResourceList( werft, costs ); 
     122                         
    116123                        //Schiffsliste 
    117                         this.out_buildShipList( werft ); 
     124                        this.out_buildShipList( werft, shipdata ); 
    118125                 
    119126                        this.out_wsShipList(werft); 
     
    189196        } 
    190197 
    191         private void out_buildShipList(WerftObject werft) {            
     198        private void out_buildShipList(WerftObject werft, SQLResultRow[] shipdata) {           
    192199                t.set_var("werftgui.buildshiplist", 1); 
    193200                t.set_block("_WERFT.WERFTGUI", "buildshiplist.listitem", "buildshiplist.list"); 
    194201                t.set_block("buildshiplist.listitem", "buildship.res.listitem", "buildship.res.list"); 
    195                  
    196                 SQLResultRow[] shipdata = werft.getBuildShipList(); 
    197202 
    198203                Cargo availablecargo = werft.getCargo(false); 
     
    247252                        t.parse("buildship.res.list", "buildship.res.listitem", true); 
    248253 
     254                        SQLResultRow shiptype = Ships.getShipType(ashipdata.getInt("type"), false); 
     255                         
    249256                        t.set_var(      "buildship.id",                 ashipdata.getInt("id"), 
    250257                                                "buildship.type.id",    ashipdata.getInt("type"), 
     258                                                "buildship.type.image", shiptype.getString("picture"), 
    251259                                                "buildship.flagschiff", ashipdata.getBoolean("flagschiff"), 
    252260                                                "buildship.type.name",  tmptype.getString("nickname") ); 
     
    258266        } 
    259267 
    260         private void out_ResourceList(WerftObject werft) {             
     268        private void out_ResourceList(WerftObject werft, Cargo showonly) {             
    261269                t.set_var("werftgui.reslist", 1); 
    262270                t.set_block("_WERFT.WERFTGUI", "reslist.res.listitem", "reslist.res.list"); 
     
    265273                int frei = werft.getCrew(); 
    266274         
    267                 ResourceList reslist = cargo.getResourceList(); 
     275                ResourceList reslist = showonly.compare(cargo, false); 
    268276                for( ResourceEntry res : reslist ) { 
    269277                        t.set_var(      "res.image",            res.getImage(), 
    270278                                                "res.plainname",        res.getPlainName(), 
    271                                                 "res.cargo",            res.getCargo1() ); 
     279                                                "res.cargo",            res.getCargo2() ); 
    272280                        t.parse("reslist.res.list", "reslist.res.listitem", true); 
    273281                } 
  • templates/werft.werftgui.html

    r98d4544 ra601a20  
    227227{/endif} 
    228228{if werftgui.reslist} 
    229         {!table_begin 850,left} 
    230                 Waren vorhanden:<br /> 
     229        {!table_begin 810} 
     230                <h3>Vorhandene Rohstoffe</h3> 
     231                <table class="noBorderX" style="width:90%; margin-left:auto; margin-right:auto"> 
     232                <tr> 
    231233                <!-- BEGIN reslist.res.listitem --> 
    232                         <span class="nobr"><img style="vertical-align:middle" src="{res.image}" alt="" title="{res.plainname}" />{res.cargo}</span> 
     234                        <td class="noBorderX" style="text-align:center"> 
     235                                <img style="vertical-align:middle" src="{res.image}" alt="" title="{res.plainname}" /><br /> 
     236                                <span class="nobr">{res.cargo}</span> 
     237                        </td> 
    233238                <!-- END reslist.res.listitem --> 
     239                </tr> 
     240                </table> 
    234241        {!table_end} 
    235242        <br /> 
    236243{/endif} 
    237244{if werftgui.buildshiplist} 
    238         {!table_begin 850,left} 
    239         <table class="noBorderX" width="100%"> 
    240         <tr><td class="noBorderX">ID</td><td class="noBorderX">Type</td><td class="noBorderX">?</td><td class="noBorderX">Kosten</td></tr> 
    241         <!-- BEGIN buildshiplist.listitem --> 
     245        {!table_begin 810,left} 
     246        <div style="height:400px; overflow:auto;"> 
     247                <table class="noBorderX" style="width:95%"> 
    242248                <tr> 
    243                         <td class="noBorderX"> 
    244                                 <a class="forschinfo" href="{werftgui.urlbase}&amp;sess={global.sess}&amp;build={buildship.id}{if buildship.item.id}&amp;item={buildship.item.id}{/endif}">{buildship.type.id}</a> 
    245                         </td> 
    246                         <td class="noBorderX"> 
    247                                 {if buildship.item.id} 
    248                                         <span style="color:{buildship.item.color}">[Item]</span> 
    249                                         {if buildship.item.uses} 
    250                                                 <span style="font-style:italic">[{buildship.item.uses}]</span> 
    251                                         {/endif} 
    252                                 {/endif} 
    253                                 {if buildship.flagschiff} 
    254                                         <span class="smallfont" style="color:#EECC44">[Flagschiff]</span> 
    255                                 {/endif} 
    256                                 <a class="forschinfo" href="{werftgui.urlbase}&amp;sess={global.sess}&amp;build={buildship.id}{if buildship.item.id}&amp;item={buildship.item.id}{/endif}">{buildship.type.name}</a> 
    257                         </td> 
    258                         <td class="noBorderX"> 
    259                                 <a class="forschinfo" href="./main.php?module=schiffinfo&amp;sess={global.sess}&amp;ship={buildship.type.id}" target="_blank">?</a> 
    260                         </td> 
    261                         <td class="noBorderX"> 
    262                                 <!-- BEGIN buildship.res.listitem --> 
    263                                         <img src="{res.image}" alt="" title="{res.plainname}" />{if res.mangel}<span style="color:red">{/endif}{res.count}{if res.mangel}</span>{/endif} 
    264                                 <!-- END buildship.res.listitem --> 
    265                         </td> 
    266                 </tr>            
    267         <!-- END buildshiplist.listitem --> 
    268         </table> 
     249                        <td class="noBorderX"></td> 
     250                        <td class="noBorderX" style="text-align:center" colspan="2">Typ</td> 
     251                        <td class="noBorderX" style="text-align:center">Kosten pro Schiff</td> 
     252                        <td class="noBorderX"></td> 
     253                </tr> 
     254                <!-- BEGIN buildshiplist.listitem --> 
     255                        <tr> 
     256                                <td class="noBorderX"> 
     257                                        {if buildship.item.id} 
     258                                                <span style="color:{buildship.item.color}">[Item]</span> 
     259                                                {if buildship.item.uses} 
     260                                                        <span style="font-style:italic">[{buildship.item.uses}]</span> 
     261                                                {/endif} 
     262                                        {/endif} 
     263                                        {if buildship.flagschiff} 
     264                                                <span class="smallfont" style="color:#EECC44" title="Flagschiff">[FS]</span> 
     265                                        {/endif} 
     266                                </td> 
     267                                <td class="noBorderX"> 
     268                                        <img style="vertical-align:middle;width:64px" src="{buildship.type.image}" alt="" /> 
     269                                </td> 
     270                                <td class="noBorderX"> 
     271                                        <a class="forschinfo" href="./main.php?module=schiffinfo&amp;sess={global.sess}&amp;ship={buildship.type.id}">{buildship.type.name}</a> 
     272                                </td> 
     273                                <td class="noBorderX"> 
     274                                        <!-- BEGIN buildship.res.listitem --> 
     275                                                <span class="nobr"><img src="{res.image}" alt="" title="{res.plainname}" />{if res.mangel}<span style="color:red">{/endif}{res.count}{if res.mangel}</span>{/endif}</span> 
     276                                        <!-- END buildship.res.listitem --> 
     277                                </td> 
     278                                <td class="noBorderX"> 
     279                                        <a class="forschinfo" href="{werftgui.urlbase}&amp;sess={global.sess}&amp;build={buildship.id}{if buildship.item.id}&amp;item={buildship.item.id}{/endif}">bauen</a> 
     280                                </td> 
     281                        </tr>            
     282                <!-- END buildshiplist.listitem --> 
     283                </table> 
     284        </div> 
    269285        {!table_end} 
    270286{/endif}