Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
CreatureChat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Public
CreatureChat
Commits
8b632382
Commit
8b632382
authored
Jul 03, 2024
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When chat bubble is **hidden**, do **not truncate** long names
parent
552e5e33
Pipeline
#12565
passed with stages
in 2 minutes 24 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
CHANGELOG.md
CHANGELOG.md
+1
-0
BubbleRenderer.java
src/client/java/com/owlmaddie/ui/BubbleRenderer.java
+6
-6
No files found.
CHANGELOG.md
View file @
8b632382
...
@@ -18,6 +18,7 @@ All notable changes to **CreatureChat** are documented in this file. The format
...
@@ -18,6 +18,7 @@ All notable changes to **CreatureChat** are documented in this file. The format
-
Refactored
**ATTACK**
behavior to allow more flexibility (in order to support PROTECT behavior)
-
Refactored
**ATTACK**
behavior to allow more flexibility (in order to support PROTECT behavior)
-
Updated
`ServerEntityFinder::getEntityByUUID`
to be more generic and so it can find players and mobs.
-
Updated
`ServerEntityFinder::getEntityByUUID`
to be more generic and so it can find players and mobs.
-
Added
`PlayerBaseGoal`
class to allow
**goals/behaviors**
to
**continue**
after a player
**respawns**
/ logs out / logs in
-
Added
`PlayerBaseGoal`
class to allow
**goals/behaviors**
to
**continue**
after a player
**respawns**
/ logs out / logs in
-
When chat bubble is
**hidden**
, do
**not truncate**
long names
## [1.0.6] - 2024-06-17
## [1.0.6] - 2024-06-17
...
...
src/client/java/com/owlmaddie/ui/BubbleRenderer.java
View file @
8b632382
...
@@ -296,7 +296,7 @@ public class BubbleRenderer {
...
@@ -296,7 +296,7 @@ public class BubbleRenderer {
}
}
private
static
void
drawEntityName
(
Entity
entity
,
Matrix4f
matrix
,
VertexConsumerProvider
immediate
,
private
static
void
drawEntityName
(
Entity
entity
,
Matrix4f
matrix
,
VertexConsumerProvider
immediate
,
int
fullBright
,
float
yOffset
)
{
int
fullBright
,
float
yOffset
,
boolean
truncate
)
{
TextRenderer
fontRenderer
=
MinecraftClient
.
getInstance
().
textRenderer
;
TextRenderer
fontRenderer
=
MinecraftClient
.
getInstance
().
textRenderer
;
// Get Name of entity
// Get Name of entity
...
@@ -312,7 +312,7 @@ public class BubbleRenderer {
...
@@ -312,7 +312,7 @@ public class BubbleRenderer {
}
}
// Truncate long names
// Truncate long names
if
(
nameText
.
length
()
>
14
)
{
if
(
nameText
.
length
()
>
14
&&
truncate
)
{
nameText
=
nameText
.
substring
(
0
,
14
)
+
"..."
;
nameText
=
nameText
.
substring
(
0
,
14
)
+
"..."
;
}
}
...
@@ -486,7 +486,7 @@ public class BubbleRenderer {
...
@@ -486,7 +486,7 @@ public class BubbleRenderer {
}
else
if
(
chatData
.
sender
==
ChatDataManager
.
ChatSender
.
ASSISTANT
&&
chatData
.
status
!=
ChatDataManager
.
ChatStatus
.
HIDDEN
)
{
}
else
if
(
chatData
.
sender
==
ChatDataManager
.
ChatSender
.
ASSISTANT
&&
chatData
.
status
!=
ChatDataManager
.
ChatStatus
.
HIDDEN
)
{
// Draw Entity (Custom Name)
// Draw Entity (Custom Name)
drawEntityName
(
entity
,
matrix
,
immediate
,
fullBright
,
24
F
+
DISPLAY_PADDING
);
drawEntityName
(
entity
,
matrix
,
immediate
,
fullBright
,
24
F
+
DISPLAY_PADDING
,
true
);
// Draw text background (no smaller than 50F tall)
// Draw text background (no smaller than 50F tall)
drawTextBubbleBackground
(
"text-top"
,
matrices
,
-
64
,
0
,
128
,
scaledTextHeight
,
chatData
.
friendship
);
drawTextBubbleBackground
(
"text-top"
,
matrices
,
-
64
,
0
,
128
,
scaledTextHeight
,
chatData
.
friendship
);
...
@@ -512,7 +512,7 @@ public class BubbleRenderer {
...
@@ -512,7 +512,7 @@ public class BubbleRenderer {
}
else
if
(
chatData
.
sender
==
ChatDataManager
.
ChatSender
.
ASSISTANT
&&
chatData
.
status
==
ChatDataManager
.
ChatStatus
.
HIDDEN
)
{
}
else
if
(
chatData
.
sender
==
ChatDataManager
.
ChatSender
.
ASSISTANT
&&
chatData
.
status
==
ChatDataManager
.
ChatStatus
.
HIDDEN
)
{
// Draw Entity (Custom Name)
// Draw Entity (Custom Name)
drawEntityName
(
entity
,
matrix
,
immediate
,
fullBright
,
24
F
+
DISPLAY_PADDING
);
drawEntityName
(
entity
,
matrix
,
immediate
,
fullBright
,
24
F
+
DISPLAY_PADDING
,
false
);
// Draw 'resume chat' button
// Draw 'resume chat' button
if
(
chatData
.
friendship
==
3
)
{
if
(
chatData
.
friendship
==
3
)
{
...
@@ -528,7 +528,7 @@ public class BubbleRenderer {
...
@@ -528,7 +528,7 @@ public class BubbleRenderer {
}
else
if
(
chatData
.
sender
==
ChatDataManager
.
ChatSender
.
USER
&&
chatData
.
status
==
ChatDataManager
.
ChatStatus
.
DISPLAY
)
{
}
else
if
(
chatData
.
sender
==
ChatDataManager
.
ChatSender
.
USER
&&
chatData
.
status
==
ChatDataManager
.
ChatStatus
.
DISPLAY
)
{
// Draw Player Name
// Draw Player Name
drawEntityName
(
entity
,
matrix
,
immediate
,
fullBright
,
24
F
+
DISPLAY_PADDING
);
drawEntityName
(
entity
,
matrix
,
immediate
,
fullBright
,
24
F
+
DISPLAY_PADDING
,
true
);
// Draw text background
// Draw text background
drawTextBubbleBackground
(
"text-top-player"
,
matrices
,
-
64
,
0
,
128
,
scaledTextHeight
,
chatData
.
friendship
);
drawTextBubbleBackground
(
"text-top-player"
,
matrices
,
-
64
,
0
,
128
,
scaledTextHeight
,
chatData
.
friendship
);
...
@@ -557,7 +557,7 @@ public class BubbleRenderer {
...
@@ -557,7 +557,7 @@ public class BubbleRenderer {
// Draw Player Name (if not self and HUD is visible)
// Draw Player Name (if not self and HUD is visible)
if
(!
entity
.
equals
(
cameraEntity
)
&&
!
MinecraftClient
.
getInstance
().
options
.
hudHidden
)
{
if
(!
entity
.
equals
(
cameraEntity
)
&&
!
MinecraftClient
.
getInstance
().
options
.
hudHidden
)
{
drawEntityName
(
entity
,
matrices
.
peek
().
getPositionMatrix
(),
immediate
,
fullBright
,
24
F
+
DISPLAY_PADDING
);
drawEntityName
(
entity
,
matrices
.
peek
().
getPositionMatrix
(),
immediate
,
fullBright
,
24
F
+
DISPLAY_PADDING
,
true
);
if
(
showPendingIcon
)
{
if
(
showPendingIcon
)
{
// Draw 'pending' button (when Chat UI is open)
// Draw 'pending' button (when Chat UI is open)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment