|
From: <che...@us...> - 2007-05-24 15:35:15
|
Revision: 422
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=422&view=rev
Author: chef_koch
Date: 2007-05-24 08:35:07 -0700 (Thu, 24 May 2007)
Log Message:
-----------
deleted obsolete Thumbs.db
added german and english languageFiles
added multilanguage support
cleanup for B2skin file
Modified Paths:
--------------
trunk/plugins/My Connect4/Skin/Skin Blue Two/MyConnect4.xml
trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.cs
trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.csproj
Added Paths:
-----------
trunk/plugins/My Connect4/Source/MyConnect4/LocalizeStrings.cs
trunk/plugins/My Connect4/language/
trunk/plugins/My Connect4/language/MyConnect4/
trunk/plugins/My Connect4/language/MyConnect4/strings_de.xml
trunk/plugins/My Connect4/language/MyConnect4/strings_en.xml
Removed Paths:
-------------
trunk/plugins/My Connect4/Thumbs.db
Modified: trunk/plugins/My Connect4/Skin/Skin Blue Two/MyConnect4.xml
===================================================================
--- trunk/plugins/My Connect4/Skin/Skin Blue Two/MyConnect4.xml 2007-05-23 16:45:51 UTC (rev 421)
+++ trunk/plugins/My Connect4/Skin/Skin Blue Two/MyConnect4.xml 2007-05-24 15:35:07 UTC (rev 422)
@@ -1,604 +1,601 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<window>
- <id>22031969</id>
- <defaultcontrol>2</defaultcontrol>
- <allowoverlay>yes</allowoverlay>
- <autohidetopbar>yes</autohidetopbar>
- <controls>
- <import>common.time.xml</import>
- <control>
- <description>BackGround</description>
- <type>image</type>
- <id>10</id>
- <posX>0</posX>
- <posY>0</posY>
- <width>720</width>
- <height>576</height>
- <texture>background.png</texture>
- </control>
- <control>
- <description>text label</description>
- <type>label</type>
- <id>11</id>
- <posX>60</posX>
- <posY>70</posY>
- <label>Connect 4</label>
- <font>font16</font>
- <align>Left</align>
- <textcolor>ffffffff</textcolor>
- <animation effect="fade" time="150">WindowOpen</animation>
- <animation effect="fade" time="150">WindowClose</animation>
- </control>
- <control>
+ <id>22031969</id>
+ <defaultcontrol>2</defaultcontrol>
+ <allowoverlay>yes</allowoverlay>
+ <autohidetopbar>yes</autohidetopbar>
+ <controls>
+ <import>common.time.xml</import>
+ <control>
+ <description>BackGround</description>
+ <type>image</type>
+ <id>10</id>
+ <posX>0</posX>
+ <posY>0</posY>
+ <width>720</width>
+ <height>576</height>
+ <texture>background.png</texture>
+ </control>
+ <control>
+ <description>header label</description>
+ <type>label</type>
+ <id>11</id>
+ <posX>250</posX>
+ <posY>70</posY>
+ <font>font16</font>
+ <align>right</align>
+ <textcolor>White</textcolor>
+ <animation effect="fade" time="200">WindowOpen</animation>
+ <animation effect="fade" time="200">WindowClose</animation>
+ </control>
+ <control>
+ <description>button group</description>
<type>group</type>
- <description>group element</description>
- <animation effect="fade" time="150">WindowOpen</animation>
- <animation effect="fade" time="150">WindowClose</animation>
- <control>
- <description>Start</description>
- <type>button</type>
- <id>2</id>
- <posX>60</posX>
- <posY>97</posY>
- <label>Start</label>
- <onleft>2</onleft>
- <onright>301</onright>
- <onup>7</onup>
- <ondown>3</ondown>
- </control>
- <control>
- <description>Mode</description>
- <type>button</type>
- <id>3</id>
- <posX>60</posX>
+ <animation effect="fade" time="250">WindowOpen</animation>
+ <animation effect="fade" time="500">WindowClose</animation>
+ <animation effect="slide" time="250" start="-300,0">WindowOpen</animation>
+ <animation effect="slide" time="500" end="0,-300">WindowClose</animation>
+ <control>
+ <description>Start</description>
+ <type>button</type>
+ <id>2</id>
+ <posX>60</posX>
+ <posY>97</posY>
+ <onleft>2</onleft>
+ <onright>301</onright>
+ <onup>7</onup>
+ <ondown>3</ondown>
+ </control>
+ <control>
+ <description>Mode</description>
+ <type>button</type>
+ <id>3</id>
+ <posX>60</posX>
<posY>131</posY>
- <label>Mode: Play vs Player</label>
- <onleft>3</onleft>
- <onright>3</onright>
- <onup>2</onup>
- <ondown>4</ondown>
- </control>
- <control>
- <description>Level</description>
- <type>button</type>
- <id>4</id>
- <posX>60</posX>
+ <onleft>3</onleft>
+ <onright>301</onright>
+ <onup>2</onup>
+ <ondown>4</ondown>
+ </control>
+ <control>
+ <description>Level</description>
+ <type>button</type>
+ <id>4</id>
+ <posX>60</posX>
<posY>165</posY>
- <label>Level: Amateur</label>
- <onleft>4</onleft>
- <onright>4</onright>
- <onup>3</onup>
- <ondown>7</ondown>
- </control>
- <control>
- <description>text label</description>
+ <onleft>4</onleft>
+ <onright>301</onright>
+ <onup>3</onup>
+ <ondown>7</ondown>
+ </control>
+ <control>
+ <description>Round</description>
<type>label</type>
<id>5</id>
<posX>70</posX>
<posY>205</posY>
<label>#Round</label>
- <font>font12</font>
- <align>Left</align>
- <textcolor>ffffffff</textcolor>
- </control>
- <control>
- <description>text label</description>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ </control>
+ <control>
+ <description>Player: / GameOver</description>
<type>label</type>
<id>6</id>
<posX>70</posX>
<posY>240</posY>
<label>#Player</label>
- <font>font12</font>
- <align>Left</align>
- <textcolor>ffffffff</textcolor>
- </control>
- <control>
- <description>Whatsthis</description>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ </control>
+ <control>
+ <description>What is this?</description>
<type>button</type>
<id>7</id>
<posX>60</posX>
<posY>270</posY>
- <label>What's this?</label>
<onleft>7</onleft>
<onright>301</onright>
<onup>4</onup>
<ondown>2</ondown>
- </control>
- </control>
- <control>
- <description>BackGround Game</description>
- <type>image</type>
- <id>15</id>
- <posX>260</posX>
- <posY>120</posY>
- <width>440</width>
- <height>380</height>
- <texture>MyConnBack.png</texture>
- <animation effect="fade" time="150">WindowOpen</animation>
- <animation effect="fade" time="150">WindowClose</animation>
</control>
- <control>
- <type>group</type>
- <description>group element</description>
- <animation effect="fade" time="150">WindowOpen</animation>
- <animation effect="fade" time="150">WindowClose</animation>
- <control>
- <type>image</type>
- <id>101</id>
- <posX>280</posX>
- <posY>140</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_1_1</texture>
- </control>
- <control>
- <type>image</type>
- <id>102</id>
- <posX>340</posX>
- <posY>140</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_1_2</texture>
- </control>
- <control>
- <type>image</type>
- <id>103</id>
- <posX>400</posX>
- <posY>140</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_1_3</texture>
- </control>
- <control>
- <type>image</type>
- <id>104</id>
- <posX>460</posX>
- <posY>140</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_1_4</texture>
- </control>
- <control>
- <type>image</type>
- <id>105</id>
- <posX>520</posX>
- <posY>140</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_1_5</texture>
- </control>
- <control>
- <type>image</type>
- <id>106</id>
- <posX>580</posX>
- <posY>140</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_1_6</texture>
- </control>
- <control>
- <type>image</type>
- <id>107</id>
- <posX>640</posX>
- <posY>140</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_1_7</texture>
- </control>
-
- <control>
- <type>image</type>
- <id>111</id>
- <posX>280</posX>
- <posY>200</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_2_1</texture>
- </control>
- <control>
- <type>image</type>
- <id>112</id>
- <posX>340</posX>
- <posY>200</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_2_2</texture>
- </control>
- <control>
- <type>image</type>
- <id>113</id>
- <posX>400</posX>
- <posY>200</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_2_3</texture>
- </control>
- <control>
- <type>image</type>
- <id>114</id>
- <posX>460</posX>
- <posY>200</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_2_4</texture>
- </control>
- <control>
- <type>image</type>
- <id>115</id>
- <posX>520</posX>
- <posY>200</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_2_5</texture>
- </control>
- <control>
- <type>image</type>
- <id>116</id>
- <posX>580</posX>
- <posY>200</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_2_6</texture>
- </control>
- <control>
- <type>image</type>
- <id>117</id>
- <posX>640</posX>
- <posY>200</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_2_7</texture>
- </control>
-
- <control>
- <type>image</type>
- <id>121</id>
- <posX>280</posX>
- <posY>260</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_3_1</texture>
- </control>
- <control>
- <type>image</type>
- <id>122</id>
- <posX>340</posX>
- <posY>260</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_3_2</texture>
- </control>
- <control>
- <type>image</type>
- <id>123</id>
- <posX>400</posX>
- <posY>260</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_3_3</texture>
- </control>
- <control>
- <type>image</type>
- <id>124</id>
- <posX>460</posX>
- <posY>260</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_3_4</texture>
- </control>
- <control>
- <type>image</type>
- <id>125</id>
- <posX>520</posX>
- <posY>260</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_3_5</texture>
- </control>
- <control>
- <type>image</type>
- <id>126</id>
- <posX>580</posX>
- <posY>260</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_3_6</texture>
- </control>
- <control>
- <type>image</type>
- <id>127</id>
- <posX>640</posX>
- <posY>260</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_3_7</texture>
- </control>
-
- <control>
- <type>image</type>
- <id>131</id>
- <posX>280</posX>
- <posY>320</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_4_1</texture>
- </control>
- <control>
- <type>image</type>
- <id>132</id>
- <posX>340</posX>
- <posY>320</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_4_2</texture>
- </control>
- <control>
- <type>image</type>
- <id>133</id>
- <posX>400</posX>
- <posY>320</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_4_3</texture>
- </control>
- <control>
- <type>image</type>
- <id>134</id>
- <posX>460</posX>
- <posY>320</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_4_4</texture>
- </control>
- <control>
- <type>image</type>
- <id>135</id>
- <posX>520</posX>
- <posY>320</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_4_5</texture>
- </control>
- <control>
- <type>image</type>
- <id>136</id>
- <posX>580</posX>
- <posY>320</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_4_6</texture>
- </control>
- <control>
- <type>image</type>
- <id>137</id>
- <posX>640</posX>
- <posY>320</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_4_7</texture>
- </control>
-
- <control>
- <type>image</type>
- <id>141</id>
- <posX>280</posX>
- <posY>380</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_5_1</texture>
- </control>
- <control>
- <type>image</type>
- <id>142</id>
- <posX>340</posX>
- <posY>380</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_5_2</texture>
- </control>
- <control>
- <type>image</type>
- <id>143</id>
- <posX>400</posX>
- <posY>380</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_5_3</texture>
- </control>
- <control>
- <type>image</type>
- <id>144</id>
- <posX>460</posX>
- <posY>380</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_5_4</texture>
- </control>
- <control>
- <type>image</type>
- <id>145</id>
- <posX>520</posX>
- <posY>380</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_5_5</texture>
- </control>
- <control>
- <type>image</type>
- <id>146</id>
- <posX>580</posX>
- <posY>380</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_5_6</texture>
- </control>
- <control>
- <type>image</type>
- <id>147</id>
- <posX>640</posX>
- <posY>380</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_5_7</texture>
- </control>
-
- <control>
- <type>image</type>
- <id>151</id>
- <posX>280</posX>
- <posY>440</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_6_1</texture>
- </control>
- <control>
- <type>image</type>
- <id>152</id>
- <posX>340</posX>
- <posY>440</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_6_2</texture>
- </control>
- <control>
- <type>image</type>
- <id>153</id>
- <posX>400</posX>
- <posY>440</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_6_3</texture>
- </control>
- <control>
- <type>image</type>
- <id>154</id>
- <posX>460</posX>
- <posY>440</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_6_4</texture>
- </control>
- <control>
- <type>image</type>
- <id>155</id>
- <posX>520</posX>
- <posY>440</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_6_5</texture>
- </control>
- <control>
- <type>image</type>
- <id>156</id>
- <posX>580</posX>
- <posY>440</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_6_6</texture>
- </control>
- <control>
- <type>image</type>
- <id>157</id>
- <posX>640</posX>
- <posY>440</posY>
- <width>40</width>
- <height>40</height>
- <texture>#Con_6_7</texture>
- </control>
- <control>
- <description>text label</description>
- <type>label</type>
- <id>18</id>
- <posX>260</posX>
- <posY>510</posY>
- <label>#Status</label>
- <font>font16</font>
- <align>Left</align>
- <textcolor>ffffffff</textcolor>
- </control>
- <control>
- <description>Pointer 01</description>
- <type>button</type>
- <id>301</id>
- <posX>280</posX>
- <posY>70</posY>
- <width>40</width>
- <height>40</height>
- <onleft>2</onleft>
- <onright>302</onright>
- <textureFocus>MyConn4Cur.png</textureFocus>
- </control>
- <control>
- <description>Pointer 02</description>
- <type>button</type>
- <id>302</id>
- <posX>340</posX>
- <posY>70</posY>
- <width>40</width>
- <height>40</height>
- <onleft>301</onleft>
- <onright>303</onright>
- <textureFocus>MyConn4Cur.png</textureFocus>
- </control>
- <control>
- <description>Pointer 03</description>
- <type>button</type>
- <id>303</id>
- <posX>400</posX>
- <posY>70</posY>
- <width>40</width>
- <height>40</height>
- <onleft>302</onleft>
- <onright>304</onright>
- <textureFocus>MyConn4Cur.png</textureFocus>
- </control>
- <control>
- <description>Pointer 04</description>
- <type>button</type>
- <id>304</id>
- <posX>460</posX>
- <posY>70</posY>
- <width>40</width>
- <height>40</height>
- <onleft>303</onleft>
- <onright>305</onright>
- <textureFocus>MyConn4Cur.png</textureFocus>
- </control>
- <control>
- <description>Pointer 05</description>
- <type>button</type>
- <id>305</id>
- <posX>520</posX>
- <posY>70</posY>
- <width>40</width>
- <height>40</height>
- <onleft>304</onleft>
- <onright>306</onright>
- <textureFocus>MyConn4Cur.png</textureFocus>
- </control>
- <control>
- <description>Pointer 06</description>
- <type>button</type>
- <id>306</id>
- <posX>580</posX>
- <posY>70</posY>
- <width>40</width>
- <height>40</height>
- <onleft>305</onleft>
- <onright>307</onright>
- <textureFocus>MyConn4Cur.png</textureFocus>
- </control>
- <control>
- <description>Pointer 07</description>
- <type>button</type>
- <id>307</id>
- <posX>640</posX>
- <posY>70</posY>
- <width>40</width>
- <height>40</height>
- <onleft>306</onleft>
- <onright>307</onright>
- <textureFocus>MyConn4Cur.png</textureFocus>
- </control>
- </control>
- </controls>
+ </control>
+ <control>
+ <description>BackGround Game</description>
+ <type>image</type>
+ <id>15</id>
+ <posX>260</posX>
+ <posY>120</posY>
+ <width>440</width>
+ <height>380</height>
+ <texture>MyConnBack.png</texture>
+ <animation effect="fade" time="250">WindowOpen</animation>
+ <animation effect="fade" time="500">WindowClose</animation>
+ <animation effect="slide" time="400" start="0,-300">WindowOpen</animation>
+ <animation effect="slide" time="400" end="800,0">WindowClose</animation>
+ </control>
+ <control>
+ <description>game group</description>
+ <type>group</type>
+ <animation effect="fade" time="250">WindowOpen</animation>
+ <animation effect="fade" time="500">WindowClose</animation>
+ <animation effect="slide" time="400" start="0,-300">WindowOpen</animation>
+ <animation effect="slide" time="400" end="800,0">WindowClose</animation>
+ <control>
+ <type>image</type>
+ <id>101</id>
+ <posX>280</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_1</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>102</id>
+ <posX>340</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_2</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>103</id>
+ <posX>400</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_3</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>104</id>
+ <posX>460</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_4</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>105</id>
+ <posX>520</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_5</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>106</id>
+ <posX>580</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_6</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>107</id>
+ <posX>640</posX>
+ <posY>140</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_1_7</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>111</id>
+ <posX>280</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_1</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>112</id>
+ <posX>340</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_2</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>113</id>
+ <posX>400</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_3</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>114</id>
+ <posX>460</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_4</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>115</id>
+ <posX>520</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_5</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>116</id>
+ <posX>580</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_6</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>117</id>
+ <posX>640</posX>
+ <posY>200</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_2_7</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>121</id>
+ <posX>280</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_1</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>122</id>
+ <posX>340</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_2</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>123</id>
+ <posX>400</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_3</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>124</id>
+ <posX>460</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_4</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>125</id>
+ <posX>520</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_5</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>126</id>
+ <posX>580</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_6</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>127</id>
+ <posX>640</posX>
+ <posY>260</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_3_7</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>131</id>
+ <posX>280</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_1</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>132</id>
+ <posX>340</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_2</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>133</id>
+ <posX>400</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_3</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>134</id>
+ <posX>460</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_4</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>135</id>
+ <posX>520</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_5</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>136</id>
+ <posX>580</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_6</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>137</id>
+ <posX>640</posX>
+ <posY>320</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_4_7</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>141</id>
+ <posX>280</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_1</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>142</id>
+ <posX>340</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_2</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>143</id>
+ <posX>400</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_3</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>144</id>
+ <posX>460</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_4</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>145</id>
+ <posX>520</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_5</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>146</id>
+ <posX>580</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_6</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>147</id>
+ <posX>640</posX>
+ <posY>380</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_5_7</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>151</id>
+ <posX>280</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_1</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>152</id>
+ <posX>340</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_2</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>153</id>
+ <posX>400</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_3</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>154</id>
+ <posX>460</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_4</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>155</id>
+ <posX>520</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_5</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>156</id>
+ <posX>580</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_6</texture>
+ </control>
+ <control>
+ <type>image</type>
+ <id>157</id>
+ <posX>640</posX>
+ <posY>440</posY>
+ <width>40</width>
+ <height>40</height>
+ <texture>#Con_6_7</texture>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>18</id>
+ <posX>260</posX>
+ <posY>510</posY>
+ <label>#Status</label>
+ <font>font16</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ </control>
+ <control>
+ <description>Pointer 01</description>
+ <type>button</type>
+ <id>301</id>
+ <posX>280</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>2</onleft>
+ <onright>302</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ <control>
+ <description>Pointer 02</description>
+ <type>button</type>
+ <id>302</id>
+ <posX>340</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>301</onleft>
+ <onright>303</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ <control>
+ <description>Pointer 03</description>
+ <type>button</type>
+ <id>303</id>
+ <posX>400</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>302</onleft>
+ <onright>304</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ <control>
+ <description>Pointer 04</description>
+ <type>button</type>
+ <id>304</id>
+ <posX>460</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>303</onleft>
+ <onright>305</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ <control>
+ <description>Pointer 05</description>
+ <type>button</type>
+ <id>305</id>
+ <posX>520</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>304</onleft>
+ <onright>306</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ <control>
+ <description>Pointer 06</description>
+ <type>button</type>
+ <id>306</id>
+ <posX>580</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>305</onleft>
+ <onright>307</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ <control>
+ <description>Pointer 07</description>
+ <type>button</type>
+ <id>307</id>
+ <posX>640</posX>
+ <posY>70</posY>
+ <width>40</width>
+ <height>40</height>
+ <onleft>306</onleft>
+ <onright>307</onright>
+ <textureFocus>MyConn4Cur.png</textureFocus>
+ </control>
+ </control>
+ </controls>
</window>
Added: trunk/plugins/My Connect4/Source/MyConnect4/LocalizeStrings.cs
===================================================================
--- trunk/plugins/My Connect4/Source/MyConnect4/LocalizeStrings.cs (rev 0)
+++ trunk/plugins/My Connect4/Source/MyConnect4/LocalizeStrings.cs 2007-05-24 15:35:07 UTC (rev 422)
@@ -0,0 +1,260 @@
+#region Copyright (C) 2005-2007 Team MediaPortal
+
+/*
+ * Copyright (C) 2005-2007 Team MediaPortal
+ * http://www.team-mediaportal.com
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#endregion
+
+using System;
+using System.IO;
+using System.Globalization;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using MediaPortal.Util;
+using MediaPortal.GUI.Library;
+using MediaPortal.Configuration;
+using MediaPortal.Localisation;
+
+namespace MediaPortal.GUI.MyConnect
+{
+ /// <summary>
+ /// This class will hold all text used in the application
+ /// The text is loaded for the current language from
+ /// the file language/[language]/strings.xml
+ /// </summary>
+ public class GUILocalizeStrings
+ {
+ #region Variables
+ static LocalisationProvider _stringProvider;
+ static Dictionary<string, string> _cultures;
+ static string[] _languages;
+ #endregion
+
+ #region Constructors/Destructors
+ // singleton. Dont allow any instance of this class
+ private GUILocalizeStrings()
+ {
+ }
+
+ static public void Dispose()
+ {
+ if (_stringProvider != null)
+ _stringProvider.Dispose();
+ }
+ #endregion
+
+ #region Public Methods
+ /// <summary>
+ /// Public method to load the text from a strings/xml file into memory
+ /// </summary>
+ /// <param name="strFileName">Contains the filename+path for the string.xml file</param>
+ /// <returns>
+ /// true when text is loaded
+ /// false when it was unable to load the text
+ /// </returns>
+ //[Obsolete("This method has changed", true)]
+ static public bool Load(string language)
+ {
+ bool isPrefixEnabled = true;
+
+ using (MediaPortal.Profile.Settings reader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
+ isPrefixEnabled = reader.GetValueAsBool("general", "myprefix", true);
+
+ string directory = Config.GetSubFolder(Config.Dir.Language, "MyConnect4");
+ string cultureName = null;
+ if (language != null)
+ cultureName = GetCultureName(language);
+
+ Log.Info(" Loading localised Strings - Path: {0} Culture: {1} Language: {2} Prefix: {3}", directory, cultureName, language, isPrefixEnabled);
+
+ _stringProvider = new LocalisationProvider(directory, cultureName, isPrefixEnabled);
+
+ GUIGraphicsContext.CharsInCharacterSet = _stringProvider.Characters;
+
+ return true;
+ }
+
+ static public string CurrentLanguage()
+ {
+ if (_stringProvider == null)
+ Load(null);
+
+ return _stringProvider.CurrentLanguage.EnglishName;
+ }
+
+ static public void ChangeLanguage(string language)
+ {
+ if (_stringProvider == null)
+ Load(language);
+ else
+ _stringProvider.ChangeLanguage(GetCultureName(language));
+ }
+
+ /// <summary>
+ /// Get the translation for a given id and format the sting with
+ /// the given parameters
+ /// </summary>
+ /// <param name="dwCode">id of text</param>
+ /// <param name="parameters">parameters used in the formating</param>
+ /// <returns>
+ /// string containing the translated text
+ /// </returns>
+ static public string Get(int dwCode, object[] parameters)
+ {
+ if (_stringProvider == null)
+ Load(null);
+
+ string translation = _stringProvider.GetString("unmapped", dwCode);
+ // if parameters or the translation is null, return the translation.
+ if ((translation == null) || (parameters == null))
+ {
+ return translation;
+ }
+ // return the formatted string. If formatting fails, log the error
+ // and return the unformatted string.
+ try
+ {
+ return String.Format(translation, parameters);
+ }
+ catch (System.FormatException e)
+ {
+ Log.Error("Error formatting translation with id {0}", dwCode);
+ Log.Error("Unformatted translation: {0}", translation);
+ Log.Error(e);
+ return translation;
+ }
+ }
+
+ /// <summary>
+ /// Get the translation for a given id
+ /// </summary>
+ /// <param name="dwCode">id of text</param>
+ /// <returns>
+ /// string containing the translated text
+ /// </returns>
+ static public string Get(int dwCode)
+ {
+ if (_stringProvider == null)
+ Load(null);
+
+ string translation = _stringProvider.GetString("unmapped", dwCode);
+
+ if (translation == null)
+ {
+ Log.Error("No translation found for id {0}", dwCode);
+ return String.Empty;
+ }
+
+ return translation;
+ }
+
+ static public void LocalizeLabel(ref string strLabel)
+ {
+ if (_stringProvider == null)
+ Load(null);
+
+ if (strLabel == null) strLabel = String.Empty;
+ if (strLabel == "-") strLabel = "";
+ if (strLabel == "") return;
+ // This can't be a valid string code if the first character isn't a number.
+ // This check will save us from catching unnecessary exceptions.
+ if (!char.IsNumber(strLabel, 0))
+ return;
+
+ int dwLabelID;
+
+ try
+ {
+ dwLabelID = System.Int32.Parse(strLabel);
+ }
+ catch (FormatException e)
+ {
+ Log.Error(e);
+ strLabel = String.Empty;
+ return;
+ }
+
+ strLabel = _stringProvider.GetString("unmapped", dwLabelID);
+ if (strLabel == null)
+ {
+ Log.Error("No translation found for id {0}", dwLabelID);
+ strLabel = String.Empty;
+ }
+ }
+
+ public static string LocalSupported()
+ {
+ if (_stringProvider == null)
+ Load(null);
+
+ CultureInfo culture = _stringProvider.GetBestLanguage();
+
+ return culture.EnglishName;
+ }
+
+ public static string[] SupportedLanguages()
+ {
+ if (_languages == null)
+ {
+ if (_stringProvider == null)
+ Load(null);
+
+ CultureInfo[] cultures = _stringProvider.AvailableLanguages();
+
+ SortedList sortedLanguages = new SortedList();
+ foreach (CultureInfo culture in cultures)
+ sortedLanguages.Add(culture.EnglishName, culture.EnglishName);
+
+ _languages = new string[sortedLanguages.Count];
+
+ for (int i = 0; i < sortedLanguages.Count; i++)
+ {
+ _languages[i] = (string)sortedLanguages.GetByIndex(i);
+ }
+ }
+
+ return _languages;
+ }
+
+ static public string GetCultureName(string language)
+ {
+ if (_cultures == null)
+ {
+ _cultures = new Dictionary<string, string>();
+
+ CultureInfo[] cultureList = CultureInfo.GetCultures(CultureTypes.AllCultures);
+
+ for (int i = 0; i < cultureList.Length; i++)
+ {
+ _cultures.Add(cultureList[i].EnglishName, cultureList[i].Name);
+ }
+ }
+
+ if (_cultures.ContainsKey(language))
+ return _cultures[language];
+
+ return null;
+ }
+ #endregion
+ }
+}
\ No newline at end of file
Modified: trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.cs
===================================================================
--- trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.cs 2007-05-23 16:45:51 UTC (rev 421)
+++ trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.cs 2007-05-24 15:35:07 UTC (rev 422)
@@ -36,448 +36,458 @@
namespace MediaPortal.GUI.MyConnect
{
- [PluginIcons("MyConnect4.connect4.png", "MyConnect4.connect4Disabled.png")]
- public class MyConnect4GUI : GUIWindow, ISetupForm
- {
- #region SkinControl
- [SkinControlAttribute(2)] protected GUIButtonControl BtnStart = null;
- [SkinControlAttribute(4)] protected GUIButtonControl BtnLevel = null;
- [SkinControlAttribute(3)] protected GUIButtonControl BtnMode = null;
-
- [SkinControlAttribute(7)] protected GUIButtonControl BtnWhatsThis = null;
- #endregion
+ [PluginIcons("MyConnect4.connect4.png", "MyConnect4.connect4Disabled.png")]
+ public class MyConnect4GUI : GUIWindow, ISetupForm
+ {
+ #region SkinControl
+ [SkinControlAttribute(11)]
+ protected GUILabelControl lblHeader = null;
- #region Private variables
+ [SkinControlAttribute(2)]
+ protected GUIButtonControl BtnStart = null;
+ [SkinControlAttribute(4)]
+ protected GUIButtonControl BtnLevel = null;
+ [SkinControlAttribute(3)]
+ protected GUIButtonControl BtnMode = null;
- string Level="Nor"; //Choosen level
- int AI = 5;
+ [SkinControlAttribute(7)]
+ protected GUIButtonControl BtnWhatsThis = null;
+ #endregion
- string Mode = "1p"; //2player
+ #region Private variables
- int Player = 0;
- int round = 0;
+ string Level = "Nor"; //Choosen level
+ int AI = 5;
- int wait = 0;
+ string Mode = "1p"; //2player
- private static OnActionHandler ah;
+ int Player = 0;
+ int round = 0;
- private System.Windows.Forms.Timer _Game = new System.Windows.Forms.Timer();
+ int wait = 0;
- private Engine gameEngine;
+ private static OnActionHandler ah;
- #endregion
+ private System.Windows.Forms.Timer _Game = new System.Windows.Forms.Timer();
- #region ISetupForm Members
+ private Engine gameEngine;
- // Returns the name of the plugin which is shown in the plugin menu
- public string PluginName()
- {
- return "My Connect 4";
- }
+ #endregion
- // Returns the description of the plugin is shown in the plugin menu
- public string Description()
- {
- return "Connect 4";
- }
+ #region ISetupForm Members
- // Returns the author of the plugin which is shown in the plugin menu
- public string Author()
- {
- return "Mark Koenig (kroko)";
- }
+ // Returns the name of the plugin which is shown in the plugin menu
+ public string PluginName()
+ {
+ return "My Connect 4";
+ }
- // show the setup dialog
- public void ShowPlugin()
- {
- MessageBox.Show("Nothing to configure, this is just an example");
- }
+ // Returns the description of the plugin is shown in the plugin menu
+ public string Description()
+ {
+ return "Connect 4";
+ }
- // Indicates whether plugin can be enabled/disabled
- public bool CanEnable()
+ // Returns the author of the plugin which is shown in the plugin menu
+ public string Author()
+ {
+ return "Mark Koenig (kroko)";
+ }
+
+ // show the setup dialog
+ public void ShowPlugin()
+ {
+ MessageBox.Show("Nothing to configure, this is just an example");
+ }
+
+ // Indicates whether plugin can be enabled/disabled
+ public bool CanEnable()
+ {
+ return true;
+ }
+
+ // get ID of windowplugin belonging to this setup
+ public int GetWindowId()
+ {
+ return 22031969;
+ }
+
+ // Indicates if plugin is enabled by default;
+ public bool DefaultEnabled()
+ {
+ return true;
+ }
+
+ // indicates if a plugin has its own setup screen
+ public bool HasSetup()
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// If the plugin should have its own button on the main menu of MediaPortal then it
+ /// should return true to this method, otherwise if it should not be on home
+ /// it should return false
+ /// </summary>
+ /// <param name="strButtonText">text the button should have</param>
+ /// <param name="strButtonImage">image for the button, or empty for default</param>
+ /// <param name="strButtonImageFocus">image for the button, or empty for default</param>
+ /// <param name="strPictureImage">subpicture for the button or empty for none</param>
+ /// <returns>true : plugin needs its own button on home
+ /// false : plugin does not need its own button on home</returns>
+
+ public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)
+ {
+ strButtonText = PluginName();
+ strButtonImage = String.Empty;
+ strButtonImageFocus = String.Empty;
+ strPictureImage = "hover_my connect4.png";
+ return true;
+ }
+
+ #endregion
+
+ public override int GetID
+ {
+ get
{
- return true;
+ return 22031969;
}
-
- // get ID of windowplugin belonging to this setup
- public int GetWindowId()
+ set
{
- return 22031969;
+ base.GetID = value;
}
+ }
- // Indicates if plugin is enabled by default;
- public bool DefaultEnabled()
- {
- return true;
- }
+ public override bool Init()
+ {
+ MyConnect.GUILocalizeStrings.Load(GUI.Library.GUILocalizeStrings.CurrentLanguage());
- // indicates if a plugin has its own setup screen
- public bool HasSetup()
- {
- return false;
- }
+ bool result = Load(GUIGraphicsContext.Skin + @"\MyConnect4.xml");
+ if (ah == null) ah = new OnActionHandler(OnAction2);
- /// <summary>
- /// If the plugin should have its own button on the main menu of MediaPortal then it
- /// should return true to this method, otherwise if it should not be on home
- /// it should return false
- /// </summary>
- /// <param name="strButtonText">text the button should have</param>
- /// <param name="strButtonImage">image for the button, or empty for default</param>
- /// <param name="strButtonImageFocus">image for the button, or empty for default</param>
- /// <param name="strPictureImage">subpicture for the button or empty for none</param>
- /// <returns>true : plugin needs its own button on home
- /// false : plugin does not need its own button on home</returns>
+ return result;
+ }
- public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)
- {
- strButtonText = PluginName();
- strButtonImage = String.Empty;
- strButtonImageFocus = String.Empty;
- strPictureImage = "hover_my connect4.png";
- return true;
- }
+ #region Actions
+ public override void OnAction(Action action)
+ {
+ base.OnAction(action);
+ }
+ public void OnAction2(Action action)
+ {
- #endregion
+ if (GUIWindowManager.ActiveWindowEx == (int)GUIWindow.Window.WINDOW_DIALOG_MENU) return;
- public override int GetID
+ //string t = action.wID.ToString();
+ //GUIPropertyManager.SetProperty("#Round", t);
+
+ if ((Player == 1) | (Player == 2 && Mode == "2p"))
{
- get
- {
- return 22031969;
- }
- set
- {
- base.GetID = value;
- }
+ switch (action.wID)
+ {
+ case Action.ActionType.ACTION_MOVE_LEFT:
+
+ break;
+ case Action.ActionType.ACTION_MOVE_RIGHT:
+
+ break;
+ case Action.ActionType.ACTION_SELECT_ITEM:
+
+ break;
+ default:
+ break;
+ }
}
-
- public override bool Init()
- {
- bool result = Load(GUIGraphicsContext.Skin + @"\MyConnect4.xml");
- if (ah == null) ah = new OnActionHandler(OnAction2);
- return result;
- }
+ }
+ #endregion
- #region Actions
- public override void OnAction(Action action)
- {
- base.OnAction(action);
- }
- public void OnAction2(Action action)
- {
+ public override bool OnMessage(GUIMessage message)
+ {
+ return base.OnMessage(message);
+ }
- if (GUIWindowManager.ActiveWindowEx == (int)GUIWindow.Window.WINDOW_DIALOG_MENU) return;
+ public void Dispose()
+ {
+ _Game.Stop();
+ _Game.Tick -= new EventHandler(_Game_Tick);
+ }
- //string t = action.wID.ToString();
- //GUIPropertyManager.SetProperty("#Round", t);
+ protected override void OnPageLoad()
+ {
+ _Game.Interval = 300;
+ _Game.Tick += new EventHandler(_Game_Tick);
+ _Game.Start();
- if ((Player == 1) | (Player == 2 && Mode == "2p"))
- {
- switch (action.wID)
- {
- case Action.ActionType.ACTION_MOVE_LEFT:
-
- break;
- case Action.ActionType.ACTION_MOVE_RIGHT :
-
- break;
- case Action.ActionType.ACTION_SELECT_ITEM :
-
- break;
- default:
- break;
- }
- }
- }
- #endregion
+ Player = 0;
+ Level = "Nor";
+ Mode = "1p";
+ AI = 5;
- public override bool OnMessage(GUIMessage message)
- {
- return base.OnMessage(message);
- }
+ GUIControl.SetControlLabel(GetID, 11, MyConnect.GUILocalizeStrings.Get(0)); // My Connect 4
+ GUIControl.SetControlLabel(GetID, BtnStart.GetID, MyConnect.GUILocalizeStrings.Get(1)); // Start
+ GUIControl.SetControlLabel(GetID, BtnWhatsThis.GetID, MyConnect.GUILocalizeStrings.Get(31)); // What is Connect4?
- public void Dispose()
- {
- _Game.Stop();
- _Game.Tick -= new EventHandler(_Game_Tick);
- }
+ GUIPropertyManager.SetProperty("#Status", " ");
+ GUIControl.SetControlLabel(GetID, BtnLevel.GetID, MyConnect.GUILocalizeStrings.Get(12)); // Level: Normal
+ GUIControl.SetControlLabel(GetID, BtnMode.GetID, MyConnect.GUILocalizeStrings.Get(21)); // Mode: Play vs Comp
- protected override void OnPageLoad()
- {
- _Game.Interval = 300;
- _Game.Tick += new EventHandler(_Game_Tick);
- _Game.Start();
+ // Disable level selection
+ GUIControl.DisableControl(GetID, 4);
- Player = 0;
- Level = "Nor";
- Mode = "1p";
- AI = 5;
+ RelButtons();
- GUIPropertyManager.SetProperty("#Status", " ");
- GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Normal");
- GUIControl.SetControlLabel(GetID, BtnMode.GetID, "Mode: Play vs Comp");
-
- // Disable level selection
- GUIControl.DisableControl(GetID, 4);
+ GUIGraphicsContext.OnNewAction -= ah;
+ GUIGraphicsContext.OnNewAction += ah;
- RelButtons();
+ base.OnPageLoad();
- GUIGraphicsContext.OnNewAction -= ah;
- GUIGraphicsContext.OnNewAction += ah;
+ this.gameEngine = null;
+ this.gameEngine = new Engine(7, 6, 4);
- base.OnPageLoad();
+ Drawfield();
- this.gameEngine = null;
- this.gameEngine = new Engine(7, 6, 4);
+ }
- Drawfield ();
-
- }
+ protected override void OnPageDestroy(int new_windowId)
+ {
+ _Game.Stop();
+ _Game.Tick -= new EventHandler(_Game_Tick);
+ }
- protected override void OnPageDestroy(int new_windowId)
- {
- _Game.Stop();
- _Game.Tick -= new EventHandler(_Game_Tick);
- }
+ protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
+ {
+ if (control == BtnLevel)
+ OnBtnLevel();
+ if (control == BtnMode)
+ OnBtnMode();
+ if (control == BtnWhatsThis)
+ OnBtnWhatsThis();
+ if (control == BtnStart)
+ { //start game
- protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
- {
- if (control == BtnLevel)
- OnBtnLevel();
- if (control == BtnMode)
- OnBtnMode();
- if (control == BtnWhatsThis)
- OnBtnWhatsThis();
- if (control == BtnStart)
- { //start game
+ if (Player == 0 && wait == 0)
+ {
+ Player = 1;
+ round = 0;
+ GUIPropertyManager.SetProperty("#Status", " ");
- if (Player == 0 && wait==0)
- {
- Player = 1;
- round = 0;
- GUIPropertyManager.SetProperty("#Status", " ");
+ // Disable start button
+ GUIControl.DisableControl(GetID, 2);
+ // Disable level selection
+ GUIControl.DisableControl(GetID, 3);
+ // Disable mode selection
+ GUIControl.DisableControl(GetID, 4);
- // Disable start button
- GUIControl.DisableControl(GetID, 2);
- // Disable level selection
- GUIControl.DisableControl(GetID, 3);
- // Disable mode selection
- GUIControl.DisableControl(GetID, 4);
+ this.gameEngine = null;
+ this.gameEngine = new Engine(7, 6, 4);
- this.gameEngine = null;
- this.gameEngine = new Engine(7, 6, 4);
+ Drawfield();
- Drawfield();
-
- wait = 2;
- GUIControl.FocusControl(GetID, 15);
- }
- }
- if ((Player==1)|(Player==2 && Mode=="2p"))
- {
-
- if ((controlId >= 301) && (controlId <= 307))
- {
- //which button has clicked ?
- int col = controlId - 301;
-
- PlayerClick(col);
- wait = 2;
- }
- }
- base.OnClicked(controlId, control, actionType);
+ wait = 2;
+ GUIControl.FocusControl(GetID, 15);
+ }
}
+ if ((Player == 1) | (Player == 2 && Mode == "2p"))
+ {
- protected override void OnShowContextMenu()
- {
- base.OnShowContextMenu();
- }
+ if ((controlId >= 301) && (controlId <= 307))
+ {
+ //which button has clicked ?
+ int col = controlId - 301;
- private void OnBtnLevel()
- { //Choose level for the game
- if (Player==0)
- {
- if (Level == "Nor")
- {
- GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Professional");
- Level = "Pro";
- AI = 8;
- }
- else if (Level == "Pro")
- {
- GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Amateur");
- Level = "Am";
- AI = 3;
- }
- else
- {
- GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Normal");
- Level = "Nor";
- AI = 5;
- }
- }
+ PlayerClick(col);
+ wait = 2;
+ }
}
+ base.OnClicked(controlId, control, actionType);
+ }
- private void OnBtnMode()
- { //Choose mode for the game
- if (Player == 0)
- {
- if (Mode == "2p")
- {
- GUIControl.SetControlLabel(GetID, BtnMode.GetID, "Mode: Play vs Comp");
- Mode = "1p";
- // Enable level selection
- GUIControl.EnableControl(GetID, 4);
- }
- else
- {
- GUIControl.SetControlLabel(GetID, BtnMode.GetID, "Mode: Play vs Player");
- Mode = "2p";
- // Disable level selection
- GUIControl.DisableControl(GetID, 4);
- }
- }
- }
+ protected override void OnShowContextMenu()
+ {
+ base.OnShowContextMenu();
+ }
- private void OnBtnWhatsThis()
+ private void OnBtnLevel()
+ { //Choose level for the game
+ if (Player == 0)
{
- GUIDialogText dlg = (GUIDialogText)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_TEXT);
- dlg.SetHeading("What's Connect 4 (Vier gewinnt)");
- dlg.SetText("Connect 4 is a game where your object is to get 4 tokens in a row.\n" +
- "This could be vertically, horizontal or diagonally.\n\n" +
- "Gameboard design by Mikael S\xF6derstr\xF6m.\n\n" +
- "AI code has been taken from http://www.Planet-Source-Code.com\n\n" +
- "Good luck\nMark Koenig (kroko)");
- dlg.DoModal(GetID);
+ if (Level == "Nor")
+ {
+ GUIControl.SetControlLabel(GetID, BtnLevel.GetID, MyConnect.GUILocalizeStrings.Get(13)); // Level: Professional
+ Level = "Pro";
+ AI = 8;
+ }
+ else if (Level == "Pro")
+ {
+ GUIControl.SetControlLabel(GetID, BtnLevel.GetID, MyConnect.GUILocalizeStrings.Get(11)); // Level: Amateur
+ Level = "Am";
+ AI = 3;
+ }
+ else
+ {
+ GUIControl.SetControlLabel(GetID, BtnLevel.GetID, MyConnect.GUILocalizeStrings.Get(12)); // Level: Normal
+ Level = "Nor";
+ AI = 5;
+ }
}
+ }
- private void Drawfield()
- { // draw all fields
+ private void OnBtnMode()
+ { //Choose mode for the game
+ if (Player == 0)
+ {
+ if (Mode == "2p")
+ {
+ GUIControl.SetControlLabel(GetID, BtnMode.GetID, MyConnect.GUILocalizeStrings.Get(21)); // Mode: Play vs Comp
+ Mode = "1p";
+ // Enable level selection
+ GUIControl.EnableControl(GetID, 4);
+ }
+ else
+ {
+ GUIControl.SetControlLabel(GetID, BtnMode.GetID, MyConnect.GUILocalizeStrings.Get(22)); // Mode: Play vs Player
+ Mode = "2p";
+ // Disable level selection
+ GUIControl.DisableControl(GetID, 4);
+ }
+ }
+ }
- int[,] Myboard = gameEngine.getBoard();
-
- for (int i = 0; i < 7; i++)
- {
- for (int j = 0; j < 6; j++)
- {
- string prop = "#Con_" + (6-j) + "_" + (i+1);
+ private void OnBtnWhatsThis()
+ {
+ GUIDialogText dlg = (GUIDialogText)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_TEXT);
+ dlg.SetHeading(MyConnect.GUILocalizeStrings.Get(31)); // help dialog heading
+ dlg.SetText(MyConnect.GUILocalizeStrings.Get(32)); // help dialog text
+ dlg.DoModal(GetID);
+ }
- if (Myboard[i, j] == 2)
- GUIPropertyManager.SetProperty(prop, "MyConn4Wh.png");
- if (Myboard[i, j] == 0)
- GUIPropertyManager.SetProperty(prop, "MyConn4Ye.png");
- if (Myboard[i, j] == 1)
- GUIPropertyManager.SetProperty(prop, "MyConn4Rd.png");
- if (Myboard[i, j] > 2)
- GUIPropertyManager.SetProp...
[truncated message content] |