Giter Site home page Giter Site logo

ragenativeui's Introduction

ragenativeui's People

Contributors

albo1125 avatar alexguirre avatar erwigta avatar guad avatar lspdfr-peteru avatar michael21107 avatar oliverpope03 avatar pnwparksfan avatar stealth22pd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ragenativeui's Issues

UIMenuListItem switch issue

Whenever a user tries to switch menus with a UIMenuListItem and consequently a UIMenuSwitchMenusItem, it scrolls through into the next menus, resulting in the same menu staying open forever until the user 'gets lucky'. This problem was already there in 1.4.1, but got far worse in 1.5.0.0.

AppDomain-global bool for if a menu is open

It would be useful if LSPDFR plugins (running in the same AppDomain) could know if another plugin is rendering a menu, to avoid mulitple menus being visible at once. Is it possible, even across pools, to have a bool to indicate if any Menu.IsVisible?

Allow menus with no items

See this example from the vanilla game:
menu

Currently it crashes:

[4/11/2020 10:57:26 PM.835] MenuExample: 
[4/11/2020 10:57:26 PM.836] MenuExample: ==============================
[4/11/2020 10:57:26 PM.837] MenuExample: UNHANDLED EXCEPTION DURING GAME FIBER TICK
[4/11/2020 10:57:26 PM.837] MenuExample: ------------------------------
[4/11/2020 10:57:26 PM.837] MenuExample: Origin: Game fiber "<UNNAMED THREAD>".
[4/11/2020 10:57:26 PM.838] MenuExample: ------------------------------
[4/11/2020 10:57:26 PM.838] MenuExample: Exception type: System.DivideByZeroException
[4/11/2020 10:57:26 PM.838] MenuExample: Exception message: Attempted to divide by zero.
[4/11/2020 10:57:26 PM.839] MenuExample: ------------------------------
[4/11/2020 10:57:26 PM.839] MenuExample: Inner exceptions:
[4/11/2020 10:57:26 PM.839] MenuExample: ------------------------------
[4/11/2020 10:57:26 PM.840] MenuExample: Stack trace:
[4/11/2020 10:57:26 PM.840] MenuExample: at RAGENativeUI.UIMenu.Draw() in E:\programming\RAGENativeUI\Source\UIMenu.cs:line 541
[4/11/2020 10:57:26 PM.840] at RAGENativeUI.MenuPool.ProcessMenus() in E:\programming\RAGENativeUI\Source\MenuPool.cs:line 164
[4/11/2020 10:57:26 PM.841] at MenuExample.EntryPoint.ProcessLoop() in E:\programming\RAGENativeUIExamples\MenuExampleProject\MenuExample.cs:line 238
[4/11/2020 10:57:26 PM.841] at Rage.GameFiber.Main()
[4/11/2020 10:57:26 PM.841] MenuExample: ==============================
[4/11/2020 10:57:26 PM.841] MenuExample: 

Implement Generic version of UIListMenuItem

Using object for the underlying values on UIListMenuItem breaks the C# type system. It would be preferable to have a generic version of UIListMenuItem and IDisplayItem.

interface IDisplayItem<T>
{
    T Value { get; }
    string DisplayText { get; }
}

class UIMenuListItem<T> 
{
    public UIMenuListItem<T>(string text, string description, IEnumerable<IDisplayItem<T>> items) {}
} 

Possible AmbiguousMatchException when building template with MenuItemAttribute

If the Invoke method of the PropertyType is overloaded, the following code will throw an AmbiguousMatchException.

MethodInfo invokeMethod = prop.PropertyType.GetMethod("Invoke");

We should use the GetMethod overloads to only get the methods with either of the following signatures

void Invoke();
void Invoke(MenuItem item);

Additionally, if both are present, which one should we take? Should we execute both?

See #35.

zip file not valid

the zip file will not open. says invalid or empty zip. Needing the RAGENativeUI.dll file

SetKey() overload method not working

The SetKey(Common.MenuControls control, Keys keyToSet) overload isn't working. It might be related to the HasControlJustBeenPressed(), HasControlJustBeenReleased() and IsControlBeingPressed() methods.

The other overload methods (SetKey(Common.MenuControls control, GameControl gtaControl) and SetKey(Common.MenuControls control, GameControl gtaControl, int index)) work.

Basically the menu doesn't work with Keys enum.

ERROR: assemblyPath

Hey.

I'm not able to load the plugin.

ERROR: Could not load plugin from "C:........\Plugins\RAGENativeUI.dll" Assembly RAGENativeUI.dll (RAGENativeUI, Version=1.4.1.0, Culture=neutral, PublicKeyToken=null) does not have the required Plugin attribute. Paramaternavn: assemblyPath

I'm trying to load it in RAGE Plugin Hook - Open Alpha - 0.39.946.8098 - a fresh install, with no other plugins installed prior to this.

I need this plugin to get RAGE_Transportation to work.

Am I doing something wrong?

This plugin doesn't show up in RPH Plugins Options either. But the other plugin I'm trying to get to work is showing.

ESLint Issue

Hi, there is compability problem with eslint.

"[eslint] A function with a name starting with an uppercase letter should only be used as a constructor. (new-cap)"

It's on AddItem or SetRightBadge methods for example.

Window size

Can you implement a way to provide a configuration file for setting the Container size? I have a three monitor setup and I can barely see any options. Alternatively you can calculate the size based on the current window size and then keep the ratio you want (What I assume LSPDFR is doing)

_mainMenu = new Container(new Point(0, 0), new Size(700, 500), Color.FromArgb(0, 0, 0, 0));

menu_issue

Make StringMeasurer obsolete

Replace the remaining places where it is used with _BEGIN_TEXT_COMMAND_GET_WIDTH/_END_TEXT_COMMAND_GET_WIDTH and mark it as obsolete.

Crash with Britisch Police Script

Recently me and a few others have problems with viewing the court data in the Britisch Police Script.
Everytime I press F9 and go to the court data it crashes.
RagePluginHook.log

[25-9-2018 20:01:31.323] LSPD First Response: 
[25-9-2018 20:01:31.324] LSPD First Response: ==============================
[25-9-2018 20:01:31.325] LSPD First Response: UNHANDLED EXCEPTION DURING GAME FIBER TICK
[25-9-2018 20:01:31.325] LSPD First Response: ------------------------------
[25-9-2018 20:01:31.326] LSPD First Response: Origin: Rage.SleeplessGameFiber
[25-9-2018 20:01:31.326] LSPD First Response: ------------------------------
[25-9-2018 20:01:31.326] LSPD First Response: Exception type: System.NullReferenceException
[25-9-2018 20:01:31.327] LSPD First Response: Exception message: De objectverwijzing is niet op een exemplaar van een object ingesteld.
[25-9-2018 20:01:31.328] LSPD First Response: ------------------------------
[25-9-2018 20:01:31.328] LSPD First Response: Inner exceptions:
[25-9-2018 20:01:31.329] LSPD First Response: ------------------------------
[25-9-2018 20:01:31.329] LSPD First Response: Stack trace:
[25-9-2018 20:01:31.330] LSPD First Response: bij RAGENativeUI.PauseMenu.TabSubmenuItem.ProcessControls()
[25-9-2018 20:01:31.330] bij RAGENativeUI.PauseMenu.TabView.ProcessControls()
[25-9-2018 20:01:31.331] bij RAGENativeUI.PauseMenu.TabView.Update()
[25-9-2018 20:01:31.331] bij ????????????????????????????????????????.?????????????????????????????????????????(Object , GraphicsEventArgs )
[25-9-2018 20:01:31.332] bij System.EventHandler`1.Invoke(Object sender, TEventArgs e)
[25-9-2018 20:01:31.332] bij Rage.Game.RaiseFrameRender(GraphicsEventArgs e)
[25-9-2018 20:01:31.333] bij Rage.RemotePlugin.HandleRenderFiber()
[25-9-2018 20:01:31.334] bij Rage.GameFiber.Main()
[25-9-2018 20:01:31.334] LSPD First Response: ==============================
[25-9-2018 20:01:31.334] LSPD First Response: 
[25-9-2018 20:01:33.757] LSPD First Response: All signs removed
[25-9-2018 20:01:33.907] LSPD First Response: NewsHeliPursuit exited
[25-9-2018 20:01:34.177] LSPD First Response: System.Threading.ThreadAbortException: De thread is afgebroken.
[25-9-2018 20:01:34.182] bij Rage.GameFiber.SleepThis(Int32 duration)
[25-9-2018 20:01:34.185] bij Rage.GameFiber.Sleep(Int32 duration)
[25-9-2018 20:01:34.185] bij Rage.Task.WaitForStatus(TaskStatus status, Int32 timeout)
[25-9-2018 20:01:34.194] bij Rage.Task.WaitForCompletion()
[25-9-2018 20:01:34.200] bij ?????????????????????????????????????????.?????????????????????????????????????????()
[25-9-2018 20:01:34.204] bij ?????????????????????????????????????????.?????????????????????????????????????????()
[25-9-2018 20:01:34.207] LSPD First Response: Added ambient event fibers to cleanup

Make a proper project for examples

Currently, examples cannot be easily built after cloning the repo or on CI. Add a new .csproj containing all the examples and make the necessary changes so only one plugin needed (i.e. using commands to start each example).
Additionally, build the examples on CI.

No mouse cursor on PauseMenu

I saw in the TabView.cs code that you commented the lines to display and support mouse cursor.
Why did you do it?

The PauseMenu is a really good infrastructure to build a police computer for LSPDFR which is I'm now trying to do.

Zip download of 1.6 broken

Hi! Your download link for RageNativeUI.zip, v. 1.6, downloads an empty file to my network. It seems to be a broken asset because we can download 1.5.1 correctly.

Add "blank" badge item and allow custom sprites

  • Allow specifying custom texture dictionary + texture for badge sprites
  • Add a "blank" sprite which takes up the same amount of space as a normal sprite (indenting text appropriately) but doesn't actually display anything. To be used if some items have sprites and others don't and dev wants the labels to line up.

New timer bars features

Currently timer bars are missing some features seen in the vanilla game.

  • Changing the text color.
  • Highlight: done by drawing all_white_bg on top of the timer bar background.
    Highlight
  • Accent:
    Accent
  • Markers: lines that can be placed at specific percentages of a progress bar.
    Markers
  • Icons: similar to menu badges, with a predefined set of sprites allowing the user to specify their own.
    Icons
  • Checkpoins: small gray circles that get colored when completed and black when failed which can also be crossed out.
    Checkpoints
    Checkpoints

PauseMenu API

Need to port the PauseMenu API to v2.0.
Can we reuse the game's pause menu system?

FPS drops on patch 1290/RPH 0.60

Using 1.6.2 on patch 1290/RPH 0.60

Unfortunately the FPS still drops when player is approaching the stopped driver.
The good thing is, when we press E to open traffic stop menu, the FPS is back up.
I have no idea. perhaps it's also related to traffic policer which suppresses the original LSPDFR traffic stop menu plugin.

Opening EUP menu, the FPS is still dropping but better than before.

Global menu

Add a feature/code to have a global of all menus. For example, different plugins can do something like MenuPool.AddToGlobalMenu(MyMainMenu).
The global menu will be a compilation of all menus so that players can just activate the global menu and cycle through whatever menus were added. This way it'll free up keybinds and also be a major relief for controller players, as they can just press thr activation buttons to access all the menus for the various mods.

3 screen configuration leads to unreadable UI

if GTA V is configured to start with 57601080 Resolution
( 3 x (1920
1080) screens vertical setup)
the RAGENativeUI is squished and the UI is unreadable.
Reproduction Example:
open the Ultimate Backup UI.

Menu Templating

See menu-template branch.
Allows the user to create a Menu based on the properties and methods of a class that inherits MenuTemplate via attributes.
All item attributes specifiy at least three properties: Name, Text and Description. Name is used to reference the MenuItem (for example, to access the MenuItem instance with MenuTemplate.GetItemByName), if null, the property name will be used.

API

MenuTemplate

Base class for menu templates. Implements INotifyPropertyChanged.
The method BuildMenu creates the menu and sets the property Menu.

MenuAttribute

Defines the basic properties of a Menu: Title, Subtitle and Theme. Required to build the menu from a template class.

[Menu(Title = "My Menu", Subtitle = "Subtitle for my menu")]
private class TestMenu : MenuTemplate

MenuItemAttribute

Defines a property as a MenuItem. The property type must be a delegate or a type that has an Invoke method with either of the following signatures:

void Invoke();
void Invoke(MenuItem);

The delegate or method will be executed when the MenuItem.Activated event is raised.

[MenuItem(Text = "ItemText", Description "ItemDescription")]
private Action BasicItem { get; }

[MenuItem(Text = "ItemText", Description "ItemDescription")]
private Action<MenuItem> BasicItem2 { get; }

[MenuItem(Text = "ItemText", Description "ItemDescription")]
private InvokableClass ItemWithCustomClass { get; } = new InvokableClass();

// ...
private class InvokableClass
{
    public void Invoke()
    {
        // ...
    }
}

MenuItemCheckboxAttribute

Defines a property as a MenuItemCheckbox. The property type must be bool. If the create checkbox item is checked or unchecked the property value will be updated. And in the other way around, if the property setter raises the INotifyPropertyChanged.PropertyChanged event, changing the value via the property setter the checkbox item IsChecked property will be updated too.

[MenuItemCheckbox(Text = "ItemText")]
public bool BoolValue
{
    get => boolValue;
    set => SetProperty(ref doSomeOtherThing, value);
}

Note, SetProperty is a method provided by MenuTemplate that raises the PropertyChanged event.

MenuItemNumericScrollerAttribute

Similar to MenuItemCheckboxAttribute but for properties of numeric types. Also provides properties to customize the MenuItemNumericScroller created: Minimum, Maximum, Increment, ThousandsSeparator, Hexadecimal and DecimalPlaces.

[MenuItemNumericScroller(Text = "ItemText")]
public float FloatValue
{
    get => floatValue;
    set => SetProperty(ref floatValue, value);
}

[MenuItemNumericScroller(Text = "ItemText", Increment = 1.0, DecimalPlaces = 0)]
public int IntValue
{
    get => intValue;
    set => SetProperty(ref intValue, value, nameof(IntValue), nameof(IntValueAsHex));
}

[MenuItemNumericScroller(Text = "Int Value as Hex", Increment = 1.0, DecimalPlaces = 0, Hexadecimal = true)]
private int IntValueAsHex
{
    get => IntValue;
    set => IntValue = value;
}

MenuItemEnumScroller

Similar to MenuItemCheckboxAttribute and MenuItemNumericScrollerAttribute but for properties of enum types.

[MenuItemEnumScroller(Text = "ItemText")]
public GameControl EnumValue
{
    get => enumValue;
    set => SetProperty(ref enumValue, value);
}

MenuItemActivatedHandlerAttribute

Defines a method as a MenuItem.Activated event handler for a specific set of items. The Items string array contains the names of the wanted menu items.

[MenuItemActivatedHandler(nameof(IntValue), nameof(FloatValue))]
private void OnIntOrFloatValueActivated(MenuItem sender, ActivatedEventArgs e)
{
}

TBD

  • Child menus?
  • MenuItemListScroller?
  • ScrollableMenu?
  • Support more menu and item events?

UIMenuListItem get Data Problem

when I want to get informations from an UIMenuListItem the plugin crashes...

My Code:
job = jobList.Collection[jobList.Index].Value.ToString();

job is a String
jobList is an UIMenuItem with the following params:
jobList = new UIMenuListItem("Job", new List<dynamic> { "Rettungshelfer", "Rettungssanitäter" }, 0);

I know the jobList constructor I use will be removed soon but it should work anyway at the moment.

Please send help :)

Greetings

Benjamin

Stop Texture banners flickering

Split the DrawBanner method in two, ProcessBanner and DrawBanner, ProcessBanner will do the calculation on the FrameRender and DrawBanner will only do the drawing on the RawFrameRender.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.