diff --git a/assets/button.png b/assets/button.png
index f0beb52..5f9fa44 100644
Binary files a/assets/button.png and b/assets/button.png differ
diff --git a/assets/sandbox_incdec.png b/assets/sandbox_incdec.png
new file mode 100644
index 0000000..cb7adce
Binary files /dev/null and b/assets/sandbox_incdec.png differ
diff --git a/assets/sandbox_tabs.png b/assets/sandbox_tabs.png
index 69fcd36..20544fa 100644
Binary files a/assets/sandbox_tabs.png and b/assets/sandbox_tabs.png differ
diff --git a/css/slides.css b/css/slides.css
index 791effa..d45d1a0 100644
--- a/css/slides.css
+++ b/css/slides.css
@@ -129,6 +129,12 @@ body{
background: url(../assets/sandbox_tabs.png);
width:500px; height:470px;
background-size: auto 100%;
+
+ -webkit-user-select: none; /* Chrome all / Safari all */
+ -moz-user-select: none; /* Firefox all */
+ -ms-user-select: none; /* IE 10+ */
+ user-select: none;
+ cursor: default;
}
#sandbox_tabs > div{
position: absolute;
@@ -144,6 +150,33 @@ body{
left: 33px;
top: 80px;
}
+.incdec{
+ width: 0; height: 0;
+ position: absolute;
+}
+.incdec > div{
+ position: absolute;
+}
+.incdec > .incdec_num{
+ width:50px; height:50px;
+ font-size: 25px;
+ text-align: center;
+ top: -16px;
+ left: -25px;
+ cursor: default;
+}
+.incdec > .incdec_control{
+ left:-10px;
+ width:20px; height:20px;
+ background: url(../assets/sandbox_incdec.png);
+ background-size: auto 100%;
+ cursor: pointer;
+}
+.incdec > .incdec_control[arrow=up]{ top:-35px; background-position:0px 0px; }
+.incdec > .incdec_control[arrow=up]:hover{ background-position:-20px 0px; }
+.incdec > .incdec_control[arrow=down]{ bottom:-35px; background-position:-40px 0px; }
+.incdec > .incdec_control[arrow=down]:hover{ background-position:-60px 0px; }
+
/*************************/
/***** SLIDE SELECT ******/
diff --git a/index.html b/index.html
index 69a9fa6..4c0bc97 100644
--- a/index.html
+++ b/index.html
@@ -22,7 +22,7 @@
-
+
@@ -31,6 +31,7 @@
+
diff --git a/js/core/Button.js b/js/core/Button.js
index 9624cc6..282aa14 100644
--- a/js/core/Button.js
+++ b/js/core/Button.js
@@ -25,9 +25,12 @@ function Button(config){
button.style.left = config.x+"px";
button.style.top = config.y+"px";
config.upperCase = (config.upperCase===undefined) ? true : config.upperCase;
- var words = Words.get(config.text_id);
- if(config.upperCase) words=words.toUpperCase();
- text.innerHTML = words;
+ self.setText = function(text_id){
+ var words = Words.get(text_id);
+ if(config.upperCase) words=words.toUpperCase();
+ text.innerHTML = words;
+ };
+ self.setText(config.text_id);
// On hover...
hitbox.onmouseover = function(){
@@ -39,7 +42,10 @@ function Button(config){
// On click...
hitbox.onclick = function(){
- if(self.active) publish(config.message);
+ if(self.active){
+ if(config.onclick) config.onclick();
+ if(config.message) publish(config.message);
+ }
};
// Activate/Deactivate
diff --git a/js/core/IncDecNumber.js b/js/core/IncDecNumber.js
new file mode 100644
index 0000000..2d141b3
--- /dev/null
+++ b/js/core/IncDecNumber.js
@@ -0,0 +1,81 @@
+/*****************************
+
+{
+ x:x, y:y, max:5, min:-5,
+ value: PD.PAYOFFS_DEFAULT[letter],
+ onchange: function(value){
+ publish("pd/editPayoffs/"+letter,[value]);
+ }
+}
+
+*****************************/
+function IncDecNumber(config){
+
+ var self = this;
+ self.id = config.id;
+
+ // Properties
+ self.value = config.value;
+
+ // Create DOM
+ var dom = document.createElement("div");
+ dom.className = "incdec";
+ dom.style.left = config.x+"px";
+ dom.style.top = config.y+"px";
+ self.dom = dom;
+
+ // Number
+ var num = document.createElement("div");
+ num.className = "incdec_num";
+ dom.appendChild(num);
+ self.setValue = function(value){
+
+ // Bounds
+ if(value>config.max) value=config.max;
+ if(value
+reset payoffs +