GithubHelp home page GithubHelp logo

durtyfree / alt-v-nativeui Goto Github PK

View Code? Open in Web Editor NEW
46.0 3.0 22.0 351 KB

NativeUI for GTA V alt:V Multiplayer mod written in Javascript / TypeScript

Home Page: https://altv.mp/

License: Apache License 2.0

TypeScript 99.44% JavaScript 0.52% Batchfile 0.03%
gtav gta multiplayer mod altv nativeui

alt-v-nativeui's People

Contributors

cptprice1139 avatar durtyfree avatar omermecitoglu avatar xmgamingmaster 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

Watchers

 avatar  avatar  avatar

alt-v-nativeui's Issues

ItemSelect.on Checkbox detection issue

ItemSelect.on doesnt seem to recognize Checkbox Item

repro code:

    JoueursMenu.AddItem(new NativeUI.UIMenuItem("Gestion des Joueurs"));
    JoueursMenu.AddItem(new NativeUI.UIMenuItem("Admin Tools"));
    JoueursMenu.AddItem(new NativeUI.UIMenuItem("Teleport Tools"));
    JoueursMenu.AddItem(new NativeUI.UIMenuItem("Coords Tools"));
    JoueursMenu.AddItem(new NativeUI.UIMenuCheckboxItem("Show Players Name & ID", false));

    JoueursMenu.ItemSelect.on(item => {
        alt.log(item.Text);
        switch (item.Text) {
            case "Show Players Name & ID":
                showname = item.Checked;
                alt.log(showname, item.Checked);

                if (!showname)
                    API.ShowNotification('~r~ShowName désactivé');
                else
                    API.ShowNotification('~g~ShowName activé, faites Echap pour l\'afficher');
                break;
        }
    });

npm install --save @durtyfree/altv-nativeui not working

When i tried getting the package from npm its showing the error

npm ERR! code E401
npm ERR! Unable to authenticate, need: Basic realm="GitHub Package Registry"

Can you help me get this sorted?

DETAILED LOG

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '--save',
1 verbose cli '@durtyfree/altv-nativeui'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session a7e716d79c83a96c
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 401 https://npm.pkg.github.com/@durtyfree%2faltv-nativeui 459ms
8 silly fetchPackageMetaData error for @durtyfree/altv-nativeui@latest Unable to authenticate, need: Basic realm="GitHub Package Registry"
9 timing stage:rollbackFailedOptional Completed in 4ms
10 timing stage:runTopLevelLifecycles Completed in 662ms
11 verbose stack Error: Unable to authenticate, need: Basic realm="GitHub Package Registry"
11 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-fetch\check-response.js:107:17
11 verbose stack at processTicksAndRejections (internal/process/task_queues.js:93:5)
12 verbose statusCode 401
13 verbose pkgid @durtyfree/altv-nativeui@latest
14 verbose cwd D:\Acer\Desktop\altv-server(1)
15 verbose Windows_NT 10.0.19041
16 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "--save" "@durtyfree/altv-nativeui"
17 verbose node v14.13.0
18 verbose npm v6.14.8
19 error code E401
20 error Unable to authenticate, need: Basic realm="GitHub Package Registry"
21 verbose exit [ 1, true ]

When i tried accessing 'https://npm.pkg.github.com/@durtyfree%2faltv-nativeui', its asking for username and password, which causing it to get unauthorized.

ItemSelect Index of AutoListItems is 0

I want to get the Index Value of an AutoListItem on Select but the Index is Everytime 0

Code:

PerformanceMenu.ItemSelect.on((item, index) => {
	alt.log("[AutoListChange] " + index, item.Text);
});

Output:
[17:12:01] [AutoListChange] 0 Motor

NativeUI as dependency in another resource "NativeUI can not invoke without 'new'"

Hey,
ich tried to exclude the NativeUI resource from some ressources in on my server.
Add it as dependency is working great.
But if im trying to build my menu with NativeUI an error occurs:

[19:47:58][Error] [V8] Exception at NativeUI:client.js:468 [19:47:58][Error] let point = new NativeUI.Point(50,50); [19:47:58][Error] TypeError: Class constructor Point cannot be invoked without 'new'

https://prnt.sc/vdieoq

Do not know why.
I am using 'new'.

It is not possible to use it as dependency

Please submit this in npm registry instead of github. and make name in package.json in lowercase

[14:26:26][Error] [V8] Exception at admin
[14:26:26][Error]   ReferenceError: No such module: @durtyfree/altv-nativeui
[14:26:26][Error] Failed to load resource admin

UIMenuDynamicListItem - Arrows misplaced

Bug
When you don't chose any options on a UIMenuDynamicListItem, the arrows are misplaced. You should any items, and the arrows are placed well.

Step to reproduce
`
let array = ["0", "1"]

let menu = new NativeUI.Menu(
  "Title",
  "Subtitle",
  new NativeUI.Point(50, 50)
)

let item = new NativeUI.UIMenuDynamicListItem(
  "Item Name",
  itemChangeHandle,
  "Description",
  () => array[0]
)

menu.AddItem(item)

`

Screenshots
Arrows misplaced

Natives Deprecated

It seems like as the Natives from NativeUI are Deprecated i updated it like this:

at line 701 replace

getScreenActiveResolution with getActualScreenResolution

at lines 1649, 2692, 2693 replace

getControlInstructionalButton with getControlInstructionalButtonsString

at lines 2125, 2415, 2419, 2422, 2434 replace

setMouseCursorSprite with setMouseCursorStyle

at line 810 add false as last Arguement like so:

game__default.drawSprite(textureDictionary, textureName, x, y, w, h, heading, color.R, color.G, color.B, color.A, true, false);

at line 735 replace

beginTextCommandLineCount with beginTextCommandGetNumberOfLinesForString

at line 747 replace

endTextCommandLineCount with endTextCommandGetNumberOfLinesForString

It works for me so if it does not for you find ur own Solution

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.