Skip to content

Commit

Permalink
Merge pull request #4 from Scrivener07/developer
Browse files Browse the repository at this point in the history
Developer
  • Loading branch information
Scrivener07 authored Mar 20, 2018
2 parents dbeedfa + 24b8f24 commit 9b1cab6
Show file tree
Hide file tree
Showing 29 changed files with 2,391 additions and 174 deletions.
10 changes: 10 additions & 0 deletions Data/Interface/Source/FO4_Scopes/Debug.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package
{
public class Debug
{
public static function Log(className:String, classMember:String, textLog:String):void
{
trace("[Scopes Framework]["+className+"."+classMember+"]: "+textLog);
}
}
}
4 changes: 1 addition & 3 deletions Data/Interface/Source/FO4_Scopes/Path.as
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ package
{
public class Path
{

public static function ConvertFileExtension(filepath:String, toExtension:String):String
{
return filepath.substr(0, filepath.length - 3) + toExtension;
return filepath.replace(new RegExp("\\.[^/.]+$", ""), "."+toExtension);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ package
function SetOverlay(identifier:uint) : *; // native
function SetCustom(filePath:String) : *;
function GetCustom() : String;
function PathConvert(filepath:String, toExtension:String) : String;
function ConvertFileExtension(filepath:String, toExtension:String) : String;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
HoldBreathButton = new BSButtonHintData("$Hold Breath", "Alt", "PSN_L3", "Xenon_L3", 1, null);
HoldBreathButtonForVita = new BSButtonHintData("$Hold Breath", "Alt", "_DPad_Down", "Xenon_L3", 1, null);
super();

addFrameScript(0, this.frame1);
HoldBreathButtonForVita.ButtonVisible = false;

var hints:Vector.<BSButtonHintData> = new Vector.<BSButtonHintData>();
hints.push(HoldBreathButton);
hints.push(HoldBreathButtonForVita);
ButtonHintInstance.SetButtonHintData(hints);
Debug.Log("ScopeMenu", "Constructor", "Constructed the scope menu.");
}


Expand All @@ -51,14 +51,15 @@
HoldBreathButton.ButtonVisible = true;
HoldBreathButtonForVita.ButtonVisible = false;
}
Debug.Log("ScopeMenu", "SetIsVita", "The argument isVita equals "+isVita);
}


public function SetOverlay(identifier:uint) : *
{
OverlayFrame = identifier + 1;
gotoAndStop(OverlayFrame);
trace("[ScopeMenu] SetOverlay(identifier="+identifier+")");
Debug.Log("ScopeMenu", "SetOverlay", "The overlay identifier is being set to "+identifier);
}


Expand All @@ -67,20 +68,22 @@
OverlayLoader_mc.Info.addEventListener(Event.COMPLETE, this.OnLoadComplete);
OverlayLoader_mc.Info.addEventListener(IOErrorEvent.IO_ERROR, this.OnLoadError);
OverlayLoader_mc.Load(filePath);
trace("[ScopeMenu] SetCustom(filePath="+filePath+")");
Debug.Log("ScopeMenu", "SetCustom", "Setting the custom overlay file path to '"+filePath+"'.");
}


public function GetCustom() : String
{
Debug.Log("ScopeMenu", "GetCustom", "Instance equals '"+OverlayLoader_mc.Instance+"'.");
return OverlayLoader_mc.Instance;
}


public function PathConvert(filepath:String, toExtension:String) : String
public function ConvertFileExtension(filepath:String, toExtension:String) : String
{
trace("[ScopeMenu] PathConvert(filepath="+filepath+", toExtension="+toExtension+")");
return Path.ConvertFileExtension(filepath, toExtension);
var converted = Path.ConvertFileExtension(filepath, toExtension);
Debug.Log("ScopeMenu", "ConvertFileExtension", "Converting file path '"+filepath+"' to '"+toExtension+"' extension as '"+converted+"'.");
return converted;
}


Expand All @@ -92,7 +95,7 @@
OverlayLoader_mc.Info.removeEventListener(Event.COMPLETE, this.OnLoadComplete);
OverlayLoader_mc.Info.removeEventListener(IOErrorEvent.IO_ERROR, this.OnLoadError);
gotoAndStop("Custom");
trace("[ScopeMenu] OnLoadComplete: "+OverlayLoader_mc.FilePath+", Instance: "+OverlayLoader_mc.Instance);
Debug.Log("ScopeMenu", "OnLoadComplete", "Override found at '"+OverlayLoader_mc.FilePath+"' with instance of '"+OverlayLoader_mc.Instance+"'.");
}


Expand All @@ -101,7 +104,16 @@
OverlayLoader_mc.Info.removeEventListener(Event.COMPLETE, this.OnLoadComplete);
OverlayLoader_mc.Info.removeEventListener(IOErrorEvent.IO_ERROR, this.OnLoadError);
gotoAndStop(OverlayFrame);
trace("[ScopeMenu] OnLoadError: No override found at '"+OverlayLoader_mc.FilePath+"'.");
Debug.Log("ScopeMenu", "OnLoadError", "No override found at '"+OverlayLoader_mc.FilePath+"'. Moving to frame "+OverlayFrame);
}


