Skip to content

Commit

Permalink
v1.10.0
Browse files Browse the repository at this point in the history
* Close #210: Classic era support (#211)
* Close #209: Click for tooltip (#215)
* Close #216: Add row border configurations (#218)
  • Loading branch information
Mctalian committed Dec 18, 2024
1 parent 813e664 commit 4b61773
Show file tree
Hide file tree
Showing 40 changed files with 1,366 additions and 279 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,21 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
python-version: 3.13

- name: Install Python dependencies
run: pip install -r requirements.txt
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.5

- name: Install dependencies
run: poetry install

- name: Run translation check script
run: python .scripts/missing_translation_check.py
run: poetry run python .scripts/missing_translation_check.py

- name: Check for Hard-coded strings
run: python .scripts/hardcode_string_check.py
run: poetry run python .scripts/hardcode_string_check.py

run_tests:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .pkgmeta
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ externals:
Libs/AceLocale-3.0: https://repos.wowace.com/wow/ace3/trunk/AceLocale-3.0
Libs/LibSharedMedia-3.0: https://repos.curseforge.com/wow/libsharedmedia-3-0/trunk/LibSharedMedia-3.0
Libs/AceGUI-3.0-SharedMediaWidgets: https://repos.curseforge.com/wow/ace-gui-3-0-shared-media-widgets/trunk/AceGUI-3.0-SharedMediaWidgets
Libs/C_Everywhere: https://github.com/Jaliborc/C_Everywhere

enable-nolib-creation: yes

Expand All @@ -23,5 +24,7 @@ ignore:
- "*.ps1"
- "*.md"
- "*.rockspec"
- "*.gif"
- "example*.png"
- requirements.txt

4 changes: 3 additions & 1 deletion BlizzOverrides/BossBanner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ local addonName, G_RLF = ...
local BossBannerOverride = G_RLF.RLF:NewModule("BossBanner", "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0")

function BossBannerOverride:OnInitialize()
self:RegisterEvent("PLAYER_ENTERING_WORLD", "BossBannerHook")
if GetExpansionLevel() >= G_RLF.Expansion.WOD then
self:RegisterEvent("PLAYER_ENTERING_WORLD", "BossBannerHook")
end
end

local bossBannerAttempts = 0
Expand Down
175 changes: 175 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
# Contributing Guidelines

Thank you for your interest in contributing to this project! Following these guidelines helps maintain consistency and ensures a smooth collaboration process.

---

## Table of Contents

