Skip to content

Commit caa3c5b

Browse files
committed
Fix button text
1 parent 4acebc7 commit caa3c5b

7 files changed

+28
-12
lines changed

src/dndbeyond.pyj

+1-1
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ class Monster(CharacterBase):
537537
if (avatarImg):
538538
cb = def():
539539
self.displayAvatar()
540-
addRollButton(self, cb, avatarImg, small=True, image=True, text="Show in chat")
540+
addRollButton(self, cb, avatarImg, small=True, image=True, text="Display in VTT")
541541
attributes = stat_block.find(base + "__attributes " + base + "__attribute")
542542
for attr in attributes:
543543
label = $(attr).find(base + "__attribute-label").text().trim()

src/dndbeyond_character.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10707,7 +10707,7 @@ return this.__repr__();
1070710707
cb = function () {
1070810708
self.displayAvatar();
1070910709
};
10710-
ρσ_interpolate_kwargs.call(this, addRollButton, [self, cb, avatarImg].concat([ρσ_desugar_kwargs({small: true, image: true, text: "Show in chat"})]));
10710+
ρσ_interpolate_kwargs.call(this, addRollButton, [self, cb, avatarImg].concat([ρσ_desugar_kwargs({small: true, image: true, text: "Display in VTT"})]));
1071110711
}
1071210712
}
1071310713
attributes = stat_block.find(base + "__attributes " + base + "__attribute");

src/dndbeyond_encounter.js

