Skip to content

Commit

Permalink
Last minute fixes to handlers codes
Browse files Browse the repository at this point in the history
  • Loading branch information
distrohelena committed Aug 5, 2018
1 parent 8069d86 commit 479a191
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 44 deletions.
28 changes: 28 additions & 0 deletions Master/Nucleus.Coop.App/Forms/HandlerManagerForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions Master/Nucleus.Coop.App/Forms/HandlerManagerForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -381,5 +381,19 @@ private void btn_uninstall_Click(object sender, EventArgs e)
// refresh
UpdateTabs();
}

private void btn_installPkg_Click(object sender, EventArgs e)
{
using (OpenFileDialog open = new OpenFileDialog())
{
open.Filter = "Nucleus Package Files|*.nc";
if (open.ShowDialog() == DialogResult.OK)
{
string path = open.FileName;
GameManager.Instance.RepoManager.InstallPackage(path);
UpdateTabs();
}
}
}
}
}
4 changes: 0 additions & 4 deletions Master/Nucleus.Coop.App/Nucleus.Coop.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -500,10 +500,6 @@
<Content Include="Resources\icon.ico" />
</ItemGroup>
<ItemGroup>
<None Include="..\Nucleus.Coop.StartGame\bin\Debug\StartGame.exe" Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<Link>bin\StartGame.exe</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Nucleus.Coop.StartGame\bin\Release\StartGame.exe" Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<Link>bin\StartGame.exe</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
6 changes: 6 additions & 0 deletions Master/Nucleus.Coop.AppPostBuild/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ static void Main(string[] args)

List<FileInfo> toDelete = dirInfo.GetFiles("*.pdb").ToList();
toDelete.AddRange(dirInfo.GetFiles("*.xml"));
toDelete.AddRange(dirInfo.GetFiles("*.config").Where(c => !c.Name.ToLower().StartsWith("nucleus.coop.app")));

List<FileInfo> files = dirInfo.GetFiles("*.dll").ToList();
List<FileInfo> exes = dirInfo.GetFiles("*.exe").ToList();
files.AddRange(exes.Where((c) => {
var cname = c.Name.ToLower();
return !cname.StartsWith("nucleus.coop.app") && !cname.StartsWith("tempbuilder");
}));

