mirror of
https://github.com/mm201/pkmn-classic-framework.git
synced 2026-10-01 05:36:56 -05:00
Design work on GTS search
This commit is contained in:
@@ -98,7 +98,11 @@ input[type=submit].large, button.large
|
||||
{
|
||||
float: left;
|
||||
position: relative;
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
.gtsBox .pfColumn
|
||||
{
|
||||
margin: 16px;
|
||||
}
|
||||
|
||||
.pfFormSubmit
|
||||
@@ -110,9 +114,14 @@ input[type=submit].large, button.large
|
||||
|
||||
.pfFormGroup
|
||||
{
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
border-spacing: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.gtsBox .pfFormGroup
|
||||
{
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.pfFormKey, .pfFormValue
|
||||
@@ -132,8 +141,6 @@ input[type=submit].large, button.large
|
||||
{
|
||||
color: white;
|
||||
text-align: left;
|
||||
width: 64px;
|
||||
padding-right: 2px;
|
||||
text-shadow: 0 1px 0 rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
@@ -142,11 +149,41 @@ input[type=submit].large, button.large
|
||||
background-color: #82d2e0;
|
||||
}
|
||||
|
||||
.home .pfFormKey {background-color: #ff8063;}
|
||||
.gts .pfFormKey {background-color: #43c4ff;}
|
||||
.bv .pfFormKey {background-color: #9761e9;}
|
||||
.dw .pfFormKey {background-color: #fa79d4;}
|
||||
.dex .pfFormKey {background-color: #2dd350;}
|
||||
.stat .pfFormKey {background-color: #ffc321;}
|
||||
.test .pfFormKey {background-color: #82d2e0;}
|
||||
.admin .pfFormKey {background-color: #555555;}
|
||||
|
||||
.pfFormValue
|
||||
{
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
.pfRadListItem
|
||||
{
|
||||
display: block;
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
.pfRadListItem *
|
||||
{
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.pfRadListItem:first-child
|
||||
{
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.pfRadListItem:last-child
|
||||
{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.ui-spinner
|
||||
{
|
||||
display: inline-block;
|
||||
|
||||
@@ -108,9 +108,24 @@ li
|
||||
background-image: -ms-linear-gradient(top, #fcfcfc 0%,#f8f8f8 100%); /* IE10+ */
|
||||
background-image: linear-gradient(to bottom, #fcfcfc 0%,#f8f8f8 100%); /* W3C */
|
||||
background-size: 100%;
|
||||
padding: 16px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #cccccc;
|
||||
margin: 8px;
|
||||
}
|
||||
|
||||
.pfBoxThin
|
||||
{
|
||||
box-shadow: 0 3px 8px 0 rgba(0,0,0,0.05);
|
||||
background-color: #f8f8f8;
|
||||
background-image: -moz-linear-gradient(top, #fcfcfc 0%, #f8f8f8 100%); /* FF3.6+ */
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fcfcfc), color-stop(100%,#f8f8f8)); /* Chrome,Safari4+ */
|
||||
background-image: -webkit-linear-gradient(top, #fcfcfc 0%,#f8f8f8 100%); /* Chrome10+,Safari5.1+ */
|
||||
background-image: -o-linear-gradient(top, #fcfcfc 0%,#f8f8f8 100%); /* Opera 11.10+ */
|
||||
background-image: -ms-linear-gradient(top, #fcfcfc 0%,#f8f8f8 100%); /* IE10+ */
|
||||
background-image: linear-gradient(to bottom, #fcfcfc 0%,#f8f8f8 100%); /* W3C */
|
||||
background-size: 100%;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.gtsNav, .gtsNav ul, .gtsNav li
|
||||
|
||||
@@ -33,24 +33,24 @@
|
||||
font-family: 'Meiryo UI',sans-serif;
|
||||
}
|
||||
|
||||
.gtsPokemonSummary .marks .m
|
||||
.marks .m
|
||||
{
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
.gtsPokemonSummary .specialFlags, .gtsPokemonSummary li.specialFlags
|
||||
.specialFlags, li.specialFlags
|
||||
{
|
||||
width: 104px;
|
||||
}
|
||||
|
||||
.gtsPokemonSummary .specialFlags .shiny
|
||||
.specialFlags .shiny
|
||||
{
|
||||
font-weight: bold;
|
||||
vertical-align: middle;
|
||||
color: #ee0000;
|
||||
}
|
||||
|
||||
.gtsPokemonSummary .specialFlags .pkrs, .specialFlags .pkrs_cure
|
||||
.specialFlags .pkrs, .specialFlags .pkrs_cure
|
||||
{
|
||||
font-weight: bold;
|
||||
vertical-align: middle;
|
||||
@@ -79,16 +79,6 @@
|
||||
top: -2px;
|
||||
}
|
||||
|
||||
.pfGroupBasic2 .pfFormKey
|
||||
{
|
||||
background-color: #43c4ff;
|
||||
}
|
||||
|
||||
.pfGroupStats .pfFormKey
|
||||
{
|
||||
background-color: #9761e9;
|
||||
}
|
||||
|
||||
.pfFormGroup.pfGroupMoves
|
||||
{
|
||||
margin-top: 16px;
|
||||
@@ -108,8 +98,7 @@
|
||||
|
||||
.gtsPokemonSummary .pfColumn.colBasic1
|
||||
{
|
||||
width: 160px;
|
||||
margin-right: 16px;
|
||||
width: 104px;
|
||||
}
|
||||
|
||||
.gtsPokemonSummary .nextIn
|
||||
@@ -123,7 +112,6 @@
|
||||
|
||||
.pfFormGroup .type
|
||||
{
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
.pfFormGroup .move .type
|
||||
@@ -160,3 +148,12 @@
|
||||
background-color: #43c4ff;
|
||||
}
|
||||
|
||||
.gtsOffer
|
||||
{
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
.gtsOffer .pfColumn
|
||||
{
|
||||
margin: 0 8px;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
text-shadow: 0 1px 0 rgba(0,0,0,0.3);
|
||||
box-shadow: 0 -1px 0 0 rgba(0,0,0,0.3) inset;
|
||||
border-radius: 7px;
|
||||
background-color: #f2f2f2;
|
||||
background-image: -moz-linear-gradient(top, transparent 0%, rgba(0,0,0,0.1) 100%); /* FF3.6+ */
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,transparent), color-stop(100%,rgba(0,0,0,0.1))); /* Chrome,Safari4+ */
|
||||
background-image: -webkit-linear-gradient(top, transparent 0%,rgba(0,0,0,0.1) 100%); /* Chrome10+,Safari5.1+ */
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
<pf:RequireScript Key="jquery" ScriptUrl="~/scripts/jquery-1.11.1.min.js" runat="server" />
|
||||
<pf:RequireScript Key="jquery-ui" ScriptUrl="~/scripts/jquery-ui.min.js" After="jquery" runat="server" />
|
||||
<pf:RequireCss Key="form" CssUrl="~/css/form.css" After="main" runat="server" />
|
||||
<pf:RequireCss Key="pkmnstats" CssUrl="~/css/pkmnstats.css" After="form" runat="server" />
|
||||
<pf:RequireCss Key="types" CssUrl="~/css/types.css" runat="server" />
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="cpMain" runat="server">
|
||||
|
||||
<h1>Available Pokémon</h1>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function ()
|
||||
{
|
||||
@@ -22,99 +22,147 @@
|
||||
</script>
|
||||
|
||||
<form id="theForm" runat="server">
|
||||
<div class="gtsBox pfColGroup" style="width: 640px;">
|
||||
<div class="pfColumn">
|
||||
<table class="pfFormGroup">
|
||||
<tr class="pfFormPair">
|
||||
<th class="pfFormKey">Species</th>
|
||||
<td class="pfFormValue">
|
||||
<pf:PokemonPicker ID="ppSpecies" runat="server" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="pfFormPair">
|
||||
<th class="pfFormKey">Level</th>
|
||||
<td class="pfFormValue">
|
||||
<asp:TextBox ID="txtLevelMin" min="1" max="100" Width="3em" Text="1" runat="server" />
|
||||
to
|
||||
<asp:TextBox ID="txtLevelMax" min="1" max="100" Width="3em" Text="100" runat="server" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="pfFormPair">
|
||||
<th class="pfFormKey">Gender</th>
|
||||
<td class="pfFormValue">
|
||||
<asp:CheckBox ID="chkMale" Text="Male" Checked="true" runat="server" />
|
||||
<asp:CheckBox ID="chkFemale" Text="Female" Checked="true" runat="server" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="pfColumn">
|
||||
<table class="pfFormGroup">
|
||||
<tr class="pfFormPair">
|
||||
<th class="pfFormKey">Version</th>
|
||||
<td class="pfFormValue">
|
||||
<asp:RadioButton ID="rbGen4" GroupName="grpGeneration" Checked="true" runat="server" />
|
||||
<asp:Label ID="lblGen4" AssociatedControlID="rbGen4" runat="server">
|
||||
<asp:Image ImageUrl="~/images/ver-icon/10.png" CssClass="sprite"
|
||||
Width="32" Height="32" AlternateText="Diamond" runat="server" />
|
||||
<asp:Image ImageUrl="~/images/ver-icon/11.png" CssClass="sprite"
|
||||
Width="32" Height="32" AlternateText="Pearl" runat="server" />
|
||||
<asp:Image ImageUrl="~/images/ver-icon/12.png" CssClass="sprite"
|
||||
Width="32" Height="32" AlternateText="Platinum" runat="server" />
|
||||
<asp:Image ImageUrl="~/images/ver-icon/7.png" CssClass="sprite"
|
||||
Width="32" Height="32" AlternateText="Heart Gold" runat="server" />
|
||||
<asp:Image ImageUrl="~/images/ver-icon/8.png" CssClass="sprite"
|
||||
Width="32" Height="32" AlternateText="Soul Silver" runat="server" />
|
||||
</asp:Label>
|
||||
<br />
|
||||
<table class="pfFormGroup pfColumn pfBoxThin">
|
||||
<tr class="pfFormPair">
|
||||
<th class="pfFormKey">Species</th>
|
||||
<td class="pfFormValue">
|
||||
<pf:PokemonPicker ID="ppSpecies" runat="server" />
|
||||
</td>
|
||||
|
||||
<asp:RadioButton ID="rbGen5" GroupName="grpGeneration" runat="server" />
|
||||
<asp:Label ID="lblGen5" AssociatedControlID="rbGen5" runat="server">
|
||||
<asp:Image ImageUrl="~/images/ver-icon/21.png" CssClass="sprite"
|
||||
Width="32" Height="32" AlternateText="Black" runat="server" />
|
||||
<asp:Image ImageUrl="~/images/ver-icon/20.png" CssClass="sprite"
|
||||
Width="32" Height="32" AlternateText="White" runat="server" />
|
||||
<asp:Image ImageUrl="~/images/ver-icon/23.png" CssClass="sprite"
|
||||
Width="32" Height="32" AlternateText="Black 2" runat="server" />
|
||||
<asp:Image ImageUrl="~/images/ver-icon/22.png" CssClass="sprite"
|
||||
Width="32" Height="32" AlternateText="White 2" runat="server" />
|
||||
</asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="pfFormSubmit">
|
||||
<asp:Button ID="btnSearch" Width="8em" Text="Search" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
<th class="pfFormKey" rowspan="3">Version</th>
|
||||
<td class="pfFormValue" rowspan="3">
|
||||
<div class="pfRadListItem">
|
||||
<asp:RadioButton ID="rbGen4" GroupName="grpGeneration" Checked="true" runat="server" />
|
||||
<asp:Label ID="lblGen4" AssociatedControlID="rbGen4" runat="server">
|
||||
<asp:Image ImageUrl="~/images/ver-icon/10.png" CssClass="sprite"
|
||||
Width="32" Height="32" AlternateText="Diamond" runat="server" />
|
||||
<asp:Image ImageUrl="~/images/ver-icon/11.png" CssClass="sprite"
|
||||
Width="32" Height="32" AlternateText="Pearl" runat="server" />
|
||||
<asp:Image ImageUrl="~/images/ver-icon/12.png" CssClass="sprite"
|
||||
Width="32" Height="32" AlternateText="Platinum" runat="server" />
|
||||
<asp:Image ImageUrl="~/images/ver-icon/7.png" CssClass="sprite"
|
||||
Width="32" Height="32" AlternateText="Heart Gold" runat="server" />
|
||||
<asp:Image ImageUrl="~/images/ver-icon/8.png" CssClass="sprite"
|
||||
Width="32" Height="32" AlternateText="Soul Silver" runat="server" />
|
||||
</asp:Label>
|
||||
</div>
|
||||
<div class="pfRadListItem">
|
||||
<asp:RadioButton ID="rbGen5" GroupName="grpGeneration" runat="server" />
|
||||
<asp:Label ID="lblGen5" AssociatedControlID="rbGen5" runat="server">
|
||||
<asp:Image ImageUrl="~/images/ver-icon/21.png" CssClass="sprite"
|
||||
Width="32" Height="32" AlternateText="Black" runat="server" />
|
||||
<asp:Image ImageUrl="~/images/ver-icon/20.png" CssClass="sprite"
|
||||
Width="32" Height="32" AlternateText="White" runat="server" />
|
||||
<asp:Image ImageUrl="~/images/ver-icon/23.png" CssClass="sprite"
|
||||
Width="32" Height="32" AlternateText="Black 2" runat="server" />
|
||||
<asp:Image ImageUrl="~/images/ver-icon/22.png" CssClass="sprite"
|
||||
Width="32" Height="32" AlternateText="White 2" runat="server" />
|
||||
</asp:Label>
|
||||
</div>
|
||||
</td>
|
||||
<td class="pfFormValue" rowspan="3" style="vertical-align: bottom;">
|
||||
<asp:Button ID="btnSearch" Width="8em" Text="Search" runat="server" />
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr class="pfFormPair">
|
||||
<th class="pfFormKey">Level</th>
|
||||
<td class="pfFormValue">
|
||||
<asp:TextBox ID="txtLevelMin" min="1" max="100" Width="3em" Text="1" runat="server" />
|
||||
to
|
||||
<asp:TextBox ID="txtLevelMax" min="1" max="100" Width="3em" Text="100" runat="server" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="pfFormPair">
|
||||
<th class="pfFormKey">Gender</th>
|
||||
<td class="pfFormValue">
|
||||
<asp:CheckBox ID="chkMale" Text="Male" Checked="true" runat="server" />
|
||||
<asp:CheckBox ID="chkFemale" Text="Female" Checked="true" runat="server" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<div class="clear"></div>
|
||||
<asp:Repeater ID="rptPokemon4" runat="server">
|
||||
|
||||
<HeaderTemplate>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Offer</td>
|
||||
<td>Wanted</td>
|
||||
<td>Trainer</td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
</HeaderTemplate>
|
||||
|
||||
|
||||
|
||||
<ItemTemplate>
|
||||
<tr>
|
||||
<td><%# CreateOffer4(Container.DataItem) %></td>
|
||||
<td><%# CreateWanted4(Container.DataItem) %></td>
|
||||
<td><%# CreateTrainer4(Container.DataItem) %></td>
|
||||
</tr>
|
||||
|
||||
<div class="gtsPokemonSummary gtsOffer pfBoxThin">
|
||||
<div class="pfColumn colPortrait">
|
||||
<ul>
|
||||
<li class="portrait">
|
||||
<%# CreateOfferImage(Container.DataItem) %>
|
||||
</li>
|
||||
<li>
|
||||
<%# CreatePokeball(Container.DataItem) %>
|
||||
Lv.
|
||||
<%# CreateLevel(Container.DataItem) %>
|
||||
<%# CreateGender(Container.DataItem) %>
|
||||
<%# CreatePokerus(Container.DataItem) %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="pfColumn colBasic">
|
||||
<table class="pfFormGroup">
|
||||
<tr class="pfFormPair">
|
||||
<th class="pfFormKey">
|
||||
Name
|
||||
</th>
|
||||
<td class="pfFormValue">
|
||||
<%# CreateNickname(Container.DataItem) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="pfFormPair">
|
||||
<th class="pfFormKey">Species</th>
|
||||
<td class="pfFormValue"><%# CreateSpecies(Container.DataItem) %>
|
||||
(#<%# CreatePokedex(Container.DataItem) %>)
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="pfFormPair">
|
||||
<th class="pfFormKey">Held item</th>
|
||||
<td class="pfFormValue"><%# CreateHeldItem(Container.DataItem) %></td>
|
||||
</tr>
|
||||
<tr class="pfFormPair">
|
||||
<th class="pfFormKey">Nature</th>
|
||||
<td class="pfFormValue"><%# CreateNature(Container.DataItem) %></td>
|
||||
</tr>
|
||||
<tr class="pfFormPair">
|
||||
<th class="pfFormKey">Ability</th>
|
||||
<td class="pfFormValue"><%# CreateAbility(Container.DataItem) %></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="pfColumn colWanted">
|
||||
<table class="pfFormGroup">
|
||||
<tr class="pfFormPair">
|
||||
<th class="pfFormKey">Offered by</th>
|
||||
<td class="pfFormValue"><%# CreateTrainer(Container.DataItem) %></td>
|
||||
</tr>
|
||||
<tr class="pfFormPair">
|
||||
<th class="pfFormKey" rowspan="2">Wanted</th>
|
||||
<td class="pfFormValue"><%# CreateWantedSpecies(Container.DataItem) %>
|
||||
<%# CreateWantedGender(Container.DataItem) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="pfFormPair">
|
||||
<td class="pfFormValue"><%# CreateWantedLevel(Container.DataItem) %></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
|
||||
|
||||
<FooterTemplate>
|
||||
</table>
|
||||
|
||||
</FooterTemplate>
|
||||
|
||||
</asp:Repeater>
|
||||
|
||||
@@ -49,125 +49,118 @@ namespace PkmnFoundations.GTS
|
||||
{
|
||||
if (min == 0 && max == 0)
|
||||
{
|
||||
return "Any";
|
||||
return "Any level";
|
||||
}
|
||||
else if (min == 0)
|
||||
{
|
||||
return String.Format("{0} and under", max);
|
||||
return String.Format("Lv. {0} and under", max);
|
||||
}
|
||||
else if (max == 0)
|
||||
{
|
||||
return String.Format("{0} and up", min);
|
||||
return String.Format("Lv. {0} and up", min);
|
||||
}
|
||||
else
|
||||
{
|
||||
return String.Format("{0} to {1}", min, max);
|
||||
return String.Format("Lv. {0} to {1}", min, max);
|
||||
}
|
||||
}
|
||||
|
||||
protected String CreateOffer4(object DataItem)
|
||||
protected String CreateOfferImage(object DataItem)
|
||||
{
|
||||
return "<img src=\"" + ResolveUrl("~/images/pkmn-lg/todo.png") +
|
||||
"\" alt=\"todo\" class=\"sprite species\" width=\"96px\" height=\"96px\" />";
|
||||
}
|
||||
|
||||
protected String CreatePokeball(object DataItem)
|
||||
{
|
||||
return "<img src=\"" + ResolveUrl("~/images/item-sm/todo.png") +
|
||||
"\" alt=\"todo\" title=\"todo\" class=\"sprite item\" width=\"24px\" height=\"24px\" />";
|
||||
}
|
||||
|
||||
protected String CreatePokerus(object DataItem)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
// fixme: I can remove the need for separate 4/5 functions by making
|
||||
// the GtsRecords inherit from IGtsRecord and make the the Pokemon field
|
||||
// return PokemonPartyBase.
|
||||
|
||||
protected String CreateLevel(object DataItem)
|
||||
{
|
||||
GtsRecord4 record = (GtsRecord4)DataItem;
|
||||
Pokemon4 pokemon = null;
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
try
|
||||
{
|
||||
pokemon = new Pokemon4(m_pokedex, record.Data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
builder.Append("Failure to parse pokemon data.<br />");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
builder.Append(String.Format("{0} (#{1})", pokemon.Species.Name, pokemon.SpeciesID));
|
||||
}
|
||||
catch (KeyNotFoundException)
|
||||
{
|
||||
builder.Append(String.Format("??? (#{0})", record.Species));
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
builder.Append(String.Format("??? (#{0})", record.Species));
|
||||
}
|
||||
builder.Append("<br />");
|
||||
try
|
||||
{
|
||||
if (pokemon.FormID != 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
builder.Append(pokemon.Form.Name);
|
||||
}
|
||||
catch (KeyNotFoundException)
|
||||
{
|
||||
builder.Append("Unknown form");
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
builder.Append("Unknown form");
|
||||
}
|
||||
builder.Append("<br />");
|
||||
}
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
builder.Append("Unknown form");
|
||||
}
|
||||
builder.Append(String.Format("Lv {0}", record.Level));
|
||||
builder.Append(String.Format(", {0}", record.Gender));
|
||||
builder.Append("<br />");
|
||||
try
|
||||
{
|
||||
builder.Append(String.Format("Nature: {0}", pokemon.Nature.ToString()));
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
builder.Append("Nature: ???");
|
||||
}
|
||||
builder.Append("<br />");
|
||||
try
|
||||
{
|
||||
builder.Append(String.Format("Ability: {0}", pokemon.Ability.Name));
|
||||
}
|
||||
catch (KeyNotFoundException)
|
||||
{
|
||||
builder.Append("Ability: ???");
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
builder.Append("Ability: ???");
|
||||
}
|
||||
builder.Append("<br />");
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "Encountered an error trying to display this offer.";
|
||||
}
|
||||
return record.Level.ToString();
|
||||
}
|
||||
|
||||
protected String CreateWanted4(object DataItem)
|
||||
protected String CreateGender(object DataItem)
|
||||
{
|
||||
GtsRecord4 record = (GtsRecord4)DataItem;
|
||||
return String.Format("{3} (#{0})<br />{1}<br />Lv {2}",
|
||||
record.RequestedSpecies,
|
||||
record.RequestedGender,
|
||||
FormatLevels(record.RequestedMinLevel, record.RequestedMaxLevel),
|
||||
m_pokedex.Species(record.RequestedSpecies).Name);
|
||||
return Format.GenderSymbol(record.Gender);
|
||||
}
|
||||
|
||||
protected String CreateTrainer4(object DataItem)
|
||||
protected String CreateNickname(object DataItem)
|
||||
{
|
||||
return "todo";
|
||||
}
|
||||
|
||||
protected String CreateSpecies(object DataItem)
|
||||
{
|
||||
GtsRecord4 record = (GtsRecord4)DataItem;
|
||||
return m_pokedex.Species(record.Species).Name.ToString();
|
||||
}
|
||||
|
||||
protected String CreatePokedex(object DataItem)
|
||||
{
|
||||
GtsRecord4 record = (GtsRecord4)DataItem;
|
||||
return record.Species.ToString();
|
||||
}
|
||||
|
||||
protected String CreateHeldItem(object DataItem)
|
||||
{
|
||||
return "todo";
|
||||
}
|
||||
|
||||
protected String CreateNature(object DataItem)
|
||||
{
|
||||
return "todo";
|
||||
}
|
||||
|
||||
protected String CreateAbility(object DataItem)
|
||||
{
|
||||
return "todo";
|
||||
}
|
||||
|
||||
protected String CreateTrainer(object DataItem)
|
||||
{
|
||||
GtsRecord4 record = (GtsRecord4)DataItem;
|
||||
return Common.HtmlEncode(record.TrainerName.Text);
|
||||
}
|
||||
|
||||
protected String CreateWantedSpecies(object DataItem)
|
||||
{
|
||||
GtsRecord4 record = (GtsRecord4)DataItem;
|
||||
return String.Format("{0} (#{1})",
|
||||
m_pokedex.Species(record.RequestedSpecies).Name,
|
||||
record.RequestedSpecies);
|
||||
}
|
||||
|
||||
protected String CreateWantedGender(object DataItem)
|
||||
{
|
||||
GtsRecord4 record = (GtsRecord4)DataItem;
|
||||
return Format.GenderSymbol(record.RequestedGender);
|
||||
}
|
||||
|
||||
protected String CreateWantedLevel(object DataItem)
|
||||
{
|
||||
GtsRecord4 record = (GtsRecord4)DataItem;
|
||||
return FormatLevels(record.RequestedMinLevel, record.RequestedMaxLevel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected String CreateOffer5(object DataItem)
|
||||
{
|
||||
GtsRecord5 record = (GtsRecord5)DataItem;
|
||||
@@ -181,7 +174,7 @@ namespace PkmnFoundations.GTS
|
||||
protected String CreateWanted5(object DataItem)
|
||||
{
|
||||
GtsRecord5 record = (GtsRecord5)DataItem;
|
||||
return String.Format("{3} (#{0})<br />{1}<br />Lv {2}",
|
||||
return String.Format("{3} (#{0})<br />{1}<br />{2}",
|
||||
record.RequestedSpecies,
|
||||
record.RequestedGender,
|
||||
FormatLevels(record.RequestedMinLevel, record.RequestedMaxLevel),
|
||||
@@ -193,8 +186,5 @@ namespace PkmnFoundations.GTS
|
||||
GtsRecord5 record = (GtsRecord5)DataItem;
|
||||
return Common.HtmlEncode(record.TrainerName.Text);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
72
web/gts/Default.aspx.designer.cs
generated
72
web/gts/Default.aspx.designer.cs
generated
@@ -39,42 +39,6 @@ namespace PkmnFoundations.GTS {
|
||||
/// </remarks>
|
||||
protected global::PkmnFoundations.Web.controls.PokemonPicker ppSpecies;
|
||||
|
||||
/// <summary>
|
||||
/// txtLevelMin control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtLevelMin;
|
||||
|
||||
/// <summary>
|
||||
/// txtLevelMax control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtLevelMax;
|
||||
|
||||
/// <summary>
|
||||
/// chkMale control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CheckBox chkMale;
|
||||
|
||||
/// <summary>
|
||||
/// chkFemale control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CheckBox chkFemale;
|
||||
|
||||
/// <summary>
|
||||
/// rbGen4 control.
|
||||
/// </summary>
|
||||
@@ -120,6 +84,42 @@ namespace PkmnFoundations.GTS {
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnSearch;
|
||||
|
||||
/// <summary>
|
||||
/// txtLevelMin control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtLevelMin;
|
||||
|
||||
/// <summary>
|
||||
/// txtLevelMax control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtLevelMax;
|
||||
|
||||
/// <summary>
|
||||
/// chkMale control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CheckBox chkMale;
|
||||
|
||||
/// <summary>
|
||||
/// chkFemale control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CheckBox chkFemale;
|
||||
|
||||
/// <summary>
|
||||
/// rptPokemon4 control.
|
||||
/// </summary>
|
||||
|
||||
@@ -85,14 +85,13 @@ namespace PkmnFoundations.Web.gts
|
||||
{
|
||||
litNickname.Text = pkmn.Nickname;
|
||||
bool shiny = pkmn.IsShiny;
|
||||
imgPokemon.ImageUrl = (shiny ? "~/images/pkmn-lg-s/" : "~/images/pkmn-lg/") +
|
||||
SpeciesFilename(pkmn) + ".png";
|
||||
imgPokemon.ImageUrl = WebFormat.PokemonImage(pkmn);
|
||||
imgPokemon.AlternateText = pkmn.Species.Name.ToString();
|
||||
phShiny.Visible = shiny;
|
||||
// todo: pokerus
|
||||
phPkrs.Visible = false;
|
||||
phPkrsCured.Visible = false;
|
||||
litMarks.Text = CreateMarks(pkmn.Markings);
|
||||
litMarks.Text = WebFormat.Markings(pkmn.Markings);
|
||||
imgPokeball.ImageUrl = ItemFilename(pkmn.Pokeball);
|
||||
imgPokeball.AlternateText = pkmn.Pokeball.Name.ToString();
|
||||
imgPokeball.ToolTip = pkmn.Pokeball.Name.ToString();
|
||||
@@ -157,49 +156,6 @@ namespace PkmnFoundations.Web.gts
|
||||
rptUnknownRibbons.DataBind();
|
||||
}
|
||||
|
||||
private String[] m_marks = new String[] { "●", "▲", "■", "♥", "★", "♦" };
|
||||
|
||||
private String CreateMarks(Markings markings)
|
||||
{
|
||||
StringBuilder result = new StringBuilder();
|
||||
int marking = 1;
|
||||
for (int value = 0; value < 6; value++)
|
||||
{
|
||||
if (((int)markings & marking) != 0)
|
||||
{
|
||||
result.Append("<span class=\"m\">");
|
||||
result.Append(m_marks[value]);
|
||||
result.Append("</span>");
|
||||
}
|
||||
else
|
||||
{
|
||||
result.Append("<span>");
|
||||
result.Append(m_marks[value]);
|
||||
result.Append("</span>");
|
||||
}
|
||||
|
||||
marking <<= 1;
|
||||
}
|
||||
|
||||
return result.ToString();
|
||||
}
|
||||
|
||||
private String SpeciesFilename(Pokemon4 pkmn)
|
||||
{
|
||||
// todo: move to a more central location
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.Append(pkmn.SpeciesID);
|
||||
if (pkmn.Form.Suffix.Length > 0)
|
||||
{
|
||||
builder.Append('-');
|
||||
builder.Append(pkmn.Form.Suffix);
|
||||
}
|
||||
if (pkmn.Species.GenderVariations && pkmn.Gender == Genders.Female)
|
||||
builder.Append("-f");
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
|
||||
private String ItemFilename(Item item)
|
||||
{
|
||||
return "~/images/item-sm/" + item.ID.ToString() + ".png";
|
||||
|
||||
@@ -39,6 +39,21 @@ namespace PkmnFoundations.Web
|
||||
message[x] ^= m_pad[(x + padOffset) & 0xff];
|
||||
}
|
||||
|
||||
public static String ResolveUrl(String url)
|
||||
{
|
||||
url = url.Trim();
|
||||
if (!(url[0] == '~')) return url;
|
||||
try
|
||||
{
|
||||
if (VirtualPathUtility.IsAppRelative(url)) return VirtualPathUtility.ToAbsolute(url);
|
||||
return url;
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
||||
#region File extensions
|
||||
public static String GetExtension(String filename)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user