-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write bound variables to spawnmap.ini and add variables to menu.
- Loading branch information
Showing
8 changed files
with
468 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
using DTAClient.Domain.Singleplayer; | ||
|
||
using Rampastring.XNAUI; | ||
using Rampastring.XNAUI.XNAControls; | ||
|
||
namespace DTAClient.DXGUI.Generic.Campaign | ||
{ | ||
|
||
public class VariableCheckbox : XNACheckBox | ||
{ | ||
private string _variable; | ||
public string Variable | ||
{ | ||
get | ||
{ | ||
return _variable; | ||
} | ||
set | ||
{ | ||
Checked = CampaignHandler.Instance.Variables[value] > 0; | ||
_variable = value; | ||
} | ||
} | ||
public VariableCheckbox(WindowManager windowManager) : base(windowManager) | ||
{ | ||
AllowChecking = true; | ||
} | ||
public override void OnLeftClick() | ||
{ | ||
base.OnLeftClick(); | ||
|
||
if (CampaignHandler.Instance.Variables.ContainsKey(Variable)) | ||
CampaignHandler.Instance.Variables[Variable] = Checked ? 1 : 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.