
gdjs.evtsExt__Buttons__Button = gdjs.evtsExt__Buttons__Button || {};

/**
 * Behavior generated from 
 * @class Button
 * @extends gdjs.RuntimeBehavior
 * @constructor
 */
gdjs.evtsExt__Buttons__Button.Button = function(runtimeScene, behaviorData, owner)
{
    gdjs.RuntimeBehavior.call(this, runtimeScene, behaviorData, owner);
    this._runtimeScene = runtimeScene;

    this._onceTriggers = new gdjs.OnceTriggers();
    this._behaviorData = {};
    
};

gdjs.evtsExt__Buttons__Button.Button.prototype = Object.create( gdjs.RuntimeBehavior.prototype );
gdjs.registerBehavior("Buttons::Button", gdjs.evtsExt__Buttons__Button.Button);

// Hot-reload:
gdjs.evtsExt__Buttons__Button.Button.prototype.updateFromBehaviorData = function(oldBehaviorData, newBehaviorData) {


    return true;
}

// Properties:
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext = {};
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1= [];
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects2= [];

gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.conditionTrue_0 = {val:false};
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition0IsTrue_0 = {val:false};
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition1IsTrue_0 = {val:false};
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition2IsTrue_0 = {val:false};
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.conditionTrue_1 = {val:false};
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition0IsTrue_1 = {val:false};
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition1IsTrue_1 = {val:false};
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition2IsTrue_1 = {val:false};


gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.mapOfGDgdjs_46evtsExt_95_95Buttons_95_95Button_46Button_46prototype_46doStepPreEventsContext_46GDObjectObjects1Objects = Hashtable.newFrom({"Object": gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1});gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.mapOfGDgdjs_46evtsExt_95_95Buttons_95_95Button_46Button_46prototype_46doStepPreEventsContext_46GDObjectObjects1Objects = Hashtable.newFrom({"Object": gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1});gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.mapOfGDgdjs_46evtsExt_95_95Buttons_95_95Button_46Button_46prototype_46doStepPreEventsContext_46GDObjectObjects1Objects = Hashtable.newFrom({"Object": gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1});gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.eventsList0 = function(runtimeScene, eventsFunctionContext) {

{

gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1.createFrom(eventsFunctionContext.getObjects("Object"));

gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition0IsTrue_0.val = false;
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition1IsTrue_0.val = false;
{
for(var i = 0, k = 0, l = gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1.length;i<l;++i) {
    if ( gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1[i].getVariableNumber(gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1[i].getVariables().get("ChangedValue")) != 5 ) {
        gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition0IsTrue_0.val = true;
        gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1[k] = gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1[i];
        ++k;
    }
}
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1.length = k;}if ( gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition0IsTrue_0.val ) {
{
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition1IsTrue_0.val = gdjs.evtTools.input.cursorOnObject(gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.mapOfGDgdjs_46evtsExt_95_95Buttons_95_95Button_46Button_46prototype_46doStepPreEventsContext_46GDObjectObjects1Objects, runtimeScene, true, false);
}}
if (gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition1IsTrue_0.val) {
/* Reuse gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1 */
{for(var i = 0, len = gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1.length ;i < len;++i) {
    gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1[i].setY(gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1[i].getY() - (1));
}
}{for(var i = 0, len = gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1.length ;i < len;++i) {
    gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1[i].returnVariable(gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1[i].getVariables().get("ChangedValue")).add(1);
}
}}

}


{

gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1.createFrom(eventsFunctionContext.getObjects("Object"));

gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition0IsTrue_0.val = false;
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition1IsTrue_0.val = false;
{
for(var i = 0, k = 0, l = gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1.length;i<l;++i) {
    if ( gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1[i].getVariableNumber(gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1[i].getVariables().get("ChangedValue")) != 0 ) {
        gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition0IsTrue_0.val = true;
        gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1[k] = gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1[i];
        ++k;
    }
}
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1.length = k;}if ( gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition0IsTrue_0.val ) {
{
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition1IsTrue_0.val = gdjs.evtTools.input.cursorOnObject(gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.mapOfGDgdjs_46evtsExt_95_95Buttons_95_95Button_46Button_46prototype_46doStepPreEventsContext_46GDObjectObjects1Objects, runtimeScene, true, true);
}}
if (gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition1IsTrue_0.val) {
/* Reuse gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1 */
{for(var i = 0, len = gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1.length ;i < len;++i) {
    gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1[i].setY(gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1[i].getY() + (1));
}
}{for(var i = 0, len = gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1.length ;i < len;++i) {
    gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1[i].returnVariable(gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1[i].getVariables().get("ChangedValue")).sub(1);
}
}}

}


{

gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1.createFrom(eventsFunctionContext.getObjects("Object"));

gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition0IsTrue_0.val = false;
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition1IsTrue_0.val = false;
{
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition0IsTrue_0.val = gdjs.evtTools.input.cursorOnObject(gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.mapOfGDgdjs_46evtsExt_95_95Buttons_95_95Button_46Button_46prototype_46doStepPreEventsContext_46GDObjectObjects1Objects, runtimeScene, true, false);
}if ( gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition0IsTrue_0.val ) {
{
{gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.conditionTrue_1 = gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition1IsTrue_0;
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.conditionTrue_1.val = eventsFunctionContext.getOnceTriggers().triggerOnce(23202740);
}
}}
if (gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.condition1IsTrue_0.val) {
{gdjs.evtTools.sound.playSoundOnChannel(runtimeScene, "sfx\\game_hover.wav", 2, false, gdjs.evtTools.common.getVariableNumber(runtimeScene.getGame().getVariables().get("SFXVolume")), 1);
}}

}


};

gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEvents = function(parentEventsFunctionContext) {
this._onceTriggers.startNewFrame();
var that = this;
var runtimeScene = this._runtimeScene;
var thisObjectList = [this.owner];
var Object = Hashtable.newFrom({Object: thisObjectList});
var Behavior = this.name;
var eventsFunctionContext = {
  _objectsMap: {
"Object": Object
},
  _objectArraysMap: {
"Object": thisObjectList
},
  _behaviorNamesMap: {
"Behavior": Behavior
},
  getObjects: function(objectName) {
    return eventsFunctionContext._objectArraysMap[objectName] || [];
  },
  getObjectsLists: function(objectName) {
    return eventsFunctionContext._objectsMap[objectName] || null;
  },
  getBehaviorName: function(behaviorName) {
    return eventsFunctionContext._behaviorNamesMap[behaviorName];
  },
  createObject: function(objectName) {
    var objectsList = eventsFunctionContext._objectsMap[objectName];
    if (objectsList) {
      return parentEventsFunctionContext ?
        parentEventsFunctionContext.createObject(objectsList.firstKey()) :
        runtimeScene.createObject(objectsList.firstKey());
    }
    return null;
  },
  getArgument: function(argName) {
    return "";
  },
  getOnceTriggers: function() { return that._onceTriggers; }
};

gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects1.length = 0;
gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.GDObjectObjects2.length = 0;

gdjs.evtsExt__Buttons__Button.Button.prototype.doStepPreEventsContext.eventsList0(runtimeScene, eventsFunctionContext);
return;
}


// Methods:

