Questify: Panel Subtitle Premium Orb Quantity. (#1102)

* Premium Orb Quantity.

* Prevent Text Shifting.

* Make CSS Manages.

* Make CSS Managed.
This commit is contained in:
Etorix 2026-05-22 07:31:08 -07:00 • committed by GitHub
parent 09cd7ddd37
commit 822f6c7359
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 6 deletions

View file

@ -4,8 +4,6 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import "./styles.css";
import { playAudio } from "@api/AudioPlayer";
import { addServerListElement, removeServerListElement, ServerListRenderPosition } from "@api/ServerList";
import { PlainSettings, Settings } from "@api/Settings";
@ -26,6 +24,7 @@ import { rerenderQuests, useQuestRerender } from "./settings/rerender";
import { disposeRestartTracking, initializeRestartTracking, promptToRestartIfDirty, setRestartDirty } from "./settings/restartTracking";
import { settings } from "./settings/store";
import { getSettingsModalOpen, initialQuestDataFetched, setInitialQuestDataFetched, setSettingsModalOpen } from "./state";
import managedStyle from "./styles.css?managed";
import { canAutoCompleteQuest, getActiveAutoCompletes, getQuestAutoCompleteProgress, getQuestButtonProps, getQuestPanelSubtitleText, hasEnabledAutoCompleteQuestTypes, processQuestForAutoComplete, resumeInterruptedAutoCompletes, setHeartbeatStackTracePatchSucceeded, setVideoProgressStackTracePatchSucceeded, stopAllAutoCompletes, stopAutoCompletesForRunningGames, stopQuestAutoComplete } from "./utils/completion";
import { canOpenDevToolsWindow, fetchAndDispatchQuests, openDevToolsWindow, snakeToCamel } from "./utils/fetching";
import { normalizeQuestName } from "./utils/filtering";
@ -103,6 +102,7 @@ export default definePlugin({
authors: [EquicordDevs.Etorix],
dependencies: ["AudioPlayerAPI", "ServerListAPI"],
startAt: StartAt.Init, // Needed in order to beat Read All Messages to inserting above the server list.
managedStyle,
settings,
canOpenDevToolsWindow,

View file

@ -21,6 +21,11 @@
overflow: visible;
}
/* Prevent shifting in the progress subtitle. */
[class*="questProgressHint_"] {
font-variant-numeric: tabular-nums;
}
/* Settings */
.questify-setting {

View file

@ -5,10 +5,10 @@
*/
import type { PluginNative } from "@utils/types";
import type { Quest } from "@vencord/discord-types";
import type { Quest, User } from "@vencord/discord-types";
import { QuestTaskType } from "@vencord/discord-types/enums";
import { findByCodeLazy, findLazy } from "@webpack";
import { FluxDispatcher, QuestStore, RestAPI, showToast, Toasts } from "@webpack/common";
import { FluxDispatcher, QuestStore, RestAPI, showToast, Toasts, UserStore } from "@webpack/common";
import { getCurrentUserId, getQuestifySettings } from "../settings/access";
import { autoCompleteQuestTaskTypes, isDesktopCompatible } from "../settings/def";
@ -75,6 +75,7 @@ type QuestCompletionStateTuple = [text: string | null, state: QuestCompletionSta
interface QuestRewardItem {
orbQuantity?: number;
premiumOrbQuantity?: number | null;
messages?: {
nameWithArticle?: string;
};
@ -89,7 +90,10 @@ const sendHeartbeat = findByCodeLazy(".QUESTS_HEARTBEAT(") as (options: {
executableFingerprint?: unknown;
}) => Promise<void>;
export const enrollInQuest = findByCodeLazy('type:"QUESTS_ENROLL_BEGIN",') as (questId: string, options: QuestEnrollmentMetadata) => Promise<QuestEnrollResult>;
const getQuestOrbQuantity = findByCodeLazy("premiumOrbQuantity??", "orbQuantity") as (
config: Quest["config"],
user: User | null | undefined
) => number | null;
const QuestCTA = findLazy(m => !!m?.START_QUEST && !!m?.ACCEPT_QUEST) as QuestCTAConstants;
function resolveQuestCTA(taskType?: QuestTaskType): string | undefined {
@ -511,7 +515,7 @@ export function getQuestPanelSubtitleText(quest: Quest): string | null {
}
const rewardItem = (quest.config.rewardsConfig.rewards[0] ?? null) as QuestRewardItem | null;
const orbsReward = rewardItem?.orbQuantity ?? 0;
const orbsReward = getQuestOrbQuantity(quest.config, UserStore.getCurrentUser()) ?? 0;
if (orbsReward > 0) {
return `${statusText} for ${orbsReward} Orbs.`;