first commit
This commit is contained in:
+4
@@ -0,0 +1,4 @@
|
||||
on(rollOut){
|
||||
// Forbidden
|
||||
getURL("FSCommand:" add qualifyName(_parent,"OnRollOut"),"");
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
on(rollOver){
|
||||
// Forbidden
|
||||
getURL("FSCommand:" add qualifyName(_parent,"OnRollOver"),"");
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
function Initialize(count)
|
||||
{
|
||||
pipCount = count;
|
||||
var _loc3_ = 0;
|
||||
var _loc2_ = 0;
|
||||
while(_loc2_ < pipCount)
|
||||
{
|
||||
var _loc1_ = attachMovie("RA3PowerBarPip",String(_loc2_),_loc2_);
|
||||
_loc1_._x = _loc3_;
|
||||
_loc1_._y = 0;
|
||||
_loc3_ += _loc1_._width;
|
||||
_loc1_.gotoAndPlay("_green");
|
||||
_loc2_ = _loc2_ + 1;
|
||||
}
|
||||
}
|
||||
function CalculateMeterRange(production, consumption)
|
||||
{
|
||||
var _loc1_ = 1000;
|
||||
while(_loc1_ < Math.max(production,consumption))
|
||||
{
|
||||
_loc1_ *= 2;
|
||||
}
|
||||
return _loc1_;
|
||||
}
|
||||
function GetPipIndex(intervals, meterValue, meterRange)
|
||||
{
|
||||
var _loc1_ = Math.floor(meterValue / meterRange * intervals);
|
||||
return Math.max(0,Math.min(_loc1_,intervals - 1));
|
||||
}
|
||||
function ConfigurePips(production, consumption)
|
||||
{
|
||||
var _loc7_ = CalculateMeterRange(production,consumption);
|
||||
var _loc4_ = GetPipIndex(pipCount,production,_loc7_);
|
||||
var _loc6_ = GetPipIndex(pipCount,consumption,_loc7_);
|
||||
var _loc5_ = Math.max(_loc4_,_loc6_);
|
||||
if(_loc4_ == _loc6_ && production < consumption)
|
||||
{
|
||||
_loc4_ = Math.max(0,_loc4_ - 1);
|
||||
}
|
||||
var _loc2_ = 0;
|
||||
while(_loc2_ < pipCount)
|
||||
{
|
||||
var _loc3_ = this[String(_loc2_)];
|
||||
_loc3_._visible = _loc2_ > _loc5_ ? false : true;
|
||||
_loc3_.gotoAndPlay(_loc2_ > _loc4_ ? "_red" : "_green");
|
||||
_loc2_ = _loc2_ + 1;
|
||||
}
|
||||
return this[String(_loc6_)]._x;
|
||||
}
|
||||
function onUnload()
|
||||
{
|
||||
delete Initialize;
|
||||
delete CalculateMeterRange;
|
||||
delete GetPipIndex;
|
||||
delete ConfigurePips;
|
||||
delete onUnload;
|
||||
}
|
||||
if(!initialized)
|
||||
{
|
||||
initialized = true;
|
||||
_parent.OnPipsLoaded(this);
|
||||
}
|
||||
stop();
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
function OnPipsLoaded(mc)
|
||||
{
|
||||
pipsClip = mc;
|
||||
pipsClip.Initialize(_pipCount);
|
||||
var _loc3_ = 3;
|
||||
var _loc2_ = 3;
|
||||
button._x = - _loc3_;
|
||||
button._y = - _loc2_;
|
||||
button._xscale = _loc3_ * 2 + pipsClip._width;
|
||||
button._yscale = _loc2_ * 2 + pipsClip._height;
|
||||
if(!extern.InGame)
|
||||
{
|
||||
_parent.SetValues(1130,1132);
|
||||
}
|
||||
}
|
||||
function SetValues(production, consumption)
|
||||
{
|
||||
marker._x = pipsClip.ConfigurePips(production,consumption);
|
||||
if(consumption <= production)
|
||||
{
|
||||
SetAlertMode(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAlertMode(true);
|
||||
}
|
||||
}
|
||||
function SetAlertMode(newMode)
|
||||
{
|
||||
if(alertMode != newMode)
|
||||
{
|
||||
alertMode = newMode;
|
||||
if(alertMode == true)
|
||||
{
|
||||
gotoAndStop("_pulse");
|
||||
play();
|
||||
}
|
||||
else
|
||||
{
|
||||
gotoAndStop("_steady");
|
||||
play();
|
||||
}
|
||||
}
|
||||
}
|
||||
function onUnload()
|
||||
{
|
||||
delete OnPipsLoaded;
|
||||
delete SetValues;
|
||||
delete SetAlertMode;
|
||||
delete onUnload;
|
||||
}
|
||||
if(!initialized)
|
||||
{
|
||||
initialized = true;
|
||||
SetAlertMode(false);
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
gotoAndStop("_pulse");
|
||||
play();
|
||||
+1
@@ -0,0 +1 @@
|
||||
stop();
|
||||
+1
@@ -0,0 +1 @@
|
||||
stop();
|
||||
+1
@@ -0,0 +1 @@
|
||||
stop();
|
||||
+1
@@ -0,0 +1 @@
|
||||
stop();
|
||||
+1
@@ -0,0 +1 @@
|
||||
stop();
|
||||
@@ -0,0 +1,38 @@
|
||||
function SetValues(productionArg, consumptionArg)
|
||||
{
|
||||
powerBar.SetValues(productionArg,consumptionArg);
|
||||
}
|
||||
function SetHighlighted(highlightArg)
|
||||
{
|
||||
var _loc2_ = highlightArg != 0;
|
||||
if(_loc2_)
|
||||
{
|
||||
if(highlightClip == undefined)
|
||||
{
|
||||
highlightDummy._visible = true;
|
||||
highlightClip = _global.CreateHUDGadgetFlash(highlightDummy);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
highlightClip.Close();
|
||||
highlightClip = undefined;
|
||||
}
|
||||
}
|
||||
function onUnload()
|
||||
{
|
||||
highlightClip.Close();
|
||||
delete SetValues;
|
||||
delete SetHighlighted;
|
||||
delete OnPipsLoaded;
|
||||
delete onUnload;
|
||||
}
|
||||
if(!initialized)
|
||||
{
|
||||
highlightDummy._visible = false;
|
||||
initialized = true;
|
||||
_parent.OnContentLoaded(this);
|
||||
// Forbidden
|
||||
getURL("FSCommand:" add qualifyName(this,"OnInitialized"),"");
|
||||
}
|
||||
stop();
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
on(construct){
|
||||
_pipCount = 38;
|
||||
}
|
||||
Reference in New Issue
Block a user