Skip to content
Merged

Tags #159

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rlbot_gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,14 @@ def pick_location(is_folder, filter="Config files (*.cfg)"):
def read_info(bundle: RunnableConfigBundle):
details_header = 'Details'
if bundle.base_agent_config.has_section(details_header):
raw_tags = bundle.base_agent_config.get(details_header, 'tags')
return {
'developer': bundle.base_agent_config.get(details_header, 'developer'),
'description': bundle.base_agent_config.get(details_header, 'description'),
'fun_fact': bundle.base_agent_config.get(details_header, 'fun_fact'),
'github': bundle.base_agent_config.get(details_header, 'github'),
'language': bundle.base_agent_config.get(details_header, 'language'),
'tags': [tag.strip() for tag in raw_tags.split(',')] if raw_tags else [],
}
return None

Expand Down
28 changes: 23 additions & 5 deletions rlbot_gui/gui/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ body, html {
position: relative;
}

.team-card .bot-card {
display: flex;
}

.team-label {
position: absolute;
bottom: 3px;
Expand All @@ -84,6 +88,7 @@ body, html {
.bot-card {
margin: 2px;
box-shadow: 1px 1px 7px #0000002e;
display: inline-flex;
}

.bot-card .card-body {
Expand All @@ -98,7 +103,12 @@ body, html {
}

.script-card {
background: linear-gradient(90deg, rgb(255, 255, 255) 0%, rgba(255, 255, 255, 0.34) 50%)
background: linear-gradient(90deg, rgb(255, 255, 255) 0%, rgba(255, 255, 255, 0.644) 50%)
}

.bot-card.disabled {
opacity: 50%;
cursor: default;
}

.center-flex {
Expand Down Expand Up @@ -162,8 +172,16 @@ body, html {
padding: 2px 5px;
}

.bot-pool .bot-card {
display: inline-flex;
.bot-pool .categories-radio-group {
margin-right: 10px;
background-color: white;
}

.bot-pool .scripts-header {
margin-top: 5px;
margin-bottom: 0px;
margin-left: 3px;
font-weight: bold;
}

.bot-card img {
Expand All @@ -175,8 +193,8 @@ body, html {
margin: 0 3px 0 0;
}

.filtered {
opacity: 0.2;
.script-card:not(.disabled) .script-switch * {
cursor: pointer;
}

.bot-card img.darkened {
Expand Down
63 changes: 42 additions & 21 deletions rlbot_gui/gui/js/bot-card-vue.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,46 @@
import RunnableCard from './runnable-card-vue.js'

export default {
name: 'bot-card',
props: ['bot'],
template: `
<b-card class="bot-card md-elevation-3" @click="$emit('click')">

<slot>
<img v-if="!bot.logo" class="darkened" v-bind:src="bot.image">
<img v-if="bot.logo" v-bind:src="bot.logo">
<span class="bot-name">{{ bot.name }} <span v-if="bot.uniquePathSegment" class="unique-bot-identifier">({{ bot.uniquePathSegment }})</span></span>
</slot>

<b-button size="sm" class="icon-button warning-icon" v-if="bot.warn" variant="outline-warning"
@click.stop="$emit('active-bot')" v-b-modal.language-warning-modal>
<b-icon icon="exclamation-triangle-fill"/>
</b-button>

<b-button size="sm" variant="outline-primary" class="bot-hover-reveal icon-button" v-if="bot.info"
@click.stop="$emit('active-bot')" v-b-modal.bot-info-modal>
<b-icon icon="info-circle"/>
</b-button>

</b-card>
components: {
'runnable-card': RunnableCard,
},
props: {
bot: Object,
disabled: Boolean,
draggable: {
type: Boolean,
default: true,
},
},
template: /*html*/`
<draggable v-model="draggableModel" :options="draggableOptions" style="display: inline;">
<runnable-card :runnable="bot" :disabled="disabled" :class="{draggable: draggable}" @click="$emit('click')">
<img v-if="bot.logo" :src="bot.logo">
<img v-else class="darkened" :src="bot.image">
<span class="bot-name">
{{ bot.name }}
<span v-if="bot.uniquePathSegment" class="unique-bot-identifier">
({{ bot.uniquePathSegment }})
</span>
</span>
</runnable-card>
</draggable>
`,
computed: {
draggableModel: function() {
return [this.bot];
},
draggableOptions: function() {
return {
group: {
name: 'bots',
pull: 'clone',
put: false,
},
sort: false,
disabled: !this.draggable || this.disabled,
};
},
},
}
73 changes: 73 additions & 0 deletions rlbot_gui/gui/js/categories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
export default {
all: {
name: "All",
categories: [
{
bots: "*",
scripts: "*",
includePsyonixBots: true,
},
],
},
standard: {
name: "Standard",
categories: [
{
name: "Bots for 1v1",
bots: "1v1",
},
{
name: "Bots with teamplay",
bots: "teamplay",
},
{
name: "Goalie bots",
bots: "goalie",
},
],
},
extra: {
name: "Extra modes",
categories: [
{
name: "Hoops",
bots: "hoops",
scripts: "hoops",
},
{
name: "Dropshot",
bots: "dropshot",
scripts: "dropshot",
},
{
name: "Snow Day",
bots: "snow-day",
scripts: "snow-day",
},
{
name: "Rumble",
bots: "rumble",
scripts: "rumble",
},
{
name: "Spike Rush",
bots: "spike-rush",
scripts: "spike-rush",
},
{
name: "Heatseeker",
bots: "heatseeker",
scripts: "heatseeker",
},
],
},
special: {
name: "Special bots/scripts",
categories: [
{
bots: "memebot",
displayScriptDependencies: true,
},
],
},
};
Loading