Skip to content

Commit

Permalink
Various bug fixes and changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Scrivener07 committed Mar 14, 2019
1 parent 89f66ee commit 771ced9
Show file tree
Hide file tree
Showing 18 changed files with 423 additions and 199 deletions.
4 changes: 2 additions & 2 deletions Data.Sample.Scouter/Scouter Overlay.esp
Git LFS file not shown
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Scriptname Scouter:Overlay extends Quest
{Provides advanced overlay interactions for the scouter.}
import Scouter:Log
import Fallout:Overlays:Framework
import Fallout:Overlays:Client

Actor Player
Armor Scouter

Fallout:Overlays:Framework Framework
string TextBox4_Label = ""
string TextBox4_Value = ""

string TextBox5_Label = ""
string TextBox5_Value = ""

Expand All @@ -32,18 +32,12 @@ Function OnGameReload()
If (Plugin.IsInstalled)
Scouter = Plugin.GetArmor(Plugin._R_Scouter)
If (Scouter)
Framework = OverlayFramework()
If (Framework)
TextBox4_Label = Framework.GetMember("TextBox4.Label")
TextBox4_Value = Framework.GetMember("TextBox4.Value")
TextBox5_Label = Framework.GetMember("TextBox5.Label")
TextBox5_Value = Framework.GetMember("TextBox5.Value")
Framework.RegisterForOpenCloseEvent(self)

WriteLine(self, "OnGameReload")
Else
WriteUnexpectedValue(self, "OnGameReload", "Framework", "The script object cannot be none.")
EndIf
TextBox4_Label = Client.GetMember("TextBox4.Label")
TextBox4_Value = Client.GetMember("TextBox4.Value")
TextBox5_Label = Client.GetMember("TextBox5.Label")
TextBox5_Value = Client.GetMember("TextBox5.Value")
Client.RegisterForOpenCloseEvent(self)
WriteLine(self, "OnGameReload")
Else
WriteUnexpectedValue(self, "OnGameReload", "Scouter", "The Armor cannot be none.")
EndIf
Expand All @@ -53,20 +47,19 @@ Function OnGameReload()
EndFunction


Event Fallout:Overlays:Framework.OpenCloseEvent(Fallout:Overlays:Framework sender, var[] arguments)
OpenCloseEventArgs e = sender.GetOpenCloseEventArgs(arguments)
Event Fallout:Overlays:Client.OpenCloseEvent(Fallout:Overlays:Client sender, var[] arguments)
OpenCloseEventArgs e = Client.GetOpenCloseEventArgs(arguments)
If (e.Opening)
If (sender.Equipped == Scouter)
If (Client.Equipped == Scouter)
WriteLine(self, "Invoking AS3 code on the scouter overlay.")

Game:PluginInfo info = Plugin.GetInfo()

sender.Set(TextBox4_Label, "Mod")
sender.Set(TextBox4_Value, info.name+" by "+info.author)

sender.Set(TextBox5_Label, "Player Level")
sender.Set(TextBox5_Value, "The players level is "+Game.GetPlayerLevel())
Client.Set(TextBox4_Label, "Mod")
Client.Set(TextBox4_Value, info.name+" by "+info.author)

Client.Set(TextBox5_Label, "Player Level")
Client.Set(TextBox5_Value, "The players level is "+Game.GetPlayerLevel())
Else
WriteLine(self, "No scouter item is equipped.")
EndIf
Expand All @@ -78,5 +71,6 @@ EndEvent
;---------------------------------------------

Group Properties
Fallout:Overlays:Client Property Client Auto Const Mandatory
Scouter:Plugin Property Plugin Auto Const Mandatory
EndGroup
5 changes: 5 additions & 0 deletions Data.Test/Console/EnableVertibirds.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Set BoSFastTravelCanUse To 1
Set BoSFastTravelPilot To 1
PRID 1BBC91
Enable
Player.AddItem 00056917 20
4 changes: 2 additions & 2 deletions Data.Test/OverlaysTest.esp
Git LFS file not shown
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Scriptname Fallout:OverlaysTest:Events extends Fallout:Overlays:Type DebugOnly
import Fallout:Overlays:Papyrus

