1
0
Quellcode durchsuchen

Merge branch 'Edited-TW' into SC-Master

Stephan Fuchs vor 10 Monaten
Ursprung
Commit
8e2b10e478

+ 5 - 0
sugarcube/src/PassageReady.tw

@@ -0,0 +1,5 @@
+:: PassageReady
+<<if !setup.doOnceAfterReload>>
+    <<run setup.settingsApply($settings)>>
+    <<run setup.doOnceAfterReload = true>>
+<</if>>

+ 19 - 5
sugarcube/src/menu/Menu.tw

@@ -1,11 +1,25 @@
 :: Menu[menu]
 <h2>Settings</h2>
-<h3>User Interface</h3>
-    <<set $settings.ui ??= {}>>
-    <<set $settings.ui.actionsAtBottom ??= false>>
-    <p>
-       <<checkbox "$settings.ui.actionsAtBottom" false true autocheck>> Display the available actions at the bottom of each passage instead of on the left side (only effects screens which are large enough to display the actions on the left to begin with).
+<h3>User Interface (Experimental)</h3>
+	<<set $settings.ui ??= {}>>
+	<<set $settings.ui.actionsAtBottom ??= false>>
+	<<set $settings.ui.sidebarRight ??= false>>
+	<<set $settings.ui.css ??= "">>
+	<p>
+		<b>Note: All Style-settings tinker with the display-code at a low level. You might need to reload the page (F5) for changes to take effect.</b>
+	</p>
+	<p>
+		<<checkbox "$settings.ui.actionsAtBottom" false true autocheck>> Display the available actions at the bottom of each passage instead of on the left side (only effects screens which are large enough to display the actions on the left to begin with).
+	</p>
+	<p>
+       <<checkbox "$settings.ui.sidebarRight" false true autocheck>> Display the sidebar on the right instead of the left side.
     </p>
+	<p>
+		Custom CSS:<br/>
+		Use URLs of external stylesheets (one stylesheet per line). Example: <i>"""https://girllife.neocities.org/blue.css"""</i>
+		Note: you can't host stylesheets everywhere. The correct MIME-type has to be transferred. Most webservers will work, but services such as pastebin won't.<br/>
+		<<textarea "$settings.ui.css" $settings.ui.css>>
+	</p>
 <hr/>
 <h3>Gameplay</h3>
 	<p>

+ 0 - 3
sugarcube/src/npcs/therapist/therapist.tw

@@ -364,9 +364,6 @@
 <</if>>
 :: therapist_hypnoResist
 	<<set $time.minutes += 5>>
-	<<if getvar("$sound") == 0>>
-	<</if>>
-	<font color="<<$hypnocolour>>">
 	<<if getvar("$q.therapist.hypnoTimesResistedStage") == 0>>
 		<p>Your body tenses, and you shake your head as you reject Dr. Pavlov's suggestion to $location_var[$here][0]. Seeing that you might awaken, he quickly tells you to forget the command he gave you. As the suggestion fades from your memory, you once again relax.</p>
 		"Hmmm," Dr. Pavlov muses. "Your will is quite strong. It may take some time to break you, but you will break."

+ 21 - 10
sugarcube/src/settings/settings.js

@@ -34,15 +34,26 @@ Save.onLoad.add(function (save) {
 });
 
 setup.settingsApply = function(settings){
-    switch(settings.autosave){
+	console.warn('Aplly settings',settings);
+	switch(settings.autosave){
 		case 'ALWAYS':
-            Config.saves.autosave = true;
-            break;
-        case 'AWAKE':
-            Config.saves.autosave = ['sleepAwake','autosave'];
-            break;
-        case 'NONE':
-            Config.saves.autosave = false;
-            break;
-    }
+			Config.saves.autosave = true;
+			break;
+		case 'AWAKE':
+			Config.saves.autosave = ['sleepAwake','autosave'];
+			break;
+		case 'NONE':
+			Config.saves.autosave = false;
+			break;
+	}
+	switch(settings.ui?.sidebarRight){
+		case true:
+			$("#ui-bar").addClass("uiBarRight");
+			break;
+		default:
+
+			break;
+	}
+	if(settings.ui?.css)
+		importStyles(settings.ui?.css.split("\n"));
 }

+ 29 - 0
sugarcube/src/style/sidebarOnRight.css

@@ -0,0 +1,29 @@
+#ui-bar.uiBarRight{
+	left: unset;
+	right: 0;
+}
+
+#ui-bar.uiBarRight.stowed {
+	left: unset;
+	right: -15.5em;
+}
+
+#ui-bar.uiBarRight #ui-bar-toggle{
+	right: unset;
+	left: 0;
+	border-right: 1px solid #444;
+}
+
+#ui-bar.uiBarRight~#story {
+	margin-left: 1em;
+	margin-right: 1em;
+}
+
+#ui-bar.uiBarRight.stowed~#story{
+	margin-left: 1em;
+	margin-right: 1em;
+}
+
+#ui-bar.uiBarRight~#story #actions {
+	left: 1em;
+}