Improve paper stamping experience (#17135)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Command
|
||||
# Command
|
||||
cmd-faxui-desc = Open admin window for sending faxes
|
||||
cmd-faxui-help = Usage: faxui
|
||||
|
||||
@@ -7,7 +7,8 @@ admin-fax-title = Admin Fax Manager
|
||||
admin-fax-fax = Fax:
|
||||
admin-fax-follow = Follow
|
||||
admin-fax-title-placeholder = Paper name...
|
||||
admin-fax-from-placeholder = From who...
|
||||
admin-fax-from-placeholder = Stamped by...
|
||||
admin-fax-message-placeholder = Your message here...
|
||||
admin-fax-stamp = Stamp:
|
||||
admin-fax-stamp = Stamp icon:
|
||||
admin-fax-stamp-color = Stamp color:
|
||||
admin-fax-send = Send
|
||||
|
||||
@@ -91310,7 +91310,8 @@ entities:
|
||||
type: Transform
|
||||
- stampState: paper_stamp-syndicate
|
||||
stampedBy:
|
||||
- Syndicate
|
||||
- stampedName: stamp-component-stamped-name-syndicate
|
||||
stampedColor: '#850000'
|
||||
content: >-
|
||||
Operative, i have succeeded in the mission and this is the remainder of the evidence. I am hiding it behind this wall and escaping ASAP.
|
||||
|
||||
|
||||
@@ -421,6 +421,7 @@
|
||||
- type: Stamp
|
||||
stampedName: stamp-component-stamped-name-default
|
||||
stampState: "paper_stamp-generic"
|
||||
stampedColor: "#a23e3e"
|
||||
sound:
|
||||
path: /Audio/Items/Stamp/thick_stamp_sub.ogg
|
||||
params:
|
||||
@@ -454,6 +455,7 @@
|
||||
components:
|
||||
- type: Stamp
|
||||
stampedName: stamp-component-stamped-name-captain
|
||||
stampedColor: "#3681bb"
|
||||
stampState: "paper_stamp-cap"
|
||||
- type: Sprite
|
||||
sprite: Objects/Misc/bureaucracy.rsi
|
||||
@@ -466,6 +468,7 @@
|
||||
components:
|
||||
- type: Stamp
|
||||
stampedName: stamp-component-stamped-name-centcom
|
||||
stampedColor: "#006600"
|
||||
stampState: "paper_stamp-centcom"
|
||||
- type: Sprite
|
||||
sprite: Objects/Misc/bureaucracy.rsi
|
||||
@@ -478,6 +481,7 @@
|
||||
components:
|
||||
- type: Stamp
|
||||
stampedName: stamp-component-stamped-name-chaplain
|
||||
stampedColor: "#d70601"
|
||||
stampState: "paper_stamp-chaplain"
|
||||
- type: Sprite
|
||||
sprite: Objects/Misc/bureaucracy.rsi
|
||||
@@ -490,6 +494,7 @@
|
||||
components:
|
||||
- type: Stamp
|
||||
stampedName: stamp-component-stamped-name-clown
|
||||
stampedColor: "#ff33cc"
|
||||
stampState: "paper_stamp-clown"
|
||||
- type: Sprite
|
||||
sprite: Objects/Misc/bureaucracy.rsi
|
||||
@@ -505,6 +510,7 @@
|
||||
components:
|
||||
- type: Stamp
|
||||
stampedName: stamp-component-stamped-name-ce
|
||||
stampedColor: "#c69b17"
|
||||
stampState: "paper_stamp-ce"
|
||||
- type: Sprite
|
||||
sprite: Objects/Misc/bureaucracy.rsi
|
||||
@@ -517,6 +523,7 @@
|
||||
components:
|
||||
- type: Stamp
|
||||
stampedName: stamp-component-stamped-name-cmo
|
||||
stampedColor: "#33ccff"
|
||||
stampState: "paper_stamp-cmo"
|
||||
- type: Sprite
|
||||
sprite: Objects/Misc/bureaucracy.rsi
|
||||
@@ -529,6 +536,7 @@
|
||||
components:
|
||||
- type: Stamp
|
||||
stampedName: stamp-component-stamped-name-hop
|
||||
stampedColor: "#6ec0ea"
|
||||
stampState: "paper_stamp-hop"
|
||||
- type: Sprite
|
||||
sprite: Objects/Misc/bureaucracy.rsi
|
||||
@@ -541,6 +549,7 @@
|
||||
components:
|
||||
- type: Stamp
|
||||
stampedName: stamp-component-stamped-name-hos
|
||||
stampedColor: "#cc0000"
|
||||
stampState: "paper_stamp-hos"
|
||||
- type: Sprite
|
||||
sprite: Objects/Misc/bureaucracy.rsi
|
||||
@@ -553,6 +562,7 @@
|
||||
components:
|
||||
- type: Stamp
|
||||
stampedName: stamp-component-stamped-name-mime
|
||||
stampedColor: "#777777"
|
||||
stampState: "paper_stamp-mime"
|
||||
# TODO remove sound from mime's rubber stamp
|
||||
- type: Sprite
|
||||
@@ -566,6 +576,7 @@
|
||||
components:
|
||||
- type: Stamp
|
||||
stampedName: stamp-component-stamped-name-qm
|
||||
stampedColor: "#a23e3e"
|
||||
stampState: "paper_stamp-qm"
|
||||
- type: Sprite
|
||||
sprite: Objects/Misc/bureaucracy.rsi
|
||||
@@ -578,6 +589,7 @@
|
||||
components:
|
||||
- type: Stamp
|
||||
stampedName: stamp-component-stamped-name-rd
|
||||
stampedColor: "#1f66a0"
|
||||
stampState: "paper_stamp-rd"
|
||||
- type: Sprite
|
||||
sprite: Objects/Misc/bureaucracy.rsi
|
||||
@@ -590,6 +602,7 @@
|
||||
components:
|
||||
- type: Stamp
|
||||
stampedName: stamp-component-stamped-name-trader
|
||||
stampedColor: "#000000"
|
||||
stampState: "paper_stamp-trader"
|
||||
- type: Sprite
|
||||
sprite: Objects/Misc/bureaucracy.rsi
|
||||
@@ -602,6 +615,7 @@
|
||||
components:
|
||||
- type: Stamp
|
||||
stampedName: stamp-component-stamped-name-syndicate
|
||||
stampedColor: "#850000"
|
||||
stampState: "paper_stamp-syndicate"
|
||||
- type: Sprite
|
||||
sprite: Objects/Misc/bureaucracy.rsi
|
||||
@@ -614,6 +628,7 @@
|
||||
components:
|
||||
- type: Stamp
|
||||
stampedName: stamp-component-stamped-name-warden
|
||||
stampedColor: "#5b0000"
|
||||
stampState: "paper_stamp-warden"
|
||||
- type: Sprite
|
||||
sprite: Objects/Misc/bureaucracy.rsi
|
||||
@@ -626,6 +641,7 @@
|
||||
components:
|
||||
- type: Stamp
|
||||
stampedName: stamp-component-stamped-name-approved
|
||||
stampedColor: "#00be00"
|
||||
stampState: "paper_stamp-ok"
|
||||
- type: Sprite
|
||||
sprite: Objects/Misc/bureaucracy.rsi
|
||||
@@ -638,6 +654,7 @@
|
||||
components:
|
||||
- type: Stamp
|
||||
stampedName: stamp-component-stamped-name-denied
|
||||
stampedColor: "#a23e3e"
|
||||
stampState: "paper_stamp-deny"
|
||||
- type: Sprite
|
||||
sprite: Objects/Misc/bureaucracy.rsi
|
||||
|
||||
@@ -71,3 +71,8 @@
|
||||
id: Stealth
|
||||
kind: source
|
||||
path: "/Textures/Shaders/stealth.swsl"
|
||||
|
||||
- type: shader
|
||||
id: PaperStamp
|
||||
kind: source
|
||||
path: "/Textures/Shaders/paperstamp.swsl"
|
||||
|
||||
103
Resources/Textures/Interface/Paper/paper_stamp_border.svg
Normal file
103
Resources/Textures/Interface/Paper/paper_stamp_border.svg
Normal file
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="35.0625"
|
||||
height="34"
|
||||
viewBox="0 0 35.0625 34"
|
||||
fill="none"
|
||||
version="1.1"
|
||||
id="svg4"
|
||||
sodipodi:docname="paper_stamp_border.svg"
|
||||
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
|
||||
inkscape:export-filename="paper_stamp_border.svg.96dpi.png"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<metadata
|
||||
id="metadata10">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs8">
|
||||
<inkscape:path-effect
|
||||
effect="powerclip"
|
||||
id="path-effect302"
|
||||
is_visible="true"
|
||||
lpeversion="1"
|
||||
inverse="true"
|
||||
flatten="false"
|
||||
hide_clip="false"
|
||||
message="Use fill-rule evenodd on <b>fill and stroke</b> dialog if no flatten result after convert clip to paths." />
|
||||
<clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath298">
|
||||
<rect
|
||||
x="2.6084003"
|
||||
y="2.5943766"
|
||||
width="26.783199"
|
||||
height="26.811247"
|
||||
rx="4.1848745"
|
||||
fill="#ffffff"
|
||||
id="rect300"
|
||||
style="display:none;stroke-width:0.837413"
|
||||
d="M 6.7932749,2.5943766 H 25.206725 c 2.318421,0 4.184875,1.866454 4.184875,4.1848745 V 25.220749 c 0,2.31842 -1.866454,4.184874 -4.184875,4.184874 H 6.7932749 c -2.3184205,0 -4.1848746,-1.866454 -4.1848746,-4.184874 V 6.7792511 c 0,-2.3184205 1.8664541,-4.1848745 4.1848746,-4.1848745 z" />
|
||||
<path
|
||||
id="lpe_path-effect302"
|
||||
style="stroke-width:0.837413"
|
||||
class="powerclip"
|
||||
d="M -5,-5 H 37 V 37 H -5 Z M 6.7932749,2.5943766 c -2.3184205,0 -4.1848746,1.866454 -4.1848746,4.1848745 V 25.220749 c 0,2.31842 1.8664541,4.184874 4.1848746,4.184874 H 25.206725 c 2.318421,0 4.184875,-1.866454 4.184875,-4.184874 V 6.7792511 c 0,-2.3184205 -1.866454,-4.1848745 -4.184875,-4.1848745 z" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1916"
|
||||
inkscape:window-height="1034"
|
||||
id="namedview6"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:zoom="15.527471"
|
||||
inkscape:cx="6.7300077"
|
||||
inkscape:cy="17.16313"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="44"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg4"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pagecheckerboard="true"
|
||||
inkscape:deskcolor="#d1d1d1" />
|
||||
<path
|
||||
x="0"
|
||||
y="0"
|
||||
width="32"
|
||||
height="32"
|
||||
rx="5"
|
||||
fill="#ffffff"
|
||||
id="rect2"
|
||||
clip-path="url(#clipPath298)"
|
||||
inkscape:path-effect="#path-effect302"
|
||||
d="m 5,0 h 22 c 2.77,0 5,2.23 5,5 v 22 c 0,2.77 -2.23,5 -5,5 H 5 C 2.23,32 0,29.77 0,27 V 5 C 0,2.23 2.23,0 5,0 Z"
|
||||
sodipodi:type="rect"
|
||||
transform="translate(1,1)" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 445 B |
53
Resources/Textures/Shaders/paperstamp.swsl
Normal file
53
Resources/Textures/Shaders/paperstamp.swsl
Normal file
@@ -0,0 +1,53 @@
|
||||
// Object position in screen space. Allows the noise to
|
||||
// have a constant screen-space size, without being
|
||||
// affected by the widget layout/position.
|
||||
uniform highp vec2 objCoord;
|
||||
|
||||
// Magic, well-known 2d random function; makes perlin-like noise
|
||||
highp vec2 random(highp vec2 uv){
|
||||
uv = vec2( dot(uv, vec2(127.1,311.7) ),
|
||||
dot(uv, vec2(269.5,183.3) ) );
|
||||
return -1.0 + 2.0 * fract(sin(uv) * 43758.5453123);
|
||||
}
|
||||
|
||||
highp float noise(highp vec2 uv) {
|
||||
highp vec2 uv_i = floor(uv);
|
||||
highp vec2 uv_f = fract(uv);
|
||||
|
||||
highp vec2 t = smoothstep(0.0, 1.0, uv_f);
|
||||
|
||||
// Sample the random function and run a bilinear filter to smooth it out
|
||||
highp float tl = dot( random(uv_i + vec2(0.0,0.0) ), uv_f - vec2(0.0,0.0) );
|
||||
highp float tr = dot( random(uv_i + vec2(1.0,0.0) ), uv_f - vec2(1.0,0.0) );
|
||||
highp float bl = dot( random(uv_i + vec2(0.0,1.0) ), uv_f - vec2(0.0,1.0) );
|
||||
highp float br = dot( random(uv_i + vec2(1.0,1.0) ), uv_f - vec2(1.0,1.0) );
|
||||
|
||||
highp float tA = mix( tl, tr, t.x );
|
||||
highp float tB = mix( bl, br, t.x );
|
||||
return mix( tA, tB, t.y ) + 0.5;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
// Stamps have orientation, and the texture sampling is nearest
|
||||
// pixel, so run a bilinear filter to smooth out the edges.
|
||||
{
|
||||
highp vec4 tl = texture2D(TEXTURE, UV);
|
||||
highp vec4 tr = texture2D(TEXTURE, UV + vec2(TEXTURE_PIXEL_SIZE.x, 0.0));
|
||||
highp vec4 bl = texture2D(TEXTURE, UV + vec2(0.0, TEXTURE_PIXEL_SIZE.y));
|
||||
highp vec4 br = texture2D(TEXTURE, UV + TEXTURE_PIXEL_SIZE);
|
||||
|
||||
highp vec2 textureSize = 1.0 / TEXTURE_PIXEL_SIZE;
|
||||
highp vec2 f = fract( UV * textureSize );
|
||||
highp vec4 tA = mix( tl, tr, f.x );
|
||||
highp vec4 tB = mix( bl, br, f.x );
|
||||
COLOR = mix( tA, tB, f.y );
|
||||
}
|
||||
|
||||
// Add a bit of noise to mimic imperfect contact with the paper
|
||||
{
|
||||
float stampNoise = noise((FRAGCOORD.xy - objCoord) * vec2(0.03, 0.03)) *
|
||||
noise((FRAGCOORD.xy - objCoord) * vec2(0.08, 0.08));
|
||||
COLOR.a *= min(0.9, 0.4 + smoothstep(0.05, 0.3, stampNoise));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user