// Frames
//---------------------------------------------

function frame1() : *
{
stop();
}


Expand Down
3 changes: 3 additions & 0 deletions Data/Interface/Source/FO4_Scopes/ScopeMenu/ScopeMenu.fla
Git LFS file not shown
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package ScopeMenu_fla
{
import flash.display.MovieClip;

public dynamic class BSButtonHint_IconHolder_29 extends MovieClip
public dynamic class BSButtonHint_IconHolder_56 extends MovieClip
{


public var IconAnimInstance:MovieClip;

public function BSButtonHint_IconHolder_29()
public function BSButtonHint_IconHolder_56()
{
super();
addFrameScript(0,this.frame1,59,this.frame60);
Expand Down
160 changes: 160 additions & 0 deletions Data/Interface/Source/FO4_Scopes/ScopeMenu/Shared/AS3/BSBracketClip.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
package Shared.AS3
{
import flash.display.CapsStyle;
import flash.display.JointStyle;
import flash.display.MovieClip;
import flash.geom.Point;
import flash.geom.Rectangle;

public dynamic class BSBracketClip extends MovieClip
{

static const BR_HORIZONTAL:String = "horizontal";

static const BR_VERTICAL:String = "vertical";

static const BR_CORNERS:String = "corners";

static const BR_FULL:String = "full";


private var _drawPos:Point;

private var _clipRect:Rectangle;

private var _lineThickness:Number;

private var _cornerLength:Number;

private var _padding:Point;

private var _style:String;

public function BSBracketClip()
{
super();
}

public function BracketPair() : *
{
}

public function ClearBrackets() : *
{
graphics.clear();
}

public function redrawUIComponent(param1:BSUIComponent, param2:Number, param3:Number, param4:Point, param5:String) : *
{
this._clipRect = param1.getBounds(param1);
this._lineThickness = param2;
this._cornerLength = param3;
this._padding = param4;
this._clipRect.inflatePoint(this._padding);
this._style = param5;
this.ClearBrackets();
graphics.lineStyle(this._lineThickness,16777215,1,false,"normal",CapsStyle.SQUARE,JointStyle.MITER,3);
switch(this._style)
{
case BR_HORIZONTAL:
this.doHorizontal();
break;
case BR_VERTICAL:
this.doVertical();
break;
case BR_CORNERS:
this.doCorners();
break;
case BR_FULL:
this.doFull();
}
}

private function doHorizontal() : *
{
this._drawPos = new Point(this._clipRect.left + this._cornerLength,this._clipRect.top);
this.moveTo();
this.LineX(this._clipRect.left);
this.LineY(this._clipRect.bottom);
this.LineX(this._clipRect.left + this._cornerLength);
this.MoveX(this._clipRect.right - this._cornerLength);
this.LineX(this._clipRect.right);
this.LineY(this._clipRect.top);
this.LineX(this._clipRect.right - this._cornerLength);
}

private function doVertical() : *
{
this._drawPos = new Point(this._clipRect.left,this._clipRect.top + this._cornerLength);
this.moveTo();
this.LineY(this._clipRect.top);
this.LineX(this._clipRect.right);
this.LineY(this._clipRect.top + this._cornerLength);
this.MoveY(this._clipRect.bottom - this._cornerLength);
this.LineY(this._clipRect.bottom);
this.LineX(this._clipRect.left);
this.LineY(this._clipRect.bottom - this._cornerLength);
}

private function doCorners() : *
{
this._drawPos = new Point(this._clipRect.left + this._cornerLength,this._clipRect.top);
this.moveTo();
this.LineX(this._clipRect.left);
this.LineY(this._clipRect.top + this._cornerLength);
this.MoveY(this._clipRect.bottom - this._cornerLength);
this.LineY(this._clipRect.bottom);
this.LineX(this._clipRect.left + this._cornerLength);
this.MoveX(this._clipRect.right - this._cornerLength);
this.LineX(this._clipRect.right);
this.LineY(this._clipRect.bottom - this._cornerLength);
this.MoveY(this._clipRect.top + this._cornerLength);
this.LineY(this._clipRect.top);
this.LineX(this._clipRect.right - this._cornerLength);
}

private function doFull() : *
{
this._drawPos = new Point(this._clipRect.left,this._clipRect.top);
this.moveTo();
this.LineY(this._clipRect.bottom);
this.LineX(this._clipRect.right);
this.LineY(this._clipRect.top);
this.LineX(this._clipRect.left);
}

private function LineX(param1:Number) : *
{
this._drawPos.x = param1;
this.lineTo();
}

private function LineY(param1:Number) : *
{
this._drawPos.y = param1;
this.lineTo();
}

private function MoveX(param1:Number) : *
{
this._drawPos.x = param1;
this.moveTo();
}

private function MoveY(param1:Number) : *
{
this._drawPos.y = param1;
this.moveTo();
}

private function lineTo() : *
{
graphics.lineTo(this._drawPos.x,this._drawPos.y);
}

private function moveTo() : *
{
graphics.moveTo(this._drawPos.x,this._drawPos.y);
}
}
}
Loading

0 comments on commit 9b1cab6

Please sign in to comment.