Skip to content

Commit

Permalink
Merge pull request #1220 from solaris-games/dev
Browse files Browse the repository at this point in the history
Dev 247.1
  • Loading branch information
SpacialCircumstances authored Nov 4, 2024
2 parents 458dd32 + d290023 commit c09b539
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 17 deletions.
10 changes: 4 additions & 6 deletions client/src/views/game/components/badges/BadgeShopList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div>
<div class="row" v-for="badge in badges" :key="badge.key">
<div class="col-auto">
<img :src="badgeSrc" :alt="badge.name"/>
<img :src="getBadgeSrc(badge)" :alt="badge.name"/>

<div class="d-grid gap-2">
<button class="btn btn-sm btn-success" v-if="userCredits >= badge.price" @click="purchaseBadge(badge)">
Expand Down Expand Up @@ -37,11 +37,9 @@ export default {
}
this.$emit('onPurchaseBadgeConfirmed', badge);
}
},
computed: {
badgeSrc () {
return new URL(`../../../../assets/badges/${this.badge.key}.png`, import.meta.url);
},
getBadgeSrc (badge) {
return new URL(`../../../../assets/badges/${badge.key}.png`, import.meta.url);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<loading-spinner :loading="isLoading"/>

<div class="pt-3 pb-3" v-if="!isLoading">
<div class="pt-3 pb-3" v-if="!isLoading && userCredits">
<badge-shop-list :badges="badges" :userCredits="userCredits.credits" :recipientName="recipientPlayer.alias" @onPurchaseBadgeConfirmed="onPurchaseBadgeConfirmed" />
</div>
</div>
Expand Down
16 changes: 12 additions & 4 deletions client/src/views/game/components/ledger/Ledger.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@

<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" data-bs-toggle="tab" href="#credits">Credits</a>
<a class="nav-link" :class="selectedTab === 'credits' ? 'active show' : null" @click="() => select('credits')" href="javascript:;">Credits</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" href="#tokens">Tokens</a>
<a class="nav-link" :class="selectedTab === 'tokens' ? 'active show' : null" @click="() => select('tokens')" href="javascript:;">Tokens</a>
</li>
</ul>

<div class="tab-content pt-2">
<div class="tab-pane fade show active" id="credits">
<div class="tab-pane" :class="selectedTab === 'credits' ? 'active show' : null" id="credits">
<ledger-table :ledgerType="'credits'" @onOpenPlayerDetailRequested="onOpenPlayerDetailRequested" />
</div>
<div class="tab-pane fade" id="tokens">
<div class="tab-pane" :class="selectedTab === 'tokens' ? 'active show' : null" id="tokens">
<ledger-table :ledgerType="'creditsSpecialists'" @onOpenPlayerDetailRequested="onOpenPlayerDetailRequested" />
</div>
</div>
Expand All @@ -37,7 +37,15 @@ export default {
'loading-spinner': LoadingSpinner,
'ledger-table': LedgerTableVue
},
data () {
return {
selectedTab: 'credits'
}
},
methods: {
select(tab) {
this.selectedTab = tab
},
onOpenPlayerDetailRequested(playerId) {
this.$emit('onOpenPlayerDetailRequested', playerId)
},
Expand Down
4 changes: 0 additions & 4 deletions client/src/views/game/components/welcome/SelectAlias.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
<div v-if="isAnonymousGame" class="alert alert-warning">
<p>This game is anonymous, you might want to hide your identity!</p>
</div>

<!-- <div class="mb-2 text-center small">
<p>Your alias must be between 3 and 24 characters.</p>
</div> -->
</div>
</div>
</form>
Expand Down
10 changes: 8 additions & 2 deletions client/src/views/game/components/welcome/SelectColour.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<template>
<div>
<div class="row text-center">
<div class="row text-center bg-dark">
<div class="col">
<p class="mb-0 mt-2 mb-2 small text-warning">Remember to abide by the <router-link class="guidelines-link" :to="{ name: 'guidelines' }">Community Guidelines</router-link></p>
</div>
</div>

<div class="row text-center">
<div class="col">
<p class="mb-0 mt-2 mb-2">Select a colour and starting location.</p>
<p class="mb-0 mt-2 mb-2">Select a colour and starting location.</p>
</div>
</div>

Expand Down
17 changes: 17 additions & 0 deletions server/db/scripts/deleteMessage.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const mainDocumentId = ObjectId('');
const conversationId = ObjectId('');
const messageId = ObjectId('');

db.games.findOne({
_id: mainDocumentId,
"conversations._id": conversationId
})

db.games.updateOne(
{
_id: mainDocumentId,
"conversations._id": conversationId
},
{
$pull: { "conversations.$.messages": { _id: messageId } }
});

0 comments on commit c09b539

Please sign in to comment.