Console.WriteLine($"NucleusCoop Builder Helper");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ Game.OnPlay.Callback(function () {
var saveSrc = Context.CombinePath(Context.InstallFolder, "synergy\\cfg\\video.txt");
var savePath = Context.CombinePath(Context.InstanceFolder, "synergy\\cfg\\video.txt");
Context.ModifySaveFile(saveSrc, savePath, SaveType.CFG, [
Context.NewCfgSaveInfo("VideoConfig", "setting.fullscreen", "0"),
Context.NewCfgSaveInfo("VideoConfig", "setting.defaultres", Math.max(640, Context.Width)),
Context.NewCfgSaveInfo("VideoConfig", "setting.defaultresheight", Math.max(360, Context.Height)),
Context.NewCfgSaveInfo("VideoConfig", "setting.nowindowborder", "0"),
Context.NewSaveInfo("VideoConfig", "setting.fullscreen", "0"),
Context.NewSaveInfo("VideoConfig", "setting.defaultres", Math.max(640, Context.Width)),
Context.NewSaveInfo("VideoConfig", "setting.defaultresheight", Math.max(360, Context.Height)),
Context.NewSaveInfo("VideoConfig", "setting.nowindowborder", "0"),
]);

//copy config.cfg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Game.ExecutableName = "borderlandspresequel.exe";
Game.SteamID = "261640";
Game.MaxPlayers = 4;
Game.MaxPlayersOneMonitor = 4;
Game.BinariesFolder = "binaries\\win32";
Game.ExecutablePath = "binaries\\win32";
Game.NeedsSteamEmulation = false;
Game.LauncherTitle = "splashscreen";
Game.SaveType = SaveType.INI;
Expand All @@ -28,21 +28,21 @@ Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "Borderlands: The Pre-Sequel (32-bit, DX9)";
Game.Hook.DInputEnabled = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;// true; // this is beta
Game.Hook.XInputReroute = false;// true; // this is beta/not working at all probably
Game.Hook.XInputNames = ["xinput1_3.dll"];

Game.OnPlay.Callback(function () {
var savePath = Context.GetFolder(Folder.Documents) + "\\My Games\\Borderlands The Pre-Sequel\\WillowGame\\Config\\WillowEngine.ini";
Context.ModifySaveFile(savePath, savePath, SaveType.INI, [
Context.NewIniSaveInfo("SystemSettings", "WindowedFullscreen", Context.IsFullscreen),
Context.NewIniSaveInfo("SystemSettings", "ResX", Context.Width),
Context.NewIniSaveInfo("SystemSettings", "ResY", Context.Height),
Context.NewIniSaveInfo("SystemSettings", "Fullscreen", false),
Context.NewIniSaveInfo("Engine.Engine", "bPauseOnLossOfFocus", false),
Context.NewIniSaveInfo("WillowGame.WillowGameEngine", "bPauseLostFocusWindowed", false),
Context.NewIniSaveInfo("Engine.Engine", "bMuteAudioWhenNotInFocus", false),
Context.NewIniSaveInfo("Engine.Engine", "bPauseOnLossOfFocus", false),
Context.NewIniSaveInfo("WillowGame.WillowGameEngine", "bMuteAudioWhenNotInFocus", false),
Context.NewSaveInfo("SystemSettings", "WindowedFullscreen", Context.IsFullscreen),
Context.NewSaveInfo("SystemSettings", "ResX", Context.Width),
Context.NewSaveInfo("SystemSettings", "ResY", Context.Height),
Context.NewSaveInfo("SystemSettings", "Fullscreen", false),
Context.NewSaveInfo("Engine.Engine", "bPauseOnLossOfFocus", false),
Context.NewSaveInfo("WillowGame.WillowGameEngine", "bPauseLostFocusWindowed", false),
Context.NewSaveInfo("Engine.Engine", "bMuteAudioWhenNotInFocus", false),
Context.NewSaveInfo("Engine.Engine", "bPauseOnLossOfFocus", false),
Context.NewSaveInfo("WillowGame.WillowGameEngine", "bMuteAudioWhenNotInFocus", false),
]);

var playerStr = "saveid" + Context.PlayerID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Game.SupportsKeyboard = true;
Game.ExecutableName = "borderlands2.exe";
Game.MaxPlayers = 4;
Game.MaxPlayersOneMonitor = 4;
Game.BinariesFolder = "binaries\\win32";
Game.ExecutablePath = "binaries\\win32";
Game.NeedsSteamEmulation = false;
Game.LauncherTitle = "splashscreen";
Game.SaveType = SaveType.INI;
Expand All @@ -36,15 +36,15 @@ Game.Hook.XInputNames = [ "xinput1_3.dll" ];
Game.OnPlay.Callback(function () {
var savePath = Context.GetFolder(Folder.Documents) + "\\My Games\\Borderlands 2\\WillowGame\\Config\\WillowEngine.ini";
Context.ModifySaveFile(savePath, savePath, SaveType.INI, [
Context.NewIniSaveInfo("SystemSettings", "WindowedFullscreen", Context.IsFullscreen),
Context.NewIniSaveInfo("SystemSettings", "ResX", Context.Width),
Context.NewIniSaveInfo("SystemSettings", "ResY", Context.Height),
Context.NewIniSaveInfo("SystemSettings", "Fullscreen", false),
Context.NewIniSaveInfo("Engine.Engine", "bPauseOnLossOfFocus", false),
Context.NewIniSaveInfo("WillowGame.WillowGameEngine", "bPauseLostFocusWindowed", false),
Context.NewIniSaveInfo("Engine.Engine", "bMuteAudioWhenNotInFocus", false),
Context.NewIniSaveInfo("Engine.Engine", "bPauseOnLossOfFocus", false),
Context.NewIniSaveInfo("WillowGame.WillowGameEngine", "bMuteAudioWhenNotInFocus", false),
Context.NewSaveInfo("SystemSettings", "WindowedFullscreen", Context.IsFullscreen),
Context.NewSaveInfo("SystemSettings", "ResX", Context.Width),
Context.NewSaveInfo("SystemSettings", "ResY", Context.Height),
Context.NewSaveInfo("SystemSettings", "Fullscreen", false),
Context.NewSaveInfo("Engine.Engine", "bPauseOnLossOfFocus", false),
Context.NewSaveInfo("WillowGame.WillowGameEngine", "bPauseLostFocusWindowed", false),
Context.NewSaveInfo("Engine.Engine", "bMuteAudioWhenNotInFocus", false),
Context.NewSaveInfo("Engine.Engine", "bPauseOnLossOfFocus", false),
Context.NewSaveInfo("WillowGame.WillowGameEngine", "bMuteAudioWhenNotInFocus", false),
]);

var playerStr = "saveid" + Context.PlayerID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ Game.OnPlay.Callback(function () {
var saveSrc = Context.CombinePath(Context.InstallFolder, "left4dead2\\cfg\\video.txt");
var savePath = Context.CombinePath(Context.InstanceFolder, "left4dead2\\cfg\\video.txt");
Context.ModifySaveFile(saveSrc, savePath, SaveType.CFG, [
Context.NewCfgSaveInfo("config", "setting.fullscreen", "0"),
Context.NewCfgSaveInfo("config", "setting.defaultres", Math.max(640, Context.Width)),
Context.NewCfgSaveInfo("config", "setting.defaultresheight", Math.max(360, Context.Height)),
Context.NewCfgSaveInfo("config", "setting.nowindowborder", "0"),
Context.NewCfgSaveInfo("VideoConfig", "setting.fullscreen", "0"),
Context.NewCfgSaveInfo("VideoConfig", "setting.defaultres", Math.max(640, Context.Width)),
Context.NewCfgSaveInfo("VideoConfig", "setting.defaultresheight", Math.max(360, Context.Height)),
Context.NewCfgSaveInfo("VideoConfig ", "setting.nowindowborder", "0"),
Context.NewSaveInfo("config", "setting.fullscreen", "0"),
Context.NewSaveInfo("config", "setting.defaultres", Math.max(640, Context.Width)),
Context.NewSaveInfo("config", "setting.defaultresheight", Math.max(360, Context.Height)),
Context.NewSaveInfo("config", "setting.nowindowborder", "0"),
Context.NewSaveInfo("VideoConfig", "setting.fullscreen", "0"),
Context.NewSaveInfo("VideoConfig", "setting.defaultres", Math.max(640, Context.Width)),
Context.NewSaveInfo("VideoConfig", "setting.defaultresheight", Math.max(360, Context.Height)),
Context.NewSaveInfo("VideoConfig ", "setting.nowindowborder", "0"),
]);

//copy config.cfg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ Game.OnPlay.Callback(function () {
var saveSrc = Context.CombinePath(Context.RootInstallFolder, "reactivedrop\\cfg\\video.txt");
var savePath = Context.CombinePath(Context.RootFolder, "reactivedrop\\cfg\\video.txt");
Context.ModifySaveFile(saveSrc, savePath, SaveType.CFG, [
Context.NewCfgSaveInfo("VideoConfig", "setting.fullscreen", "0"),
Context.NewCfgSaveInfo("VideoConfig", "setting.defaultres", Math.max(640, Context.Width)),
Context.NewCfgSaveInfo("VideoConfig", "setting.defaultresheight", Math.max(360, Context.Height)),
Context.NewCfgSaveInfo("VideoConfig", "setting.nowindowborder", "0"),
Context.NewSaveInfo("VideoConfig", "setting.fullscreen", "0"),
Context.NewSaveInfo("VideoConfig", "setting.defaultres", Math.max(640, Context.Width)),
Context.NewSaveInfo("VideoConfig", "setting.defaultresheight", Math.max(360, Context.Height)),
Context.NewSaveInfo("VideoConfig", "setting.nowindowborder", "0"),
]);

//copy config.cfg
Expand Down
19 changes: 16 additions & 3 deletions Master/Nucleus.Coop.PkgManager/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@ static void Main()
{
string rootDir = AssemblyUtil.GetStartFolder();
string output = Path.Combine(rootDir, "output");
string toBuild = "..\\..\\MainRepo\\handlers\\sources";
BuildDir(output, toBuild);

output = Path.Combine(rootDir, "altoutput");
toBuild = "..\\..\\..\\..\\..\\altrepo\\packages\\source\\";
BuildDir(output, toBuild);
}

private static void BuildDir(string output, string toBuild)
{
string infosFolder = Path.Combine(output, "infos");
string pkgsFolder = Path.Combine(output, "handlers");

string toBuild = "..\\..\\MainRepo\\handlers\\sources";

string indexPagePath = Path.Combine(output, "index.html");
string indexData = "<html><head><link rel='stylesheet' href='bootstrap.css'><link rel='stylesheet' href='style.css'></head><body>";

Expand Down Expand Up @@ -64,6 +72,11 @@ static void Main()
{
DirectoryInfo dir = dirs[i];

if (dir.Name.Contains("239140")) // ignore dying light, unfinished
{
continue;
}

// read handler data
string handlerPath = Path.Combine(dir.FullName, "info.json");
string handlerData = File.ReadAllText(handlerPath);
Expand Down Expand Up @@ -136,7 +149,7 @@ static void Main()

indexData += string.Format("<a href='packages/{0}.nc'>", pkgName);
indexData += string.Format("<img src='infos/{0}/header.jpg' /></a> ", metadata.HandlerID);
indexData += string.Format("<h3>{0}</h3><h4>{1}</h4><h5><a href='packages/{2}.nc'>[DOWNLOAD HANDLER v{3}]</a></h5>",
indexData += string.Format("<h3>{0}</h3><h4>{1}</h4><h5><a href='handlers/{2}.nc'>[DOWNLOAD HANDLER v{3}]</a></h5>",
metadata.GameTitle, metadata.Title, pkgName, metadata.V);
indexData += "<br /> </div>";
}
Expand Down
5 changes: 5 additions & 0 deletions Master/Nucleus.Gaming/Coop/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,11 @@ public void RebuildGameDb()
user.InstalledHandlers.Add(metadata);
}

if (installedHandlers.Length == 0)
{
user.Games.Clear(); // TODO: better clear
}

user.Save();
}

Expand Down

0 comments on commit 479a191

Please sign in to comment.