@@ -137,6 +137,7 @@ export default {
137137 @bot-clicked="addToTeam($event, teamSelection)"
138138 ref="botPool"
139139 :display-human="displayHumanInBotPool"
140+ :favorites="favoritesPool"
140141 class="noscroll-flex"
141142 />
142143
@@ -255,6 +256,17 @@ export default {
255256 </b-toast>
256257
257258 <b-modal id="bot-info-modal" size="xl" :title="activeBot.name" v-if="activeBot && activeBot.info" hide-footer centered>
259+ <template #modal-title="{ close }">
260+ <div class="d-flex align-items-center">
261+ {{activeBot.name}}
262+ <b-button v-if="activeBot.path" variant="outline-primary" class="icon-button" @click="toggleFavoriteRunnable(activeBot)"
263+ v-b-tooltip.hover title="Toggle bot as favorite"
264+ >
265+ <b-icon v-if="favoritesPool.includes(activeBot.path)" icon="star-fill" variant="warning" />
266+ <b-icon v-else icon="star" />
267+ </b-button>
268+ </div>
269+ </template>
258270
259271 <img v-if="activeBot.logo" class="bot-logo" v-bind:src="activeBot.logo">
260272 <p><span class="bot-info-key">Developers:</span> {{activeBot.info.developer}}</p>
@@ -471,6 +483,7 @@ export default {
471483 showBotpackUpdateSnackbar : false ,
472484 appearancePath : '' ,
473485 recommendations : null ,
486+ favoritesPool : [ ] ,
474487 downloadModalTitle : "Downloading Bot Pack" ,
475488 }
476489 } ,
@@ -743,6 +756,10 @@ export default {
743756 eel . get_match_options ( ) ( this . matchOptionsReceived )
744757 } ,
745758
759+ favoriteRunnablesReceived : function ( runnables ) {
760+ this . favoritesPool = runnables ;
761+ } ,
762+
746763 botpackUpdateChecked : function ( isBotpackUpToDate ) {
747764 this . showBotpackUpdateSnackbar = ! isBotpackUpToDate ;
748765 this . isBotpackUpToDate = isBotpackUpToDate ;
@@ -791,6 +808,16 @@ export default {
791808 bots . forEach ( this . handleBotAddedToTeam ) ;
792809 this . $bvModal . hide ( 'recommendations-modal' ) ;
793810 } ,
811+ toggleFavoriteRunnable : async function ( runnable ) {
812+ let i = this . favoritesPool . indexOf ( runnable . path ) ;
813+ if ( i >= 0 ) {
814+ this . favoritesPool . splice ( i , 1 ) ;
815+ } else {
816+ this . favoritesPool . push ( runnable . path ) ;
817+ }
818+ await eel . save_favorite_runnables ( this . favoritesPool ) ( ) ;
819+ } ,
820+
794821 startup : function ( ) {
795822 if ( this . $route . path != "/" ) {
796823 return
@@ -799,6 +826,7 @@ export default {
799826 eel . get_match_options ( ) ( this . matchOptionsReceived ) ;
800827 eel . get_match_settings ( ) ( this . matchSettingsReceived ) ;
801828 eel . get_team_settings ( ) ( this . teamSettingsReceived ) ;
829+ eel . get_favorite_runnables ( ) ( this . favoriteRunnablesReceived ) ;
802830
803831 eel . get_language_support ( ) ( ( support ) => {
804832 this . languageSupport = support ;
0 commit comments