Skip to content

Commit

Permalink
Update Chat.vue
Browse files Browse the repository at this point in the history
Give option to display or hide users roles and XP in the chat.
  • Loading branch information
SalleeMatthew committed Jan 8, 2025
1 parent 57668b5 commit 6a45f1e
Showing 1 changed file with 48 additions and 13 deletions.
61 changes: 48 additions & 13 deletions spa/src/components/Chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
<span
v-else-if="msg.username === $store.data.user.username && msg.new === true"
class="text-yellow-200 font-bold">
<sup class="inline" v-show="msg.role">{{ msg.role }}</sup>
<sup class="inline" v-if="showRole" v-show="msg.role">{{ msg.role }}</sup>
{{ msg.username }}
<sub class="inline">{{ msg.exp }}</sub> :
<sub class="inline" v-if="showXP">{{ msg.exp }}</sub> :
<span class="font-normal">{{ msg.msg }}</span>
</span>
<span class="font-bold" v-else-if="msg.new === true">
<sup class="inline" v-show="msg.role">{{ msg.role }}</sup>
<sup class="inline" v-if="showRole" v-show="msg.role">{{ msg.role }}</sup>
{{ msg.username }}
<sub class="inline">{{ msg.exp }}</sub> :
<sub class="inline" v-if="showXP">{{ msg.exp }}</sub> :
<span class="font-normal">{{ msg.msg }}</span>
</span>
</li>
Expand Down Expand Up @@ -107,7 +107,7 @@
</div>
<div class="flex-grow overflow-y-auto p-1 messages-pane">
<ul v-if="activePanel === 'users'">
<li class="text-white">
<li class="text-white" @click="handler($event)" @contextmenu="handler($event)" @mouseup="menu($store.data.user.id)">
<img src="/assets/img/av_me.gif" class="inline" />
{{ this.$store.data.user.username }}
</li>
Expand Down Expand Up @@ -198,7 +198,7 @@
active:bg-gray-400
"
@click="closeMenu()">
Cancel Menu
Close Menu
</li>
<li style="border: inset #EEE 3px;"></li>
<li v-show="menuGoTo"
Expand All @@ -212,6 +212,30 @@
@click="goToPlace()">
Go to
</li>
<li v-show="menuToggleRole"
class="
p-1
pl-3.5
hover:text-white
hover:bg-gray-500
active:bg-gray-400
"
>
<input type="checkbox" id="role" v-model="showRole" />
<label for="role"> Users Roles</label>
</li>
<li v-show="menuToggleXP"
class="
p-1
pl-3.5
hover:text-white
hover:bg-gray-500
active:bg-gray-400
"
>
<input type="checkbox" id="XP" v-model="showXP" />
<label for="XP"> Users XP</label>
</li>
<li v-show="menuBeamTo"
class="
p-1
Expand Down Expand Up @@ -331,7 +355,7 @@
>
Properties
</li>
<li v-if="activePanel === 'users'" style="border:inset #EEE 3px;"></li>
<li v-if="menuRequestBackpack && activePanel === 'users'" style="border:inset #EEE 3px;"></li>
<li v-show="menuRequestBackpack"
class="
p-1
Expand Down Expand Up @@ -397,6 +421,8 @@ export default Vue.extend({
menuProperties: false,
menuRequestBackpack: true,
menuGoTo: false,
menuToggleRole: false,
menuToggleXP: false,
mallObject: false,
activePlaces: [],
placeList: [],
Expand All @@ -406,6 +432,8 @@ export default Vue.extend({
placeId: null,
chatIntervalId: null,
pingIntervalId: null,
showRole: true,
showXP: true,
};
},
directives: {
Expand Down Expand Up @@ -545,6 +573,8 @@ export default Vue.extend({
this.menuProperties = false;
this.menuRequestBackpack = false;
this.menuGoTo = false;
this.menuToggleRole = false;
this.menuToggleXP = false;
this.mallObject = false;
this.placeType = null;
this.placeUsername = null;
Expand Down Expand Up @@ -585,12 +615,17 @@ export default Vue.extend({
//User Panel
if(this.activePanel === 'users'){
this.menuIgnore = true;
this.menuInviteChat = true;
this.menuRequestBackpack = true;
this.menuWhisper = true;
if(this.$store.data.view3d){
this.menuBeamTo = true;
if(target[0] === this.$store.data.user.id){
this.menuToggleRole = true;
this.menuToggleXP = true;
} else {
this.menuIgnore = true;
this.menuInviteChat = true;
this.menuRequestBackpack = true;
this.menuWhisper = true;
if(this.$store.data.view3d){
this.menuBeamTo = true;
}
}
}
Expand Down

0 comments on commit 6a45f1e

Please sign in to comment.