Actor Player

; Events
;---------------------------------------------

Event OnQuestInit()
Player = Game.GetPlayer()
RegisterForRemoteEvent(Player, "OnSit")
; RegisterForRemoteEvent(Player, "OnGetUp")
RegisterForRemoteEvent(Player, "OnPlayerEnterVertibird")
RegisterForRemoteEvent(Player, "OnRaceSwitchComplete")
RegisterForRemoteEvent(Player, "OnPlayerUseWorkBench")
RegisterForRemoteEvent(Player, "OnPlayerModArmorWeapon")
WriteLine(self, "Registered for remote test events.")
EndEvent


Event Actor.OnSit(Actor akSender, ObjectReference akFurniture)
WriteLine(self, "Actor.OnSit", "akSender:"+akSender+", akFurniture:"+akFurniture)
EndEvent


; Event Actor.OnGetUp(Actor akSender, ObjectReference akFurniture)
; WriteLine(self, "Actor.OnGetUp", "akSender:"+akSender+", akFurniture:"+akFurniture)
; EndEvent


Event Actor.OnPlayerEnterVertibird(Actor akSender, ObjectReference akVertibird)
WriteLine(self, "Actor.OnPlayerEnterVertibird", "akSender:"+akSender+", akVertibird:"+akVertibird)
EndEvent


Event Actor.OnRaceSwitchComplete(Actor akSender)
WriteLine(self, "Actor.OnRaceSwitchComplete", "akSender:"+akSender)
EndEvent


Event Actor.OnPlayerUseWorkBench(Actor akSender, ObjectReference akWorkBench)
WriteLine(self, "Actor.OnPlayerUseWorkBench", "akSender:"+akSender+", akWorkBench:"+akWorkBench)
EndEvent


Event Actor.OnPlayerModArmorWeapon(Actor akSender, Form akBaseObject, ObjectMod akModBaseObject)
WriteLine(self, "Actor.OnPlayerModArmorWeapon", "akSender:"+akSender+", akBaseObject:"+akBaseObject+", akModBaseObject:"+akModBaseObject)
EndEvent
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@
import System.IO.FileSystem;
import System.IO.Path;

/**
* This still wont switch from one overlay to another.
* Unloading the entire menu makes it work. (unequipping)
*/
public dynamic class OverlayLoader extends LoaderType
{

// Initialize
//---------------------------------------------

Expand Down Expand Up @@ -53,7 +48,7 @@
path = Path.ChangeExtension(filepath, extension);
}

if (extension == File.SWF && File.ExistsIn(XSE, FileSystem.Interface, path))
if (extension == File.SWF && File.ExistsIn(F4SE, FileSystem.Interface, path))
{
Debug.WriteLine("[OverlayLoader]", "Found SWF:", "path:"+path);
return super.Load(path);
Expand All @@ -64,7 +59,7 @@
path = Path.ChangeExtension(filepath, extension);
}

