|
From: <kro...@us...> - 2007-04-10 11:58:20
|
Revision: 310
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=310&view=rev
Author: kroko_koenig
Date: 2007-04-10 04:58:17 -0700 (Tue, 10 Apr 2007)
Log Message:
-----------
Initial Release
Added Paths:
-----------
trunk/plugins/My Hexxagon/Skin/
trunk/plugins/My Hexxagon/Skin/SimpleMP/
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx01.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx01F.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx02.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx02F.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx03.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx03F.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx04.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx04F.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx05.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx05F.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx06.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx06F.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx07.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx07F.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/hover_my hexxagon.png
trunk/plugins/My Hexxagon/Skin/SimpleMP/MyHexxagon.xml
trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/
trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxDouble.wav
trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxMove.wav
trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxSelect.wav
trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxZap.wav
trunk/plugins/My Hexxagon/Source/
trunk/plugins/My Hexxagon/Source/MyHexxagon/
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.cs
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.csproj
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.xml
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/Properties/
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/Properties/AssemblyInfo.cs
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon.sln
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon.suo
trunk/plugins/My Hexxagon/hexxagon.jpg
trunk/plugins/My Hexxagon/readme.txt
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx01.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx01.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx01F.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx01F.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx02.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx02.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx02F.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx02F.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx03.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx03.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx03F.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx03F.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx04.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx04.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx04F.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx04F.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx05.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx05.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx05F.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx05F.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx06.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx06.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx06F.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx06F.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx07.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx07.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx07F.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx07F.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/hover_my hexxagon.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/hover_my hexxagon.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/MyHexxagon.xml
===================================================================
--- trunk/plugins/My Hexxagon/Skin/SimpleMP/MyHexxagon.xml (rev 0)
+++ trunk/plugins/My Hexxagon/Skin/SimpleMP/MyHexxagon.xml 2007-04-10 11:58:17 UTC (rev 310)
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<window>
+ <id>1234711</id>
+ <defaultcontrol>2</defaultcontrol>
+ <allowoverlay>yes</allowoverlay>
+ <autohidetopbar>yes</autohidetopbar>
+ <controls>
+ <import>common.time.xml</import>
+ <control>
+ <description>Hexxagon label</description>
+ <type>label</type>
+ <posX>55</posX>
+ <posY>20</posY>
+ <align>left</align>
+ <font>font48</font>
+ <label>Hexxagon</label>
+ <textcolor>20ffffff</textcolor>
+ <id>1</id>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>BackGround</description>
+ <type>image</type>
+ <id>1</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>250</posX>
+ <posY>70</posY>
+ <label>Hexxagon</label>
+ <font>font16</font>
+ <align>right</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>Start</description>
+ <type>button</type>
+ <id>2</id>
+ <posX>60</posX>
+ <posY>97</posY>
+ <label>Start</label>
+ <onleft>2</onleft>
+ <onright>22</onright>
+ <onup>4</onup>
+ <ondown>3</ondown>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>Mode</description>
+ <type>button</type>
+ <id>3</id>
+ <posX>60</posX>
+ <posY>131</posY>
+ <label>Mode: Play vs Computer</label>
+ <onleft>3</onleft>
+ <onright>3</onright>
+ <onup>2</onup>
+ <ondown>4</ondown>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </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>6</ondown>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>5</id>
+ <posX>70</posX>
+ <posY>204</posY>
+ <label>#Round</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>7</id>
+ <posX>70</posX>
+ <posY>238</posY>
+ <label>#Player</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>Whatsthis</description>
+ <type>button</type>
+ <id>6</id>
+ <posX>60</posX>
+ <posY>267</posY>
+ <label>What's this?</label>
+ <onleft>6</onleft>
+ <onright>6</onright>
+ <onup>3</onup>
+ <ondown>2</ondown>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>12</id>
+ <posX>70</posX>
+ <posY>310</posY>
+ <label>#Ply1.Count</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ff000000</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>13</id>
+ <posX>70</posX>
+ <posY>340</posY>
+ <label>#Ply2.Count</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>progress bar</description>
+ <type>progress</type>
+ <id>8</id>
+ <posX>100</posX>
+ <posY>310</posY>
+ <width>180</width>
+ <label>#Ply1.Percentage</label>
+ <visible>yes</visible>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>progress bar</description>
+ <type>progress</type>
+ <id>9</id>
+ <posX>100</posX>
+ <posY>340</posY>
+ <width>180</width>
+ <label>#Ply2.Percentage</label>
+ <visible>yes</visible>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ </controls>
+</window>
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxDouble.wav
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxDouble.wav
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxMove.wav
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxMove.wav
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxSelect.wav
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxSelect.wav
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxZap.wav
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Sounds/HexxZap.wav
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.cs
===================================================================
--- trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.cs (rev 0)
+++ trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.cs 2007-04-10 11:58:17 UTC (rev 310)
@@ -0,0 +1,842 @@
+#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.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+using MediaPortal.GUI.Library;
+using MediaPortal.Dialogs;
+using MediaPortal.Util;
+
+namespace MediaPortal.GUI.MyHexxagon
+{
+ public class MyHexxagonGUI : GUIWindow, ISetupForm
+ {
+ #region SkinControl
+ [SkinControlAttribute(2)]
+ protected GUIButtonControl BtnStart = null;
+ [SkinControlAttribute(3)]
+ protected GUIButtonControl BtnMode = null;
+ [SkinControlAttribute(4)]
+ protected GUIButtonControl BtnLevel = null;
+ [SkinControlAttribute(6)]
+ protected GUIButtonControl BtnWhatsThis = null;
+
+ #endregion
+
+ #region Private variables
+
+ int ActPly = 0; // actual player
+ string Mode = "1p"; // one player
+ string Level = "Am"; // Choosen level
+
+ int player = 4; // constant player
+ int computer = 6; // constant computer
+
+ int wait = 0; // init wait timer for computer
+
+ // init board
+ int[] board = {0,0,0,0,0,0,0,0,0,0, // 0-9
+ 0,0,0,0,0,0,0,0,0,0, //10-19
+ 0,0,1,1,1,1,1,0,0,0, //20-29
+ 0,0,1,1,1,1,1,1,0,0, //30-39
+ 0,0,1,1,1,1,1,1,1,0, //40-49
+ 0,0,1,1,1,1,0,1,1,1, //50-59
+ 0,0,1,1,1,0,1,1,1,1, //60-69
+ 1,0,0,1,1,1,1,0,1,1, //70-79
+ 1,0,0,0,1,1,1,1,1,1, //80-89
+ 1,0,0,0,0,1,1,1,1,1, //90-99
+ 1,0,0,0,0,0,1,1,1,1, //100-109
+ 1,0,0,0,0,0,0,0,0,0, //110-119
+ 0,0,0,0,0,0,0,0,0,0, //120-129
+ 0,0,0}; //130-132
+
+ // distances for moves
+ int[] MoveDouble = { 10, 11, 1, -10, -11, -1 };
+ int[] MoveJump = { 9, 20, 21, 22, 12, 2, -9, -20, -21, -22, -12, -2 };
+
+ // last selected move
+ int lastHexx = 0;
+
+ // init counter
+ int cntPly1 = 0;
+ int cntPly2 = 0;
+ int round = 1;
+
+ // some help arrays for draw the board
+ int[] Draw = { 22, 32, 42, 52, 62, 73, 84, 95, 106 };
+ int[] DrawCnt = { 5, 6, 7, 8, 9, 8, 7, 6, 5 };
+
+ // values on the baord
+ // Off Double Jump On1 On1Select On2 On2Select
+ // 1 2 3 4 5 6 7
+
+ // game ticker for the computer
+ private System.Windows.Forms.Timer _Game = new System.Windows.Forms.Timer();
+
+ #endregion
+
+ #region ISetupForm Members
+
+ // Returns the name of the plugin which is shown in the plugin menu
+ public string PluginName()
+ {
+ return "My Hexxagon";
+ }
+
+ // Returns the description of the plugin is shown in the plugin menu
+ public string Description()
+ {
+ return "My Hexxagon";
+ }
+
+ // 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 1234711;
+ }
+
+ // 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 hexxagon.png";
+ return true;
+ }
+
+ #endregion
+
+ public override int GetID
+ {
+ get
+ {
+ return 1234711;
+ }
+ set
+ {
+ base.GetID = value;
+ }
+ }
+
+ public override bool Init()
+ {
+ bool result = Load(GUIGraphicsContext.Skin + @"\MyHexxagon.xml");
+ return result;
+ }
+
+ public override bool OnMessage(GUIMessage message)
+ {
+ return base.OnMessage(message);
+ }
+
+ public void Dispose()
+ {
+ _Game.Stop();
+ _Game.Tick -= new EventHandler(_Game_Tick);
+ }
+
+ protected override void OnPageLoad()
+ {
+ // start game ticker
+ _Game.Interval = 100;
+ _Game.Tick += new EventHandler(_Game_Tick);
+ _Game.Start();
+
+ base.OnPageLoad();
+
+ // get position from the start button
+ int StartX = GetControl(BtnStart.GetID).XPosition;
+ int StartY = GetControl(BtnStart.GetID).YPosition;
+ int Width = GetControl(BtnStart.GetID).Width;
+
+ // calc the position of the hexxagon
+ StartX = StartX + Width + 10;
+ StartY = StartY + 100;
+
+ // draw buttons
+ for (int j = 0; j < 9; j++)
+ {
+ for (int i = 0; i < DrawCnt[j]; i++)
+ {
+
+ int Nr = Draw[j] + i;
+ int XPos = StartX + (j * 45);
+ int YPos = 0;
+
+ if (j < 5)
+ YPos = StartY + (i * 37) - (19 * j);
+
+ if (j > 4)
+ YPos = StartY + (i * 37) - (19 * (8 - j));
+
+ CreateButton(Nr, XPos, YPos, 40, 60, "#F" + Nr, "#NF" + Nr);
+
+ //default navigation
+ int up = Nr - 1;
+ int dn = Nr + 1;
+ int le = Nr - 10;
+ int ri = Nr + 10;
+
+ //make it easier to navigate
+ if (j == 0 || j == 2 || j == 4 || j == 6 || j == 8)
+ {
+ le = Nr - 11;
+ ri = Nr + 11;
+ }
+ //block to top
+ if (i == 0)
+ up = Nr;
+ //block to bottom
+ if (i == (DrawCnt[j]-1))
+ dn = Nr;
+ //goto to start on left side
+ if (j == 0)
+ le = 2;
+ //block to right
+ if (j == 8)
+ ri = Nr;
+ // some exeption top row
+ if (i==0)
+ {
+ if (j == 2 || j == 4)
+ {
+ le = Nr - 10;
+ }
+ if (j == 5 || j==7)
+ {
+ ri = Nr + 11 ;
+ }
+ }
+ // some exeption bottom row
+ if ((i==5 && j==1) || (i==7 && j==3))
+ le = Nr - 11;
+ if ((i==8 && j==4) || (i==6 && j==6))
+ ri = Nr + 10;
+
+ //SetNavigation(U, D, L, R)
+ GetControl(Nr).SetNavigation(up, dn, le, ri);
+
+ }
+ }
+
+ // Disable some buttons
+ GUIControl.DisableControl(GetID, 56);
+ GUIControl.DisableControl(GetID, 65);
+ GUIControl.DisableControl(GetID, 77);
+
+ // Draw field
+ UpdateBoard();
+ }
+
+ 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 == BtnWhatsThis)
+ OnBtnWhatsThis();
+ if (control == BtnStart)
+ {
+ ActPly = 4; // Player 1 starts
+ round = 1; // reset round counter
+
+ // clear board
+ for (int i = 22; i < 111; i++)
+ {
+ if (board[i] > 1)
+ board[i] = 1;
+ }
+
+ // Set first tokens
+ board[22] = 4;
+ board[70] = 4;
+ board[106] = 4;
+ board[26] = 6;
+ board[62] = 6;
+ board[110] = 6;
+
+ // reset score
+ cntPly1 = 3;
+ cntPly2 = 3;
+
+ // draw field
+ UpdateBoard();
+
+ }
+ if (control == BtnLevel)
+ OnBtnLevel();
+ if (control == BtnMode )
+ OnBtnMode();
+
+ // check if some has clicked
+ if (board[controlId] == ActPly)
+ {
+ if (ActPly == 4 || (ActPly == 6 && Mode=="2p"))
+ Select(ActPly, controlId);
+ }
+ if (board[controlId] == 2 || board[controlId] == 3)
+ Move(ActPly, controlId);
+ }
+
+ protected override void OnShowContextMenu()
+ {
+ base.OnShowContextMenu();
+ }
+
+ private void CreateButton(int ID, int posx, int posy, int height, int width, string focusimg, string nofocusimg)
+ {
+ GUIButtonControl button = new GUIButtonControl(GetID, ID, posx, posy, width, height, focusimg, nofocusimg);
+ button.AllocResources();
+ GUIControl btnControl = (GUIControl)button;
+ Add(ref btnControl);
+ }
+
+ void _Game_Tick(object sender, EventArgs e)
+ {
+ // wait some time
+ if (wait > 0)
+ wait = wait - 1;
+
+ if (wait == 0 && ActPly == computer)
+ {
+ if (Mode=="1p")
+ // move the computer
+ CompSelect();
+ }
+ }
+
+ private void UpdateBoard()
+ {
+ // draw the board
+ for (int i = 22; i < 111; i++)
+ {
+ if (board[i] == 1)
+ {
+ GUIPropertyManager.SetProperty("#F" + i, @"\Hexxagon\MyHexx01F.png");
+ GUIPropertyManager.SetProperty("#NF" + i, @"\Hexxagon\MyHexx01.png");
+ }
+ if (board[i] == 2)
+ {
+ GUIPropertyManager.SetProperty("#F" + i, @"\Hexxagon\MyHexx02F.png");
+ GUIPropertyManager.SetProperty("#NF" + i, @"\Hexxagon\MyHexx02.png");
+ }
+ if (board[i] == 3)
+ {
+ GUIPropertyManager.SetProperty("#F" + i, @"\Hexxagon\MyHexx03F.png");
+ GUIPropertyManager.SetProperty("#NF" + i, @"\Hexxagon\MyHexx03.png");
+ }
+ if (board[i] == 4)
+ {
+ GUIPropertyManager.SetProperty("#F" + i, @"\Hexxagon\MyHexx04F.png");
+ GUIPropertyManager.SetProperty("#NF" + i, @"\Hexxagon\MyHexx04.png");
+ }
+ if (board[i] == 5)
+ {
+ GUIPropertyManager.SetProperty("#F" + i, @"\Hexxagon\MyHexx05F.png");
+ GUIPropertyManager.SetProperty("#NF" + i, @"\Hexxagon\MyHexx05.png");
+ }
+ if (board[i] == 6)
+ {...
[truncated message content] |
|
From: <kro...@us...> - 2007-05-24 20:05:21
|
Revision: 429
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=429&view=rev
Author: kroko_koenig
Date: 2007-05-24 13:05:15 -0700 (Thu, 24 May 2007)
Log Message:
-----------
Update to version 0.3
Modified Paths:
--------------
trunk/plugins/My Hexxagon/Skin/SimpleMP/MyHexxagon.xml
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.cs
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.csproj
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/Properties/AssemblyInfo.cs
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon.suo
trunk/plugins/My Hexxagon/hexxagon.jpg
trunk/plugins/My Hexxagon/readme.txt
Added Paths:
-----------
trunk/plugins/My Hexxagon/HexLayout.txt
trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx0X.png
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.csproj.user
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/hexxagon.png
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/hexxagonDisabled.png
Removed Paths:
-------------
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.xml
Added: trunk/plugins/My Hexxagon/HexLayout.txt
===================================================================
--- trunk/plugins/My Hexxagon/HexLayout.txt (rev 0)
+++ trunk/plugins/My Hexxagon/HexLayout.txt 2007-05-24 20:05:15 UTC (rev 429)
@@ -0,0 +1,15 @@
+ 62
+ 52 73
+ 42 84
+ 32 95
+22 106
+
+ 65
+ 56 77
+
+
+26 110
+ 37 100
+ 48 90
+ 59 80
+ 70
\ No newline at end of file
Added: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx0X.png
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/My Hexxagon/Skin/SimpleMP/Media/Hexxagon/MyHexx0X.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/plugins/My Hexxagon/Skin/SimpleMP/MyHexxagon.xml
===================================================================
--- trunk/plugins/My Hexxagon/Skin/SimpleMP/MyHexxagon.xml 2007-05-24 19:27:07 UTC (rev 428)
+++ trunk/plugins/My Hexxagon/Skin/SimpleMP/MyHexxagon.xml 2007-05-24 20:05:15 UTC (rev 429)
@@ -51,7 +51,35 @@
<label>Start</label>
<onleft>2</onleft>
<onright>22</onright>
- <onup>4</onup>
+ <onup>6</onup>
+ <ondown>15</ondown>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>Board</description>
+ <type>button</type>
+ <id>15</id>
+ <posX>60</posX>
+ <posY>131</posY>
+ <label>Board: 1</label>
+ <onleft>15</onleft>
+ <onright>22</onright>
+ <onup>2</onup>
+ <ondown>10</ondown>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>Undo</description>
+ <type>button</type>
+ <id>10</id>
+ <posX>60</posX>
+ <posY>165</posY>
+ <label>Undo</label>
+ <onleft>2</onleft>
+ <onright>22</onright>
+ <onup>15</onup>
<ondown>3</ondown>
<animation effect="fade" time="150">WindowOpen</animation>
<animation effect="fade" time="150">WindowClose</animation>
@@ -61,11 +89,11 @@
<type>button</type>
<id>3</id>
<posX>60</posX>
- <posY>131</posY>
+ <posY>199</posY>
<label>Mode: Play vs Computer</label>
<onleft>3</onleft>
<onright>3</onright>
- <onup>2</onup>
+ <onup>10</onup>
<ondown>4</ondown>
<animation effect="fade" time="150">WindowOpen</animation>
<animation effect="fade" time="150">WindowClose</animation>
@@ -75,7 +103,7 @@
<type>button</type>
<id>4</id>
<posX>60</posX>
- <posY>165</posY>
+ <posY>233</posY>
<label>Level: Amateur</label>
<onleft>4</onleft>
<onright>4</onright>
@@ -89,7 +117,7 @@
<type>label</type>
<id>5</id>
<posX>70</posX>
- <posY>204</posY>
+ <posY>272</posY>
<label>#Round</label>
<font>font12</font>
<align>Left</align>
@@ -102,7 +130,7 @@
<type>label</type>
<id>7</id>
<posX>70</posX>
- <posY>238</posY>
+ <posY>306</posY>
<label>#Player</label>
<font>font12</font>
<align>Left</align>
@@ -115,7 +143,7 @@
<type>button</type>
<id>6</id>
<posX>60</posX>
- <posY>267</posY>
+ <posY>335</posY>
<label>What's this?</label>
<onleft>6</onleft>
<onright>6</onright>
@@ -124,13 +152,13 @@
<animation effect="fade" time="150">WindowOpen</animation>
<animation effect="fade" time="150">WindowClose</animation>
</control>
-
+
<control>
<description>text label</description>
<type>label</type>
<id>12</id>
<posX>70</posX>
- <posY>310</posY>
+ <posY>394</posY>
<label>#Ply1.Count</label>
<font>font12</font>
<align>Left</align>
@@ -143,7 +171,7 @@
<type>label</type>
<id>13</id>
<posX>70</posX>
- <posY>340</posY>
+ <posY>424</posY>
<label>#Ply2.Count</label>
<font>font12</font>
<align>Left</align>
@@ -156,7 +184,7 @@
<type>progress</type>
<id>8</id>
<posX>100</posX>
- <posY>310</posY>
+ <posY>394</posY>
<width>180</width>
<label>#Ply1.Percentage</label>
<visible>yes</visible>
@@ -168,12 +196,35 @@
<type>progress</type>
<id>9</id>
<posX>100</posX>
- <posY>340</posY>
+ <posY>424</posY>
<width>180</width>
<label>#Ply2.Percentage</label>
<visible>yes</visible>
<animation effect="fade" time="150">WindowOpen</animation>
<animation effect="fade" time="150">WindowClose</animation>
</control>
+ <control>
+ <description>hidden hex</description>
+ <type>image</type>
+ <id>198</id>
+ <posX>270</posX>
+ <posY>220</posY>
+ <width>40</width>
+ <height>60</height>
+ <texture>\Hexxagon\MyHexx01.png</texture>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>14</id>
+ <posX>70</posX>
+ <posY>458</posY>
+ <label>#Time</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
</controls>
</window>
Modified: trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.cs
===================================================================
--- trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.cs 2007-05-24 19:27:07 UTC (rev 428)
+++ trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.cs 2007-05-24 20:05:15 UTC (rev 429)
@@ -30,9 +30,11 @@
using MediaPortal.GUI.Library;
using MediaPortal.Dialogs;
using MediaPortal.Util;
+using MediaPortal.Configuration;
namespace MediaPortal.GUI.MyHexxagon
{
+ [PluginIcons("MyHexxagon.hexxagon.png", "MyHexxagon.hexxagonDisabled.png")]
public class MyHexxagonGUI : GUIWindow, ISetupForm
{
#region SkinControl
@@ -44,6 +46,10 @@
protected GUIButtonControl BtnLevel = null;
[SkinControlAttribute(6)]
protected GUIButtonControl BtnWhatsThis = null;
+ [SkinControlAttribute(10)]
+ protected GUIButtonControl BtnUndo = null;
+ [SkinControlAttribute(15)]
+ protected GUIButtonControl BtnBoard = null;
#endregion
@@ -58,15 +64,20 @@
int wait = 0; // init wait timer for computer
+ int time = 0; // timer for game
+ int boardNo = 1; // default board
+
+ int[] time_rec = { 999, 999, 999, 999, 999 };
+
// init board
int[] board = {0,0,0,0,0,0,0,0,0,0, // 0-9
0,0,0,0,0,0,0,0,0,0, //10-19
0,0,1,1,1,1,1,0,0,0, //20-29
0,0,1,1,1,1,1,1,0,0, //30-39
0,0,1,1,1,1,1,1,1,0, //40-49
- 0,0,1,1,1,1,0,1,1,1, //50-59
- 0,0,1,1,1,0,1,1,1,1, //60-69
- 1,0,0,1,1,1,1,0,1,1, //70-79
+ 0,0,1,1,1,1,1,1,1,1, //50-59
+ 0,0,1,1,1,1,1,1,1,1, //60-69
+ 1,0,0,1,1,1,1,1,1,1, //70-79
1,0,0,0,1,1,1,1,1,1, //80-89
1,0,0,0,0,1,1,1,1,1, //90-99
1,0,0,0,0,0,1,1,1,1, //100-109
@@ -74,6 +85,9 @@
0,0,0,0,0,0,0,0,0,0, //120-129
0,0,0}; //130-132
+ int[,] rem_board = new int [80,140];
+ bool initBoard = false;
+
// distances for moves
int[] MoveDouble = { 10, 11, 1, -10, -11, -1 };
int[] MoveJump = { 9, 20, 21, 22, 12, 2, -9, -20, -21, -22, -12, -2 };
@@ -94,6 +108,11 @@
// Off Double Jump On1 On1Select On2 On2Select
// 1 2 3 4 5 6 7
+ private int[] ani01 = { 0, 0, 0, 0, 0, 0, 0, 0 };
+ // possible moves 0-5, player 6 , cnt 7
+ private int[] ani02 = { 0, 0 , 0};
+ // last move, player, counter
+
// game ticker for the computer
private System.Windows.Forms.Timer _Game = new System.Windows.Forms.Timer();
@@ -203,94 +222,107 @@
protected override void OnPageLoad()
{
+
// start game ticker
_Game.Interval = 100;
_Game.Tick += new EventHandler(_Game_Tick);
- _Game.Start();
+ _Game.Start();
base.OnPageLoad();
// get position from the start button
- int StartX = GetControl(BtnStart.GetID).XPosition;
- int StartY = GetControl(BtnStart.GetID).YPosition;
- int Width = GetControl(BtnStart.GetID).Width;
+ int StartX = GetControl(198).XPosition;
+ int StartY = GetControl(198).YPosition;
+ // Disable level control
+ GUIControl.HideControl(GetID, 198);
- // calc the position of the hexxagon
- StartX = StartX + Width + 10;
- StartY = StartY + 100;
+ try
+ {
+ int StartT = GetControl(22).XPosition;
+ }
+ catch
+ {
+ initBoard = false;
+ }
- // draw buttons
- for (int j = 0; j < 9; j++)
+ if (initBoard == false)
{
- for (int i = 0; i < DrawCnt[j]; i++)
+ initBoard = true;
+ // draw buttons
+ for (int j = 0; j < 9; j++)
{
+ for (int i = 0; i < DrawCnt[j]; i++)
+ {
- int Nr = Draw[j] + i;
- int XPos = StartX + (j * 45);
- int YPos = 0;
+ int Nr = Draw[j] + i;
+ int XPos = StartX + (j * 45);
+ int YPos = 0;
- if (j < 5)
- YPos = StartY + (i * 37) - (19 * j);
+ if (j < 5)
+ YPos = StartY + (i * 37) - (19 * j);
- if (j > 4)
- YPos = StartY + (i * 37) - (19 * (8 - j));
+ if (j > 4)
+ YPos = StartY + (i * 37) - (19 * (8 - j));
- CreateButton(Nr, XPos, YPos, 40, 60, "#F" + Nr, "#NF" + Nr);
+ CreateButton(Nr, XPos, YPos, 40, 60, "#F" + Nr, "#NF" + Nr);
- //default navigation
- int up = Nr - 1;
- int dn = Nr + 1;
- int le = Nr - 10;
- int ri = Nr + 10;
+ //default navigation
+ int up = Nr - 1;
+ int dn = Nr + 1;
+ int le = Nr - 10;
+ int ri = Nr + 10;
- //make it easier to navigate
- if (j == 0 || j == 2 || j == 4 || j == 6 || j == 8)
- {
- le = Nr - 11;
- ri = Nr + 11;
- }
- //block to top
- if (i == 0)
- up = Nr;
- //block to bottom
- if (i == (DrawCnt[j]-1))
- dn = Nr;
- //goto to start on left side
- if (j == 0)
- le = 2;
- //block to right
- if (j == 8)
- ri = Nr;
- // some exeption top row
- if (i==0)
- {
- if (j == 2 || j == 4)
+ //make it easier to navigate
+ if (j == 0 || j == 2 || j == 4 || j == 6 || j == 8)
{
- le = Nr - 10;
+ le = Nr - 11;
+ ri = Nr + 11;
}
- if (j == 5 || j==7)
+ //block to top
+ if (i == 0)
+ up = Nr;
+ //block to bottom
+ if (i == (DrawCnt[j] - 1))
+ dn = Nr;
+ //goto to start on left side
+ if (j == 0)
+ le = 2;
+ //block to right
+ if (j == 8)
+ ri = Nr;
+ // some exeption top row
+ if (i == 0)
{
- ri = Nr + 11 ;
+ if (j == 2 || j == 4)
+ {
+ le = Nr - 10;
+ }
+ if (j == 5 || j == 7)
+ {
+ ri = Nr + 11;
+ }
}
+ // some exeption bottom row
+ if ((i == 5 && j == 1) || (i == 7 && j == 3))
+ le = Nr - 11;
+ if ((i == 8 && j == 4) || (i == 6 && j == 6))
+ ri = Nr + 10;
+
+ //SetNavigation(U, D, L, R)
+ GetControl(Nr).SetNavigation(up, dn, le, ri);
+
}
- // some exeption bottom row
- if ((i==5 && j==1) || (i==7 && j==3))
- le = Nr - 11;
- if ((i==8 && j==4) || (i==6 && j==6))
- ri = Nr + 10;
-
- //SetNavigation(U, D, L, R)
- GetControl(Nr).SetNavigation(up, dn, le, ri);
-
}
}
+
- // Disable some buttons
- GUIControl.DisableControl(GetID, 56);
- GUIControl.DisableControl(GetID, 65);
- GUIControl.DisableControl(GetID, 77);
+ // Disable level control
+ GUIControl.DisableControl(GetID, 4);
// Draw field
+ ResetBoard();
+ SetLevel();
+ Count();
UpdateBoard();
}
@@ -304,33 +336,30 @@
{
if (control == BtnWhatsThis)
OnBtnWhatsThis();
+ if (control == BtnUndo)
+ OnBtnUndo();
+ if (control == BtnBoard)
+ OnBtnBoard();
if (control == BtnStart)
{
ActPly = 4; // Player 1 starts
round = 1; // reset round counter
- // clear board
- for (int i = 22; i < 111; i++)
- {
- if (board[i] > 1)
- board[i] = 1;
- }
+ time = 0;
- // Set first tokens
- board[22] = 4;
- board[70] = 4;
- board[106] = 4;
- board[26] = 6;
- board[62] = 6;
- board[110] = 6;
+ ResetBoard();
+ SetLevel();
- // reset score
- cntPly1 = 3;
- cntPly2 = 3;
+ Count();
+ for (int i = 0; i < 133; i++)
+ {
+ rem_board[0,i] = board [i];
+ }
+
// draw field
UpdateBoard();
-
+
}
if (control == BtnLevel)
OnBtnLevel();
@@ -340,8 +369,10 @@
// check if some has clicked
if (board[controlId] == ActPly)
{
- if (ActPly == 4 || (ActPly == 6 && Mode=="2p"))
- Select(ActPly, controlId);
+ if (ActPly == 4 || (ActPly == 6 && Mode == "2p"))
+ {
+ Select(ActPly, controlId);
+ }
}
if (board[controlId] == 2 || board[controlId] == 3)
Move(ActPly, controlId);
@@ -362,6 +393,25 @@
void _Game_Tick(object sender, EventArgs e)
{
+
+ if ((ActPly > 0) && (round>1))
+ time++;
+ if (round <=1)
+ time = 0;
+
+
+ GUIPropertyManager.SetProperty("#Time", "Time: " + (time/10).ToString() + "s");
+
+
+ if ((round > 1) && (ActPly!=0))
+ {
+ GUIControl.EnableControl(GetID, 10); // Undo
+ }
+ else
+ {
+ GUIControl.DisableControl(GetID, 10); // Undo
+ }
+
// wait some time
if (wait > 0)
wait = wait - 1;
@@ -372,6 +422,69 @@
// move the computer
CompSelect();
}
+
+ // ------------------------------------------------
+ // animation 01
+
+ if ((ani01[0] != 0) && (ani01[7] > 0))
+ {
+ int tmp;
+ // select different color
+ if (board[ani01[0]]== player)
+ {
+ tmp = computer;
+ }
+ else
+ {
+ tmp = player;
+ }
+
+ // last animation
+ if (ani01[7] == 1)
+ {
+ tmp = ani01[06];
+ }
+
+ // set board take over
+ for (int i = 0; i < 6; i++)
+ {
+ if (board[ani01[i]] != 0)
+ {
+ board[ani01[i]] = tmp;
+ }
+ }
+ UpdateBoard();
+ ani01[7]--;
+ }
+ // ------------------------------------------------
+ // animation 02
+
+ if ((ani02[0] != 0) && (ani02[2] > 0))
+ {
+ int tmp;
+ // select different
+ if (board[ani02[0]] != 1)
+ {
+ tmp = 1;
+ }
+ else
+ {
+ tmp = ani02[1];
+ }
+
+ // last animation
+ if (ani02[2] == 1)
+ {
+ tmp = ani02[01];
+ }
+
+ board[ani02[0]] = tmp;
+
+ UpdateBoard();
+ ani02[2]--;
+
+ }
+
}
private void UpdateBoard()
@@ -414,6 +527,11 @@
GUIPropertyManager.SetProperty("#F" + i, @"\Hexxagon\MyHexx07F.png");
GUIPropertyManager.SetProperty("#NF" + i, @"\Hexxagon\MyHexx07.png");
}
+ if (board[i] == 10)
+ {
+ GUIPropertyManager.SetProperty("#F" + i, @"\Hexxagon\MyHexx0X.png");
+ GUIPropertyManager.SetProperty("#NF" + i, @"\Hexxagon\MyHexx0X.png");
+ }
if (ActPly == 4)
GUIPropertyManager.SetProperty("#Player", "Player 1");
if (ActPly == 6)
@@ -431,7 +549,7 @@
GUIPropertyManager.SetProperty("#Ply1.Percentage", p1.ToString());
GUIPropertyManager.SetProperty("#Ply2.Percentage", p2.ToString());
- GUIPropertyManager.SetProperty("#Round", "Round: " + round);
+ GUIPropertyManager.SetProperty("#Round", "Round: " + round.ToString());
}
}
@@ -481,6 +599,11 @@
{
// double
board[pos] = ply;
+
+ ani02[0] = pos;
+ ani02[1] = ply;
+ ani02[2] = 10;
+
Check(ply, pos);
MediaPortal.Util.Utils.PlaySound("HexxDouble.wav", false, true);
}
@@ -489,6 +612,11 @@
// jump
board[lastHexx] = 1;
board[pos] = ply;
+
+ ani02[0] = pos;
+ ani02[1] = ply;
+ ani02[2] = 10;
+
Check(ply, pos);
MediaPortal.Util.Utils.PlaySound("HexxMove.wav", false, true);
}
@@ -515,7 +643,14 @@
private void Check(int ply, int pos)
{
- bool signal = false;
+ int cnt = 0;
+ // reset ani
+ for (int i = 0; i < 6; i++)
+ {
+ ani01[i] = 0;
+ }
+ // remember player
+ ani01[6] = ply;
// after move turn arround all surrounding tokens
for (int i = 0; i < 6; i++)
@@ -525,8 +660,12 @@
if (board[pos + MoveDouble[i]] == next)
{
+ //SetFlowDirection board
board[pos + MoveDouble[i]] = ply;
- signal = true;
+ // set values for animation
+ ani01[7] = 10; // counter for animation
+ ani01[cnt]=pos + MoveDouble[i];
+ cnt++;
}
}
}
@@ -537,12 +676,18 @@
{
ActPly = 6;
wait = 25;
- //CompSelect();
}
else
{
ActPly = 4;
+
+ for (int i = 0; i < 133; i++)
+ {
+ rem_board[round, i] = board[i];
+ }
+
round = round + 1;
+
}
// check if there is a move left
NoMove(ActPly);
@@ -595,17 +740,7 @@
}
}
- // set counter to 0
- cntPly1 = 0;
- cntPly2 = 0;
- //count all fields
- for (int j = 22; j < 111; j++)
- {
- if (board[j] == 4 || board[j] == 5)
- cntPly1 = cntPly1 + 1;
- if (board[j] == 6 || board[j] == 7)
- cntPly2 = cntPly2 + 1;
- }
+ Count();
UpdateBoard();
// set message for game over
@@ -733,6 +868,11 @@
// Count attacks for each move
attackCount++;
}
+ if (board[tryDest + MoveDouble[k]] == 1)
+ {
+ // Count attacks for each move
+ attackCount = attackCount + 0.1;
+ }
}
}
if (attackCount>=highestRanking)
@@ -781,8 +921,9 @@
"board games of strategy, loosely based upon\n" +
"Othello and Attaxx!. The original version was\n" +
"written in 1992 by Argo Games, and has been\n" +
- "updated for the web by Neave. Finally I updated\n" +
- "it for th MP.\n\n" +
+ "updated for the web by Neave.\n" +
+ "http://www.neave.com/games/\n\n" +
+ "Finally I updated it for the MP\n\n" +
"Game board design by Mikael S\xF6derstr\xF6m\n\n" +
"YOUR AIM: To take over the world! You can\n" +
"choose to play against the computer, or\n" +
@@ -790,12 +931,13 @@
"two types of move, a jump or double, indicated\n" +
"hexxagon occupied by an opponent's piece will\n" +
"transform them into yours.\n\n" +
- "Good luck\nkroko");
+ "Good luck\nMark Koenig (kroko)");
dlg.DoModal(GetID);
}
private void OnBtnLevel()
{ //Choose level for the game
+
if (ActPly == 0 || (round==1 && ActPly == player ))
{
if (Level == "Nor")
@@ -825,18 +967,278 @@
GUIControl.SetControlLabel(GetID, BtnMode.GetID, "Mode: Play vs Computer");
Mode = "1p";
// Enable level selection
- GUIControl.EnableControl(GetID, 4);
+ //GUIControl.EnableControl(GetID, 4);
}
else
{
GUIControl.SetControlLabel(GetID, BtnMode.GetID, "Mode: Play vs Player");
Mode = "2p";
// Disable level selection
- GUIControl.DisableControl(GetID, 4);
+ //GUIControl.DisableControl(GetID, 4);
}
}
}
+ private void OnBtnBoard()
+ { //Choose mode for the game
+ if (ActPly == 0 || (round == 1 && ActPly == player))
+ {
+ switch (boardNo)
+ {
+ case 1:
+ boardNo = 2;
+ break;
+ case 2:
+ boardNo = 3;
+ break;
+ case 3:
+ boardNo = 4;
+ break;
+ case 4:
+ boardNo = 5;
+ break;
+ case 5:
+ boardNo = 1;
+ break;
+ }
+ GUIControl.SetControlLabel(GetID, BtnBoard.GetID, "Board: " + boardNo.ToString());
+
+ ResetBoard();
+ SetLevel();
+ Count();
+ UpdateBoard();
+
+ }
+ }
+
+ private void OnBtnUndo()
+ {
+ if (round > 1)
+ {
+ for (int i = 0; i < 133; i++)
+ {
+ board[i] = rem_board[round - 2, i];
+ }
+ round = round - 1;
+ ActPly = player;
+ Count();
+ UpdateBoard();
+ }
+ }
+
+ private void Count()
+ {
+ // set counter to 0
+ cntPly1 = 0;
+ cntPly2 = 0;
+ //count all fields
+ for (int j = 22; j < 111; j++)
+ {
+ if (board[j] == 4 || board[j] == 5)
+ cntPly1 = cntPly1 + 1;
+ if (board[j] == 6 || board[j] == 7)
+ cntPly2 = cntPly2 + 1;
+ }
+ }
+
+ private void ResetBoard()
+ {
+ for (int i = 22; i <= 26; i++)
+ {
+ board[i] = 1;
+ GUIControl.EnableControl(GetID, i);
+ }
+ for (int i = 32; i <= 37; i++)
+ {
+ board[i] = 1;
+ GUIControl.EnableControl(GetID, i);
+ }
+ for (int i = 42; i <= 48; i++)
+ {
+ board[i] = 1;
+ GUIControl.EnableControl(GetID, i);
+ }
+ for (int i = 52; i <= 59; i++)
+ {
+ board[i] = 1;
+ GUIControl.EnableControl(GetID, i);
+ }
+ for (int i = 62; i <= 70; i++)
+ {
+ board[i] = 1;
+ GUIControl.EnableControl(GetID, i);
+ }
+ for (int i = 73; i <= 80; i++)
+ {
+ board[i] = 1;
+ GUIControl.EnableControl(GetID, i);
+ }
+ for (int i = 84; i <= 90; i++)
+ {
+ board[i] = 1;
+ GUIControl.EnableControl(GetID, i);
+ }
+ for (int i = 95; i <= 100; i++)
+ {
+ board[i] = 1;
+ GUIControl.EnableControl(GetID, i);
+ }
+ for (int i = 106; i <= 110; i++)
+ {
+ board[i] = 1;
+ GUIControl.EnableControl(GetID, i);...
[truncated message content] |
|
From: <che...@us...> - 2007-05-27 01:20:02
|
Revision: 458
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=458&view=rev
Author: chef_koch
Date: 2007-05-26 18:20:00 -0700 (Sat, 26 May 2007)
Log Message:
-----------
added option to enable/disabled sound effects
Modified Paths:
--------------
trunk/plugins/My Hexxagon/Skin/SimpleMP/MyHexxagon.xml
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.cs
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.csproj
Added Paths:
-----------
trunk/plugins/My Hexxagon/Skin/BlueTwo/MyHexxagon.xml
trunk/plugins/My Hexxagon/language/
trunk/plugins/My Hexxagon/language/MyHexxagon/
trunk/plugins/My Hexxagon/language/MyHexxagon/strings_de.xml
trunk/plugins/My Hexxagon/language/MyHexxagon/strings_en.xml
Added: trunk/plugins/My Hexxagon/Skin/BlueTwo/MyHexxagon.xml
===================================================================
--- trunk/plugins/My Hexxagon/Skin/BlueTwo/MyHexxagon.xml (rev 0)
+++ trunk/plugins/My Hexxagon/Skin/BlueTwo/MyHexxagon.xml 2007-05-27 01:20:00 UTC (rev 458)
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<window>
+ <id>1234711</id>
+ <defaultcontrol>2</defaultcontrol>
+ <allowoverlay>yes</allowoverlay>
+ <autohidetopbar>yes</autohidetopbar>
+ <controls>
+ <import>common.time.xml</import>
+ <control>
+ <description>BackGround</description>
+ <type>image</type>
+ <id>1</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>1</id>
+ <posX>250</posX>
+ <posY>70</posY>
+ <label>#header_label</label>
+ <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>
+ <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>
+ <posX>60</posX>
+ <posY>97</posY>
+ <layout>StackLayout</layout>
+ <control>
+ <description>Start</description>
+ <type>button</type>
+ <id>2</id>
+ <onleft>2</onleft>
+ <onright>22</onright>
+ <onup>6</onup>
+ <ondown>15</ondown>
+ </control>
+ <control>
+ <description>Board</description>
+ <type>button</type>
+ <id>15</id>
+ <onleft>15</onleft>
+ <onright>22</onright>
+ <onup>2</onup>
+ <ondown>10</ondown>
+ </control>
+ <control>
+ <description>Undo</description>
+ <type>button</type>
+ <id>10</id>
+ <onleft>10</onleft>
+ <onright>22</onright>
+ <onup>15</onup>
+ <ondown>3</ondown>
+ </control>
+ <control>
+ <description>Mode</description>
+ <type>button</type>
+ <id>3</id>
+ <onleft>3</onleft>
+ <onright>3</onright>
+ <onup>10</onup>
+ <ondown>4</ondown>
+ </control>
+ <control>
+ <description>Level</description>
+ <type>button</type>
+ <id>4</id>
+ <onleft>4</onleft>
+ <onright>4</onright>
+ <onup>3</onup>
+ <ondown>5</ondown>
+ </control>
+ <control>
+ <description>Sounds</description>
+ <type>togglebutton</type>
+ <id>5</id>
+ <onleft>5</onleft>
+ <onright>5</onright>
+ <onup>4</onup>
+ <ondown>6</ondown>
+ </control>
+ <control>
+ <description>Round</description>
+ <type>button</type>
+ <id>1</id>
+ <label>#Round</label>
+ <font>font12</font>
+ <enabled>false</enabled>
+ <textureFocus>-</textureFocus>
+ <textureNoFocus>-</textureNoFocus>
+ </control>
+ <control>
+ <description>Player: / GameOver</description>
+ <type>button</type>
+ <id>1</id>
+ <label>#Player</label>
+ <font>font12</font>
+ <enabled>false</enabled>
+ <textureFocus>-</textureFocus>
+ <textureNoFocus>-</textureNoFocus>
+ </control>
+ <control>
+ <description>Whatsthis</description>
+ <type>button</type>
+ <id>6</id>
+ <onleft>6</onleft>
+ <onright>6</onright>
+ <onup>5</onup>
+ <ondown>2</ondown>
+ </control>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>12</id>
+ <posX>70</posX>
+ <posY>394</posY>
+ <label>#Ply1.Count</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ff000000</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>13</id>
+ <posX>70</posX>
+ <posY>424</posY>
+ <label>#Ply2.Count</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>progress bar</description>
+ <type>progress</type>
+ <id>8</id>
+ <posX>100</posX>
+ <posY>394</posY>
+ <width>180</width>
+ <label>#Ply1.Percentage</label>
+ <visible>yes</visible>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>progress bar</description>
+ <type>progress</type>
+ <id>9</id>
+ <posX>100</posX>
+ <posY>424</posY>
+ <width>180</width>
+ <label>#Ply2.Percentage</label>
+ <visible>yes</visible>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ <control>
+ <description>hidden hex</description>
+ <type>image</type>
+ <id>198</id>
+ <posX>270</posX>
+ <posY>220</posY>
+ <width>40</width>
+ <height>60</height>
+ <texture>\Hexxagon\MyHexx01.png</texture>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>14</id>
+ <posX>70</posX>
+ <posY>458</posY>
+ <label>#Time</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ </control>
+ </controls>
+</window>
Modified: trunk/plugins/My Hexxagon/Skin/SimpleMP/MyHexxagon.xml
===================================================================
--- trunk/plugins/My Hexxagon/Skin/SimpleMP/MyHexxagon.xml 2007-05-26 20:39:02 UTC (rev 457)
+++ trunk/plugins/My Hexxagon/Skin/SimpleMP/MyHexxagon.xml 2007-05-27 01:20:00 UTC (rev 458)
@@ -1,230 +1,198 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<window>
- <id>1234711</id>
- <defaultcontrol>2</defaultcontrol>
+ <id>1234711</id>
+ <defaultcontrol>2</defaultcontrol>
<allowoverlay>yes</allowoverlay>
<autohidetopbar>yes</autohidetopbar>
<controls>
- <import>common.time.xml</import>
- <control>
- <description>Hexxagon label</description>
- <type>label</type>
- <posX>55</posX>
- <posY>20</posY>
- <align>left</align>
- <font>font48</font>
- <label>Hexxagon</label>
- <textcolor>20ffffff</textcolor>
- <id>1</id>
+ <import>common.time.xml</import>
+ <control>
+ <description>BackGround</description>
+ <type>image</type>
+ <id>1</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>1</id>
+ <posX>250</posX>
+ <posY>70</posY>
+ <label>#header_label</label>
+ <font>font16</font>
+ <align>right</align>
+ <textcolor>White</textcolor>
<animation effect="fade" time="150">WindowOpen</animation>
<animation effect="fade" time="150">WindowClose</animation>
- </control>
- <control>
- <description>BackGround</description>
- <type>image</type>
- <id>1</id>
- <posX>0</posX>
- <posY>0</posY>
- <width>720</width>
- <height>576</height>
- <texture>background.png</texture>
+ </control>
+ <control>
+ <description>button group</description>
+ <type>group</type>
+ <animation effect="fade" time="150">WindowOpen</animation>
+ <animation effect="fade" time="150">WindowClose</animation>
+ <posX>60</posX>
+ <posY>97</posY>
+ <layout>StackLayout</layout>
+ <control>
+ <description>Start</description>
+ <type>button</type>
+ <id>2</id>
+ <onleft>2</onleft>
+ <onright>22</onright>
+ <onup>6</onup>
+ <ondown>15</ondown>
</control>
- <control>
- <description>text label</description>
- <type>label</type>
- <id>11</id>
- <posX>250</posX>
- <posY>70</posY>
- <label>Hexxagon</label>
- <font>font16</font>
- <align>right</align>
- <textcolor>ffffffff</textcolor>
- <animation effect="fade" time="150">WindowOpen</animation>
- <animation effect="fade" time="150">WindowClose</animation>
+ <control>
+ <description>Board</description>
+ <type>button</type>
+ <id>15</id>
+ <onleft>15</onleft>
+ <onright>22</onright>
+ <onup>2</onup>
+ <ondown>10</ondown>
</control>
- <control>
- <description>Start</description>
- <type>button</type>
- <id>2</id>
- <posX>60</posX>
- <posY>97</posY>
- <label>Start</label>
- <onleft>2</onleft>
- <onright>22</onright>
- <onup>6</onup>
- <ondown>15</ondown>
- <animation effect="fade" time="150">WindowOpen</animation>
- <animation effect="fade" time="150">WindowClose</animation>
+ <control>
+ <description>Undo</description>
+ <type>button</type>
+ <id>10</id>
+ <onleft>10</onleft>
+ <onright>22</onright>
+ <onup>15</onup>
+ <ondown>3</ondown>
</control>
- <control>
- <description>Board</description>
- <type>button</type>
- <id>15</id>
- <posX>60</posX>
- <posY>131</posY>
- <label>Board: 1</label>
- <onleft>15</onleft>
- <onright>22</onright>
- <onup>2</onup>
- <ondown>10</ondown>
- <animation effect="fade" time="150">WindowOpen</animation>
- <animation effect="fade" time="150">WindowClose</animation>
+ <control>
+ <description>Mode</description>
+ <type>button</type>
+ <id>3</id>
+ <onleft>3</onleft>
+ <onright>3</onright>
+ <onup>10</onup>
+ <ondown>4</ondown>
</control>
- <control>
- <description>Undo</description>
- <type>button</type>
- <id>10</id>
- <posX>60</posX>
- <posY>165</posY>
- <label>Undo</label>
- <onleft>2</onleft>
- <onright>22</onright>
- <onup>15</onup>
- <ondown>3</ondown>
- <animation effect="fade" time="150">WindowOpen</animation>
- <animation effect="fade" time="150">WindowClose</animation>
+ <control>
+ <description>Level</description>
+ <type>button</type>
+ <id>4</id>
+ <onleft>4</onleft>
+ <onright>4</onright>
+ <onup>3</onup>
+ <ondown>5</ondown>
</control>
- <control>
- <description>Mode</description>
- <type>button</type>
- <id>3</id>
- <posX>60</posX>
- <posY>199</posY>
- <label>Mode: Play vs Computer</label>
- <onleft>3</onleft>
- <onright>3</onright>
- <onup>10</onup>
- <ondown>4</ondown>
- <animation effect="fade" time="150">WindowOpen</animation>
- <animation effect="fade" time="150">WindowClose</animation>
- </control>
- <control>
- <description>Level</description>
- <type>button</type>
- <id>4</id>
- <posX>60</posX>
- <posY>233</posY>
- <label>Level: Amateur</label>
- <onleft>4</onleft>
- <onright>4</onright>
- <onup>3</onup>
- <ondown>6</ondown>
- <animation effect="fade" time="150">WindowOpen</animation>
- <animation effect="fade" time="150">WindowClose</animation>
+ <control>
+ <description>Sounds</description>
+ <type>togglebutton</type>
+ <id>5</id>
+ <onleft>5</onleft>
+ <onright>5</onright>
+ <onup>4</onup>
+ <ondown>6</ondown>
</control>
<control>
- <description>text label</description>
- <type>label</type>
- <id>5</id>
- <posX>70</posX>
- <posY>272</posY>
- <label>#Round</label>
- <font>font12</font>
- <align>Left</align>
- <textcolor>ffffffff</textcolor>
+ <description>Round</description>
+ <type>button</type>
+ <id>1</id>
+ <label>#Round</label>
+ <font>font12</font>
+ <enabled>false</enabled>
+ <textureFocus>-</textureFocus>
+ <textureNoFocus>-</textureNoFocus>
+ </control>
+ <control>
+ <description>Player: / GameOver</description>
+ <type>button</type>
+ <id>1</id>
+ <label>#Player</label>
+ <font>font12</font>
+ <enabled>false</enabled>
+ <textureFocus>-</textureFocus>
+ <textureNoFocus>-</textureNoFocus>
+ </control>
+ <control>
+ <description>Whatsthis</description>
+ <type>button</type>
+ <id>6</id>
+ <onleft>6</onleft>
+ <onright>6</onright>
+ <onup>5</onup>
+ <ondown>2</ondown>
+ </control>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>12</id>
+ <posX>70</posX>
+ <posY>394</posY>
+ <label>#Ply1.Count</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ff000000</textcolor>
<animation effect="fade" time="150">WindowOpen</animation>
<animation effect="fade" time="150">WindowClose</animation>
- </control>
- <control>
- <description>text label</description>
- <type>label</type>
- <id>7</id>
- <posX>70</posX>
- <posY>306</posY>
- <label>#Player</label>
- <font>font12</font>
- <align>Left</align>
- <textcolor>ffffffff</textcolor>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>13</id>
+ <posX>70</posX>
+ <posY>424</posY>
+ <label>#Ply2.Count</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
<animation effect="fade" time="150">WindowOpen</animation>
<animation effect="fade" time="150">WindowClose</animation>
- </control>
- <control>
- <description>Whatsthis</description>
- <type>button</type>
- <id>6</id>
- <posX>60</posX>
- <posY>335</posY>
- <label>What's this?</label>
- <onleft>6</onleft>
- <onright>6</onright>
- <onup>3</onup>
- <ondown>2</ondown>
+ </control>
+ <control>
+ <description>progress bar</description>
+ <type>progress</type>
+ <id>8</id>
+ <posX>100</posX>
+ <posY>394</posY>
+ <width>180</width>
+ <label>#Ply1.Percentage</label>
+ <visible>yes</visible>
<animation effect="fade" time="150">WindowOpen</animation>
<animation effect="fade" time="150">WindowClose</animation>
- </control>
-
- <control>
- <description>text label</description>
- <type>label</type>
- <id>12</id>
- <posX>70</posX>
- <posY>394</posY>
- <label>#Ply1.Count</label>
- <font>font12</font>
- <align>Left</align>
- <textcolor>ff000000</textcolor>
- <animation effect="fade" time="150">WindowOpen</animation>
- <animation effect="fade" time="150">WindowClose</animation>
- </control>
- <control>
- <description>text label</description>
- <type>label</type>
- <id>13</id>
- <posX>70</posX>
- <posY>424</posY>
- <label>#Ply2.Count</label>
- <font>font12</font>
- <align>Left</align>
- <textcolor>ffffffff</textcolor>
- <animation effect="fade" time="150">WindowOpen</animation>
- <animation effect="fade" time="150">WindowClose</animation>
- </control>
- <control>
- <description>progress bar</description>
- <type>progress</type>
- <id>8</id>
- <posX>100</posX>
- <posY>394</posY>
- <width>180</width>
- <label>#Ply1.Percentage</label>
- <visible>yes</visible>
+ </control>
+ <control>
+ <description>progress bar</description>
+ <type>progress</type>
+ <id>9</id>
+ <posX>100</posX>
+ <posY>424</posY>
+ <width>180</width>
+ <label>#Ply2.Percentage</label>
+ <visible>yes</visible>
<animation effect="fade" time="150">WindowOpen</animation>
<animation effect="fade" time="150">WindowClose</animation>
- </control>
- <control>
- <description>progress bar</description>
- <type>progress</type>
- <id>9</id>
- <posX>100</posX>
- <posY>424</posY>
- <width>180</width>
- <label>#Ply2.Percentage</label>
- <visible>yes</visible>
+ </control>
+ <control>
+ <description>hidden hex</description>
+ <type>image</type>
+ <id>198</id>
+ <posX>270</posX>
+ <posY>220</posY>
+ <width>40</width>
+ <height>60</height>
+ <texture>\Hexxagon\MyHexx01.png</texture>
+ </control>
+ <control>
+ <description>text label</description>
+ <type>label</type>
+ <id>14</id>
+ <posX>70</posX>
+ <posY>458</posY>
+ <label>#Time</label>
+ <font>font12</font>
+ <align>Left</align>
+ <textcolor>ffffffff</textcolor>
<animation effect="fade" time="150">WindowOpen</animation>
<animation effect="fade" time="150">WindowClose</animation>
- </control>
- <control>
- <description>hidden hex</description>
- <type>image</type>
- <id>198</id>
- <posX>270</posX>
- <posY>220</posY>
- <width>40</width>
- <height>60</height>
- <texture>\Hexxagon\MyHexx01.png</texture>
- </control>
- <control>
- <description>text label</description>
- <type>label</type>
- <id>14</id>
- <posX>70</posX>
- <posY>458</posY>
- <label>#Time</label>
- <font>font12</font>
- <align>Left</align>
- <textcolor>ffffffff</textcolor>
- <animation effect="fade" time="150">WindowOpen</animation>
- <animation effect="fade" time="150">WindowClose</animation>
- </control>
- </controls>
+ </control>
+ </controls>
</window>
Modified: trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.cs
===================================================================
--- trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.cs 2007-05-26 20:39:02 UTC (rev 457)
+++ trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon/MyHexxagon.cs 2007-05-27 01:20:00 UTC (rev 458)
@@ -34,43 +34,65 @@
namespace MediaPortal.GUI.MyHexxagon
{
- [PluginIcons("MyHexxagon.hexxagon.png", "MyHexxagon.hexxagonDisabled.png")]
- public class MyHexxagonGUI : GUIWindow, ISetupForm
+ [PluginIcons("MyHexxagon.hexxagon.png", "MyHexxagon.hexxagonDisabled.png")]
+ public class MyHexxagonGUI : GUIWindow, ISetupForm
+ {
+ #region enums
+
+ private enum Level
{
- #region SkinControl
- [SkinControlAttribute(2)]
- protected GUIButtonControl BtnStart = null;
- [SkinControlAttribute(3)]
- protected GUIButtonControl BtnMode = null;
- [SkinControlAttribute(4)]
- protected GUIButtonControl BtnLevel = null;
- [SkinControlAttribute(6)]
- protected GUIButtonControl BtnWhatsThis = null;
- [SkinControlAttribute(10)]
- protected GUIButtonControl BtnUndo = null;
- [SkinControlAttribute(15)]
- protected GUIButtonControl BtnBoard = null;
+ Easy = 0,
+ Medium = 1,
+ Hard = 2
+ }
- #endregion
+ private enum Mode
+ {
+ PlayerVsComputer = 0,
+ PlayerVsPlayer = 1
+ }
- #region Private variables
+ #endregion
- int ActPly = 0; // actual player
- string Mode = "1p"; // one player
- string Level = "Am"; // Choosen level
+ #region SkinControl
- int player = 4; // constant player
- int computer = 6; // constant computer
+ [SkinControlAttribute(2)]
+ protected GUIButtonControl btnStart = null;
+ [SkinControlAttribute(3)]
+ protected GUIButtonControl btnMode = null;
+ [SkinControlAttribute(4)]
+ protected GUIButtonControl btnLevel = null;
+ [SkinControlAttribute(5)]
+ protected GUIToggleButtonControl btnSound = null;
+ [SkinControlAttribute(6)]
+ protected GUIButtonControl btnWhatsThis = null;
+ [SkinControlAttribute(10)]
+ protected GUIButtonControl btnUndo = null;
+ [SkinControlAttribute(15)]
+ protected GUIButtonControl btnBoard = null;
- int wait = 0; // init wait timer for computer
+ #endregion
- int time = 0; // timer for game
- int boardNo = 1; // default board
+ #region Private variables
- int[] time_rec = { 999, 999, 999, 999, 999 };
+ Level _currentLevel = Level.Easy;
+ Mode _currentMode = Mode.PlayerVsComputer;
+ bool _soundOn = true;
- // init board
- int[] board = {0,0,0,0,0,0,0,0,0,0, // 0-9
+ int ActPly = 0; // actual player
+
+ int player = 4; // constant player
+ int computer = 6; // constant computer
+
+ int wait = 0; // init wait timer for computer
+
+ int time = 0; // timer for game
+ int boardNo = 1; // default board
+
+ int[] time_rec = { 999, 999, 999, 999, 999 };
+
+ // init board
+ int[] board = {0,0,0,0,0,0,0,0,0,0, // 0-9
0,0,0,0,0,0,0,0,0,0, //10-19
0,0,1,1,1,1,1,0,0,0, //20-29
0,0,1,1,1,1,1,1,0,0, //30-39
@@ -85,1160 +107,1218 @@
0,0,0,0,0,0,0,0,0,0, //120-129
0,0,0}; //130-132
- int[,] rem_board = new int [80,140];
- bool initBoard = false;
+ int[,] rem_board = new int[80, 140];
+ bool initBoard = false;
- // distances for moves
- int[] MoveDouble = { 10, 11, 1, -10, -11, -1 };
- int[] MoveJump = { 9, 20, 21, 22, 12, 2, -9, -20, -21, -22, -12, -2 };
+ // distances for moves
+ int[] MoveDouble = { 10, 11, 1, -10, -11, -1 };
+ int[] MoveJump = { 9, 20, 21, 22, 12, 2, -9, -20, -21, -22, -12, -2 };
- // last selected move
- int lastHexx = 0;
+ // last selected move
+ int lastHexx = 0;
- // init counter
- int cntPly1 = 0;
- int cntPly2 = 0;
- int round = 1;
+ // init counter
+ int cntPly1 = 0;
+ int cntPly2 = 0;
+ int round = 1;
- // some help arrays for draw the board
- int[] Draw = { 22, 32, 42, 52, 62, 73, 84, 95, 106 };
- int[] DrawCnt = { 5, 6, 7, 8, 9, 8, 7, 6, 5 };
+ // some help arrays for draw the board
+ int[] Draw = { 22, 32, 42, 52, 62, 73, 84, 95, 106 };
+ int[] DrawCnt = { 5, 6, 7, 8, 9, 8, 7, 6, 5 };
- // values on the baord
- // Off Double Jump On1 On1Select On2 On2Select
- // 1 2 3 4 5 6 7
+ // values on the baord
+ // Off Double Jump On1 On1Select On2 On2Select
+ // 1 2 3 4 5 6 7
- private int[] ani01 = { 0, 0, 0, 0, 0, 0, 0, 0 };
- // possible moves 0-5, player 6 , cnt 7
- private int[] ani02 = { 0, 0 , 0};
- // last move, player, counter
-
- // game ticker for the computer
- private System.Windows.Forms.Timer _Game = new System.Windows.Forms.Timer();
+ private int[] ani01 = { 0, 0, 0, 0, 0, 0, 0, 0 };
+ // possible moves 0-5, player 6 , cnt 7
+ private int[] ani02 = { 0, 0, 0 };
+ // last move, player, counter
- #endregion
+ // game ticker for the computer
+ private System.Windows.Forms.Timer _Game = new System.Windows.Forms.Timer();
- #region ISetupForm Members
+ #endregion
- // Returns the name of the plugin which is shown in the plugin menu
- public string PluginName()
- {
- return "My Hexxagon";
- }
+ #region ISetupForm Members
- // Returns the description of the plugin is shown in the plugin menu
- public string Description()
- {
- return "My Hexxagon";
- }
+ // Returns the name of the plugin which is shown in the plugin menu
+ public string PluginName()
+ {
+ return "My Hexxagon";
+ }
- // Returns the author of the plugin which is shown in the plugin menu
- public string Author()
- {
- return "Mark Koenig (kroko)";
- }
+ // Returns the description of the plugin is shown in the plugin menu
+ public string Description()
+ {
+ return "My Hexxagon";
+ }
- // show the setup dialog
- public void ShowPlugin()
- {
- MessageBox.Show("Nothing to configure, this is just an example");
- }
+ // Returns the author of the plugin which is shown in the plugin menu
+ public string Author()
+ {
+ return "Mark Koenig (kroko)";
+ }
- // Indicates whether plugin can be enabled/disabled
- public bool CanEnable()
- {
- return true;
- }
+ // show the setup dialog
+ public void ShowPlugin()
+ {
+ MessageBox.Show("Nothing to configure, this is just an example");
+ }
- // get ID of windowplugin belonging to this setup
- public int GetWindowId()
- {
- return 1234711;
- }
+ // Indicates whether plugin can be enabled/disabled
+ public bool CanEnable()
+ {
+ return true;
+ }
- // Indicates if plugin is enabled by default;
- public bool DefaultEnabled()
- {
- return true;
- }
+ // get ID of windowplugin belonging to this setup
+ public int GetWindowId()
+ {
+ return 1234711;
+ }
- // indicates if a plugin has its own setup screen
- public bool HasSetup()
- {
- return false;
- }
+ // Indicates if plugin is enabled by default;
+ public bool DefaultEnabled()
+ {
+ return true;
+ }
- /// <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>
+ // indicates if a plugin has its own setup screen
+ public bool HasSetup()
+ {
+ return false;
+ }
- 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 hexxagon.png";
- return true;
- }
+ /// <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>
- #endregion
+ public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)
+ {
+ strButtonText = PluginName();
+ strButtonImage = String.Empty;
+ strBu...
[truncated message content] |