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
2 changes: 2 additions & 0 deletions BH/BH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ void BH::Initialize()
new StashExport();
new MapNotify();
new ChatColor();
new ChatItemLinks();
new ChatOverhaul();

moduleManager->LoadModules();

Expand Down
21 changes: 21 additions & 0 deletions BH/BH.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,32 @@ struct BHApp
SettingsBool usingHDText = { false, false };
} d2gl;

struct
{
SettingsBool enabled = { true, true }; // chat item links (Modules/ItemLinks)
} itemLinks;

struct
{
pd2PlaySoundImpl_t pd2PlaySoundImpl = NULL;
} pd2;

struct
{
SettingsBool enabled = { true, true }; // false: vanilla chat, nothing hooked
SettingsBool timestamps = { false, false }; // "[hh:mm]" before every line
SettingsBool mentionHighlight = { true, true };
SettingsInt mentionSound = { 0, 0, 0, 4000 }; // Sounds.txt row, 0 = silent
SettingsArray mentionKeywords = { {}, {} }; // besides your character name
SettingsInt historyLines = { 500, 500, 50, 2000 }; // lines kept (all tabs share them)
SettingsInt visibleRows = { 14, 14, 4, 40 }; // rows shown while the panel is open
SettingsInt width = { 440, 440, 200, 1000 }; // panel width in px
SettingsInt fadeSeconds = { 10, 10, 0, 300 }; // closed panel: recent lines stay this long
SettingsInt fadeRows = { 8, 8, 0, 40 }; // closed panel: at most this many rows
SettingsBool alwaysOpen = { false, false }; // keep the full panel up while not typing
SettingsKey replyHotkey = { 0x52, 0x52 }; // Ctrl + this key: "/w <last whisperer> "
} chat;

std::vector<Toggle*> hotkeyToggles;
};

Expand Down
11 changes: 11 additions & 0 deletions BH/BH.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,15 @@ powershell.exe -NoProfile -File "$(ProjectDir)..\..\scripts\CopyDataFolder.ps1"<
<ClCompile Include="JSONObject.cpp" />
<ClCompile Include="Modules\Bnet\Bnet.cpp" />
<ClCompile Include="Modules\ChatColor\ChatColor.cpp" />
<ClCompile Include="Modules\Chat\ChatModel.cpp" />
<ClCompile Include="Modules\Chat\ChatOverhaul.cpp" />
<ClCompile Include="Modules\Gamefilter\Gamefilter.cpp" />
<ClCompile Include="Modules\Gamefilter\ParsedFilterString.cpp" />
<ClCompile Include="Modules\GameSettings\GameSettings.cpp" />
<ClCompile Include="Modules\Item\Item.cpp" />
<ClCompile Include="Modules\ItemLinks\ItemLinkCodec.cpp" />
<ClCompile Include="Modules\ItemLinks\ItemLinkGame.cpp" />
<ClCompile Include="Modules\ItemLinks\ItemLinks.cpp" />
<ClCompile Include="Modules\Item\ItemDisplay.cpp" />
<ClCompile Include="Modules\MapNotify\MapNotify.cpp" />
<ClCompile Include="Modules\Module.cpp" />
Expand Down Expand Up @@ -240,10 +245,16 @@ powershell.exe -NoProfile -File "$(ProjectDir)..\..\scripts\CopyDataFolder.ps1"<
<ClInclude Include="Modules.h" />
<ClInclude Include="Modules\Bnet\Bnet.h" />
<ClInclude Include="Modules\ChatColor\ChatColor.h" />
<ClInclude Include="Modules\Chat\ChatModel.h" />
<ClInclude Include="Modules\Chat\ChatOverhaul.h" />
<ClInclude Include="Modules\Gamefilter\Gamefilter.h" />
<ClInclude Include="Modules\Gamefilter\ParsedFilterString.h" />
<ClInclude Include="Modules\GameSettings\GameSettings.h" />
<ClInclude Include="Modules\Item\Item.h" />
<ClInclude Include="Modules\ItemLinks\ChatLinkApi.h" />
<ClInclude Include="Modules\ItemLinks\ItemLinkCodec.h" />
<ClInclude Include="Modules\ItemLinks\ItemLinkGame.h" />
<ClInclude Include="Modules\ItemLinks\ItemLinks.h" />
<ClInclude Include="Modules\Item\ItemDisplay.h" />
<ClInclude Include="Modules\MapNotify\MapNotify.h" />
<ClInclude Include="Modules\Module.h" />
Expand Down
37 changes: 37 additions & 0 deletions BH/BH.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@
<ClCompile Include="Modules\ChatColor\ChatColor.cpp">
<Filter>Modules\ChatColor</Filter>
</ClCompile>
<ClCompile Include="Modules\ItemLinks\ItemLinks.cpp">
<Filter>Modules\ItemLinks</Filter>
</ClCompile>
<ClCompile Include="Modules\ItemLinks\ItemLinkCodec.cpp">
<Filter>Modules\ItemLinks</Filter>
</ClCompile>
<ClCompile Include="Modules\ItemLinks\ItemLinkGame.cpp">
<Filter>Modules\ItemLinks</Filter>
<ClCompile Include="Modules\Chat\ChatModel.cpp">
<Filter>Modules\Chat</Filter>
</ClCompile>
<ClCompile Include="Modules\Chat\ChatOverhaul.cpp">
<Filter>Modules\Chat</Filter>
</ClCompile>
<ClCompile Include="Modules\Gamefilter\Gamefilter.cpp">
<Filter>Modules\Gamefilter</Filter>
</ClCompile>
Expand Down Expand Up @@ -174,6 +188,23 @@
<ClInclude Include="Modules\ChatColor\ChatColor.h">
<Filter>Modules\ChatColor</Filter>
</ClInclude>
<ClInclude Include="Modules\ItemLinks\ItemLinks.h">
<Filter>Modules\ItemLinks</Filter>
</ClInclude>
<ClInclude Include="Modules\ItemLinks\ItemLinkCodec.h">
<Filter>Modules\ItemLinks</Filter>
</ClInclude>
<ClInclude Include="Modules\ItemLinks\ItemLinkGame.h">
<Filter>Modules\ItemLinks</Filter>
</ClInclude>
<ClInclude Include="Modules\ItemLinks\ChatLinkApi.h">
<Filter>Modules\ItemLinks</Filter>
<ClInclude Include="Modules\Chat\ChatModel.h">
<Filter>Modules\Chat</Filter>
</ClInclude>
<ClInclude Include="Modules\Chat\ChatOverhaul.h">
<Filter>Modules\Chat</Filter>
</ClInclude>
<ClInclude Include="Modules\Gamefilter\Gamefilter.h">
<Filter>Modules\Gamefilter</Filter>
</ClInclude>
Expand Down Expand Up @@ -258,6 +289,12 @@
<Filter Include="Modules\ChatColor">
<UniqueIdentifier>{f652bd02-2b0b-46a4-843c-20a0a9ea472d}</UniqueIdentifier>
</Filter>
<Filter Include="Modules\ItemLinks">
<UniqueIdentifier>{6d2a8f41-3b7e-4c19-9e5a-0f4b2c7d8e13}</UniqueIdentifier>
</Filter>
<Filter Include="Modules\Chat">
<UniqueIdentifier>{6b1f0f62-3c1e-4d7e-9a57-2f0c4e8a91d3}</UniqueIdentifier>
</Filter>
<Filter Include="Modules\Gamefilter">
<UniqueIdentifier>{b2342ae5-3b17-4a7e-bd84-a5173ecce46d}</UniqueIdentifier>
</Filter>
Expand Down
5 changes: 5 additions & 0 deletions BH/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ set(MODULE_SOURCES "Modules/Module.cpp"
"Modules/ModuleManager.cpp"
"Modules/Bnet/Bnet.cpp"
"Modules/ChatColor/ChatColor.cpp"
"Modules/Chat/ChatModel.cpp"
"Modules/Chat/ChatOverhaul.cpp"
"Modules/Gamefilter/Gamefilter.cpp"
"Modules/Item/Item.cpp"
"Modules/Item/ItemDisplay.cpp"
"Modules/ItemLinks/ItemLinkCodec.cpp"
"Modules/ItemLinks/ItemLinkGame.cpp"
"Modules/ItemLinks/ItemLinks.cpp"
"Modules/ItemMover/ItemMover.cpp"
"Modules/Party/Party.cpp"
"Modules/ScreenInfo/ScreenInfo.cpp"
Expand Down
38 changes: 38 additions & 0 deletions BH/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ void Config::SaveConfig()
jsonGame["always_show_items"] = App.game.alwaysShowItems.value;
App.jsonConfig["game"] = jsonGame;

// Chat item links
json jsonItemLinks;
jsonItemLinks["enabled"] = App.itemLinks.enabled.value;
App.jsonConfig["item_links"] = jsonItemLinks;

// Party settings
json jsonParty;
jsonParty["auto_party"]["enabled"] = App.party.autoParty.toggle.isEnabled;
Expand Down Expand Up @@ -264,6 +269,22 @@ void Config::SaveConfig()
jsonStash["mustache_format"] = App.stash.mustacheFormat.values;
App.jsonConfig["stash_export"] = jsonStash;

// Chat
json jsonChat;
jsonChat["enabled"] = App.chat.enabled.value;
jsonChat["timestamps"] = App.chat.timestamps.value;
jsonChat["mention_highlight"] = App.chat.mentionHighlight.value;
jsonChat["mention_sound"] = App.chat.mentionSound.value;
jsonChat["mention_keywords"] = App.chat.mentionKeywords.values;
jsonChat["history_lines"] = App.chat.historyLines.value;
jsonChat["visible_rows"] = App.chat.visibleRows.value;
jsonChat["width"] = App.chat.width.value;
jsonChat["fade_seconds"] = App.chat.fadeSeconds.value;
jsonChat["fade_rows"] = App.chat.fadeRows.value;
jsonChat["always_open"] = App.chat.alwaysOpen.value;
jsonChat["reply_hotkey"] = GetKeyCode(App.chat.replyHotkey.hotkey).name;
App.jsonConfig["chat"] = jsonChat;

// BH UI window
json jsonBHUI;
jsonBHUI["is_minimized"] = App.bhui.isMinimized.value;
Expand Down Expand Up @@ -391,6 +412,9 @@ void Config::LoadConfig()
App.game.experienceMeter.value = GetBool("/game"_json_pointer, "experience_meter", App.game.experienceMeter);
App.game.alwaysShowItems.value = GetBool("/game"_json_pointer, "always_show_items", App.game.alwaysShowItems);

// Chat item links
App.itemLinks.enabled.value = GetBool("/item_links"_json_pointer, "enabled", App.itemLinks.enabled);

// Party settings
App.party.autoParty.toggle = GetToggle("/party"_json_pointer, "auto_party", App.party.autoParty);
App.party.autoCorpseLoot.toggle = GetToggle("/party"_json_pointer, "auto_corpse_loot", App.party.autoCorpseLoot);
Expand All @@ -408,6 +432,20 @@ void Config::LoadConfig()
App.stash.mustacheOptions.values = GetArray("/stash_export"_json_pointer, "mustache_options", App.stash.mustacheOptions);
App.stash.mustacheFormat.values = GetAssoc("/stash_export"_json_pointer, "mustache_format", App.stash.mustacheFormat);

// Chat
App.chat.enabled.value = GetBool("/chat"_json_pointer, "enabled", App.chat.enabled);
App.chat.timestamps.value = GetBool("/chat"_json_pointer, "timestamps", App.chat.timestamps);
App.chat.mentionHighlight.value = GetBool("/chat"_json_pointer, "mention_highlight", App.chat.mentionHighlight);
App.chat.mentionSound.value = GetInt("/chat"_json_pointer, "mention_sound", App.chat.mentionSound);
App.chat.mentionKeywords.values = GetArray("/chat"_json_pointer, "mention_keywords", App.chat.mentionKeywords);
App.chat.historyLines.value = GetInt("/chat"_json_pointer, "history_lines", App.chat.historyLines);
App.chat.visibleRows.value = GetInt("/chat"_json_pointer, "visible_rows", App.chat.visibleRows);
App.chat.width.value = GetInt("/chat"_json_pointer, "width", App.chat.width);
App.chat.fadeSeconds.value = GetInt("/chat"_json_pointer, "fade_seconds", App.chat.fadeSeconds);
App.chat.fadeRows.value = GetInt("/chat"_json_pointer, "fade_rows", App.chat.fadeRows);
App.chat.alwaysOpen.value = GetBool("/chat"_json_pointer, "always_open", App.chat.alwaysOpen);
App.chat.replyHotkey.hotkey = GetKey("/chat"_json_pointer, "reply_hotkey", App.chat.replyHotkey);

App.bhui.isMinimized.value = GetBool("/bh_ui"_json_pointer, "is_minimized", App.bhui.isMinimized);
App.bhui.openedX.value = GetInt("/bh_ui"_json_pointer, "opened_x", App.bhui.openedX);
App.bhui.openedY.value = GetInt("/bh_ui"_json_pointer, "opened_y", App.bhui.openedY);
Expand Down
2 changes: 2 additions & 0 deletions BH/Modules.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@
#include "Modules\Party\Party.h"
#include "Modules\StashExport\StashExport.h"
#include "Modules\ChatColor\ChatColor.h"
#include "Modules\ItemLinks\ItemLinks.h"
#include "Modules/GameSettings/GameSettings.h"
#include "Modules/Chat/ChatOverhaul.h"
Loading
Loading