GithubHelp home page GithubHelp logo

lemonuibylemon / lemonui Goto Github PK

View Code? Open in Web Editor NEW
172.0 11.0 40.0 1.99 MB

LemonUI for .NET (FiveM, RageMP, RagePluginHook and ScriptHookVDotNet 3)

License: MIT License

C# 99.20% Python 0.80%

lemonui's Introduction

LemonUI
GitHub Actions NuGet NuGet NuGet NuGet NuGet NuGet Patreon PayPal Discord

LemonUI is a framework for creating UI systems in Grand Theft Auto V that is compatible with FiveM, RageMP, RagePluginHook ScriptHookVDotNet 2, and ScriptHookVDotNet 3. It allows you to create UI Elements with a NativeUI-like style, or you can also create your UI System from scratch via the resolution-independent classes for Text, Rectangles, and Textures.

It was created as a replacement for NativeUI due to being too convoluted to develop and maintain. LemonUI retains most (if not all) of the UI Elements available in NativeUI.

Special thanks to:

  • Guad for the original work in NativeUI
  • alloc8or for the help with the GTA Online Loading Screen Scaleform
  • ikt for helping me to use SET_SCRIPT_GFX_ALIGN and SET_SCRIPT_GFX_ALIGN_PARAMS
  • Dot. for the snippet of code used for the item scrolling
  • deterministic_bubble for answering some questions about some missing C# classes in FiveM
  • PNWParksFan for helping me with some RPH questions when I was doing the port

Download

Installation

Warning: You don't need to install all of the files. You only need to install the ones for the framework you plan to use. For example, if you want to install SHVDN mods, you don't need to install the RPH version.

FiveM

You don't need to install any files when using FiveM. When you connect to a server, the resources that need it will automatically provide a copy of LemonUI.

RageMP

You don't need to install any files when using RageMP. When you connect to a server, the resources that need it will automatically provide a copy of LemonUI when compiling the code.

RagePluginHook

Copy all of the files from the RPH folder inside of the compressed file to the root of your GTA V installation directory.

ScriptHookVDotNet 2 and ScriptHookVDotNet 3

PLEASE NOTE THAT THE LAST VERSION THAT SUPPORTED SHVDN2 WAS 1.5.2. You can download it here.

Copy all of the files from the SHVDN2 and/or SHVDN3 folder(s) inside of the compressed file to your scripts directory.

Usage

Once installed, the mods that require LemonUI will start working.

Developers

Check the Quick Start guide to learn how to use LemonUI in your project.

If you would like to make changes to the code, clone the repo, restore the packages, and open the solution in your favorite IDE.

lemonui's People

Contributors

censor1337 avatar dotmbf avatar drewridley avatar hxrv3y avatar justalemon avatar kagikn avatar kimtisott avatar michael21107 avatar sander0542 avatar sardelka9515 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

lemonui's Issues

Add the Grid Panel

I don't know what else to call it.

Is the Panel used in GTA Online to set some facial features. I guess that it returns an X and Y value that can be fetched.

vlcsnap-2021-05-28-23h52m38s725

Added missing stuff from UIMenuColoredItem

As far as I know, the UIMenuColoredItem class in NativeUI was used to change the color of the item text depending if it was hovered or not. This would probably be a good feature to implement in LemonUI.

This is probably required before we implement #17.

Alert (POPUP_WARNING) screen?

Method definitions: POPUP_WARNING
Scaleform GFX file: update.rpf/x64/data/cdimages/scaleform_frontend.rpf/popup_warning
Native counterpart: SET_WARNING_MESSAGE and related/similar natives (which requires GXT entires)

Decompiling found:

  • Default title is a localized text, in English it will be Alert

Statement:

function SHOW_POPUP_WARNING(msecs, titleMsg, warningMsg, promptMsg, showBg, alertType, errorMsg)

Parameter notes:

  • msecs: not found use
  • errorMsg: string, optional
  • promptMsg: string, optional
  • alertType: seems like int (compares to loc7 which is 1, and never changed); if 1 creates a new buttonclip

glitch with franklin

so i downloaded LemonUI and when i launched the game franklin would be invisible for me and it would switch to micheal sooooo yea anyone who can help me i would appreciate that

LemonUI Does not work with SHVDN3

I Have Tried Putting it in scripts, referencing the dll, but SHVDN3 still wont recognize LemonUI when running GTA. Can Someone Help Me?

Add Dynamic List Item

It was part of NativeUI, but it was not implemented on the first release of LemonUI.

Is a standard list item, but the items are changed via events during runtime instead of a list.

Add missing documentation to the wiki

So far, I know that the following is missing in the documentation:

  • Instructional Buttons and the different formats
  • Implementation of IProcessable
  • Scaleforms (all of them)

Just a TimerBar.

There is no way of just using a TimerBar without menu. Or I am doing something wrong.. I have tried several diffrent approaches before opening the issue. I can use it if I use a collection with inside only the TimerBarProgress, but Visible bool is actually acting weird.

   class Bar : Script
    {
        private static float NewProgress = 0f;
        private static readonly ObjectPool pool = new ObjectPool();
        private static readonly TimerBar bar = new TimerBarProgress("Progress") { Progress = NewProgress };

        public Bar()
        {
            pool.Add(bar);
            
            Tick += Bar_Tick;
        }

        private async System.Threading.Tasks.Task Bar_Tick()
        {
            pool.Process();
            if (API.IsPlayerFreeAiming(Game.Player.Character.Handle) == true)
            { NewProgress += 1;  }

        }
    }

image

Use SelectedItem as sender parameter for OnActivated?

Would using the SelectedItem as the sender parameter for the Activated event make sense?

Here and here.

If SelectedItem is used for the sender parameter, then you could do something like this in the Activated event:

private void OnActivated(object sender, EventArgs e)
{
    if (sender == firstItem)
    {
        //do something
    }
    else if (sender == secondItem)
    {
        //do something else
    }
}

With the way it currently works (using the NativeMenu as the sender parameter) you are required to use an event for each individual item.

RageMP Support

Should be fairly simple to implement; Would fork and implement it myself if I had the time... Mainly recommending this due to RageMP's poor extendibility in the NativeUI Department (Think it actually uses the NativeUI implementation to begin with).

RAGE.Game.Invoker.Invoke( Hash , params[] );
RAGE.Game.Invoker.GetReturn()

RAGE.Game.Alignment

  public enum Alignment
  {
    Center,
    Left,
    Right,
  }

RAGE.Game.Font

  public enum Font
  {
    ChaletLondon = 0,
    HouseScript = 1,
    Monospace = 2,
    ChaletComprimeCologne = 4,
    Pricedown = 7,
  }

Menu Flickering

Menu flickers when script tick interval is changed from default value.

Right Badge position not updating

When opening a menu with RightBadge, the position is not updated.

Temporarily fix is using Recalculate() after recreating the menu

Record_2021_04_25_16_54_01_321.mp4

Submenu description

I can't change submenus description. It works for items but submenus just keep the same description assigned in the constructor

Remove examples

I don't feel that the examples serve a purpose due to being too convoluted to understand for compatibility reasons (aka trying to make it compile with multiple frameworks at the same time).

Big Message weapon purchased crash

I get this error when trying to use the Big Message scaleform:

System.ArgumentException: Unexpected argument type UInt32.
Parameter name: parameters
at LemonUI.Scaleform.BaseScaleform.CallFunctionBase(String function, Object[] parameters)
at LemonUI.Scaleform.BaseScaleform.CallFunction(String function, Object[] parameters)
at LemonUI.Scaleform.BigMessage..ctor(String title, String weapon, WeaponHash hash)

It happens when this line gets executed:

https://i.imgur.com/2J0yTYd.png

Big message don't have an animation when visible

Discord : DJ-LEXX#6948 [say]
I haven't tried making BigMessages using LemonUI yet but I've looked into the code and haven't found this function:

Function.Call(Hash.BEGIN_SCALEFORM_MOVIE_METHOD, new InputArgument[]
   {
      scaleform,
      "SHARD_ANIM_OUT"
   });

Add Item Tag

        /// <summary>
        /// Tag Property.
        /// </summary>
        public virtual object Tag { get; set; }

Add random

Not really an issue.

Would be nice if you could set the position of random items added. If you'd like to add items during runtime that is..

NativeItem Alternate Title

image

public static NativeItem weapon = new NativeItem("Weapon:");
. . .
string wHash = Function.Call<WeaponHash>(Hash.GET_SELECTED_PED_WEAPON, Game.Player.Character).ToString(); // Get current weapon
weapon.AltTitle = $"{SAM_WG.GetDisplayName(wHash)}"; // Update alt. title

Native calls missing on RagePluginHook

There are some functions that are missing the RagePluginHook calls, like:

  • CallFunctionBase on BaseScaleform.cs
  • Control property of the InstructionalButton struct in InstructionalButton.cs
  • Process of TimerBarCollection in TimerBarCollection.cs
  • Setting the cursor position in NativeMenu.cs

And others.

Change color of banner | rproblem

Hi, i tried to change the "Banner" of a NativeMenu with this : new_menu.Banner.Color = Color.FromArgb(255,0,0); but i get a Dark Red color instead of a Red so why ? Sadly there is no documentation about how to do it so is it a bug ?

Add the Slider panel

The Slider panel, if that is the correct way to call it, is the slider used to select some facial features in the GTA Online Character Creator.

vlcsnap-2021-05-28-23h52m55s038

Add missing methods in NativeListItem<T>

I don't know why I had not noticed until now that all of the following methods are missing in the NativeListItem<T> class:

  • Add(T)
  • Add(int, T)
  • Remove(T)
  • RemoveAt(int)
  • Remove(Func<bool, T>)
  • Clear()

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.