if (extension == File.DDS && File.ExistsIn(XSE, FileSystem.Textures, path))
if (extension == File.DDS && File.ExistsIn(F4SE, FileSystem.Textures, path))
{
Debug.WriteLine("[OverlayLoader]", "Found DDS:", "path:"+path);
return super.Load(path);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
package
{
import com.greensock.*;
import com.greensock.easing.*;
import F4SE.ICodeObject;
import flash.display.MovieClip;
import System.Diagnostics.Debug;

public class OverlayMenu extends MovieClip
// TODO: Expose the "Client" string variable path to papyrus.

public class OverlayMenu extends MovieClip implements F4SE.ICodeObject
{
// Stage
public var Controller:MovieClip;

// Loader
private var Overlay:OverlayLoader;
private const Name:String = "OverlayMenu";
private const MountID:String = "OverlayMenu_ImageMount";

// Properties
public function get Visible():Boolean { return this.visible; }
public function set Visible(value:Boolean):void { this.visible = value; }

Expand All @@ -23,20 +33,34 @@
{
System.Diagnostics.Debug.Prefix = "Overlay Framework";
Overlay = new OverlayLoader(Name, MountID);
this.addChild(Overlay);
Controller.addChild(Overlay);
Debug.WriteLine("[OverlayMenu]", "(ctor)", "Constructor Code", this.loaderInfo.url);
}


// @F4SE.ICodeObject
public function onF4SEObjCreated(codeObject:*):void
{
Overlay.onF4SEObjCreated(codeObject);
}


// Methods
//---------------------------------------------

public function SetURI(filepath:String):void
public function Load(filepath:String):void
{
Debug.WriteLine("[OverlayMenu]", "(SetURI)", "Setting the filepath to '"+filepath+"'");
Debug.WriteLine("[OverlayMenu]", "(Load)", "Setting the filepath to '"+filepath+"'.");
Overlay.Load(filepath);
}


public function AlphaTo(value:Number, duration:Number):void
{
Debug.WriteLine("[OverlayMenu]", "(AlphaTo)", "Alpha is tweening from "+alpha+" to "+value+" over "+duration+" seconds.");
TweenMax.to(Controller, duration, {alpha:value});
}


}
}
Git LFS file not shown
3 changes: 2 additions & 1 deletion Data/Interface/Source/FO4_Overlays/Readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Fallout 4 Overlays

This is the root package directory for AS3 imports.

This library uses an external package [UI Library #c37b191ae21e1a392850a736ed2b09263c577dee](https://github.com/Scrivener07/FO4_Scripting/tree/c37b191ae21e1a392850a736ed2b09263c577dee/Data.UI.Library/Interface/Source/Fallout_Library)
52 changes: 47 additions & 5 deletions Data/MCM/Config/Overlays/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"content":
[
{
"text": "Opacity",
"text": "Transparency",
"type": "slider",
"help": "Applies transparency to overlays. Range: 0-1, Step: 0.01.",
"valueOptions":
{
"sourceType": "GlobalValue",
"form": "Overlays.esp|5B95",
"min": 0,
"max": 1,
"sourceForm": "Overlays.esp|5B95",
"min": 0.0,
"max": 1.0,
"step": 0.01
},
"action":
Expand All @@ -22,7 +22,49 @@
"form": "Overlays.esp|F99",
"function": "SetAlpha",
"params": ["{value}"],
"scriptName": "Fallout:Overlays:Menu"
"scriptName": "Fallout:Overlays:Configuration"
}
},
{
"text": "Transparency Transition Duration",
"type": "slider",
"help": "Transitions the overlay transparency over the given duration in seconds. Range: 0-10, Step: 0.25.",
"valueOptions":
{
"sourceType": "GlobalValue",
"sourceForm": "Overlays.esp|632F",
"min": 0.0,
"max": 5.0,
"step": 0.25
},
"action":
{
"type": "CallFunction",
"form": "Overlays.esp|F99",
"function": "SetScopeAlpha",
"params": ["{value}"],
"scriptName": "Fallout:Overlays:Configuration"
}
},
{
"text": "Scope Menu - Transparency",
"type": "slider",
"help": "Applies transparency to overlays when zoomed in the scope menu. Range: 0-1, Step: 0.01.",
"valueOptions":
{
"sourceType": "GlobalValue",
"sourceForm": "Overlays.esp|7263",
"min": 0.0,
"max": 1.0,
"step": 0.01
},
"action":
{
"type": "CallFunction",
"form": "Overlays.esp|F99",
"function": "SetScopeAlpha",
"params": ["{value}"],
"scriptName": "Fallout:Overlays:Configuration"
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions Data/Overlays.esp
Git LFS file not shown
9 changes: 9 additions & 0 deletions Data/Overlays.esp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
```
GLOB
01005B95 Fallout_Overlays_Alpha
0100632F Fallout_Overlays_AlphaSpeed
01007263 Fallout_Overlays_Scope_Alpha
QUST
01000F99 Fallout_Overlays
```
Loading

0 comments on commit 771ced9

Please sign in to comment.