+22-6
Original file line numberDiff line numberDiff line change
@@ -2558,7 +2558,8 @@ function all(iterable) {
25582558
if (!all.__argnames__) Object.defineProperties(all, {
25592559
__argnames__ : {value: ["iterable"]}
25602560
});
2561-
var define_str_func, ρσ_unpack, ρσ_orig_split, ρσ_orig_replace;
2561+
var decimal_sep, define_str_func, ρσ_unpack, ρσ_orig_split, ρσ_orig_replace;
2562+
decimal_sep = 1.1.toLocaleString()[1];
25622563
function ρσ_repr_js_builtin(x, as_array) {
25632564
var ans, b, keys, key;
25642565
ans = [];
@@ -2935,7 +2936,7 @@ define_str_func("format", function () {
29352936
value = value.toExponential(prec - 1);
29362937
}
29372938
value = value.replace(/0+$/g, "");
2938-
if (value[value.length-1] === ".") {
2939+
if (value[value.length-1] === decimal_sep) {
29392940
value = value.slice(0, -1);
29402941
}
29412942
if (ftype === "G") {
@@ -3751,7 +3752,9 @@ var str = ρσ_str, repr = ρσ_repr;;
37513752
s.jsset.add("aside");
37523753
s.jsset.add("audio");
37533754
s.jsset.add("b");
3755+
s.jsset.add("base");
37543756
s.jsset.add("big");
3757+
s.jsset.add("body");
37553758
s.jsset.add("blockquote");
37563759
s.jsset.add("br");
37573760
s.jsset.add("button");
@@ -3790,6 +3793,7 @@ var str = ρσ_str, repr = ρσ_repr;;
37903793
s.jsset.add("h5");
37913794
s.jsset.add("h6");
37923795
s.jsset.add("hr");
3796+
s.jsset.add("head");
37933797
s.jsset.add("i");
37943798
s.jsset.add("iframe");
37953799
s.jsset.add("img");
@@ -4735,9 +4739,6 @@ var str = ρσ_str, repr = ρσ_repr;;
47354739
pos = close + 1;
47364740
continue;
47374741
}
4738-
if (extension === "<") {
4739-
throw new SyntaxError("Look behind assertions are not supported in JavaScript");
4740-
}
47414742
if (extension === "(") {
47424743
throw new SyntaxError("Group existence assertions are not supported in JavaScript");
47434744
}
@@ -10668,7 +10669,7 @@ return this.__repr__();
1066810669
if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "stat_block")){
1066910670
stat_block = ρσ_kwargs_obj.stat_block;
1067010671
}
10671-
var add_dice, inject_descriptions, base, quick_settings, link, avatar, attributes, label, value, cb, attr, abilities, prefix, makeCB, abbr, score, modifier, roll_initiative, initiative, ability, tidbits, data, saves, parts, mod, save, skills, name, skill, mon_skill, text, last, a, first, tidbit;
10672+
var add_dice, inject_descriptions, base, quick_settings, link, avatar, avatarImg, cb, attributes, label, value, attr, abilities, prefix, makeCB, abbr, score, modifier, roll_initiative, initiative, ability, tidbits, data, saves, parts, mod, save, skills, name, skill, mon_skill, text, last, a, first, tidbit;
1067210673
add_dice = self.getGlobalSetting("handle-stat-blocks", true);
1067310674
inject_descriptions = self.getGlobalSetting("subst-dndbeyond-stat-blocks", true);
1067410675
base = self._base;
@@ -10701,6 +10702,13 @@ return this.__repr__();
1070110702
avatar = $(".details-aside .image a");
1070210703
if (avatar.length > 0) {
1070310704
self._avatar = avatar[0].href;
10705+
avatarImg = $(".details-aside .image");
10706+
if (avatarImg) {
10707+
cb = function () {
10708+
self.displayAvatar();
10709+
};
10710+
ρσ_interpolate_kwargs.call(this, addRollButton, [self, cb, avatarImg].concat([ρσ_desugar_kwargs({small: true, image: true, text: "Display in VTT"})]));
10711+
}
1070410712
}
1070510713
attributes = stat_block.find(base + "__attributes " + base + "__attribute");
1070610714
var ρσ_Iter10 = ρσ_Iterable(attributes);
@@ -10884,6 +10892,14 @@ return this.__repr__();
1088410892
__handles_kwarg_interpolation__ : {value: true},
1088510893
__argnames__ : {value: ["stat_block"]}
1088610894
});
10895+
Monster.prototype.displayAvatar = function displayAvatar() {
10896+
var self = this;
10897+
sendRoll(self, "avatar", self.avatar, (function(){
10898+
var ρσ_d = {};
10899+
ρσ_d["name"] = "Avatar";
10900+
return ρσ_d;
10901+
}).call(this));
10902+
};
1088710903
Monster.prototype.rollHitPoints = function rollHitPoints() {
1088810904
var self = this;
1088910905
sendRoll(self, "custom", self._hp_formula, (function(){

src/dndbeyond_items.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10707,7 +10707,7 @@ return this.__repr__();
1070710707
cb = function () {
1070810708
self.displayAvatar();
1070910709
};
10710-
ρσ_interpolate_kwargs.call(this, addRollButton, [self, cb, avatarImg].concat([ρσ_desugar_kwargs({small: true, image: true, text: "Show in chat"})]));
10710+
ρσ_interpolate_kwargs.call(this, addRollButton, [self, cb, avatarImg].concat([ρσ_desugar_kwargs({small: true, image: true, text: "Display in VTT"})]));
1071110711
}
1071210712
}
1071310713
attributes = stat_block.find(base + "__attributes " + base + "__attribute");

src/dndbeyond_monster.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10707,7 +10707,7 @@ return this.__repr__();
1070710707
cb = function () {
1070810708
self.displayAvatar();
1070910709
};
10710-
ρσ_interpolate_kwargs.call(this, addRollButton, [self, cb, avatarImg].concat([ρσ_desugar_kwargs({small: true, image: true, text: "Show in chat"})]));
10710+
ρσ_interpolate_kwargs.call(this, addRollButton, [self, cb, avatarImg].concat([ρσ_desugar_kwargs({small: true, image: true, text: "Display in VTT"})]));
1071110711
}
1071210712
}
1071310713
attributes = stat_block.find(base + "__attributes " + base + "__attribute");

src/dndbeyond_spell.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10707,7 +10707,7 @@ return this.__repr__();
1070710707
cb = function () {
1070810708
self.displayAvatar();
1070910709
};
10710-
ρσ_interpolate_kwargs.call(this, addRollButton, [self, cb, avatarImg].concat([ρσ_desugar_kwargs({small: true, image: true, text: "Show in chat"})]));
10710+
ρσ_interpolate_kwargs.call(this, addRollButton, [self, cb, avatarImg].concat([ρσ_desugar_kwargs({small: true, image: true, text: "Display in VTT"})]));
1071110711
}
1071210712
}
1071310713
attributes = stat_block.find(base + "__attributes " + base + "__attribute");

src/dndbeyond_vehicle.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10707,7 +10707,7 @@ return this.__repr__();
1070710707
cb = function () {
1070810708
self.displayAvatar();
1070910709
};
10710-
ρσ_interpolate_kwargs.call(this, addRollButton, [self, cb, avatarImg].concat([ρσ_desugar_kwargs({small: true, image: true, text: "Show in chat"})]));
10710+
ρσ_interpolate_kwargs.call(this, addRollButton, [self, cb, avatarImg].concat([ρσ_desugar_kwargs({small: true, image: true, text: "Display in VTT"})]));
1071110711
}
1071210712
}
1071310713
attributes = stat_block.find(base + "__attributes " + base + "__attribute");

0 commit comments

Comments
 (0)