Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/marzent/XIV-on-Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
marzent committed Mar 22, 2022
2 parents 8ad2001 + f51e2d8 commit c9d4aeb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion XIV on Mac/AddOns/Dalamud.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ struct Dalamud {
static let dalamudDownload = Util.cache.appendingPathComponent("dalamud.zip")
static let localAssets = Wine.xomData.appendingPathComponent("Dalamud Assets")
static let runtime = Wine.xomData.appendingPathComponent("dotNET Runtime")
// Dalamud injection delay seems to be heavily system dependent for some reason.
// But, while the default 7 seems to work great on Intel system we've seen a lot of evidence
// in the Discord support channel that 2 works much better on Apple Silicon; so, it's easy enough to
// have two different defaults.
#if arch(arm64)
static let defaultInjectionDelay = 2.0
#else
static let defaultInjectionDelay = 7.0
#endif

private struct Remote {

Expand Down Expand Up @@ -123,7 +132,7 @@ struct Dalamud {
private static let injectionSettingKey = "InjectionDelaySetting"
static var delay: Double {
get {
return Util.getSetting(settingKey: injectionSettingKey, defaultValue: 7.0)
return Util.getSetting(settingKey: injectionSettingKey, defaultValue: Dalamud.defaultInjectionDelay)
}
set {
UserDefaults.standard.set(newValue, forKey: injectionSettingKey)
Expand Down
2 changes: 1 addition & 1 deletion XIV on Mac/SettingsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class SettingsController: NSViewController {

FFXIVSettings.dalamud = (dalamud.state == NSControl.StateValue.on) ? true : false
Dalamud.mbCollection = (crowdSource.state == NSControl.StateValue.on) ? true : false
Dalamud.delay = Double(delay.stringValue) ?? 7.0
Dalamud.delay = Double(delay.stringValue) ?? Dalamud.defaultInjectionDelay

FFXIVSettings.language = FFXIVLanguage(rawValue: UInt32(language.indexOfSelectedItem)) ?? .english
FFXIVSettings.platform = FFXIVPlatform(rawValue: UInt32(license.indexOfSelectedItem)) ?? .mac
Expand Down

0 comments on commit c9d4aeb

Please sign in to comment.