Skip to content

Commit

Permalink
updated client for character name and merge requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Icehunter committed Mar 4, 2015
1 parent 16afadb commit 9eb9ebd
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 76 deletions.
6 changes: 0 additions & 6 deletions FFXIVAPP.Client/App.cs
Expand Up @@ -192,12 +192,6 @@ private static void SettingsPropertyChanged(object sender, PropertyChangedEventA
case "CharacterName":
Constants.CharacterName = Settings.Default.CharacterName;
break;
case "FirstName":
Initializer.SetCharacter();
break;
case "LastName":
Initializer.SetCharacter();
break;
case "GameLanguage":
Constants.GameLanguage = Settings.Default.GameLanguage;
var lang = Settings.Default.GameLanguage.ToLower();
Expand Down
8 changes: 0 additions & 8 deletions FFXIVAPP.Client/Initializer.cs
Expand Up @@ -459,14 +459,6 @@ private static void SetHomePlugin(int pluginIndex)
ShellView.View.PluginsTC.SelectedIndex = pluginIndex;
}

/// <summary>
/// </summary>
public static void SetCharacter()
{
var name = String.Format("{0} {1}", Settings.Default.FirstName, Settings.Default.LastName);
Settings.Default.CharacterName = StringHelper.TrimAndCleanSpaces(name);
}

/// <summary>
/// </summary>
public static void CheckUpdates()
Expand Down
1 change: 1 addition & 0 deletions FFXIVAPP.Client/Localization/Chinese.cs
Expand Up @@ -60,6 +60,7 @@ public static ResourceDictionary Context()
Dictionary.Add("app_DescriptionHeader", "描述");
Dictionary.Add("app_DescriptionLabel", "描述:");
Dictionary.Add("app_EnableNLogHeader", "用NLog开启记录");
Dictionary.Add("app_CharacterNameLabel", "Character Name:");
Dictionary.Add("app_FirstNameLabel", "名:");
Dictionary.Add("app_GameLanguageLabel", "游戏语言:");
Dictionary.Add("app_ImportLodestoneIDButtonText", "输入 磁石 ID");
Expand Down
1 change: 1 addition & 0 deletions FFXIVAPP.Client/Localization/English.cs
Expand Up @@ -60,6 +60,7 @@ public static ResourceDictionary Context()
Dictionary.Add("app_DescriptionHeader", "Description");
Dictionary.Add("app_DescriptionLabel", "Description:");
Dictionary.Add("app_EnableNLogHeader", "Enable Logging With NLog");
Dictionary.Add("app_CharacterNameLabel", "Character Name:");
Dictionary.Add("app_FirstNameLabel", "First Name:");
Dictionary.Add("app_GameLanguageLabel", "Game Language:");
Dictionary.Add("app_ImportLodestoneIDButtonText", "Import Lodestone ID");
Expand Down
1 change: 1 addition & 0 deletions FFXIVAPP.Client/Localization/French.cs
Expand Up @@ -60,6 +60,7 @@ public static ResourceDictionary Context()
Dictionary.Add("app_DescriptionHeader", "Description");
Dictionary.Add("app_DescriptionLabel", "Description:");
Dictionary.Add("app_EnableNLogHeader", "Activer le logging avec NLog");
Dictionary.Add("app_CharacterNameLabel", "Character Name:");
Dictionary.Add("app_FirstNameLabel", "Prénom:");
Dictionary.Add("app_GameLanguageLabel", "Langage du jeu:");
Dictionary.Add("app_ImportLodestoneIDButtonText", "Importer l'ID Lodestone");
Expand Down
1 change: 1 addition & 0 deletions FFXIVAPP.Client/Localization/German.cs
Expand Up @@ -60,6 +60,7 @@ public static ResourceDictionary Context()
Dictionary.Add("app_DescriptionHeader", "Beschreibung");
Dictionary.Add("app_DescriptionLabel", "Beschreibung:");
Dictionary.Add("app_EnableNLogHeader", "Protokoll mit Nlog zulassen");
Dictionary.Add("app_CharacterNameLabel", "Character Name:");
Dictionary.Add("app_FirstNameLabel", "Virname:");
Dictionary.Add("app_GameLanguageLabel", "Spielsprache");
Dictionary.Add("app_ImportLodestoneIDButtonText", "Lodestone ID Importieren");
Expand Down
1 change: 1 addition & 0 deletions FFXIVAPP.Client/Localization/Japanese.cs
Expand Up @@ -60,6 +60,7 @@ public static ResourceDictionary Context()
Dictionary.Add("app_DescriptionHeader", "内容");
Dictionary.Add("app_DescriptionLabel", "内容:");
Dictionary.Add("app_EnableNLogHeader", "NLogでのログ取得を有効にする");
Dictionary.Add("app_CharacterNameLabel", "名:");
Dictionary.Add("app_FirstNameLabel", "名前:");
Dictionary.Add("app_GameLanguageLabel", "表示言語:");
Dictionary.Add("app_ImportLodestoneIDButtonText", "Lodestone IDを取得する");
Expand Down
46 changes: 6 additions & 40 deletions FFXIVAPP.Client/Memory/InventoryWorker.cs
Expand Up @@ -38,7 +38,6 @@
using FFXIVAPP.Client.Properties;
using FFXIVAPP.Common.Core.Memory;
using FFXIVAPP.Common.Core.Memory.Enums;
using FFXIVAPP.Common.Core.Constant;
using Newtonsoft.Json;
using NLog;