- [Getting Started](#getting-started)
- [Setting Up the Development Environment](#setting-up-the-development-environment)
- [Python](#python)
- [Lua](#lua)
- [Code Standards](#code-standards)
- [Testing](#testing)
- [Contributing Workflow](#contributing-workflow)
- [Common Commands](#common-commands)
- [Contact](#contact)

---

## Getting Started

1. Fork the repository and clone it to your local machine:

```bash
git clone https://github.com/<YOUR_USERNAME>/RPGLootFeed.git
cd RPGlootFeed
```

2. Review the [issues](https://github.com/RPGLootFeed/issues) to find something you'd like to work on, or propose a new feature by creating an issue.

---

## Setting Up the Development Environment

### Python

1. **Install Poetry**
Poetry is used for Python dependency and environment management:

```bash
curl -sSL https://install.python-poetry.org | python3 -
```

2. **Install Dependencies**
Install project dependencies into a virtual environment:

```bash
poetry install
```

3. **Run Scripts**
Use `make` to execute project-specific scripts, such as:
```bash
make hardcode_string_check
make missing_translation_check
make all_checks
make test
```

### Lua

1. **Install Lua**
Install Lua using your package manager or `luaenv`:
```bash
luaenv install
```
1. **Install LuaRocks**
[Install Luarocks for package management.](https://github.com/luarocks/luarocks?tab=readme-ov-file#installing)
1. **Install Dependencies**
Install project dependencies using `luarocks`:
```bash
luarocks install busted
luarocks install luassert
```
1. **Verify Installation**
Ensure the tools are available:
```bash
lua -v
busted --version
```

---

## Code Standards

Run [trunk](https://trunk.io) checks to ensure your code meets the project's standards:

```bash
./trunk fmt
./trunk check
```

---

## Testing

### Packaging

- Use `make local` to package the project for local testing:

```bash
make local
```

This will create an alpha build in the `.release` directory. It is recommended that you create a symlink to this directory in your game's `Interface/Addons` directory so that the latest changes are immediately available in the game after a `/reload`.

- Smoke tests are run automatically upon loading an alpha build of the addon (on login or `/reload`).
- Run `/rlf i` in the game to run integration tests (you will see a failure if you looted anything since the last `/reload` or if you already ran the integration tests since "loot history" is part of the integration tests).

### Lua Tests

- Use `busted` for unit tests:

```bash
busted
```

- Generate coverage reports:
```bash
busted --coverage && luarocks luacov
```

---

## Contributing Workflow

1. **Create a Feature Branch**
Branch from `main` and name your branch descriptively:

```bash
git checkout -b feature/your-feature
```

1. **Test Your Changes**
Run all checks and tests before opening a pull request:

```bash
make all_checks
make test
```

1. **Submit a Pull Request**
- Push your branch:
```bash
git push origin feature/your-feature
```
- Open a pull request to `main` with a clear title and description of your changes.

---

## Common Commands

### Development Commands

| Command | Description |
| -------------------------------- | ------------------------------------------- |
| `make hardcode_string_check` | Checks for hard-coded strings in Lua files. |
| `make missing_translation_check` | Detects missing translations in Lua files. |
| `make test` | Runs Lua unit tests. |
| `trunk check` | Lints all files. |

### Cleanup Commands

| Command | Description |
| ------------------------------------------ | ------------------------- |
| `rm -rf luacov-html && rm -rf luacov.*out` | Cleans up coverage files. |

---

## Contact

If you have any questions or need help, feel free to reach out by creating an issue in the repository.

---
25 changes: 19 additions & 6 deletions Features/Currency.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
local addonName, G_RLF = ...

local C = LibStub("C_Everywhere")

local Currency = G_RLF.RLF:NewModule("Currency", "AceEvent-3.0")

Currency.Element = {}
Expand Down Expand Up @@ -80,21 +82,32 @@ local function isHiddenCurrency(id)
end

function Currency:OnInitialize()
if G_RLF.db.global.currencyFeed then
if G_RLF.db.global.currencyFeed and GetExpansionLevel() >= G_RLF.Expansion.SL then
self:Enable()
else
self:Disable()
end
end

function Currency:OnDisable()
if GetExpansionLevel() < G_RLF.Expansion.SL then
return
end
self:UnregisterEvent("CURRENCY_DISPLAY_UPDATE")
self:UnregisterEvent("PERKS_PROGRAM_CURRENCY_AWARDED")
if G_RLF:IsRetail() then
self:UnregisterEvent("PERKS_PROGRAM_CURRENCY_AWARDED")
end
end

function Currency:OnEnable()
if GetExpansionLevel() < G_RLF.Expansion.SL then
return
end
self:RegisterEvent("CURRENCY_DISPLAY_UPDATE")
self:RegisterEvent("PERKS_PROGRAM_CURRENCY_AWARDED")
if G_RLF:IsRetail() then
self:RegisterEvent("PERKS_PROGRAM_CURRENCY_AWARDED")
end
G_RLF:LogDebug("OnEnable", addonName, self.moduleName)
end

function Currency:Process(eventName, currencyType, quantityChange)
Expand Down Expand Up @@ -124,7 +137,7 @@ function Currency:Process(eventName, currencyType, quantityChange)
return
end

local info = C_CurrencyInfo.GetCurrencyInfo(currencyType)
local info = C.CurrencyInfo.GetCurrencyInfo(currencyType)
if info == nil or info.description == "" or info.iconFileID == nil then
G_RLF:LogDebug(
"Skip showing currency",
Expand All @@ -138,8 +151,8 @@ function Currency:Process(eventName, currencyType, quantityChange)
end

self:fn(function()
local basicInfo = C_CurrencyInfo.GetBasicCurrencyInfo(currencyType, quantityChange)
local e = self.Element:new(C_CurrencyInfo.GetCurrencyLink(currencyType), info, basicInfo)
local basicInfo = C.CurrencyInfo.GetBasicCurrencyInfo(currencyType, quantityChange)
local e = self.Element:new(C.CurrencyInfo.GetCurrencyLink(currencyType), info, basicInfo)
e:Show()
end)
end
Expand Down
1 change: 1 addition & 0 deletions Features/Experience.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ function Xp:OnDisable()
end

function Xp:OnEnable()
G_RLF:LogDebug("OnEnable", addonName, self.moduleName)
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("PLAYER_XP_UPDATE")
if currentXP == nil then
Expand Down
3 changes: 2 additions & 1 deletion Features/ItemLoot/AuctionIntegrations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function AuctionIntegrations:Init()
local possibleIntegrations = { Integ_Auctionator, Integ_TSM }
self.nilIntegration = Integ_Nil
self.activeIntegrations = {}
self.activeIntegration = nil

self.numActiveIntegrations = 0
for _, integration in ipairs(possibleIntegrations) do
Expand All @@ -39,7 +40,7 @@ function AuctionIntegrations:Init()
end
end

if G_RLF.db.global.auctionHouseSource ~= self.activeIntegration:ToString() then
if self.activeIntegration and G_RLF.db.global.auctionHouseSource ~= self.activeIntegration:ToString() then
G_RLF.db.global.auctionHouseSource = self.activeIntegration:ToString()
end
end
Expand Down
Loading

0 comments on commit 4b61773

Please sign in to comment.