add ui option for activity context profiles
This commit is contained in:
@@ -36,6 +36,7 @@ namespace PlayerTags.Configuration
|
||||
public bool IsPlayersTabAllianceVisible = true;
|
||||
public bool IsPlayersTabEnemiesVisible = true;
|
||||
public bool IsPlayersTabOthersVisible = false;
|
||||
public bool IsGeneralOptionsAllTheSameEnabled = true;
|
||||
|
||||
[JsonProperty(TypeNameHandling = TypeNameHandling.None, ItemTypeNameHandling = TypeNameHandling.None)]
|
||||
public Dictionary<string, InheritableData> AllTagsChanges = new Dictionary<string, InheritableData>();
|
||||
|
||||
@@ -65,6 +65,12 @@ namespace PlayerTags.Configuration
|
||||
DrawCheckbox(nameof(m_PluginConfiguration.IsCustomTagsContextMenuEnabled), true, ref m_PluginConfiguration.IsCustomTagsContextMenuEnabled, () => SaveSettings());
|
||||
|
||||
|
||||
ImGui.Spacing();
|
||||
ImGui.Spacing();
|
||||
DrawHeading(Strings.Loc_Static_CurrentActivityProfile);
|
||||
DrawComboBox(true, true, false, ref propertyProxy.CurrentActivityContext, () => SaveSettings(false));
|
||||
|
||||
|
||||
ImGui.Spacing();
|
||||
ImGui.Spacing();
|
||||
DrawHeading(Strings.Loc_Static_Nameplates);
|
||||
@@ -72,13 +78,17 @@ namespace PlayerTags.Configuration
|
||||
DrawComboBox(true, true, false, ref propertyProxy.NameplateTitleVisibility, () => SaveSettings(true));
|
||||
DrawComboBox(true, true, false, ref propertyProxy.NameplateTitlePosition, () => SaveSettings(true));
|
||||
|
||||
ImGui.Spacing();
|
||||
ImGui.Spacing();
|
||||
DrawHeading(Strings.Loc_Static_ChatExperimental);
|
||||
DrawCheckbox(nameof(propertyProxy.IsLinkSelfInChatEnabled), true, ref propertyProxy.IsLinkSelfInChatEnabled, () => SaveSettings(true));
|
||||
DrawCheckbox(nameof(propertyProxy.IsApplyTagsToAllChatMessagesEnabled), true, ref propertyProxy.IsApplyTagsToAllChatMessagesEnabled, () => SaveSettings(true));
|
||||
|
||||
|
||||
ImGui.Spacing();
|
||||
ImGui.Spacing();
|
||||
DrawHeading(Strings.Loc_Static_Experimental);
|
||||
DrawHeading(Strings.Loc_Static_OtherExperimental);
|
||||
DrawCheckbox(nameof(m_PluginConfiguration.IsPlayerNameRandomlyGenerated), true, ref m_PluginConfiguration.IsPlayerNameRandomlyGenerated, () => SaveSettings());
|
||||
DrawCheckbox(nameof(propertyProxy.IsLinkSelfInChatEnabled), true, ref propertyProxy.IsLinkSelfInChatEnabled, () => SaveSettings(true));
|
||||
DrawCheckbox(nameof(propertyProxy.IsApplyTagsToAllChatMessagesEnabled), true, ref propertyProxy.IsApplyTagsToAllChatMessagesEnabled, () => SaveSettings(true));
|
||||
|
||||
ImGui.EndTabItem();
|
||||
}
|
||||
@@ -1176,6 +1186,7 @@ namespace PlayerTags.Configuration
|
||||
{
|
||||
private PluginConfiguration pluginConfig;
|
||||
|
||||
public ActivityContextSelection CurrentActivityContext;
|
||||
public NameplateFreeCompanyVisibility NameplateFreeCompanyVisibility;
|
||||
public NameplateTitleVisibility NameplateTitleVisibility;
|
||||
public NameplateTitlePosition NameplateTitlePosition;
|
||||
@@ -1185,20 +1196,34 @@ namespace PlayerTags.Configuration
|
||||
public PropertyProxy(PluginConfiguration config)
|
||||
{
|
||||
pluginConfig = config;
|
||||
CurrentActivityContext = config.IsGeneralOptionsAllTheSameEnabled ? ActivityContextSelection.All : ActivityContextSelection.None;
|
||||
}
|
||||
|
||||
public void LoadData()
|
||||
{
|
||||
NameplateFreeCompanyVisibility = pluginConfig.GeneralOptions[ActivityContext.None].NameplateFreeCompanyVisibility;
|
||||
NameplateTitleVisibility = pluginConfig.GeneralOptions[ActivityContext.None].NameplateTitleVisibility;
|
||||
NameplateTitlePosition = pluginConfig.GeneralOptions[ActivityContext.None].NameplateTitlePosition;
|
||||
IsApplyTagsToAllChatMessagesEnabled = pluginConfig.GeneralOptions[ActivityContext.None].IsApplyTagsToAllChatMessagesEnabled;
|
||||
IsLinkSelfInChatEnabled = pluginConfig.GeneralOptions[ActivityContext.None].IsLinkSelfInChatEnabled;
|
||||
var currentActivityContext = GetActivityContext(CurrentActivityContext);
|
||||
NameplateFreeCompanyVisibility = pluginConfig.GeneralOptions[currentActivityContext].NameplateFreeCompanyVisibility;
|
||||
NameplateTitleVisibility = pluginConfig.GeneralOptions[currentActivityContext].NameplateTitleVisibility;
|
||||
NameplateTitlePosition = pluginConfig.GeneralOptions[currentActivityContext].NameplateTitlePosition;
|
||||
IsApplyTagsToAllChatMessagesEnabled = pluginConfig.GeneralOptions[currentActivityContext].IsApplyTagsToAllChatMessagesEnabled;
|
||||
IsLinkSelfInChatEnabled = pluginConfig.GeneralOptions[currentActivityContext].IsLinkSelfInChatEnabled;
|
||||
}
|
||||
|
||||
public void SaveData()
|
||||
{
|
||||
foreach (var key in pluginConfig.GeneralOptions.Keys)
|
||||
if (CurrentActivityContext == ActivityContextSelection.All)
|
||||
{
|
||||
pluginConfig.IsGeneralOptionsAllTheSameEnabled = true;
|
||||
foreach (var key in pluginConfig.GeneralOptions.Keys)
|
||||
applyChanges(key);
|
||||
}
|
||||
else
|
||||
{
|
||||
pluginConfig.IsGeneralOptionsAllTheSameEnabled = false;
|
||||
applyChanges(GetActivityContext(CurrentActivityContext));
|
||||
}
|
||||
|
||||
void applyChanges(ActivityContext key)
|
||||
{
|
||||
pluginConfig.GeneralOptions[key].NameplateFreeCompanyVisibility = NameplateFreeCompanyVisibility;
|
||||
pluginConfig.GeneralOptions[key].NameplateTitleVisibility = NameplateTitleVisibility;
|
||||
@@ -1207,6 +1232,36 @@ namespace PlayerTags.Configuration
|
||||
pluginConfig.GeneralOptions[key].IsLinkSelfInChatEnabled = IsLinkSelfInChatEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
private ActivityContext GetActivityContext(ActivityContextSelection selection)
|
||||
{
|
||||
ActivityContext result;
|
||||
|
||||
switch (selection)
|
||||
{
|
||||
case ActivityContextSelection.PveDuty:
|
||||
result = ActivityContext.PveDuty;
|
||||
break;
|
||||
case ActivityContextSelection.PvpDuty:
|
||||
result = ActivityContext.PvpDuty;
|
||||
break;
|
||||
case ActivityContextSelection.All:
|
||||
case ActivityContextSelection.None:
|
||||
default:
|
||||
result = ActivityContext.None;
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
private enum ActivityContextSelection
|
||||
{
|
||||
All,
|
||||
None,
|
||||
PveDuty,
|
||||
PvpDuty
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
108
PlayerTags/Resources/Strings.Designer.cs
generated
108
PlayerTags/Resources/Strings.Designer.cs
generated
@@ -69,6 +69,87 @@ namespace PlayerTags.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Below options to be apply for ähnelt.
|
||||
/// </summary>
|
||||
public static string Loc_ActivityContextSelection {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_ActivityContextSelection", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Everywhere ähnelt.
|
||||
/// </summary>
|
||||
public static string Loc_ActivityContextSelection_All {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_ActivityContextSelection_All", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die The most options below will apply everywhere you are. They will be the same in Overworld, in PvE Duties and PvP Duties. Your options defined specifically for another context will be overwritten. ähnelt.
|
||||
/// </summary>
|
||||
public static string Loc_ActivityContextSelection_All_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_ActivityContextSelection_All_Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die No Duty ähnelt.
|
||||
/// </summary>
|
||||
public static string Loc_ActivityContextSelection_None {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_ActivityContextSelection_None", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die The most options below will apply only if you are outside of any duty. ähnelt.
|
||||
/// </summary>
|
||||
public static string Loc_ActivityContextSelection_None_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_ActivityContextSelection_None_Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die PvE Duties ähnelt.
|
||||
/// </summary>
|
||||
public static string Loc_ActivityContextSelection_PveDuty {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_ActivityContextSelection_PveDuty", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die The most options below will apply only to PvE Duties. ähnelt.
|
||||
/// </summary>
|
||||
public static string Loc_ActivityContextSelection_PveDuty_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_ActivityContextSelection_PveDuty_Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die PvP Duties ähnelt.
|
||||
/// </summary>
|
||||
public static string Loc_ActivityContextSelection_PvpDuty {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_ActivityContextSelection_PvpDuty", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die The most options below will apply only to PvP Duties. ähnelt.
|
||||
/// </summary>
|
||||
public static string Loc_ActivityContextSelection_PvpDuty_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_ActivityContextSelection_PvpDuty_Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Custom ähnelt.
|
||||
/// </summary>
|
||||
@@ -1113,6 +1194,15 @@ namespace PlayerTags.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Chat (Erperimental) ähnelt.
|
||||
/// </summary>
|
||||
public static string Loc_Static_ChatExperimental {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_Static_ChatExperimental", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Add tag: {0} ähnelt.
|
||||
/// </summary>
|
||||
@@ -1131,6 +1221,15 @@ namespace PlayerTags.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Current Activity Profile ähnelt.
|
||||
/// </summary>
|
||||
public static string Loc_Static_CurrentActivityProfile {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_Static_CurrentActivityProfile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Development ähnelt.
|
||||
/// </summary>
|
||||
@@ -1203,6 +1302,15 @@ namespace PlayerTags.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Other (Experimental) ähnelt.
|
||||
/// </summary>
|
||||
public static string Loc_Static_OtherExperimental {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_Static_OtherExperimental", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Player ähnelt.
|
||||
/// </summary>
|
||||
|
||||
@@ -59,46 +59,46 @@
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
<xsd:attribute name="name" use="required" type="xsd:string"/>
|
||||
<xsd:attribute name="type" type="xsd:string"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="alias" type="xsd:string"/>
|
||||
<xsd:attribute name="name" type="xsd:string"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="name" type="xsd:string" use="required"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
@@ -127,7 +127,7 @@
|
||||
<value>Generell</value>
|
||||
</data>
|
||||
<data name="Loc_Static_QuickTag" xml:space="preserve">
|
||||
<value>Quick Tag</value>
|
||||
<value>Schnell-Tag</value>
|
||||
</data>
|
||||
<data name="Loc_Static_TaggedPlayers" xml:space="preserve">
|
||||
<value>Getaggte Spieler</value>
|
||||
|
||||
@@ -585,4 +585,40 @@
|
||||
<data name="Loc_IsTextColorAppliedToNameplateFreeCompany_Description" xml:space="preserve">
|
||||
<value>Whether the color will be applied to the free company in nameplates.</value>
|
||||
</data>
|
||||
<data name="Loc_ActivityContextSelection_All" xml:space="preserve">
|
||||
<value>Everywhere</value>
|
||||
</data>
|
||||
<data name="Loc_ActivityContextSelection_None" xml:space="preserve">
|
||||
<value>No Duty</value>
|
||||
</data>
|
||||
<data name="Loc_ActivityContextSelection_PveDuty" xml:space="preserve">
|
||||
<value>PvE Duties</value>
|
||||
</data>
|
||||
<data name="Loc_ActivityContextSelection_PvpDuty" xml:space="preserve">
|
||||
<value>PvP Duties</value>
|
||||
</data>
|
||||
<data name="Loc_Static_CurrentActivityProfile" xml:space="preserve">
|
||||
<value>Current Activity Profile</value>
|
||||
</data>
|
||||
<data name="Loc_ActivityContextSelection" xml:space="preserve">
|
||||
<value>Below options to be apply for</value>
|
||||
</data>
|
||||
<data name="Loc_ActivityContextSelection_All_Description" xml:space="preserve">
|
||||
<value>The most options below will apply everywhere you are. They will be the same in Overworld, in PvE Duties and PvP Duties. Your options defined specifically for another context will be overwritten.</value>
|
||||
</data>
|
||||
<data name="Loc_ActivityContextSelection_None_Description" xml:space="preserve">
|
||||
<value>The most options below will apply only if you are outside of any duty.</value>
|
||||
</data>
|
||||
<data name="Loc_ActivityContextSelection_PveDuty_Description" xml:space="preserve">
|
||||
<value>The most options below will apply only to PvE Duties.</value>
|
||||
</data>
|
||||
<data name="Loc_ActivityContextSelection_PvpDuty_Description" xml:space="preserve">
|
||||
<value>The most options below will apply only to PvP Duties.</value>
|
||||
</data>
|
||||
<data name="Loc_Static_ChatExperimental" xml:space="preserve">
|
||||
<value>Chat (Erperimental)</value>
|
||||
</data>
|
||||
<data name="Loc_Static_OtherExperimental" xml:space="preserve">
|
||||
<value>Other (Experimental)</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user