Skip to content

Commit bf0666e

Browse files
committed
update
1 parent b3892d0 commit bf0666e

4 files changed

Lines changed: 45 additions & 7 deletions

File tree

client/_Examples.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ RegisterCommand("bln_notify", function(source, args, rawCommand)
208208
description = args[3] or desc,
209209
icon = args[4] or defaultIcon,
210210
placement = (args[5] and validPlacements[args[5]] and args[5]) or defaultPlacement,
211+
contentAlignment = "center"
211212
}
212213

213214
TriggerEvent("bln_notify:send", options)

fxmanifest.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ fx_version "adamant"
33
rdr3_warning 'I acknowledge that this is a prerelease build of RedM, and I am aware my resources *will* become incompatible once RedM ships.'
44
games {"rdr3"}
55

6-
version '2.2.0'
6+
version '2.3.0'
77

88
author 'BLN Studio <bln-studio.com>'
99

ui/assets/css/styles.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,16 +277,16 @@
277277
opacity: 0.8;
278278
will-change: transform, opacity;
279279
}
280-
281-
.notification.align-start {
280+
.notification-title, .notification-description { width: 100%; }
281+
.notification.align-start, .notification.align-start .notification-title {
282282
text-align: start;
283283
}
284284

285-
.notification.align-center {
285+
.notification.align-center, .notification.align-center .notification-title {
286286
text-align: center;
287287
}
288288

289-
.notification.align-end {
289+
.notification.align-end, .notification.align-end .notification-title {
290290
text-align: end;
291291
}
292292

ui/assets/js/dynamic-text.js

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,33 @@ Vue.component('dynamic-text', {
1818
}
1919
},
2020
methods: {
21+
isValidFontSize(size) {
22+
if (!size) return false;
23+
return /^-?\d*\.?\d+(px|em|rem|%|pt|vh|vw|vmin|vmax|ch|ex)$/i.test(size.trim());
24+
},
25+
isValidFontWeight(weight) {
26+
if (!weight) return false;
27+
const normalized = weight.trim().toLowerCase();
28+
if (/^[1-9]00$/.test(normalized)) return true;
29+
return ['normal', 'bold', 'bolder', 'lighter'].includes(normalized);
30+
},
2131
parseText() {
2232
const parts = [];
2333
let currentText = '';
2434
let currentColor = null;
35+
let currentSize = null;
36+
let currentWeight = null;
2537
let i = 0;
2638

2739
const pushCurrentText = () => {
2840
if (currentText) {
29-
parts.push({ type: 'text', text: currentText, color: currentColor });
41+
parts.push({
42+
type: 'text',
43+
text: currentText,
44+
color: currentColor,
45+
size: currentSize,
46+
weight: currentWeight
47+
});
3048
currentText = '';
3149
}
3250
};
@@ -54,6 +72,23 @@ Vue.component('dynamic-text', {
5472
});
5573
} else if (code === 'e') {
5674
currentColor = null;
75+
currentSize = null;
76+
currentWeight = null;
77+
} else if (code.startsWith('size:')) {
78+
const sizeData = code.substring(5);
79+
const [rawSize, rawWeight] = sizeData.split('|');
80+
const nextSize = rawSize ? rawSize.trim() : null;
81+
const nextWeight = rawWeight ? rawWeight.trim() : null;
82+
83+
if (nextSize && this.isValidFontSize(nextSize)) {
84+
currentSize = nextSize;
85+
}
86+
87+
if (nextWeight && this.isValidFontWeight(nextWeight)) {
88+
currentWeight = nextWeight;
89+
} else {
90+
currentWeight = null;
91+
}
5792
} else if (code.startsWith('#')) {
5893
currentColor = code;
5994
} else if (code.startsWith('img:')) {
@@ -136,7 +171,9 @@ Vue.component('dynamic-text', {
136171
return h('span', {
137172
key: index,
138173
style: {
139-
color: part.color
174+
color: part.color,
175+
fontSize: part.size,
176+
fontWeight: part.weight
140177
}
141178
}, part.text);
142179
}

0 commit comments

Comments
 (0)