Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src-tauri/src/engine/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ pub fn start_clicker(config: ClickerConfig, control: RunControl) -> RunOutcome {
}
}

let per_tick_clicks = batch_size.saturating_mul(if config.double_click_enabled { 2 } else { 1 });
let per_tick_clicks =
batch_size.saturating_mul(if config.double_click_enabled { 2 } else { 1 });
let requested_clicks = if config.sequence_enabled && !config.sequence_points.is_empty() {
sequence_clicks_remaining.min(per_tick_clicks)
} else {
Expand Down
28 changes: 14 additions & 14 deletions src/components/panels/advanced/LimitsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ export default function LimitsSection({ settings, update, showInfo }: Props) {
: "clicks",
);

useEffect(() => {
if (
settings.timeLimitEnabled &&
!settings.clickLimitEnabled &&
mode !== "time"
) {
setMode("time");
} else if (
settings.clickLimitEnabled &&
!settings.timeLimitEnabled &&
mode !== "clicks"
) {
setMode("clicks");
// Sync mode with settings if they change from the outside (e.g. presets)
const [prevSettings, setPrevSettings] = useState(settings);
if (
settings.clickLimitEnabled !== prevSettings.clickLimitEnabled ||
settings.timeLimitEnabled !== prevSettings.timeLimitEnabled
) {
setPrevSettings(settings);
const nextMode =
settings.timeLimitEnabled && !settings.clickLimitEnabled
? "time"
: "clicks";
if (nextMode !== mode) {
setMode(nextMode);
}
}, [settings.clickLimitEnabled, settings.timeLimitEnabled, mode]);
}

useEffect(() => {
if (settings.clickLimitEnabled && settings.timeLimitEnabled) {
Expand Down
1 change: 0 additions & 1 deletion src/components/panels/advanced/shared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ export function InfoIcon({ text }: { text: string }) {
return;
}

updateTooltipPosition();
const id = window.requestAnimationFrame(updateTooltipPosition);

const handleReposition = () => {
Expand Down
9 changes: 6 additions & 3 deletions src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ import ar from "./locales/ar.json";
import en from "./locales/en.json";
import es from "./locales/es.json";
import fr from "./locales/fr.json";
import pt from "./locales/pt.json";

export const LANGUAGE_CODES = ["en", "es", "fr", "ar"] as const;
export const LANGUAGE_CODES = ["ar", "en", "es", "fr", "pt"] as const;
export type Language = (typeof LANGUAGE_CODES)[number];

export const DEFAULT_LANGUAGE: Language = "en";
export const LANGUAGE_OPTIONS: readonly { code: Language; label: string }[] = [
{ code: "ar", label: "العربية" },
{ code: "en", label: "English" },
{ code: "es", label: "Español" },
{ code: "fr", label: "Français" },
{ code: "ar", label: "العربية" },
{ code: "pt", label: "Português (Brasil)" },
];

type TranslationTree = typeof en;
Expand All @@ -34,10 +36,11 @@ export type TranslationKey = DotKeys<TranslationTree>;
type TranslationVars = Record<string, string | number>;

const translations: Record<Language, TranslationTree> = {
ar,
en,
es,
fr,
ar,
pt,
};

type I18nContextValue = {
Expand Down
413 changes: 207 additions & 206 deletions src/locales/ar.json

Large diffs are not rendered by default.

Loading