Expand Down Expand Up @@ -93,36 +92,7 @@ public void StopScanning()
#region Threads

public Stopwatch Stopwatch = new Stopwatch();
// when CharacterName is not set in FFXIVAPP, get it from CHARMAP.
private void SetCharacterName()
{
if (Settings.Default.CharacterName.Length == 0)
{
var characterAddressMap = MemoryHandler.Instance.SigScanner.Locations["CHARMAP"];
uint characterAddress = MemoryHandler.Instance.GetUInt32(characterAddressMap);
String tempName = MemoryHandler.Instance.GetString(characterAddress, 0x30);
if (!tempName.Equals(Constants.CharacterName))
{
Constants.CharacterName = tempName;
ConstantsEntity lce = new ConstantsEntity
{
AutoTranslate = Constants.AutoTranslate,
CharacterName = Constants.CharacterName,
ChatCodes = Constants.ChatCodes,
ChatCodesXml = Constants.ChatCodesXml,
Colors = Constants.Colors,
CultureInfo = Constants.CultureInfo,
EnableHelpLabels = Constants.EnableHelpLabels,
GameLanguage = Constants.GameLanguage,
ServerName = Constants.ServerName,
Theme = Constants.Theme,
UIScale = Constants.UIScale
};
AppContextHelper.Instance.RaiseNewConstants(lce);
}
}

}

/// <summary>
/// </summary>
/// <param name="sender"> </param>
Expand Down Expand Up @@ -157,20 +127,17 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
GetItems(InventoryPointerMap, Inventory.Container.EXTRA_EQ),
GetItems(InventoryPointerMap, Inventory.Container.CRYSTALS),
GetItems(InventoryPointerMap, Inventory.Container.QUESTS_KI),

GetItems(InventoryPointerMap, Inventory.Container.HIRE_1),
GetItems(InventoryPointerMap, Inventory.Container.HIRE_2),
GetItems(InventoryPointerMap, Inventory.Container.HIRE_3),
GetItems(InventoryPointerMap, Inventory.Container.HIRE_4),
GetItems(InventoryPointerMap, Inventory.Container.HIRE_5),
GetItems(InventoryPointerMap, Inventory.Container.HIRE_6),
GetItems(InventoryPointerMap, Inventory.Container.HIRE_7),

GetItems(InventoryPointerMap, Inventory.Container.COMPANY_1),
GetItems(InventoryPointerMap, Inventory.Container.COMPANY_2),
GetItems(InventoryPointerMap, Inventory.Container.COMPANY_3),
GetItems(InventoryPointerMap, Inventory.Container.COMPANY_CRYSTALS),

GetItems(InventoryPointerMap, Inventory.Container.AC_MH),
GetItems(InventoryPointerMap, Inventory.Container.AC_OH),
GetItems(InventoryPointerMap, Inventory.Container.AC_HEAD),
Expand Down Expand Up @@ -205,7 +172,6 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
}
if (notify)
{
SetCharacterName();
AppContextHelper.Instance.RaiseNewInventoryEntries(inventoryEntities);
}
}
Expand All @@ -232,20 +198,20 @@ private InventoryEntity GetItems(uint address, Inventory.Container type)
Type = type
};
// The number of item is 50 in COMPANY's locker
int MAX_AMOUNT;
int limit;
switch (type)
{
case Inventory.Container.COMPANY_1:
case Inventory.Container.COMPANY_2:
case Inventory.Container.COMPANY_3:
MAX_AMOUNT = 3200;
limit = 3200;
break;
default:
MAX_AMOUNT = 1600;
limit = 1600;
break;
}

for (var ci = 0; ci < MAX_AMOUNT; ci += 64)
for (var ci = 0; ci < limit; ci += 64)
{
var itemOffset = (uint) (containerAddress + ci);
var id = MemoryHandler.Instance.GetUInt32(itemOffset, 0x8);
Expand All @@ -260,7 +226,7 @@ private InventoryEntity GetItems(uint address, Inventory.Container type)
Durability = MemoryHandler.Instance.GetUInt16(itemOffset, 0x12),
GlamourID = MemoryHandler.Instance.GetUInt32(itemOffset, 0x30),
//get the flag that show if the item is hq or not
IsHQ = (MemoryHandler.Instance.GetByte(itemOffset, 0x14) == 0x01)? true:false
IsHQ = (MemoryHandler.Instance.GetByte(itemOffset, 0x14) == 0x01)
});
}
}
Expand Down
5 changes: 5 additions & 0 deletions FFXIVAPP.Client/Memory/MonsterWorker.cs
Expand Up @@ -176,6 +176,11 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
entry.MapIndex = mapIndex;
if (i == 0)
{
var name = Settings.Default.CharacterName;
if (name != entry.Name || String.IsNullOrWhiteSpace(name))
{
Settings.Default.CharacterName = entry.Name;
}
if (targetAddress > 0)
{
uint currentTargetID;
Expand Down
10 changes: 0 additions & 10 deletions FFXIVAPP.Client/ViewModels/SettingsViewModel.cs
Expand Up @@ -121,7 +121,6 @@ public List<string> AvailableAudioDevicesList
public ICommand DefaultSettingsCommand { get; private set; }
public ICommand ChangeAudioModeCommand { get; private set; }
public ICommand GetCICUIDCommand { get; private set; }
public ICommand SaveCharacterCommand { get; private set; }
public ICommand ColorSelectionCommand { get; private set; }
public ICommand UpdateColorCommand { get; private set; }

Expand All @@ -135,7 +134,6 @@ public SettingsViewModel()
DefaultSettingsCommand = new DelegateCommand(DefaultSettings);
ChangeAudioModeCommand = new DelegateCommand(ChangeAudioMode);
GetCICUIDCommand = new DelegateCommand(GetCICUID);
SaveCharacterCommand = new DelegateCommand(SaveCharacter);
ColorSelectionCommand = new DelegateCommand(ColorSelection);
UpdateColorCommand = new DelegateCommand(UpdateColor);
}
Expand Down Expand Up @@ -193,7 +191,6 @@ public static void ChangeAudioMode()
/// </summary>
private static void GetCICUID()
{
SaveCharacter();
var characterName = Settings.Default.CharacterName;
var serverName = Settings.Default.ServerName;
if (characterName.Replace(" ", "")
Expand Down Expand Up @@ -255,13 +252,6 @@ private static void LodestoneCallBack(IAsyncResult asyncResult)
Settings.Default.CICUID = result;
}

/// <summary>
/// </summary>
private static void SaveCharacter()
{
Initializer.SetCharacter();
}

/// <summary>
/// </summary>
private static void ColorSelection()
Expand Down
16 changes: 4 additions & 12 deletions FFXIVAPP.Client/Views/SettingsView.xaml
Expand Up @@ -204,21 +204,13 @@
<GroupBox Header="{Binding Locale[app_CharacterInformationHeader],
Source={StaticResource AppProperties}}">
<StackPanel>
<TextBlock Text="{Binding Locale[app_FirstNameLabel],
<TextBlock Text="{Binding Locale[app_CharacterNameLabel],
Source={StaticResource AppProperties}}" />
<TextBox x:Name="FirstName"
<TextBox x:Name="CharacterName"
Margin="5"
AutoWordSelection="True"
MaxLength="32"
Text="{Binding FirstName,
Source={x:Static Properties:Settings.Default}}" />
<TextBlock Text="{Binding Locale[app_LastNameLabel],
Source={StaticResource AppProperties}}" />
<TextBox x:Name="LastName"
Margin="5"
AutoWordSelection="True"
MaxLength="32"
Text="{Binding LastName,
MaxLength="60"
Text="{Binding CharacterName,
Source={x:Static Properties:Settings.Default}}" />
<TextBlock Text="{Binding Locale[app_ServerLabel],
Source={StaticResource AppProperties}}" />
Expand Down
Binary file modified distribution/FFXIVAPP.Client.exe
Binary file not shown.
Binary file modified distribution/FFXIVAPP.Common.dll
Binary file not shown.
Binary file modified distribution/FFXIVAPP.IPluginInterface.dll
Binary file not shown.
Binary file modified distribution/FFXIVAPP.Updater.exe
Binary file not shown.

0 comments on commit 9eb9ebd

Please sign in to comment.