initial commit, kind of working.
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
package com.arc.dh.state
|
||||
{
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.Fonts;
|
||||
import com.arc.dh.util.SoundSystem;
|
||||
import com.arc.flixel.ArcButton;
|
||||
import com.arc.flixel.ArcGroup;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import org.flixel.FlxBitmapText;
|
||||
import org.flixel.FlxG;
|
||||
|
||||
public class BossButton extends ArcGroup
|
||||
{
|
||||
|
||||
private static const buttonSprite:Class = BossButton_buttonSprite;
|
||||
|
||||
private static const lockSprite:Class = BossButton_lockSprite;
|
||||
|
||||
private var _boss:int;
|
||||
|
||||
private var _button:ArcButton;
|
||||
|
||||
private var _text:FlxBitmapText;
|
||||
|
||||
private var _lock:ArcSprite;
|
||||
|
||||
private var _screen:BossScreen;
|
||||
|
||||
public function BossButton(param1:Number, param2:Number, param3:int)
|
||||
{
|
||||
var X:Number = param1;
|
||||
var Y:Number = param2;
|
||||
var H:int = param3;
|
||||
super();
|
||||
this._boss = H + 1;
|
||||
this._button = new ArcButton(X,Y,42,16,buttonSprite).selectable(false).callback(function():void
|
||||
{
|
||||
if(!FlxG.keys.SHIFT || Data.boss[0] != 0)
|
||||
{
|
||||
SoundSystem.fadeOutMusic();
|
||||
FlxG.fade(4278190080,0.25,function():void
|
||||
{
|
||||
FlxG.mouse.hide();
|
||||
FlxG.switchState(new BossMode(FlxG.keys.SHIFT,_boss,true));
|
||||
});
|
||||
}
|
||||
});
|
||||
this.add(this._button);
|
||||
this._text = new FlxBitmapText(X,Y + 4,Fonts.font(Fonts.OUTLINE_BLACK_S),"CHAPT " + this._boss,"right",37);
|
||||
this.add(this._text);
|
||||
}
|
||||
|
||||
public function setScreen(param1:BossScreen) : void
|
||||
{
|
||||
this._screen = param1;
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
if(this._button.hover() && this._lock != null)
|
||||
{
|
||||
if(this._screen.tooltip == null || this._screen.tooltip.source != this)
|
||||
{
|
||||
this._screen.tooltip = new BossModeTooltip(this._button.x + 21,this._button.y,this._boss);
|
||||
this._screen.tooltip.source = this;
|
||||
}
|
||||
this._screen.hovering = true;
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
|
||||
override public function draw() : void
|
||||
{
|
||||
super.draw();
|
||||
if(this._lock != null)
|
||||
{
|
||||
this._lock.draw();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user