GithubHelp home page GithubHelp logo

marco4413 / cp77-discordrpc2 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 64 KB

A Discord Rich Presence Client for Cyberpunk 2077

Home Page: https://www.nexusmods.com/cyberpunk2077/mods/10831

License: Other

Lua 77.52% C++ 19.38% Red 3.10%
cyberenginetweaks cyberpunk-mods cyberpunk2077 discord discord-rich-presence mod red4ext redscript rich-presence

cp77-discordrpc2's Introduction

Cyberpunk2077 - DiscordRPC 2

About

This is a Cyberpunk 2077 mod which adds Discord Rich Presence to the game!

I had already made a mod which claimed to do the same thing, but it used CET and an external application (not convenient). This new version is self-contained!

Features

  • Large image based on character gender.
  • Level and Street Cred shown when hovering the large image.
  • Small image based on lifepath.
  • When hovering the small image:
    • Playthrough time (optional, experimental).
    • Lifepath.
  • Quest and Objective tracking (optional).
  • Driving activity (optional).
  • Combat activity (optional).
  • Radio activity (optional) with RadioExt integration (also optional).
  • Roaming activity (no quest selected) showing what district the player is in.

Requirements

Adding Translations

Note: I don't accept PRs that add other languages since it would be a nightmare for me to maintain. That's why this mod has support for other mods to provide translations (see below).

Other CET mods can register locales using the CP77RPC2.RegisterLocale function.

The following snippet of code can get you started:

-- Name used for logging inside the "onTweak" event
local langName = "Italian"
-- A unique id for this locale
local localeName = "it"
local locale = {
    -- All loc keys and their meaning can be found at https://github.com/Marco4413/CP77-DiscordRPC2/blob/master/src/cet/locales/en.lua
    -- If a key was not translated, it can be omitted and a fallback to English will be made.
    ["Locale.Name"] = "Italiano (by Marco4413)",
    ...
}

registerForEvent("onTweak", function()
    local CP77RPC2 = GetMod("CP77RPC2")
    if not CP77RPC2 then
        print("[CP77RPC2 - " .. langName .. " Translation]: CP77RPC2 is not installed.")
        return
    end

    local ok, error = CP77RPC2.RegisterLocale(localeName, locale)
    if ok then
        print("[CP77RPC2 - " .. langName .. " Translation]: Translation registered!")
    else
        print("[CP77RPC2 - " .. langName .. " Translation]: Failed to register translation: ", error)
    end
end)

Credits

Thanks to all contributors of RED4ext, redscript and CyberEngineTweaks for developing those projects, and to the people from the Cyberpunk 2077 Modding Community Discord Server for helping me understand some parts of RED4ext and redscript, I truly appreciate it!

Also thanks to WillyJL for making the original mod that inspired me to do this! And thanks to psiberx for developing cet-kit.

Building

You must have premake5 and VS2022 installed.

Run the following commands to set up build files:

$ premake5 configure
$ premake5 vs2022

Then open the cp77rpc2.sln file (with VS2022) that was created in the root directory, and build the cp77rpc2 project. The built RED4ext plugin can be found inside src/red4ext/build/Configuration/cp77rpc2.dll. Make sure to also copy discord_game_sdk.dll, found inside src/red4ext/libs/discord_game_sdk/lib/x86_64/, to the same folder as the plugin.

cp77-discordrpc2's People

Contributors

marco4413 avatar

Stargazers

 avatar

Watchers

 avatar

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.