Added option to allow the game text to take up all space or stay centered when no menus are pinned

This commit is contained in:
ebolam
2022-08-10 10:59:08 -04:00
parent 18fd5920eb
commit 10e3c340d3
2 changed files with 11 additions and 0 deletions

View File

@@ -1342,10 +1342,15 @@ function send_world_info(uid) {
//--------------------------------------------General UI Functions------------------------------------
function preserve_game_space(preserve) {
var r = document.querySelector(':root');
console.log("Setting cookie to: "+preserve);
if (preserve) {
setCookie("preserve_game_space", "true");
r.style.setProperty('--setting_menu_closed_width_no_pins_width', '0px');
document.getElementById('preserve_game_space_setting').checked = true;
} else {
setCookie("preserve_game_space", "false");
r.style.setProperty('--setting_menu_closed_width_no_pins_width', '450px');
document.getElementById('preserve_game_space_setting').checked = false;
}
}
@@ -2054,4 +2059,6 @@ $(document).ready(function(){
} else {
story_unpin();
}
console.log("cookie: "+getCookie("preserve_game_space"));
preserve_game_space((getCookie("preserve_game_space") == "true"));
});

View File

@@ -30,6 +30,7 @@
<span class="setting_menu_button selected" onclick="show_setting_menu(this);">Model</span>
<span class="setting_menu_button" onclick="show_setting_menu(this);">Story</span>
<span class="setting_menu_button" onclick="show_setting_menu(this);">User</span>
<span class="setting_menu_button" onclick="show_setting_menu(this);">UI</span>
<span style="float: right;margin-right: 30px;" onclick="window.open('https://github.com/KoboldAI/KoboldAI-Client/wiki');">Help</span>
</div>
<div class="flyout_menu_contents">
@@ -86,4 +87,7 @@
{% endwith %}
</div>
</div>
<div id="setting_menu_ui" class="hidden settings_category_area">
Maximize Game Text Space: <input type=checkbox id="preserve_game_space_setting" data-size=mini data-onstyle=success data-toggle=toggle onchange="preserve_game_space(this.checked)"/>
</div>
</div>