Skip to content

Adding compatibility with the 3.7.0 API for ScriptHookDotNet#44

Open
MaelProgramming wants to merge 1 commit into
Bob74:masterfrom
MaelProgramming:master
Open

Adding compatibility with the 3.7.0 API for ScriptHookDotNet#44
MaelProgramming wants to merge 1 commit into
Bob74:masterfrom
MaelProgramming:master

Conversation

@MaelProgramming

Copy link
Copy Markdown

This PR provides the necessary fixes to ensure compatibility with the latest ScriptHookVDotNet builds (API v3.7.0+). The previous version was using deprecated methods and types that caused TypeInitializationException and script crashes upon initialization in current GTA V environments.

Key Changes
Notification System Refactor: Migrated from Notification.Show to Notification.PostTicker. Updated the return type handling from int to GTA.UI.FeedPost to match the new API requirements.

Hash Generation Update: Replaced the obsolete Game.GenerateHash with StringHash.AtStringHash. This ensures correct hashing for phone components and UI elements using UTF-16 encoding.

Strict Typing for Hashes: Migrated hash variables from int to uint. Added explicit casts where necessary to resolve CS0266 "Cannot implicitly convert type 'uint' to 'int'" errors.

Scaleform Loading Fix: Replaced the deprecated new Scaleform() constructor with the asynchronous Scaleform.RequestMovie() method. This prevents main-thread blocking and improves overall script stability during phone initialization.

Verification
Successfully compiled using Visual Studio targeting SHVDN v3.7.0-nightly.133.

Verified in-game: The iFruit phone initializes correctly, contacts are functional, and the previous Unhandled exception notifications are resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant