|
From: <che...@us...> - 2007-05-27 10:46:57
|
Revision: 476
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=476&view=rev
Author: chef_koch
Date: 2007-05-27 03:46:40 -0700 (Sun, 27 May 2007)
Log Message:
-----------
improved UpdateButtonStates, static labels will be set now only OnPageLoad
Modified Paths:
--------------
trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.cs
trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon.cs
trunk/plugins/MySimon/Source/SimonSay/MySimon.cs
Modified: trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.cs
===================================================================
--- trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.cs 2007-05-27 10:28:38 UTC (rev 475)
+++ trunk/plugins/My Connect4/Source/MyConnect4/MyConnect4.cs 2007-05-27 10:46:40 UTC (rev 476)
@@ -214,7 +214,7 @@
Drawfield();
- // set localized labels
+ // set localized labels for static controls
GUIPropertyManager.SetProperty("#header_label", MyConnect.GUILocalizeStrings.Get(0)); // MyConnect
GUIControl.SetControlLabel(GetID, btnStart.GetID, MyConnect.GUILocalizeStrings.Get(1)); // New Game
GUIControl.SetControlLabel(GetID, btnSound.GetID, MyConnect.GUILocalizeStrings.Get(9)); // Sounds
@@ -354,7 +354,7 @@
private void UpdateButtonStates()
{
- // enable/disable button
+ // enable/disable buttons
btnSound.Selected = _soundOn;
btnStart.Disabled = (Player != 0);
btnLevel.Disabled = ((Player != 0) || (_currentMode == Mode.PlayerVsPlayer));
Modified: trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon.cs
===================================================================
--- trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon.cs 2007-05-27 10:28:38 UTC (rev 475)
+++ trunk/plugins/My Hexxagon/Source/MyHexxagon/MyHexxagon.cs 2007-05-27 10:46:40 UTC (rev 476)
@@ -66,6 +66,7 @@
protected GUIToggleButtonControl btnSound = null;
[SkinControlAttribute(6)]
protected GUIButtonControl btnWhatsThis = null;
+
[SkinControlAttribute(10)]
protected GUIButtonControl btnUndo = null;
[SkinControlAttribute(15)]
@@ -344,6 +345,13 @@
Count();
UpdateBoard();
+ // set localized labels for static controls
+ GUIPropertyManager.SetProperty("#header_label", MyHexxagon.GUILocalizeStrings.Get(0)); // MyHexxagon
+ GUIControl.SetControlLabel(GetID, btnStart.GetID, MyHexxagon.GUILocalizeStrings.Get(1)); // New Game
+ GUIControl.SetControlLabel(GetID, btnSound.GetID, MyHexxagon.GUILocalizeStrings.Get(9)); // Sounds
+ GUIControl.SetControlLabel(GetID, btnWhatsThis.GetID, MyHexxagon.GUILocalizeStrings.Get(31)); // What is MyHexxagon?
+ GUIControl.SetControlLabel(GetID, btnUndo.GetID, MyHexxagon.GUILocalizeStrings.Get(8)); // Undo
+
UpdateButtonStates();
}
@@ -529,11 +537,13 @@
private void UpdateButtonStates()
{
- GUIPropertyManager.SetProperty("#header_label", MyHexxagon.GUILocalizeStrings.Get(0)); // MyHexxagon
-
- GUIControl.SetControlLabel(GetID, btnStart.GetID, MyHexxagon.GUILocalizeStrings.Get(1)); // Start
+ // enable/disable buttons
+ btnSound.Selected = _soundOn;
+ //btnMode.Disabled = (Player != 0);
//btnStart.Disabled = (Player != 0);
+ //btnLevel.Disabled = ((Player != 0) || (_currentMode == Mode.PlayerVsPlayer));
+ // refresh label for btnLevel
string strLine = MyHexxagon.GUILocalizeStrings.Get(10); // Level:
switch (_currentLevel)
{
@@ -548,8 +558,8 @@
break;
}
GUIControl.SetControlLabel(GetID, btnLevel.GetID, strLine);
- //btnLevel.Disabled = ((Player != 0) || (_currentMode == Mode.PlayerVsPlayer));
+ // refresh label for btnMode
strLine = MyHexxagon.GUILocalizeStrings.Get(20); // Mode: Play vs
switch (_currentMode)
{
@@ -561,13 +571,8 @@
break;
}
GUIControl.SetControlLabel(GetID, btnMode.GetID, strLine);
- //btnMode.Disabled = (Player != 0);
- GUIControl.SetControlLabel(GetID, btnSound.GetID, MyHexxagon.GUILocalizeStrings.Get(9)); // Sounds
- btnSound.Selected = _soundOn;
-
- GUIControl.SetControlLabel(GetID, btnWhatsThis.GetID, MyHexxagon.GUILocalizeStrings.Get(31)); // What is MyConnect?
- GUIControl.SetControlLabel(GetID, btnUndo.GetID, MyHexxagon.GUILocalizeStrings.Get(8)); // Undo
+ // refresh label for btnBoard
GUIControl.SetControlLabel(GetID, btnBoard.GetID, MyHexxagon.GUILocalizeStrings.Get(7) + ": " + boardNo.ToString()); // Board: 1
}
Modified: trunk/plugins/MySimon/Source/SimonSay/MySimon.cs
===================================================================
--- trunk/plugins/MySimon/Source/SimonSay/MySimon.cs 2007-05-27 10:28:38 UTC (rev 475)
+++ trunk/plugins/MySimon/Source/SimonSay/MySimon.cs 2007-05-27 10:46:40 UTC (rev 476)
@@ -218,7 +218,11 @@
GUIPropertyManager.SetProperty("#Round", MySimon.GUILocalizeStrings.Get(5) + "1"); // Round: 1
GUIPropertyManager.SetProperty("#Player", MySimon.GUILocalizeStrings.Get(6)); // GAME OVER
- GUIControl.EnableControl(GetID, btnWhatsThis.GetID);
+ // set localized labels for static controls
+ GUIPropertyManager.SetProperty("#header_label", MySimon.GUILocalizeStrings.Get(0)); // MySimon
+ GUIControl.SetControlLabel(GetID, btnStart.GetID, MySimon.GUILocalizeStrings.Get(1)); // New Game
+ GUIControl.SetControlLabel(GetID, btnSound.GetID, MySimon.GUILocalizeStrings.Get(9)); // Sounds
+ GUIControl.SetControlLabel(GetID, btnWhatsThis.GetID, MySimon.GUILocalizeStrings.Get(31)); // What is MySimon?
UpdateButtonStates();
}
@@ -350,11 +354,13 @@
private void UpdateButtonStates()
{
- GUIPropertyManager.SetProperty("#header_label", MySimon.GUILocalizeStrings.Get(0)); // My Simon
-
- GUIControl.SetControlLabel(GetID, btnStart.GetID, MySimon.GUILocalizeStrings.Get(1)); // Start
+ // enable/disable buttons
+ btnSound.Selected = _soundOn;
btnStart.Disabled = (PlayerOn || SimonOn);
+ btnLevel.Disabled = (PlayerOn || SimonOn);
+ btnWhatsThis.Disabled = (PlayerOn || SimonOn);
+ // refresh label for btnLevel
string strLine = MySimon.GUILocalizeStrings.Get(10); // Level:
switch (_currentLevel)
{
@@ -369,13 +375,6 @@
break;
}
GUIControl.SetControlLabel(GetID, btnLevel.GetID, strLine);
- btnLevel.Disabled = (PlayerOn || SimonOn);
-
- GUIControl.SetControlLabel(GetID, btnSound.GetID, MySimon.GUILocalizeStrings.Get(9)); // Sounds
- btnSound.Selected = _soundOn;
-
- GUIControl.SetControlLabel(GetID, btnWhatsThis.GetID, MySimon.GUILocalizeStrings.Get(31)); // What is My Simon?
- btnWhatsThis.Disabled = (PlayerOn || SimonOn);
}
#endregion
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|