From 45d31db52bf3fdd8455749bed97e742cee6ed2a3 Mon Sep 17 00:00:00 2001 From: NiziulLuizin <74280280+NiziulLuizin@users.noreply.github.com> Date: Wed, 29 Mar 2023 19:26:33 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20adding=20the=20codes=20from=20ve?= =?UTF-8?q?rsion=20v0.6.0.0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Helideck Signaling/Helideck Signaling.csproj | 2 - Helideck Signaling/Main.cs | 29 +- Helideck Signaling/Properties/AssemblyInfo.cs | 38 + .../blip-creator/BlipCreator.cs | 18 +- Helideck Signaling/user-interface/Editor.cs | 830 +++++++++--------- .../user-interface/pop-up/PopUp.cs | 420 +++++---- .../pop-up/settings/LayoutGroupManager.cs | 178 ++-- .../pop-up/settings/creators/LayoutCreator.cs | 532 +++++------ .../pop-up/settings/creators/SpriteCreator.cs | 100 +-- .../pop-up/settings/interfaces/ILayout.cs | 16 +- .../settings/interfaces/ISpriteGroups.cs | 52 +- README.md | 74 ++ 12 files changed, 1199 insertions(+), 1090 deletions(-) create mode 100644 Helideck Signaling/Properties/AssemblyInfo.cs diff --git a/Helideck Signaling/Helideck Signaling.csproj b/Helideck Signaling/Helideck Signaling.csproj index a2d5f69..f89361d 100644 --- a/Helideck Signaling/Helideck Signaling.csproj +++ b/Helideck Signaling/Helideck Signaling.csproj @@ -49,8 +49,6 @@ - - diff --git a/Helideck Signaling/Main.cs b/Helideck Signaling/Main.cs index 1e77df9..5baabe8 100644 --- a/Helideck Signaling/Main.cs +++ b/Helideck Signaling/Main.cs @@ -16,17 +16,17 @@ internal sealed class Main : Script public Main() { - _areThereBlipsOnTheMap = - false; + _blipCreator + = new BlipCreator(); - _player = - Game + _areThereBlipsOnTheMap + = false; + + _player + = Game .Player .Character; - _blipCreator = - new BlipCreator(); - Tick += (o, e) => { Start(); }; @@ -44,7 +44,7 @@ private void Start() { case true: { - BlipBehaviors(); + BlipBehaviors(); } return; case false: @@ -92,13 +92,12 @@ private void FlightOperation() _blipCreator .ClearsMapLeavingOnlyTheSelectedBlips(); + //var isTheWaypointInUse = + // World + // .WaypointBlip != null; - var isTheWaypointInUse = - World - .WaypointBlip != null; - - if (isTheWaypointInUse) - LandingZoneControl(); + //if (isTheWaypointInUse) + // LandingZoneControl(); } _areThereBlipsOnTheMap = @@ -140,7 +139,6 @@ private void LandingZoneControl() } else { - if (vehicleOnTheLandingArea .IsHelicopter && vehicleOnTheLandingArea @@ -154,7 +152,6 @@ private void LandingZoneControl() vehicleOnTheLandingArea .Delete(); - } } } diff --git a/Helideck Signaling/Properties/AssemblyInfo.cs b/Helideck Signaling/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..33df60c --- /dev/null +++ b/Helideck Signaling/Properties/AssemblyInfo.cs @@ -0,0 +1,38 @@ +using System.Resources; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Helideck-Signaling")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Helideck-Signaling")] +[assembly: AssemblyCopyright("Copyright © 2022 niziulluizin")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("EB6E70BB-473C-40AC-984B-0B1F762593B7")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.6.0.0")] +[assembly: AssemblyFileVersion("0.6.0.0")] +[assembly: NeutralResourcesLanguage("en")] diff --git a/Helideck Signaling/blip-creator/BlipCreator.cs b/Helideck Signaling/blip-creator/BlipCreator.cs index 594cdfb..47db27b 100644 --- a/Helideck Signaling/blip-creator/BlipCreator.cs +++ b/Helideck Signaling/blip-creator/BlipCreator.cs @@ -50,9 +50,12 @@ internal void CreateAllAvailableBlips() foreach (var locationOfTheNativeHelipad in locationOfTheNativeHelipads) { - if (building.Position.ToString() == locationOfTheNativeHelipad.ToString()) - hasThisHelipadBeenIdentifiedYet = - true; + var buildingPositionn + = building + .Position; + + if (buildingPositionn.ToString() == locationOfTheNativeHelipad.ToString()) + hasThisHelipadBeenIdentifiedYet = true; } if (!hasThisHelipadBeenIdentifiedYet) @@ -76,9 +79,12 @@ internal void CreateAllAvailableBlips() foreach (var locationOfTheNativeHelipad in locationOfTheNativeHelipads) { - if (prop.Position.ToString() == locationOfTheNativeHelipad.ToString()) - hasThisHelipadBeenIdentifiedYet = - true; + var propPosition + = prop + .Position; + + if (propPosition.ToString() == locationOfTheNativeHelipad.ToString()) + hasThisHelipadBeenIdentifiedYet = true; } if (!hasThisHelipadBeenIdentifiedYet) diff --git a/Helideck Signaling/user-interface/Editor.cs b/Helideck Signaling/user-interface/Editor.cs index 4b9d397..f896c62 100644 --- a/Helideck Signaling/user-interface/Editor.cs +++ b/Helideck Signaling/user-interface/Editor.cs @@ -1,420 +1,420 @@ -using GTA; -using GTA.UI; - -using Font = GTA.UI.Font; - -using System.Drawing; - -using Helideck_Signaling.setup_manager; - - -namespace Helideck_Signaling.user_interface -{ - internal struct StIntermediary - { - public static PointF CurrentPosition - { get; set; } - public static bool IsTheEditorEnabled - { get; set; } - } - - internal sealed class Editor : Script - { - public Editor() - { - Tick += (o, e) => - { - if (Game.WasCheatStringJustEntered("Editor(){}")) - { - var defaultText = - string.Empty; - - var defaultInputs = new[] - { - "[on]", - "[off]" - }; - - if (!StIntermediary.IsTheEditorEnabled) - defaultText = - defaultInputs[0]; - else - defaultText = - defaultInputs[1]; - - var userInput = - Game - .GetUserInput(windowTitle: WindowTitle.EnterMessage60, - defaultText: defaultText, - maxLength : 60); - - switch (userInput) - { - case "[on]": - { - StIntermediary - .IsTheEditorEnabled = true; - } - return; - case "[Off]": - { - StIntermediary - .IsTheEditorEnabled = false; - } - return; - case "SaveTheRelativePositionOfLayoutGroup(){}": - { - SaveTheRelativePositionOfThis(textureName: "alert - instruction", - layoutGroup: LayoutGroups.ALERT); - } - return; - } - } - - - if (StIntermediary.IsTheEditorEnabled) - { - Game - .DisableAllControlsThisFrame(); - Game - .EnableControlThisFrame(Control - .EnterCheatCode); - } - }; - } +//using GTA; +//using GTA.UI; + +//using Font = GTA.UI.Font; + +//using System.Drawing; + +//using Helideck_Signaling.setup_manager; + + +//namespace Helideck_Signaling.user_interface +//{ +// internal struct StIntermediary +// { +// public static PointF CurrentPosition +// { get; set; } +// public static bool IsTheEditorEnabled +// { get; set; } +// } + +// internal sealed class Editor : Script +// { +// public Editor() +// { +// Tick += (o, e) => +// { +// if (Game.WasCheatStringJustEntered("Editor(){}")) +// { +// var defaultText = +// string.Empty; + +// var defaultInputs = new[] +// { +// "[on]", +// "[off]" +// }; + +// if (!StIntermediary.IsTheEditorEnabled) +// defaultText = +// defaultInputs[0]; +// else +// defaultText = +// defaultInputs[1]; + +// var userInput = +// Game +// .GetUserInput(windowTitle: WindowTitle.EnterMessage60, +// defaultText: defaultText, +// maxLength : 60); + +// switch (userInput) +// { +// case "[on]": +// { +// StIntermediary +// .IsTheEditorEnabled = true; +// } +// return; +// case "[Off]": +// { +// StIntermediary +// .IsTheEditorEnabled = false; +// } +// return; +// case "SaveTheRelativePositionOfLayoutGroup(){}": +// { +// SaveTheRelativePositionOfThis(textureName: "alert - instruction", +// layoutGroup: LayoutGroups.ALERT); +// } +// return; +// } +// } + + +// if (StIntermediary.IsTheEditorEnabled) +// { +// Game +// .DisableAllControlsThisFrame(); +// Game +// .EnableControlThisFrame(Control +// .EnterCheatCode); +// } +// }; +// } - /// - ///private void SavePositionIn(ScriptSettings[] scriptsSettings) - ///{ - /// var displayCompatibility = - /// scriptsSettings[0]; - /// - /// var screenCompatibility = - /// displayCompatibility - /// .GetAllValues(section: "Compatibility", - /// name : $"{Screen.AspectRatio}")[0]; - /// - /// - /// displayCompatibility - /// .SetValue(section: screenCompatibility, - /// name : "Screen Center Position", - /// value : StIntermediary.CurrentPosition.X); - /// - /// displayCompatibility - /// .Save(); - /// - /// Notification - /// .Show(message : $"{StIntermediary.CurrentPosition.X} - ~g~successfully saved~w~!", - /// blinking: true); - ///} - ///private void SaveTexturesResolutionsIn(ScriptSettings[] scriptsSettings) - ///{ - /// var interfaceSettings = - /// scriptsSettings[1]; - /// - /// var contentResolution = - /// scriptsSettings[2]; - /// - /// var texturesName = - /// ReturnNameOfTexturesIn(interfaceSettings); - /// - /// var textureDict = - /// interfaceSettings - /// .GetAllValues(section: "Texture Dictionaries To Be Used", - /// name : "_")[0]; - /// - /// foreach (var textureName in texturesName) - /// { - /// contentResolution - /// .SetValue(section: textureName, - /// name : "_", - /// value : ReturnResolutionOfThis(textureName, - /// textureDict).ToString() - /// .Replace("{", "") - /// .Replace("}", "") - /// .Replace(",", "") - /// .Replace("=", ":")); - /// } - /// - /// contentResolution - /// .Save(); - ///} - - private void SaveTheRelativePositionOfThis(string textureName, LayoutGroups layoutGroup) - { - var settings = - new Settings(); - - var displayCompatibility = - settings - .ReturnThePositionOfCenterOfScreen(); - - var layoutGroupsFile = - ScriptSettings - .Load($@"{settings.PathToTheHelideckSignalingFolder}\PopUpSettings\LayoutGroups.ini"); - - var relativePosition = - new PointF(StIntermediary.CurrentPosition.X - displayCompatibility.X, - StIntermediary.CurrentPosition.Y - displayCompatibility.Y); - - layoutGroupsFile - .SetValue(section: $"Layout Group - {layoutGroup}", - name : textureName, - value : relativePosition.ToString() - .Replace("{", "") - .Replace("}", "") - .Replace(",", "") - .Replace("=", ":")); - - layoutGroupsFile - .Save(); - - Notification - .Show(message : $"{textureName} - {StIntermediary.CurrentPosition} - ~g~successfully saved~w~!", - blinking: true); - } - } - internal sealed class ScreenCenterIdentifier : Script - { - private Sprite _sprite; - - public ScreenCenterIdentifier() - { - var velocity = - (byte)1; - - var textsElement = - ConfiguredTextElements(4); - - Tick += (o, e) => - { - if (!StIntermediary.IsTheEditorEnabled) - { - if (Interval != 1000) - Interval = 1000; +// /// +// ///private void SavePositionIn(ScriptSettings[] scriptsSettings) +// ///{ +// /// var displayCompatibility = +// /// scriptsSettings[0]; +// /// +// /// var screenCompatibility = +// /// displayCompatibility +// /// .GetAllValues(section: "Compatibility", +// /// name : $"{Screen.AspectRatio}")[0]; +// /// +// /// +// /// displayCompatibility +// /// .SetValue(section: screenCompatibility, +// /// name : "Screen Center Position", +// /// value : StIntermediary.CurrentPosition.X); +// /// +// /// displayCompatibility +// /// .Save(); +// /// +// /// Notification +// /// .Show(message : $"{StIntermediary.CurrentPosition.X} - ~g~successfully saved~w~!", +// /// blinking: true); +// ///} +// ///private void SaveTexturesResolutionsIn(ScriptSettings[] scriptsSettings) +// ///{ +// /// var interfaceSettings = +// /// scriptsSettings[1]; +// /// +// /// var contentResolution = +// /// scriptsSettings[2]; +// /// +// /// var texturesName = +// /// ReturnNameOfTexturesIn(interfaceSettings); +// /// +// /// var textureDict = +// /// interfaceSettings +// /// .GetAllValues(section: "Texture Dictionaries To Be Used", +// /// name : "_")[0]; +// /// +// /// foreach (var textureName in texturesName) +// /// { +// /// contentResolution +// /// .SetValue(section: textureName, +// /// name : "_", +// /// value : ReturnResolutionOfThis(textureName, +// /// textureDict).ToString() +// /// .Replace("{", "") +// /// .Replace("}", "") +// /// .Replace(",", "") +// /// .Replace("=", ":")); +// /// } +// /// +// /// contentResolution +// /// .Save(); +// ///} + +// private void SaveTheRelativePositionOfThis(string textureName, LayoutGroups layoutGroup) +// { +// var settings = +// new Settings(); + +// var displayCompatibility = +// settings +// .ReturnThePositionOfCenterOfScreen(); + +// var layoutGroupsFile = +// ScriptSettings +// .Load($@"{settings.PathToTheHelideckSignalingFolder}\PopUpSettings\LayoutGroups.ini"); + +// var relativePosition = +// new PointF(StIntermediary.CurrentPosition.X - displayCompatibility.X, +// StIntermediary.CurrentPosition.Y - displayCompatibility.Y); + +// layoutGroupsFile +// .SetValue(section: $"Layout Group - {layoutGroup}", +// name : textureName, +// value : relativePosition.ToString() +// .Replace("{", "") +// .Replace("}", "") +// .Replace(",", "") +// .Replace("=", ":")); + +// layoutGroupsFile +// .Save(); + +// Notification +// .Show(message : $"{textureName} - {StIntermediary.CurrentPosition} - ~g~successfully saved~w~!", +// blinking: true); +// } +// } +// internal sealed class ScreenCenterIdentifier : Script +// { +// private Sprite _sprite; + +// public ScreenCenterIdentifier() +// { +// var velocity = +// (byte)1; + +// var textsElement = +// ConfiguredTextElements(4); + +// Tick += (o, e) => +// { +// if (!StIntermediary.IsTheEditorEnabled) +// { +// if (Interval != 1000) +// Interval = 1000; - if (_sprite != null) - _sprite - .Dispose(); - - return; - } - else - { - if (_sprite == null) - _sprite = - ReturnTheSpriteOfTheCenterIdentifier(); - - var currentPosition = - StIntermediary - .CurrentPosition; - - var captions = new[] - { - $"[~b~Editor mode~w~]", - $"Velocity - ~r~{velocity}~w~", - $"P - [X] : ~y~{currentPosition.X}", - $"P - [Y] : ~y~{currentPosition.Y}" - }; - - for (var i = (byte)0; i < textsElement.Length; i++) - { - textsElement[i] - .Caption = captions[i]; - - textsElement[i] - .ScaledDraw(); - } - - _sprite - .ScaledDraw(); - - if (Interval != 0) - Interval = 0; - } - }; - - Aborted += (o, e) => - { - if (_sprite != null) - _sprite - .Dispose(); - }; - - KeyUp += (o, e) => - { - if (!StIntermediary.IsTheEditorEnabled) - { - return; - } - else - { - switch (e.KeyCode) - { - case System.Windows.Forms.Keys.Oemplus: - { - velocity++; - return; - } - case System.Windows.Forms.Keys.OemMinus: - { - velocity--; - return; - } - } - } - }; - - KeyDown += (o, e) => - { - if (!StIntermediary.IsTheEditorEnabled) - { - return; - } - else - { - switch (e.KeyCode) - { - case System.Windows.Forms.Keys.Right: - { - var newCurrentPosition = - StIntermediary - .CurrentPosition; - - newCurrentPosition = - new PointF(newCurrentPosition.X + (byte)1 * velocity, - newCurrentPosition.Y); - - StIntermediary - .CurrentPosition = newCurrentPosition; - - return; - } - case System.Windows.Forms.Keys.Left: - { - var currentPosition = - StIntermediary - .CurrentPosition; - - currentPosition = - new PointF(currentPosition.X - (byte)1 * velocity, - currentPosition.Y); - - StIntermediary - .CurrentPosition = currentPosition; - return; - } - - case System.Windows.Forms.Keys.Up: - { - var currentPosition = - StIntermediary - .CurrentPosition; - - currentPosition = - new PointF(currentPosition.X, - currentPosition.Y - (byte)1 * velocity); - - StIntermediary - .CurrentPosition = currentPosition; - - return; - } - case System.Windows.Forms.Keys.Down: - { - var currentPosition = - StIntermediary - .CurrentPosition; +// if (_sprite != null) +// _sprite +// .Dispose(); + +// return; +// } +// else +// { +// if (_sprite == null) +// _sprite = +// ReturnTheSpriteOfTheCenterIdentifier(); + +// var currentPosition = +// StIntermediary +// .CurrentPosition; + +// var captions = new[] +// { +// $"[~b~Editor mode~w~]", +// $"Velocity - ~r~{velocity}~w~", +// $"P - [X] : ~y~{currentPosition.X}", +// $"P - [Y] : ~y~{currentPosition.Y}" +// }; + +// for (var i = (byte)0; i < textsElement.Length; i++) +// { +// textsElement[i] +// .Caption = captions[i]; + +// textsElement[i] +// .ScaledDraw(); +// } + +// _sprite +// .ScaledDraw(); + +// if (Interval != 0) +// Interval = 0; +// } +// }; + +// Aborted += (o, e) => +// { +// if (_sprite != null) +// _sprite +// .Dispose(); +// }; + +// KeyUp += (o, e) => +// { +// if (!StIntermediary.IsTheEditorEnabled) +// { +// return; +// } +// else +// { +// switch (e.KeyCode) +// { +// case System.Windows.Forms.Keys.Oemplus: +// { +// velocity++; +// return; +// } +// case System.Windows.Forms.Keys.OemMinus: +// { +// velocity--; +// return; +// } +// } +// } +// }; + +// KeyDown += (o, e) => +// { +// if (!StIntermediary.IsTheEditorEnabled) +// { +// return; +// } +// else +// { +// switch (e.KeyCode) +// { +// case System.Windows.Forms.Keys.Right: +// { +// var newCurrentPosition = +// StIntermediary +// .CurrentPosition; + +// newCurrentPosition = +// new PointF(newCurrentPosition.X + (byte)1 * velocity, +// newCurrentPosition.Y); + +// StIntermediary +// .CurrentPosition = newCurrentPosition; + +// return; +// } +// case System.Windows.Forms.Keys.Left: +// { +// var currentPosition = +// StIntermediary +// .CurrentPosition; + +// currentPosition = +// new PointF(currentPosition.X - (byte)1 * velocity, +// currentPosition.Y); + +// StIntermediary +// .CurrentPosition = currentPosition; +// return; +// } + +// case System.Windows.Forms.Keys.Up: +// { +// var currentPosition = +// StIntermediary +// .CurrentPosition; + +// currentPosition = +// new PointF(currentPosition.X, +// currentPosition.Y - (byte)1 * velocity); + +// StIntermediary +// .CurrentPosition = currentPosition; + +// return; +// } +// case System.Windows.Forms.Keys.Down: +// { +// var currentPosition = +// StIntermediary +// .CurrentPosition; - currentPosition = - new PointF(currentPosition.X, - currentPosition.Y + (byte)1 * velocity); +// currentPosition = +// new PointF(currentPosition.X, +// currentPosition.Y + (byte)1 * velocity); - StIntermediary - .CurrentPosition = currentPosition; - - return; - } - } - } - }; - } - - private Sprite ReturnTheSpriteOfTheCenterIdentifier() - { - var textureDict = - "niziul_popUp_resources"; - - var textureName = - "screen - center - identifier"; - - var size = - new SizeF(400f / 2.75f, 48 / 2.75f); - - var position = - StIntermediary.CurrentPosition; - - return new Sprite(textureDict, - textureName, - size, - position) { Centered = true}; - } - private TextElement[] ConfiguredTextElements(byte amount) - { - var textsElement = - new TextElement[amount]; - - for (var i = (byte)0; i < textsElement.Length; i++) - { - textsElement[i] = - new TextElement(caption : string.Empty, - position: PointF.Empty, - scale : 0f); - - var verticalSpacing = - !(i > 0) ? 0f : i * 1.05f; - - var position = - new PointF(15f, - 20f * verticalSpacing); +// StIntermediary +// .CurrentPosition = currentPosition; + +// return; +// } +// } +// } +// }; +// } + +// private Sprite ReturnTheSpriteOfTheCenterIdentifier() +// { +// var textureDict = +// "niziul_popUp_resources"; + +// var textureName = +// "screen - center - identifier"; + +// var size = +// new SizeF(400f / 2.75f, 48 / 2.75f); + +// var position = +// StIntermediary.CurrentPosition; + +// return new Sprite(textureDict, +// textureName, +// size, +// position) { Centered = true}; +// } +// private TextElement[] ConfiguredTextElements(byte amount) +// { +// var textsElement = +// new TextElement[amount]; + +// for (var i = (byte)0; i < textsElement.Length; i++) +// { +// textsElement[i] = +// new TextElement(caption : string.Empty, +// position: PointF.Empty, +// scale : 0f); + +// var verticalSpacing = +// !(i > 0) ? 0f : i * 1.05f; + +// var position = +// new PointF(15f, +// 20f * verticalSpacing); - var scale = - 0.35f; - - DefaultSettingFor(textsElement[i], - position, - scale); - } - - return textsElement; - } - private void DefaultSettingFor(TextElement textElement, PointF position, float scale) - { - textElement - .Caption = string.Empty; - - textElement - .Position = position; - - textElement - .Scale = scale; - - textElement - .Shadow = true; - textElement - .Outline = true; - - textElement - .Color = Color - .White; - - textElement - .Alignment = Alignment - .Left; - - textElement - .Font = Font - .ChaletLondon; - } - } -} \ No newline at end of file +// var scale = +// 0.35f; + +// DefaultSettingFor(textsElement[i], +// position, +// scale); +// } + +// return textsElement; +// } +// private void DefaultSettingFor(TextElement textElement, PointF position, float scale) +// { +// textElement +// .Caption = string.Empty; + +// textElement +// .Position = position; + +// textElement +// .Scale = scale; + +// textElement +// .Shadow = true; +// textElement +// .Outline = true; + +// textElement +// .Color = Color +// .White; + +// textElement +// .Alignment = Alignment +// .Left; + +// textElement +// .Font = Font +// .ChaletLondon; +// } +// } +//} \ No newline at end of file diff --git a/Helideck Signaling/user-interface/pop-up/PopUp.cs b/Helideck Signaling/user-interface/pop-up/PopUp.cs index c7cc056..8ca8e28 100644 --- a/Helideck Signaling/user-interface/pop-up/PopUp.cs +++ b/Helideck Signaling/user-interface/pop-up/PopUp.cs @@ -1,227 +1,199 @@ -using GTA; -using GTA.UI; +//using GTA; +//using GTA.UI; -using System.Drawing; +//using System.Drawing; -using System.Collections.Generic; +//using System.Collections.Generic; -using Helideck_Signaling.setup_manager; - -using Helideck_Signaling.user_interface.pop_up.settings; - -using Helideck_Signaling.user_interface.pop_up.settings.creators; - - -namespace Helideck_Signaling.user_interface.pop_up -{ - internal sealed class PopUp : Script - { - public PopUp() - { - var layoutGroupManager = - new LayoutGroupManager(); - - var layoutsGroupTop = - layoutGroupManager - .LayoutsTop; - - var layoutsGroupBody = - layoutGroupManager - .LayoutsBody; - - var layoutsGroupBottom = - layoutGroupManager - .LayoutsBottom; - - var layoutsGroupTimer = - layoutGroupManager - .LayoutsTimer; - - layoutsGroupTop - .Add(new LayoutCreator(LayoutGroups - .TOP)); - - layoutsGroupBody - .Add(new LayoutCreator(LayoutGroups - .BODY)); - - layoutsGroupBody - .Add(new LayoutCreator(LayoutGroups - .BODY, true)); - - layoutsGroupBody - .Add(new LayoutCreator(LayoutGroups - .BODY, true)); - - layoutsGroupBody - .Add(new LayoutCreator(LayoutGroups - .BODY, true)); - - layoutsGroupBottom - .Add(new LayoutCreator(LayoutGroups - .BOTTOM)); - - //layoutsGroupTimer - // .Add(new LayoutCreator(LayoutGroups - // .TIMER)); - - ConfigureAsNotSelectedThis(element: 0, layout: layoutsGroupBody); - ConfigureAsNotSelectedThis(element: 1, layout: layoutsGroupBody); - ConfigureAsNotSelectedThis(element: 2, layout: layoutsGroupBody); - ConfigureAsNotSelectedThis(element: 3, layout: layoutsGroupBody); - - var indexT = 0; - - Tick += (o, e) => - { - layoutGroupManager - .ScaledDrawThis(layoutsGroupBottom); - - layoutGroupManager - .ScaledDrawThis(layoutsGroupBody); - - layoutGroupManager - .ScaledDrawThis(layoutsGroupTop); - - //layoutGroupManager - // .ScaledDrawThis(layoutsGroupTimer); - }; - - Aborted += (o, e) => - { - layoutGroupManager - .DisposeAll(); - }; - - KeyUp += (o, e) => - { - switch (e.KeyCode) - { - case System.Windows.Forms.Keys - .I: - { - layoutsGroupTop[0] - .DisableAllSprites(); - } - return; - case System.Windows.Forms.Keys - .U: - { - layoutsGroupTop[0] - .EnableAllSprites(); - } - return; - case System.Windows.Forms.Keys - .Oemplus: - { - if (layoutsGroupBody.Count == 0) - { - layoutsGroupBody - .Add(new LayoutCreator(LayoutGroups - .BODY)); - - ConfigureAsSelectedThis(element: 0, layout: layoutsGroupBody); - } - else - { - layoutsGroupBody - .Add(new LayoutCreator(LayoutGroups - .BODY, true)); - - ConfigureAsNotSelectedThis(element: (byte)(layoutsGroupBody.Count - 1), layout: layoutsGroupBody); - } - } - return; - case System.Windows.Forms.Keys - .OemMinus: - { - layoutsGroupBody - .RemoveAt(layoutsGroupBody - .Count - 1); - } - return; - case System.Windows.Forms.Keys - .Down: - { - if (layoutsGroupBody.Count > 0) - { - ConfigureAsNotSelectedThis((byte)(indexT), layoutsGroupBody); - - indexT++; - - if (indexT == layoutsGroupBody.Count) - indexT = 0; - - ConfigureAsSelectedThis((byte)indexT, layoutsGroupBody); - } - } - return; - case System.Windows.Forms.Keys - .Up: - { - if (layoutsGroupBody.Count > 0) - { - ConfigureAsNotSelectedThis((byte)(indexT), layoutsGroupBody); - - indexT--; - - if (indexT < 0) - indexT = (byte)(layoutsGroupBody.Count - 1); - - ConfigureAsSelectedThis((byte)indexT, layoutsGroupBody); - } - } - return; - } - }; - } - - private void ConfigureAsSelectedThis(byte element, IList layout) - { - layout[element] - .DisableAllSprites(); - - layout[element] - .EnableThis(spriteIndex: 0); - - layout[element] - .EnableThis(spriteIndex: 1); - - layout[element] - .EnableThis(spriteIndex: 3); - - layout[element] - .EnableThis(spriteIndex: 5); - - layout[element] - .EnableThis(spriteIndex: 7); - - layout[element] - .EnableThis(spriteIndex: 8); - } - - private void ConfigureAsNotSelectedThis(byte element, IList layout) - { - layout[element] - .DisableAllSprites(); - - layout[element] - .EnableThis(spriteIndex: 0); - - layout[element] - .EnableThis(spriteIndex: 2); - - layout[element] - .EnableThis(spriteIndex: 4); - - layout[element] - .EnableThis(spriteIndex: 6); - - layout[element] - .EnableThis(spriteIndex: 7); - - layout[element] - .EnableThis(spriteIndex: 8); - } - } -} +//using Helideck_Signaling.setup_manager; + +//using Helideck_Signaling.user_interface.pop_up.settings; + +//using Helideck_Signaling.user_interface.pop_up.settings.creators; + + +//namespace Helideck_Signaling.user_interface.pop_up +//{ +// internal sealed class PopUp : Script +// { +// public PopUp() +// { +// var layoutGroupManager = +// new LayoutGroupManager(); + +// var layoutsGroupTop = +// layoutGroupManager +// .LayoutsTop; + +// var layoutsGroupBody = +// layoutGroupManager +// .LayoutsBody; + +// var layoutsGroupBottom = +// layoutGroupManager +// .LayoutsBottom; + +// var layoutsGroupTimer = +// layoutGroupManager +// .LayoutsTimer; + +// var layoutsGroupAlert = +// layoutGroupManager +// .LayoutsAlert; + +// layoutsGroupTop +// .Add(new LayoutCreator(LayoutGroups +// .TOP)); + +// layoutsGroupBody +// .Add(new LayoutCreator(LayoutGroups +// .BODY)); + +// layoutsGroupBody +// .Add(new LayoutCreator(LayoutGroups +// .BODY, true)); + +// layoutsGroupBottom +// .Add(new LayoutCreator(LayoutGroups +// .BOTTOM)); + +// layoutsGroupAlert +// .Add(new LayoutCreator(LayoutGroups +// .ALERT)); + +// //layoutsGroupTimer +// // .Add(new LayoutCreator(LayoutGroups +// // .TIMER)); + +// var indexT = 0; + +// Tick += (o, e) => +// { +// layoutGroupManager +// .ScaledDrawThis(layoutsGroupAlert); + +// layoutGroupManager +// .ScaledDrawThis(layoutsGroupBottom); + +// layoutGroupManager +// .ScaledDrawThis(layoutsGroupBody); + +// layoutGroupManager +// .ScaledDrawThis(layoutsGroupTop); + +// //layoutGroupManager +// // .ScaledDrawThis(layoutsGroupTimer); +// }; + +// Aborted += (o, e) => +// { +// layoutGroupManager +// .DisposeAll(); +// }; + +// KeyUp += (o, e) => +// { +// switch (e.KeyCode) +// { +// case System.Windows.Forms.Keys +// .I: +// { +// //layoutsGroupTop[0] +// // .DisableAllSprites(); +// } +// return; +// case System.Windows.Forms.Keys +// .U: +// { +// //layoutsGroupTop[0] +// // .EnableAllSprites(); +// } +// return; +// case System.Windows.Forms.Keys +// .Oemplus: +// { +// if (layoutsGroupBody.Count == 0) +// { +// layoutsGroupBody +// .Add(new LayoutCreator(LayoutGroups +// .BODY)); + +// ConfigureAsSelectedThis(element: 0, layout: layoutsGroupBody); +// } +// else +// { +// layoutsGroupBody +// .Add(new LayoutCreator(LayoutGroups +// .BODY, true)); + +// ConfigureAsNotSelectedThis(element: (byte)(layoutsGroupBody.Count - 1), layout: layoutsGroupBody); +// } +// } +// return; +// case System.Windows.Forms.Keys +// .OemMinus: +// { +// layoutsGroupBody +// .RemoveAt(layoutsGroupBody +// .Count - 1); +// } +// return; +// case System.Windows.Forms.Keys +// .Down: +// { +// if (layoutsGroupBody.Count != 0) +// { +// ConfigureAsNotSelectedThis((byte)(indexT), layoutsGroupBody); + +// indexT++; + +// if (indexT == layoutsGroupBody.Count) +// indexT = 0; + +// ConfigureAsSelectedThis((byte)indexT, layoutsGroupBody); +// } +// } +// return; +// case System.Windows.Forms.Keys +// .Up: +// { +// if (layoutsGroupBody.Count != 0) +// { +// ConfigureAsNotSelectedThis((byte)(indexT), layoutsGroupBody); + +// indexT--; + +// if (indexT < 0) +// indexT = (byte)(layoutsGroupBody.Count - 1); + +// ConfigureAsSelectedThis((byte)indexT, layoutsGroupBody); +// } +// } +// return; +// case System.Windows.Forms.Keys.NumPad5: +// { +// Pause(); +// } +// return; +// } +// }; +// } + +// private void ConfigureAsSelectedThis(byte element, IList layout) +// { +// layout[element] +// .DisableThisSpriteInThis(index: 2); + +// layout[element] +// .EnableThisSpriteInThis(index: 1); +// } +// private void ConfigureAsNotSelectedThis(byte element, IList layout) +// { +// layout[element] +// .DisableThisSpriteInThis(index: 1); + +// layout[element] +// .EnableThisSpriteInThis(index: 2); +// } +// } +//} diff --git a/Helideck Signaling/user-interface/pop-up/settings/LayoutGroupManager.cs b/Helideck Signaling/user-interface/pop-up/settings/LayoutGroupManager.cs index 5ef0d03..c5fe1bf 100644 --- a/Helideck Signaling/user-interface/pop-up/settings/LayoutGroupManager.cs +++ b/Helideck Signaling/user-interface/pop-up/settings/LayoutGroupManager.cs @@ -1,89 +1,89 @@ -using System.Collections.Generic; - -using Helideck_Signaling.user_interface.pop_up.settings.creators; - - -namespace Helideck_Signaling.user_interface.pop_up.settings -{ - internal sealed class LayoutGroupManager - { - internal IList LayoutsTop - { get; private set; } - - internal IList LayoutsBody - { get; private set; } - - internal IList LayoutsBottom - { get; private set; } - - internal IList LayoutsTimer - { get; private set; } - - internal IList LayoutsAlert - { get; private set; } - - - public LayoutGroupManager() - { - LayoutsTop = - new List(); - - LayoutsBody = - new List(); - - LayoutsBottom = - new List(); - - LayoutsTimer = - new List(); - - LayoutsAlert = - new List(); - } - - internal void ScaledDrawAll() - { - foreach (var listOfLayouts in ReturnListsOfLayouts()) - { - ScaledDrawThis(listOfLayouts); - } - } - internal void ScaledDrawThis(IList listOfLayouts) - { - foreach (var layout in listOfLayouts) - { - layout - .ScaledDrawAllSprites(); - } - } - - - internal void DisposeAll() - { - foreach (var listOfLayouts in ReturnListsOfLayouts()) - { - DisposeThis(listOfLayouts); - } - } - internal void DisposeThis(IList listOfLayouts) - { - foreach (var layout in listOfLayouts) - { - layout - .DisposeAllSprites(); - } - } - - private IList[] ReturnListsOfLayouts() - { - return new[] - { - LayoutsTop, - LayoutsBody, - LayoutsBottom, - LayoutsTimer, - LayoutsAlert - }; - } - } -} +//using System.Collections.Generic; + +//using Helideck_Signaling.user_interface.pop_up.settings.creators; + + +//namespace Helideck_Signaling.user_interface.pop_up.settings +//{ +// internal sealed class LayoutGroupManager +// { +// internal IList LayoutsTop +// { get; private set; } + +// internal IList LayoutsBody +// { get; private set; } + +// internal IList LayoutsBottom +// { get; private set; } + +// internal IList LayoutsTimer +// { get; private set; } + +// internal IList LayoutsAlert +// { get; private set; } + + +// public LayoutGroupManager() +// { +// LayoutsTop = +// new List(); + +// LayoutsBody = +// new List(); + +// LayoutsBottom = +// new List(); + +// LayoutsTimer = +// new List(); + +// LayoutsAlert = +// new List(); +// } + +// internal void ScaledDrawAll() +// { +// foreach (var listOfLayouts in ReturnListsOfLayouts()) +// { +// ScaledDrawThis(listOfLayouts); +// } +// } +// internal void ScaledDrawThis(IList listOfLayouts) +// { +// foreach (var layout in listOfLayouts) +// { +// layout +// .ScaledDrawAllSprites(); +// } +// } + + +// internal void DisposeAll() +// { +// foreach (var listOfLayouts in ReturnListsOfLayouts()) +// { +// DisposeThis(listOfLayouts); +// } +// } +// internal void DisposeThis(IList listOfLayouts) +// { +// foreach (var layout in listOfLayouts) +// { +// layout +// .DisposeAllSprites(); +// } +// } + +// private IList[] ReturnListsOfLayouts() +// { +// return new[] +// { +// LayoutsTop, +// LayoutsBody, +// LayoutsBottom, +// LayoutsTimer, +// LayoutsAlert +// }; +// } +// } +//} diff --git a/Helideck Signaling/user-interface/pop-up/settings/creators/LayoutCreator.cs b/Helideck Signaling/user-interface/pop-up/settings/creators/LayoutCreator.cs index e45677a..09e681b 100644 --- a/Helideck Signaling/user-interface/pop-up/settings/creators/LayoutCreator.cs +++ b/Helideck Signaling/user-interface/pop-up/settings/creators/LayoutCreator.cs @@ -1,271 +1,295 @@ -using GTA.UI; +//using GTA.UI; -using System.Drawing; +//using System.Drawing; -using System.Collections.Generic; +//using System.Collections.Generic; -using Helideck_Signaling.setup_manager; +//using Helideck_Signaling.setup_manager; -using Helideck_Signaling.user_interface.pop_up.settings.interfaces; +//using Helideck_Signaling.user_interface.pop_up.settings.interfaces; -namespace Helideck_Signaling.user_interface.pop_up.settings.creators -{ - internal sealed class LayoutCreator : SpriteCreator, ISpriteGroups - { - private readonly IList _spriteList; +//namespace Helideck_Signaling.user_interface.pop_up.settings.creators +//{ +// internal sealed class LayoutCreator : SpriteCreator, ISpriteGroups +// { +// private readonly IList _spriteList; - private static PointF _positionForTheNextLayoutGroup; +// private static PointF _positionForTheNextLayoutGroup; - private static int _topCount = 0; +// private static int _topCount = 0; - private static int _bodyCount = 0; +// private static int _bodyCount = 0; - private static int _bottomCount = 0; +// private static int _bottomCount = 0; - private static int _timerCount = 0; +// private static int _timerCount = 0; - private static int _alertCount = 0; +// private static int _alertCount = 0; - public PointF Position - { get; private set; } +// public PointF Position +// { get; private set; } - public Color Color - { get; private set; } +// public Color Color +// { get; private set; } - public bool Enabled - { get; private set; } - - public bool Centered - { get; private set; } - - - public LayoutCreator(LayoutGroups layoutGroup) - :this(layoutGroup, false) - { - } - public LayoutCreator(LayoutGroups layoutGroup, bool multiPilha) - { - _spriteList = - ReturnOneListOfSpritesFromThis(layoutGroup); - - var firstSprite = - _spriteList[0]; - - Position = - firstSprite - .Position; - - Color = - firstSprite - .Color; - - Enabled = - firstSprite - .Enabled; - - Centered = - firstSprite - .Centered; - - - switch (layoutGroup) - { - case LayoutGroups - .BODY: - { - if (multiPilha) - { - for (var i = 0; i < _spriteList.Count; i++) - { - var sprite = - _spriteList[i]; - - var position = - sprite - .Position; - - if (i == 0) - { - sprite - .Position = new PointF(position.X, - position.Y + sprite - .Size - .Height * _bodyCount); - - Position = - sprite - .Position; - - continue; - } - - sprite - .Position = new PointF(position.X, - position.Y + Position.Y); - } - - _bodyCount++; - } - else - { - for (var i = 0; i < _spriteList.Count; i++) - { - if (i == 0) - { - continue; - } - - var sprite = - _spriteList[i]; - - var position = - sprite - .Position; - - sprite - .Position = new PointF(position.X, - position.Y + Position.Y); - } - - if (_bodyCount == 0) - { - _bodyCount++; - } - else if (_bodyCount > 0) - { - _bodyCount = 0; - } - } - } - break; - case LayoutGroups - .BOTTOM: - { - for (var i = 0; i < _spriteList.Count; i++) - { - var sprite = - _spriteList[i]; - - var position = - sprite - .Position; - - sprite - .Position = new PointF(position.X, - _positionForTheNextLayoutGroup.Y - 1.5f); - } - } - break; - case LayoutGroups - .TIMER: - { - for (var i = 0; i < _spriteList.Count; i++) - { - var sprite = - _spriteList[i]; - - var position = - sprite - .Position; - - sprite - .Position = new PointF(position.X, - _positionForTheNextLayoutGroup.Y); - } - } - break; - case LayoutGroups - .ALERT: - { - - } - break; - } - - - _positionForTheNextLayoutGroup = - firstSprite - .Position + firstSprite - .Size; - } - - - public void EnableAllSprites() - { - EnableThis(); - } - private void EnableThis() - { - for (var i = (byte)0; i < _spriteList.Count; i++) - EnableThis(spriteIndex: i); - } - internal void EnableThis(byte spriteIndex) - { - if (spriteIndex > _spriteList.Count) - return; - - var sprite = - _spriteList[spriteIndex]; - - sprite - .Enabled = true; - } - - - public void DisableAllSprites() - { - DisableThis(); - } - private void DisableThis() - { - for (var i = (byte)0; i < _spriteList.Count; i++) - { - DisableThis(spriteIndex: i); - } - } - internal void DisableThis(byte spriteIndex) - { - if (spriteIndex > _spriteList.Count) - return; - - var sprite = - _spriteList[spriteIndex]; - - sprite - .Enabled = false; - } - - - public void ScaledDrawAllSprites() - { - if (Enabled) - { - foreach (var sprite in _spriteList) - { - ScaledDrawThis(sprite); - } - } - } - internal void ScaledDrawThis(Sprite sprite) - { - sprite - .ScaledDraw(); - } - - public void DisposeAllSprites() - { - foreach (var sprite in _spriteList) - { - DisposeThis(sprite); - } - } - internal void DisposeThis(Sprite sprite) - { - sprite - .Dispose(); - } - } -} +// public bool Enabled +// { get; private set; } + +// public bool Centered +// { get; private set; } + + +// public LayoutCreator(LayoutGroups layoutGroup) +// :this(layoutGroup, false) +// { +// } +// public LayoutCreator(LayoutGroups layoutGroup, bool multiPilha) +// { +// _spriteList = +// ReturnOneListOfSpritesFromThis(layoutGroup); + +// var firstSprite = +// _spriteList[0]; + +// Position = +// firstSprite +// .Position; + +// Color = +// firstSprite +// .Color; + +// Enabled = +// firstSprite +// .Enabled; + +// Centered = +// firstSprite +// .Centered; + + +// switch (layoutGroup) +// { +// case LayoutGroups +// .BODY: +// { +// if (multiPilha) +// { +// for (var i = 0; i < _spriteList.Count; i++) +// { +// var sprite = +// _spriteList[i]; + +// var position = +// sprite +// .Position; + +// if (i == 0) +// { +// sprite +// .Position = new PointF(position.X, +// position.Y + sprite +// .Size +// .Height * _bodyCount); + +// Position = +// sprite +// .Position; + +// continue; +// } + +// sprite +// .Position = new PointF(position.X, +// position.Y + Position.Y); +// } + +// _bodyCount++; +// } +// else +// { +// for (var i = 0; i < _spriteList.Count; i++) +// { +// if (i == 0) +// { +// continue; +// } + +// var sprite = +// _spriteList[i]; + +// var position = +// sprite +// .Position; + +// sprite +// .Position = new PointF(position.X, +// position.Y + Position.Y); +// } + +// if (_bodyCount == 0) +// { +// _bodyCount++; +// } +// else if (_bodyCount > 0) +// { +// _bodyCount = 0; +// } +// } + +// DisableAllSprites(); + +// EnableThisSpriteInThis(index: 0); +// EnableThisSpriteInThis(index: 2); +// EnableThisSpriteInThis(index: 4); +// EnableThisSpriteInThis(index: 6); +// EnableThisSpriteInThis(index: 7); +// EnableThisSpriteInThis(index: 8); +// } +// break; +// case LayoutGroups +// .BOTTOM: +// { +// for (var i = 0; i < _spriteList.Count; i++) +// { +// var sprite = +// _spriteList[i]; + +// var position = +// sprite +// .Position; + +// sprite +// .Position = new PointF(position.X, +// _positionForTheNextLayoutGroup.Y - 2.0f); +// } +// } +// break; +// case LayoutGroups +// .TIMER: +// { +// for (var i = 0; i < _spriteList.Count; i++) +// { +// var sprite = +// _spriteList[i]; + +// var position = +// sprite +// .Position; + +// sprite +// .Position = new PointF(position.X, +// _positionForTheNextLayoutGroup.Y); + +// sprite +// .Centered = false; +// } +// } +// break; +// case LayoutGroups +// .ALERT: +// { +// for (var i = 0; i < _spriteList.Count; i++) +// { +// var sprite = +// _spriteList[i]; + +// var position = +// sprite +// .Position; + +// sprite +// .Position = new PointF(position.X, +// _positionForTheNextLayoutGroup.Y + 10f); +// } +// } +// break; +// } + + +// _positionForTheNextLayoutGroup = +// firstSprite +// .Position + firstSprite +// .Size; +// } + + +// public void EnableAllSprites() +// { +// EnableAllSpritesInTheList(); +// } +// private void EnableAllSpritesInTheList() +// { +// for (var i = (byte)0; i < _spriteList.Count; i++) +// EnableThisSpriteInThis(index: i); +// } +// internal void EnableThisSpriteInThis(byte index) +// { +// if (index > _spriteList.Count) +// return; + +// var sprite = +// _spriteList[index]; + +// sprite +// .Enabled = true; +// } + + +// public void DisableAllSprites() +// { +// DisableAllSpritesInTheList(); +// } +// private void DisableAllSpritesInTheList() +// { +// for (var i = (byte)0; i < _spriteList.Count; i++) +// { +// DisableThisSpriteInThis(index: i); +// } +// } +// internal void DisableThisSpriteInThis(byte index) +// { +// if (index > _spriteList.Count) +// return; + +// var sprite = +// _spriteList[index]; + +// sprite +// .Enabled = false; +// } + + +// public void ScaledDrawAllSprites() +// { +// if (Enabled) +// { +// foreach (var sprite in _spriteList) +// { +// ScaledDrawThis(sprite); +// } +// } +// } +// internal void ScaledDrawThis(Sprite sprite) +// { +// sprite +// .ScaledDraw(); +// } + +// public void DisposeAllSprites() +// { +// foreach (var sprite in _spriteList) +// { +// DisposeThis(sprite); +// } +// } +// internal void DisposeThis(Sprite sprite) +// { +// sprite +// .Dispose(); +// } +// } +//} diff --git a/Helideck Signaling/user-interface/pop-up/settings/creators/SpriteCreator.cs b/Helideck Signaling/user-interface/pop-up/settings/creators/SpriteCreator.cs index c4ad803..cf0d998 100644 --- a/Helideck Signaling/user-interface/pop-up/settings/creators/SpriteCreator.cs +++ b/Helideck Signaling/user-interface/pop-up/settings/creators/SpriteCreator.cs @@ -1,65 +1,65 @@ -using GTA.UI; +//using GTA.UI; -using System.Drawing; +//using System.Drawing; -using System.Collections.Generic; +//using System.Collections.Generic; -using Helideck_Signaling.setup_manager; +//using Helideck_Signaling.setup_manager; -namespace Helideck_Signaling.user_interface.pop_up.settings.creators -{ - internal abstract class SpriteCreator - { - protected IList ReturnOneListOfSpritesFromThis(LayoutGroups layoutGroup) - { - var settings = - new Settings(); +//namespace Helideck_Signaling.user_interface.pop_up.settings.creators +//{ +// internal abstract class SpriteCreator +// { +// protected IList ReturnOneListOfSpritesFromThis(LayoutGroups layoutGroup) +// { +// var settings = +// new Settings(); - var texturesName = - settings - .ReturnAllTextureNamesIn(layoutGroup); +// var texturesName = +// settings +// .ReturnAllTextureNamesIn(layoutGroup); - var relativePositions = - settings - .ReturnAllRelativePositionsIn(layoutGroup); +// var relativePositions = +// settings +// .ReturnAllRelativePositionsIn(layoutGroup); - var sprites = - new List(); +// var sprites = +// new List(); - for (var i = (byte)0; i < relativePositions.Count; i++) - { - sprites - .Add(item: CreateSpriteWithThis(texturesName[i], - relativePositions[i], - layoutGroup)); - } +// for (var i = (byte)0; i < relativePositions.Count; i++) +// { +// sprites +// .Add(item: CreateSpriteWithThis(texturesName[i], +// relativePositions[i], +// layoutGroup)); +// } - return sprites; - } - private Sprite CreateSpriteWithThis(string textureName, PointF position, LayoutGroups layoutGroup) - { - var textureDict = - "niziul_popUp_resources"; +// return sprites; +// } +// private Sprite CreateSpriteWithThis(string textureName, PointF position, LayoutGroups layoutGroup) +// { +// var textureDict = +// "niziul_popUp_resources"; - var settings = - new Settings(); +// var settings = +// new Settings(); - var size = - settings - .ReturnSizeOfThis(textureName); +// var size = +// settings +// .ReturnSizeOfThis(textureName); - var customSize = - new SizeF(size.Width / 4f, - size.Height / 4f); +// var customSize = +// new SizeF(size.Width / 4f, +// size.Height / 4f); - var positions = - position; +// var positions = +// position; - return new Sprite(textureDict, - textureName, - customSize, - positions) { Centered = true }; - } - } -} +// return new Sprite(textureDict, +// textureName, +// customSize, +// positions) { Centered = true }; +// } +// } +//} diff --git a/Helideck Signaling/user-interface/pop-up/settings/interfaces/ILayout.cs b/Helideck Signaling/user-interface/pop-up/settings/interfaces/ILayout.cs index cfd11c4..65262c8 100644 --- a/Helideck Signaling/user-interface/pop-up/settings/interfaces/ILayout.cs +++ b/Helideck Signaling/user-interface/pop-up/settings/interfaces/ILayout.cs @@ -1,9 +1,9 @@ -using System; +//using System; -namespace Helideck_Signaling.user_interface.pop_up.settings.interfaces -{ - internal interface ILayout - { - void DisposeAll(); - } -} +//namespace Helideck_Signaling.user_interface.pop_up.settings.interfaces +//{ +// internal interface ILayout +// { +// void DisposeAll(); +// } +//} diff --git a/Helideck Signaling/user-interface/pop-up/settings/interfaces/ISpriteGroups.cs b/Helideck Signaling/user-interface/pop-up/settings/interfaces/ISpriteGroups.cs index 31e4829..76700ed 100644 --- a/Helideck Signaling/user-interface/pop-up/settings/interfaces/ISpriteGroups.cs +++ b/Helideck Signaling/user-interface/pop-up/settings/interfaces/ISpriteGroups.cs @@ -1,33 +1,33 @@ -using System.Drawing; +//using System.Drawing; -namespace Helideck_Signaling.user_interface.pop_up.settings.interfaces -{ - internal interface ISpriteGroups - { - PointF Position - { - get; - } +//namespace Helideck_Signaling.user_interface.pop_up.settings.interfaces +//{ +// internal interface ISpriteGroups +// { +// PointF Position +// { +// get; +// } - Color Color - { - get; - } +// Color Color +// { +// get; +// } - bool Enabled - { - get; - } +// bool Enabled +// { +// get; +// } - bool Centered - { - get; - } +// bool Centered +// { +// get; +// } - void ScaledDrawAllSprites(); +// void ScaledDrawAllSprites(); - void EnableAllSprites(); +// void EnableAllSprites(); - void DisableAllSprites(); - } -} +// void DisableAllSprites(); +// } +//} diff --git a/README.md b/README.md index 8b13789..52a23d5 100644 --- a/README.md +++ b/README.md @@ -1 +1,75 @@ +

+ Alternative Yaw Control - Keyboards +

+

About the mod

+ +

I created this script in the intention of making the minimap more "alive", to be honest at this stage it is something very simple, with a display mechanic that works as follows: when the player is inside a helicopter the location of all helipads present in the game will appear on the map, with an animation that resembles the airport beacons.

+ +

Requisites

+ + + +

Featured

+ +
    +
  • Adds to the game the possibility of visualizing helipad locations via interactive blips; +
      +
    • it is possible to change the color (default color = yellow) of the blip via the "BlipColor.ini" file;
    • +
    +
  • +
  • Contains the automatic identification of any new helipads ("prop_helipad_01" and "prop_helipad_02") that are added to the game;
  • +
+ +

Installation

+ +
    +
  1. Extract from the .rar file the "HelideckSignaling.dll" file and the folder named "HelideckSignaling";
  2. +
  3. Place the extracted files in your script folder
  4. +
+ +

Changelog

+ +
    +
  • [0.6.0.0] +
      +
    • This version fixes the duplicate blips bug and adds the possibility to manually insert blips through a new file called "NativeHelipads".
    • +
    +
  • +
  • [0.5.0.0] +
      +
    • Add the ability to change the color of the animated circle in the .ini file;
    • +
    • I changed the system of hiding the unselected blips, to when the player is in the air and no longer when he moves. Solves the problem of blips disappearing out of nowhere.
    • +
    +
  • +
  • [0.4.0.0] +
      +
    • I added the blips to the property category, and now you can see the name of the place where the helipad is located, along with adding colors, thus making the information more prominent. Also introduced a new mechanic that activates the hiding of those blips not selected with the waypoint when the player moves. Example in this short video.
    • +
    +
  • +
  • [0.3.0.0] +
      +
    • In this version I added the last native helipad in the game and introduce a logic that allows the automatic identification of new helipads in the game, adding by Ymap, Add-on, Xml, etc.. Example in this short video.
    • +
    +
  • +
  • [0.2.1.0] +
      +
    • Added three more helipads.
    • +
    +
  • +
  • [0.2.0.0] +
      +
    • I added the capability that when a helipad is selected on the map it becomes visible at long distances. See the example here in this short video.
    • +
    +
  • +
  • [0.1.0.0] +
      +
    • Initial release.
    • +
    +
  • +
+ +

[source code]