Skip to content

Commit

Permalink
Applies library changes while prepping extra projects
Browse files Browse the repository at this point in the history
Icon behaviour now much more customizable
Tooltips display extra info based on state
Topbar registration delayed to handle issue where other mods being dropped from topbar on /reloadui (may need to look into further reducing the processing and staggering my own delay values)
Changes name of extra testing option to be slightly less salt in the wound
  • Loading branch information
Earthfiredrake committed Apr 1, 2017
1 parent cf69955 commit 36e959c
Show file tree
Hide file tree
Showing 6 changed files with 223 additions and 107 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ The update system *should* carry forward settings from v0.4.0-beta onwards. Howe
If upgrading from v0.1.1-alpha, a clean reinstall is recommended. Remove the existing mod entirely and login to the game to clear any existing settings before installing a more recent version.

## Change Log
Version next
+ Setting migration from versions prior to v1.0.0 no longer supported
+ Tooltip now provides listing of tracked lore and pending reports

Version 1.0.0
+ An actual release version!
+ Options menu no longer possessed by a gaki, you can now esc from it
Expand Down Expand Up @@ -101,12 +105,13 @@ The following issues are known to exist in the most recent release:
## Testing and Further Developments
This release is currently feature complete, but some things may arrive in subsequent releases:
+ Actual localization would be nice, but I'm not going to rely on Google and my limited knowledge of French to be at all accurate. Somebody else will have to provide me with translations.
+ Depreciated features of the config system retained to permit smooth upgrades from pre-release versions will be removed starting with v1.1.0.
+ Am finding the coordinate based reporting slightly difficult to parse at times, will be looking into some form of onscreen waypoint or flag. (1.1.0+)
+ A second project is in the preliminary stages of development, and may have some integration possibilities with this one.
+ Maintenance updates will be made as needed to fix bugs or add updates to the data files.
+ Some form of whitelisting is a possibility: (1.1.0?)
+ Some form of whitelisting is a possibility: (1.1.0+)
+ The *easy* version would be one that simply works on loreIDs after initial filtering, as a global white list.
+ More complicated systems (intelligent per-category whitelists, random drops only, etc.) would require additional information to be saved about each lore entry.
+ It's still a bit spammy with messages. Perhaps an extension of the lore tracking system would be useful to limit how frequently a particular dynel is detected? (1.1.0)

A feature for helping with The Abandoned lore was found to be unworkable. Lore.IsLockedForChar either does not work as advertised, or requires GM permissions.

Expand Down
22 changes: 16 additions & 6 deletions config/Strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,25 @@
<String tag="OtherSettingReporting"
en="Automated Reports" />
<String tag="OtherSettingExtraTest"
en="New Game Content" />
en="Extended Testing" />
<String tag="TooltipCredit"
en="v%1% by %2%" /> <!-- %1% = ModVersion; %2% = DevName -->
<String tag="TooltipLeft"
en="Left Click: Show Options" />
<String tag="TooltipRightEnable"
en="Right Click: Enable Mod" />
<String tag="TooltipRightDisable"
en="Right Click: Disable Mod" />
en="Left Click: %1%" /> <!-- %1% = Tooltip for bound action -->
<String tag="TooltipRight"
en="Right Click: %1%" /> <!-- %1% = Tooltip for bound action -->
<String tag="TooltipModOn"
en="Enable Mod" />
<String tag="TooltipModOff"
en="Disable Mod" />
<String tag="TooltipShowSettings"
en="Show Options" />
<String tag="TooltipShowInterface"
en="[Display Interface]" />
<String tag="TooltipTracking"
en="Tracking Drops:" />
<String tag="TooltipReports"
en="Reports Pending: %1%" /> <!-- %1% = Number of pending reports -->
</Category>
<Category name="AutoReport"> <!-- Only used for player notifications, report content is internal -->
<String tag="ReportQueued"
Expand Down
57 changes: 35 additions & 22 deletions efd/LoreHound/LoreHound.as
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ import efd.LoreHound.lib.LocaleManager;
import efd.LoreHound.lib.Mod;

