:: Menu[menu]
<h2>Settings</h2>
<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>
		<<checkbox "$settings.shoes_keepOnPrivateIndoors" false true autocheck>> Keep your shoes on at private indoor locations (such as your home or a rented hotel room).
		Under normal circumstances, you will take them off for sleep independent of this setting.
	</p>
<hr/>
<h3>World</h3>
    <<set $settings.world ??= {}>>
    <<set $settings.world.crime ??= 'default'>>

        <h4>Crime</h4>
        <p>
            The crime settings influence how often you become the target of criminals.
            There are various types of crime, such as theft and abduction.
            At lower crime settings, many places, such as populated areas, are mostly safe from some crimes (theft) and completely safe from others (abduction, rape, etc.) during daytime.
            Some places, such police stations, are always safe.
            Most crimes depend on the type of location you are at. For example, theft will happen outdoors while burglary happens indoors.
        </p>
        <p>
            Note that this setting does not affect events where you are the criminal yourself.
        </p>
        <ul>
		    <li><<radiobutton "$settings.world.crime" "minimal" autocheck>> Minimal: There is still crime, but you have to actively go looking for it. Random crime events are disabled.</li>
            <li><<radiobutton "$settings.world.crime" "realistic" autocheck>> Realistic: While criminals exist you are rather unlikely to become their target unless you actively search for them.</li>
            <li><<radiobutton "$settings.world.crime" "default" autocheck>> Default: You need to mind where you're going, especially in the dark.</li>
            <li><<radiobutton "$settings.world.crime" "high" autocheck>> High: Criminals are a common problem. You even have a small risk of encountering them at populated public places during daytime.</li>
            <li><<radiobutton "$settings.world.crime" "always" autocheck>> Always: There is an army of criminals after you. Only use this option if you want to encounter the relevant content as soon as possible.</li>
        </ul>
<hr/>
<h3>Development</h3>
	<p><<checkbox "$DEBUGGING" false true autocheck>> Enable Debugging</p>

<h3>Graphics</h3>
	<p>
		<<checkbox "$settings.lightmode" false true autocheck>>
		Change the colors of the font and the background of the main passage depending on the light levels around the main character (turning this setting off requires a page-reload(F5)).
	</p>
	<p>
		Image path: <<textbox "$media_path" $media_path>>
	</p>
<h3>Misc</h3>
	<p>
		Autosave:
		<ul>
			<li><<radiobutton "$settings.autosave" "ALWAYS" autocheck>> Save on each passage. Might put a heavy strain on weaker systems.</li>
			<li><<radiobutton "$settings.autosave" "AWAKE" autocheck>> Save each time you wake up after sleeping and at key story events.</li>
			<li><<radiobutton "$settings.autosave" "NONE" autocheck>> Never autosave.</li>
		</ul>
	</p>
    <p>
        <<set $settings.maxStates ??= Config.history.maxStates>>
        History: <<attr 'min' 1 'max' 100>><<numberbox '$settings.maxStates' $settings.maxStates>><</attr>>
    </p>
	<p>
		[[Achievements|AchievementsOverview]]
	</p>
	<p>
		[[CheatMenu]]
	</p>

<<act "Return">>
    <<run memorize('media_path', $media_path)>>
    <<run setup.settingsApply($settings)>>
    <<gt $location>>
<</act>>

:: CheatMenu[menu]
<<ret>>
<h3>Appearance</h3>

<p>
    Total Appearance: $pc.pcs_apprnc
</p>

<p>
    Base Appearance: $pc.pcs_apprncbase
</p>

<p>
    Clothing Appearance: $pc.appearance_clothingBonus
</p>

<p>
    Accessories Appearance: $pc.appearance_accessoriesBonus
</p>

<p>
    Grooming Bonus Appearance: $pc.appearance_groomingBonus
</p>

<p>
    Grooming Penalty Appearance: $pc.appearance_groomingPenalty
</p>

<p>
    Hotcat: $pc.hotcat
</p>


<h3>NPCs</h3>
<<set _npcIds = $npcs.ids()>>

<div id="npcOverview">
    <<for _npcId range _npcIds>>
        <<set _npc = $npcs.npcData(_npcId)>>
        <div class="npcId">
            <<capture _npcId>>
                <<link _npcId>>
                    <<set $cheatMenuNpc to _npcId>>
                    <<goto "CheatMenu_NPC">>
                <</link>>
            <</capture>>
        </div>
        <div class="npcFirstName">_npc.firstname</div>
        <div class="npcLastName">_npc.lastname</div>
        <div class="npcRel">_npc.rel</div>
    <</for>>
</div>


:: CheatMenu_NPC
<div id="npcOverviewContainer">
    <<npcDetails $cheatMenuNpc>>
</div>

<<link "Reset">>
    <<replace "#npcOverviewContainer">>
        <<npcDetails $cheatMenuNpc>>
    <</replace>>
<</link>>
<<link "Confirm">>
    <<for _key, _value range _npc>>
        <<if _value == "undefined">>
            <<set _v = undefined>>
        <<elseif _value == "null">>
            <<set _v = null>>
        <<elseif !isNaN(_value)>>
            <<set _v = Number(_value)>>
        <<else>>
            <<set _v = _value>>
        <</if>>
        <<run $npcs.set($cheatMenuNpc,_key,_v)>>
    <</for>>
    <<goto "CheatMenu">>
<</link>>

:: CheatMenu_NPC_Widgets[widget]
<<widget 'npcDetails'>>
<<set _npc = $npcs.npcData(_args[0])>>
<div id="npcDetails">
    <label>First Name: <<textbox "_npc.firstname" _npc.firstname>></label>
    <label>Last Name: <<textbox "_npc.lastname" _npc.lastname>></label>
    <label>Day of birth: <<textbox "_npc.dob" _npc.dob>></label>
    <label>Relationship: <<textbox "_npc.rel" _npc.rel>></label>
</div>
<</widget>>
