Skip to content

Commit 297b0cb

Browse files
authored
Adding toggles for the new flags enable_rendering, enable_state_setting, auto_save_replay. (#81)
1 parent 8fd5bf6 commit 297b0cb

5 files changed

Lines changed: 31 additions & 7 deletions

File tree

rlbot_gui/gui.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ def validate_bots(bots):
135135
def get_match_settings():
136136
settings = load_settings()
137137
match_settings = settings.value(MATCH_SETTINGS_KEY, type=dict)
138+
if 'enable_state_setting' not in match_settings:
139+
# Set this to true by default for backwards compatiblity with state setting sandbox, snek, and sniper
140+
match_settings['enable_state_setting'] = True
138141
return match_settings if match_settings else None
139142

140143

rlbot_gui/gui/css/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ body {
5353
}
5454

5555
.team-entries {
56-
min-height: 220px;
56+
min-height: 180px;
5757
padding: 5px;
5858
}
5959

rlbot_gui/gui/main.vue

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
<h3 class="md-title" style="flex: 1">RLBot</h3>
99

1010
<div class="md-toolbar-section-end">
11+
<span v-if="!matchSettings.enable_state_setting">
12+
<md-icon class="warning-icon">warning</md-icon><md-tooltip md-direction="bottom">State setting is turned off, sandbox won't work!</md-tooltip>
13+
</span>
1114
<md-button @click="$router.replace('/sandbox')">
1215
State Setting Sandbox
1316
</md-button>
@@ -211,9 +214,18 @@
211214
<md-dialog-title>Extra Options</md-dialog-title>
212215

213216
<md-dialog-content>
214-
<md-switch v-model="matchSettings.skip_replays">Skip Replays</md-switch>
215-
<md-switch v-model="matchSettings.instant_start">Instant Start</md-switch>
216-
<md-switch v-model="matchSettings.enable_lockstep">Enable lockstep</md-switch>
217+
<div class="md-layout">
218+
<div class="md-layout-item">
219+
<div><md-switch v-model="matchSettings.skip_replays">Skip Replays</md-switch></div>
220+
<div><md-switch v-model="matchSettings.instant_start">Instant Start</md-switch></div>
221+
<div><md-switch v-model="matchSettings.enable_lockstep">Enable Lockstep</md-switch></div>
222+
</div>
223+
<div class="md-layout-item">
224+
<div><md-switch v-model="matchSettings.enable_rendering">Enable Rendering (bots can draw on screen)</md-switch></div>
225+
<div><md-switch v-model="matchSettings.enable_state_setting">Enable State Setting (bots can teleport)</md-switch></div>
226+
<div><md-switch v-model="matchSettings.auto_save_replay">Auto Save Replay</md-switch></div>
227+
</div>
228+
</div>
217229
<mutator-field label="Existing Match Behaviour" :options="matchOptions.match_behaviours" v-model="matchSettings.match_behavior"></mutator-field>
218230
</md-dialog-content>
219231

@@ -464,6 +476,9 @@
464476
respawn_time: null
465477
},
466478
randomizeMap: false,
479+
enable_rendering: false,
480+
enable_state_setting: false,
481+
auto_save_replay: false,
467482
},
468483
randomMapPool: [],
469484
showMutatorDialog: false,
@@ -553,6 +568,9 @@
553568
this.matchSettings.instant_start = false;
554569
this.matchSettings.enable_lockstep = false;
555570
this.matchSettings.randomizeMap = false;
571+
this.matchSettings.enable_rendering = false;
572+
this.matchSettings.enable_state_setting = true;
573+
this.matchSettings.auto_save_replay = false;
556574
this.resetMutatorsToDefault();
557575
558576
this.updateBGImage(this.matchSettings.map);
@@ -654,7 +672,7 @@
654672
655673
matchSettingsReceived: function (matchSettings) {
656674
if (matchSettings) {
657-
this.matchSettings = matchSettings;
675+
Object.assign(this.matchSettings, matchSettings);
658676
this.updateBGImage(this.matchSettings.map);
659677
} else {
660678
this.resetMatchSettingsToDefault();

rlbot_gui/match_runner/match_runner.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def spawn_car_in_showroom(loadout_config: LoadoutConfig, team: int, showcase_typ
7575
game_state.cars[0].physics.location.y = -1140
7676
game_state.cars[0].physics.velocity.x = 2300
7777
game_state.cars[0].physics.angular_velocity.z = 3.5
78-
78+
7979
elif showcase_type == "throttle":
8080
player_input.throttle = 1
8181
player_input.steer = 0.56
@@ -124,6 +124,9 @@ def start_match_helper(bot_list, match_settings):
124124
match_config.skip_replays = match_settings['skip_replays']
125125
match_config.instant_start = match_settings['instant_start']
126126
match_config.enable_lockstep = match_settings['enable_lockstep']
127+
match_config.enable_rendering = match_settings['enable_rendering']
128+
match_config.enable_state_setting = match_settings['enable_state_setting']
129+
match_config.auto_save_replay = match_settings['auto_save_replay']
127130
match_config.existing_match_behavior = match_settings['match_behavior']
128131
match_config.mutators = MutatorConfig()
129132

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import setuptools
22

3-
__version__ = '0.0.56'
3+
__version__ = '0.0.57'
44

55
with open("README.md", "r") as readme_file:
66
long_description = readme_file.read()

0 commit comments

Comments
 (0)