class efd.LoreHound.LoreHound extends Mod {
private static var ModInfo:Object = {
private var ModInfo:Object = {
// Debug settings at top so that commenting out leaves no hanging ','
// Trace : true,
Name : "LoreHound",
Version : "1.1.0.alpha",
MinUpgradableVersion : "1.0.0"
Type : e_ModType_Reactive,
MinUpgradableVersion : "1.0.0",
IconData : { UpdateState : UpdateIcon,
ExtraTooltipInfo : IconTooltip }
};

// Category flags for identifiable lore types
Expand Down Expand Up @@ -69,21 +72,6 @@ class efd.LoreHound.LoreHound extends Mod {
InitializeConfig(arConfig);
LoadLoreCategories();

Icon.UpdateState = function(stateFlag:Number, enable:Boolean) {
if (stateFlag != undefined) {
switch (enable) {
case true: { this.StateFlags |= stateFlag; break; }
case false: { this.StateFlags &= ~stateFlag; break; }
case undefined: { this.StateFlags ^= stateFlag; break; }
}
}
if (Config.GetValue("Enabled")) { // If game disables mod, it isn't visible at all, so only user disables matter
if ((this.StateFlags & LoreHound.ef_IconState_Alert) == LoreHound.ef_IconState_Alert) { this.gotoAndStop("alerted"); return; }
if ((this.StateFlags & LoreHound.ef_IconState_Report) == LoreHound.ef_IconState_Report) { this.gotoAndStop("reporting"); return; }
this.gotoAndStop("active");
} else { this.gotoAndStop("inactive"); }
};

TraceMsg("Initialized");
}

Expand All @@ -110,7 +98,7 @@ class efd.LoreHound.LoreHound extends Mod {
switch(setting) {
case "Enabled":
case "QueuedReports":
Icon.UpdateState(ef_IconState_Report, AutoReport.HasReportsPending);
UpdateIcon();
break;
default: break;
}
Expand Down Expand Up @@ -193,7 +181,32 @@ class efd.LoreHound.LoreHound extends Mod {

private function TopbarRegistered():Void {
// Topbar icon does not copy custom state variable, so needs explicit refresh
Icon.UpdateState(ef_IconState_Report, AutoReport.HasReportsPending);
// Icon.UpdateState(ef_IconState_Report, AutoReport.HasReportsPending);
}

private function UpdateIcon():Void {
Icon.RefreshTooltip();
if (Config.GetValue("Enabled")) { // If game disables mod, it isn't visible at all, so only user disables matter
for (var id:String in TrackedLore) {
Icon.gotoAndStop("alerted");
return;
}
if (AutoReport.NumReportsPending > 0) {
Icon.gotoAndStop("reporting");
return;
}
Icon.gotoAndStop("active");
} else { Icon.gotoAndStop("inactive"); }
}

private function IconTooltip():String {
var strings:Array = new Array();
for (var id:String in TrackedLore) {
if (strings.length == 0) { strings.push(LocaleManager.GetString("GUI", "TooltipTracking")); }
strings.push(" " + AttemptIdentification(TrackedLore[id], ef_LoreType_Despawn));
}
if (AutoReport.NumReportsPending > 0) { strings.push(LocaleManager.FormatString("GUI", "TooltipReports", AutoReport.NumReportsPending)); }
return strings.length > 0 ? strings.join('\n') : undefined;
}

// Override to add timestamps
Expand Down Expand Up @@ -305,7 +318,7 @@ class efd.LoreHound.LoreHound extends Mod {
// Don't care about the value, but the request is required to get DynelGone events
Dynels.RegisterProperty(dynelId.m_Type, dynelId.m_Instance, _global.enums.Property.e_ObjPos);
TrackedLore[dynelId.toString()] = loreId;
Icon.UpdateState(ef_IconState_Alert, true);
UpdateIcon();
}
}
}
Expand Down Expand Up @@ -338,7 +351,7 @@ class efd.LoreHound.LoreHound extends Mod {
for (var key:String in TrackedLore) {
return; // There's still at least one lore being tracked, don't clear the icon
}
Icon.UpdateState(ef_IconState_Alert, false);
UpdateIcon();
}
}

Expand All @@ -351,7 +364,7 @@ class efd.LoreHound.LoreHound extends Mod {
}
delete TrackedLore;
TrackedLore = new Object();
Icon.UpdateState(ef_IconState_Alert, false);
UpdateIcon();
}

/// Lore identification
Expand Down
4 changes: 2 additions & 2 deletions efd/LoreHound/lib/AutoReport.as
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ class efd.LoreHound.lib.AutoReport {
}
}

public static function get HasReportsPending():Boolean {
public static function get NumReportsPending():Number {
// Does not care about mod state, only internal state
return IsEnabled && Config.GetValue("QueuedReports").length > 0;
return IsEnabled ? Config.GetValue("QueuedReports").length : 0;
}

private static var IsModActive:Boolean;
Expand Down
Loading

0 comments on commit 36e959c

Please sign in to comment.