forked from profectus/Profectus
Remove references to purchasing for repeatable
This commit is contained in:
parent
909c7a5f5e
commit
cdce13480e
1 changed files with 15 additions and 19 deletions
|
@ -47,7 +47,6 @@ export interface RepeatableOptions {
|
||||||
small?: Computable<boolean>;
|
small?: Computable<boolean>;
|
||||||
maximize?: Computable<boolean>;
|
maximize?: Computable<boolean>;
|
||||||
display?: Computable<RepeatableDisplay>;
|
display?: Computable<RepeatableDisplay>;
|
||||||
onPurchase?: VoidFunction;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BaseRepeatable {
|
export interface BaseRepeatable {
|
||||||
|
@ -56,7 +55,6 @@ export interface BaseRepeatable {
|
||||||
maxed: Ref<boolean>;
|
maxed: Ref<boolean>;
|
||||||
canClick: ProcessedComputable<boolean>;
|
canClick: ProcessedComputable<boolean>;
|
||||||
onClick: VoidFunction;
|
onClick: VoidFunction;
|
||||||
purchase: VoidFunction;
|
|
||||||
type: typeof RepeatableType;
|
type: typeof RepeatableType;
|
||||||
[Component]: typeof ClickableComponent;
|
[Component]: typeof ClickableComponent;
|
||||||
[GatherProps]: () => Record<string, unknown>;
|
[GatherProps]: () => Record<string, unknown>;
|
||||||
|
@ -139,10 +137,8 @@ export function createRepeatable<T extends RepeatableOptions>(
|
||||||
return currClasses;
|
return currClasses;
|
||||||
});
|
});
|
||||||
repeatable.canClick = computed(() => requirementsMet(repeatable.requirements));
|
repeatable.canClick = computed(() => requirementsMet(repeatable.requirements));
|
||||||
repeatable.onClick = repeatable.purchase =
|
const onClick = repeatable.onClick;
|
||||||
repeatable.onClick ??
|
repeatable.onClick = function (this: GenericRepeatable) {
|
||||||
repeatable.purchase ??
|
|
||||||
function (this: GenericRepeatable) {
|
|
||||||
const genericRepeatable = repeatable as GenericRepeatable;
|
const genericRepeatable = repeatable as GenericRepeatable;
|
||||||
if (!unref(genericRepeatable.canClick)) {
|
if (!unref(genericRepeatable.canClick)) {
|
||||||
return;
|
return;
|
||||||
|
@ -154,7 +150,7 @@ export function createRepeatable<T extends RepeatableOptions>(
|
||||||
: 1
|
: 1
|
||||||
);
|
);
|
||||||
genericRepeatable.amount.value = Decimal.add(genericRepeatable.amount.value, 1);
|
genericRepeatable.amount.value = Decimal.add(genericRepeatable.amount.value, 1);
|
||||||
genericRepeatable.onPurchase?.();
|
onClick?.();
|
||||||
};
|
};
|
||||||
processComputable(repeatable as T, "display");
|
processComputable(repeatable as T, "display");
|
||||||
const display = repeatable.display;
|
const display = repeatable.display;
|
||||||
|
|
Loading…
Reference in a new issue