Discord world images

This commit is contained in:
Natsumi
2022-05-08 23:53:53 +12:00
parent cea263ca33
commit dc0d1883d6
5 changed files with 22 additions and 9 deletions

BIN
DiscordRPC/DiscordRPC.dll Normal file

Binary file not shown.

3
DiscordRPC/README.md Normal file
View File

@@ -0,0 +1,3 @@
# Discord Rich Presence
Source code is available here: [https://github.com/Lachee/discord-rpc-csharp](https://github.com/Lachee/discord-rpc-csharp)

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
@@ -61,6 +61,10 @@
<Reference Include="Blake2Sharp">
<HintPath>librsync.net\Blake2Sharp.dll</HintPath>
</Reference>
<Reference Include="DiscordRPC">
<SpecificVersion>False</SpecificVersion>
<HintPath>DiscordRPC\DiscordRPC.dll</HintPath>
</Reference>
<Reference Include="librsync.net">
<HintPath>librsync.net\librsync.net.dll</HintPath>
</Reference>
@@ -171,16 +175,13 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="CefSharp.Common">
<Version>100.0.230</Version>
<Version>101.0.150</Version>
</PackageReference>
<PackageReference Include="CefSharp.OffScreen">
<Version>100.0.230</Version>
<Version>101.0.150</Version>
</PackageReference>
<PackageReference Include="CefSharp.WinForms">
<Version>100.0.230</Version>
</PackageReference>
<PackageReference Include="DiscordRichPresence">
<Version>1.0.175</Version>
<Version>101.0.150</Version>
</PackageReference>
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications">
<Version>7.1.2</Version>

View File

@@ -7737,11 +7737,13 @@ speechSynthesis.getVoices();
$app.data.discordInstance = configRepository.getBool('discordInstance');
$app.data.discordJoinButton = configRepository.getBool('discordJoinButton');
$app.data.discordHideInvite = configRepository.getBool('discordHideInvite');
$app.data.discordHideImage = configRepository.getBool('discordHideImage');
$app.methods.saveDiscordOption = function () {
configRepository.setBool('discordActive', this.discordActive);
configRepository.setBool('discordInstance', this.discordInstance);
configRepository.setBool('discordJoinButton', this.discordJoinButton);
configRepository.setBool('discordHideInvite', this.discordHideInvite);
configRepository.setBool('discordHideImage', this.discordHideImage);
if (!this.discordActive) {
Discord.SetText('', '');
Discord.SetActive(false);
@@ -9850,6 +9852,7 @@ speechSynthesis.getVoices();
Discord.SetTimestamps(this.lastLocation.date, 0);
L = API.parseLocation(this.lastLocation.location);
L.worldName = '';
L.thumbnailImageUrl = '';
L.worldCapacity = 0;
L.joinUrl = '';
L.accessName = '';
@@ -9857,12 +9860,14 @@ speechSynthesis.getVoices();
var ref = API.cachedWorlds.get(L.worldId);
if (ref) {
L.worldName = ref.name;
L.thumbnailImageUrl = ref.thumbnailImageUrl;
L.worldCapacity = ref.capacity * 2;
} else {
API.getWorld({
worldId: L.worldId
}).then((args) => {
L.worldName = args.ref.name;
L.thumbnailImageUrl = args.ref.thumbnailImageUrl;
L.worldCapacity = args.ref.capacity * 2;
return args;
});
@@ -9941,8 +9946,7 @@ speechSynthesis.getVoices();
partyMaxSize = 0;
buttonText = '';
buttonUrl = '';
}
if (!hidePrivate && this.isRpcWorld(L.tag)) {
} else if (this.isRpcWorld(L.tag)) {
// dance world rpc
if (L.worldId === 'wrld_f20326da-f1ac-45fc-a062-609723b097b1') {
appId = '784094509008551956';
@@ -9978,6 +9982,8 @@ speechSynthesis.getVoices();
1000
);
}
} else if (!this.discordHideImage && L.thumbnailImageUrl) {
bigIcon = L.thumbnailImageUrl;
}
Discord.SetAssets(
bigIcon, // big icon

View File

@@ -1144,6 +1144,9 @@ html
div.options-container-item
span.name Hide world details in private
el-switch(v-model="discordHideInvite" @change="saveDiscordOption" :disabled="!discordActive")
div.options-container-item
span.name Hide world images
el-switch(v-model="discordHideImage" @change="saveDiscordOption" :disabled="!discordActive")
el-tab-pane(label="Advanced")
div.options-container(style="margin-top:0")
span.header Advanced