CSS adjustments and user script formatting

This commit is contained in:
ebolam
2022-08-30 13:34:53 -04:00
parent e54bc2564d
commit 1a7451d45d
5 changed files with 31 additions and 10 deletions

View File

@@ -7471,10 +7471,11 @@ def UI_2_load_userscripts_list(data):
column_widths=['200px', '150px', 'auto'])
def valid_userscripts_to_load(file):
return file.endswith(".lua") and file not in koboldai_vars.userscripts
print("{} is valid: {}".format(file, file.endswith(".lua") and os.path.basename(file) not in koboldai_vars.userscripts))
return file.endswith(".lua") and os.path.basename(file) not in koboldai_vars.userscripts
def valid_userscripts_to_unload(file):
return file.endswith(".lua") and file in koboldai_vars.userscripts
return file.endswith(".lua") and os.path.basename(file) in koboldai_vars.userscripts
def get_userscripts_desc(item_full_path, item, valid_selection):
if not valid_selection:

View File

@@ -232,6 +232,24 @@ input[type="range"]::-ms-fill-upper {
margin-left: 10px;
}
.setting_container_single_wide {
display: grid;
grid-template-areas: "label"
"item";
grid-template-rows: 20px auto;
grid-template-columns: 354px;
row-gap: 0.2em;
background-color: var(--setting_background);
color: var(--text);
border-radius: var(--radius_settings_background);
padding: 3px;
margin: 2px;
}
.setting_container_single_wide .setting_item{
font-size: calc(0.93em + var(--font_size_adjustment));
margin-left: 10px;
}
.setting_minlabel {
padding-top: 6px;
@@ -1051,7 +1069,7 @@ body {
background-color: var(--gamescreen_background);
z-index: 2;
box-shadow: var(--light_shadow_value);
color: white;
color: var(--text);
width: 100%;
grid-area: gamescreen;
display: flex;

View File

@@ -645,7 +645,7 @@ function popup_items(data) {
for (i=0; i < data.column_widths.length; i++) {
style = style + " p"+i;
}
style = style + '"; grid-template-columns: 30px';
style = style + '"; grid-template-columns: 50px';
for (column_width of data.column_widths) {
style = style + " "+column_width;
}

View File

@@ -177,18 +177,20 @@
<span class="setting_minlabel"><span style="top: -4px; position: relative;"></span></span>
<span class="setting_maxlabel"><span style="top: -4px; position: relative;"></span></span>
</div>
<div class="setting_container_single">
<div class="setting_container_single_wide">
<!---Top Row---->
<span class="setting_label">
<span style="white-space: pre-wrap;">User Scripts: </span>
<span style="white-space: pre-wrap;">Enabled User Scripts: </span>
<span class="helpicon material-icons-outlined" title="Allows for user scripts that modify the way the game functions">help_icon</span>
</span>
<!---Bottom Row---->
<span class="setting_item">
<div style="display: flex;flex-direction: row;">
<select id="loaded_userscripts" class="var_sync_system_userscripts settings_select" multiple></select>
<span class="material-icons-outlined cursor" style="font-size: 18px;" title="Unload File(s)" onclick="unload_userscripts();">delete</span>
<span class="material-icons-outlined cursor" style="font-size: 18px;" title="Load File" onclick="socket.emit('load_userscripts_list', '');">upload_file</span>
<select id="loaded_userscripts" class="var_sync_system_userscripts settings_select" multiple style="width:300px;"></select>
<div style="display: flex;flex-direction: column;">
<span class="material-icons-outlined cursor" style="font-size: 24px;" title="Unload File(s)" onclick="unload_userscripts();">delete</span>
<span class="material-icons-outlined cursor" style="font-size: 24px;" title="Load File" onclick="socket.emit('load_userscripts_list', '');">upload_file</span>
</div>
</div>
</span>
<!---Slider Labels--->

View File

@@ -49,7 +49,7 @@ local example_config = [[# Phrase bias
# case-sensitive, with a leading space, to appear in the output, with the
# bias increasing as each consecutive token in that phrase appears):
# 7, 25.4, 1309, 262, 3809, 286, 1842, 1011, 345, 2440
#
# #
]]
-- If config file is empty, write example config