Skip to content

Commit 598be23

Browse files
committed
Added version specific global variable to avoid addon conflicts. Edited README
1 parent 1c873b8 commit 598be23

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,4 +218,7 @@ Custom types can be registered with _BiValues.RegisterBindType_. There are some
218218
- **Remove()** - Called when the binding is removed (unbound). You should remove your callback hooks here
219219
- **SetValue(value)** - Called when the value is changed from elsewhere than the binding itself. You should handle applying the value change to your bound entity/element here
220220

221-
You can better understand how bindings work by looking at the default bindings.
221+
You can better understand how bindings work by looking at the default bindings.
222+
223+
## Conflicting addons
224+
It's possible that other addons a user has installed are using BiValues. This wouldn't be a problem if they used the exact same version as your addon, but they probably don't. To avoid conflicts, instead of using the _BiValues_ global variable, use _BiValuesV000_, replacing the zeroes with the version of BiValues that you are using. This way, you won't be using a different version of BiValues than you think and your code won't break.

bivalues.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ THE SOFTWARE.
2424
2525
--]]
2626

27-
if _G["BiValues"] then return; end
27+
local VERSION = "021";
2828

2929
---
3030
-- BiValues table definition
@@ -737,4 +737,5 @@ end
737737
---
738738

739739
AddCSLuaFile();
740+
_G["BiValuesV" .. VERSION] = BV;
740741
_G.BiValues = BV;

0 commit comments

Comments
 (0)