New UI for tokens and tiles

This commit is contained in:
Nicole Collings 2020-03-11 12:36:59 -07:00
parent c5807bdafc
commit 5c785762f0
110 changed files with 2583 additions and 680 deletions

BIN
favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,12 +1,10 @@
<html lang="en">
<head>
<link rel="icon" href="/favicon.ico">
<title>DND Mapper</title>
<script src="lib/phaser.min.js"></script>
<script src="lib/jquery.min.js"></script>
<script src="tool.js"></script>
<style>
html, body {
background-color: #333;
background-color: #000;
margin: 0;
height: 100vh;
display: block;
@ -16,7 +14,19 @@
width: 100%;
height: 100%;
}
@charset "utf-8";
@font-face {
font-family: Zepha;
src: url(/res/Zepha.ttf) format("truetype");
}
</style>
<script src="lib/phaser.min.js"></script>
<script src="lib/jquery.min.js"></script>
<script src="tool.js"></script>
</head>
<body><div id="game"></div></body>
<body>
<div id="game" />
<!-- <p>The quick brown fox jumps over the lazy dog. How dare it? I mean, what gives it the fucking right to jump over whatever it wants to? Somebody needs to teach that fox some manners! The dog would have never done that to it. Fuck man, society is fucking gay.</p> -->
</body>
</html>

BIN
res/Zepha.ttf Normal file

Binary file not shown.

19
res/_assets.txt Normal file
View File

@ -0,0 +1,19 @@
cursor
grid_tile
FOLDERPREFIX ui ui_
ui/button_grid
ui/button_side_menu 21 18
ui/history_manipulation 39 18
ui/mode_switch 39 18
ui/quick_selector
ui/text_box 100 6
ui/text_input 100 6
ui/sidebar_bg 68 21
ui/sidebar_cursor
ui/sidebar_overlay
FOLDERPREFIX tileset tileset_
tileset/0
tileset/1
tileset/2

BIN
res/dice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

BIN
res/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
res/font.zip Normal file

Binary file not shown.

105
res/font/font0.fnt Normal file
View File

@ -0,0 +1,105 @@
<font>
<info face="font" size="72" bold="0" italic="0" charset="" unicode="" stretchH="100" smooth="1" aa="1" padding="2,2,2,2" spacing="0,0" outline="0"/>
<common lineHeight="56.95" base="32" scaleW="155" scaleH="504" pages="1" packed="0"/>
<pages>
<page id="0" file="font.png"/>
</pages>
<chars count="95">
<char id="32" x="2" y="2" width="0" height="0" xoffset="0" yoffset="31.5" xadvance="22.5" page="0" chnl="15"/>
<char id="33" x="2" y="4" width="5" height="27" xoffset="0" yoffset="4.5" xadvance="9" page="0" chnl="15"/>
<char id="34" x="2" y="33" width="14" height="9" xoffset="0" yoffset="4.5" xadvance="18" page="0" chnl="15"/>
<char id="35" x="9" y="2" width="23" height="23" xoffset="0" yoffset="4.5" xadvance="27" page="0" chnl="15"/>
<char id="36" x="2" y="44" width="23" height="32" xoffset="0" yoffset="0" xadvance="27" page="0" chnl="15"/>
<char id="37" x="2" y="78" width="14" height="23" xoffset="0" yoffset="9" xadvance="18" page="0" chnl="15"/>
<char id="38" x="2" y="103" width="23" height="27" xoffset="0" yoffset="4.5" xadvance="27" page="0" chnl="15"/>
<char id="39" x="18" y="27" width="5" height="9" xoffset="0" yoffset="4.5" xadvance="9" page="0" chnl="15"/>
<char id="40" x="2" y="132" width="14" height="27" xoffset="0" yoffset="4.5" xadvance="18" page="0" chnl="15"/>
<char id="41" x="2" y="161" width="14" height="27" xoffset="0" yoffset="4.5" xadvance="18" page="0" chnl="15"/>
<char id="42" x="25" y="27" width="14" height="14" xoffset="0" yoffset="13.5" xadvance="18" page="0" chnl="15"/>
<char id="43" x="34" y="2" width="14" height="14" xoffset="0" yoffset="13.5" xadvance="18" page="0" chnl="15"/>
<char id="44" x="18" y="78" width="9" height="9" xoffset="0" yoffset="27" xadvance="13.5" page="0" chnl="15"/>
<char id="45" x="34" y="18" width="14" height="5" xoffset="0" yoffset="18" xadvance="18" page="0" chnl="15"/>
<char id="46" x="18" y="89" width="5" height="5" xoffset="0" yoffset="27" xadvance="9" page="0" chnl="15"/>
<char id="47" x="27" y="43" width="14" height="27" xoffset="0" yoffset="4.5" xadvance="18" page="0" chnl="15"/>
<char id="48" x="2" y="190" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="49" x="18" y="132" width="14" height="27" xoffset="0" yoffset="4.5" xadvance="18" page="0" chnl="15"/>
<char id="50" x="18" y="161" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="51" x="27" y="89" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="52" x="34" y="118" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="53" x="43" y="25" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="54" x="43" y="54" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="55" x="47" y="83" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="56" x="63" y="2" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="57" x="63" y="31" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="58" x="50" y="2" width="5" height="18" xoffset="0" yoffset="13.5" xadvance="9" page="0" chnl="15"/>
<char id="59" x="2" y="219" width="9" height="23" xoffset="-4.5" yoffset="13.5" xadvance="9" page="0" chnl="15"/>
<char id="60" x="29" y="72" width="9" height="14" xoffset="0" yoffset="13.5" xadvance="13.5" page="0" chnl="15"/>
<char id="61" x="63" y="60" width="14" height="14" xoffset="0" yoffset="13.5" xadvance="18" page="0" chnl="15"/>
<char id="62" x="2" y="244" width="9" height="14" xoffset="0" yoffset="13.5" xadvance="13.5" page="0" chnl="15"/>
<char id="63" x="2" y="260" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="64" x="13" y="219" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="65" x="22" y="190" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="66" x="38" y="147" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="67" x="54" y="112" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="68" x="67" y="76" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="69" x="83" y="2" width="14" height="27" xoffset="0" yoffset="4.5" xadvance="18" page="0" chnl="15"/>
<char id="70" x="83" y="31" width="14" height="27" xoffset="0" yoffset="4.5" xadvance="18" page="0" chnl="15"/>
<char id="71" x="2" y="289" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="72" x="2" y="318" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="73" x="2" y="347" width="14" height="27" xoffset="0" yoffset="4.5" xadvance="18" page="0" chnl="15"/>
<char id="74" x="2" y="376" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="75" x="18" y="347" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="76" x="22" y="248" width="14" height="27" xoffset="0" yoffset="4.5" xadvance="18" page="0" chnl="15"/>
<char id="77" x="33" y="219" width="23" height="27" xoffset="0" yoffset="4.5" xadvance="27" page="0" chnl="15"/>
<char id="78" x="42" y="176" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="79" x="58" y="141" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="80" x="74" y="105" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="81" x="87" y="60" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="82" x="99" y="2" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="83" x="99" y="31" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="84" x="22" y="277" width="14" height="27" xoffset="0" yoffset="4.5" xadvance="18" page="0" chnl="15"/>
<char id="85" x="22" y="306" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="86" x="38" y="248" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="87" x="38" y="277" width="23" height="27" xoffset="0" yoffset="4.5" xadvance="27" page="0" chnl="15"/>
<char id="88" x="58" y="205" width="23" height="27" xoffset="0" yoffset="4.5" xadvance="27" page="0" chnl="15"/>
<char id="89" x="62" y="170" width="23" height="27" xoffset="0" yoffset="4.5" xadvance="27" page="0" chnl="15"/>
<char id="90" x="78" y="134" width="18" height="27" xoffset="0" yoffset="4.5" xadvance="22.5" page="0" chnl="15"/>
<char id="91" x="58" y="234" width="9" height="27" xoffset="0" yoffset="4.5" xadvance="13.5" page="0" chnl="15"/>
<char id="92" x="94" y="89" width="14" height="27" xoffset="0" yoffset="4.5" xadvance="18" page="0" chnl="15"/>
<char id="93" x="107" y="60" width="9" height="27" xoffset="0" yoffset="4.5" xadvance="13.5" page="0" chnl="15"/>
<char id="94" x="42" y="205" width="14" height="9" xoffset="0" yoffset="4.5" xadvance="18" page="0" chnl="15"/>
<char id="95" x="78" y="163" width="14" height="5" xoffset="0" yoffset="27" xadvance="18" page="0" chnl="15"/>
<char id="96" x="22" y="335" width="9" height="5" xoffset="0" yoffset="18" xadvance="13.5" page="0" chnl="15"/>
<char id="97" x="2" y="405" width="14" height="18" xoffset="0" yoffset="13.5" xadvance="18" page="0" chnl="15"/>
<char id="98" x="2" y="425" width="14" height="27" xoffset="0" yoffset="4.5" xadvance="18" page="0" chnl="15"/>
<char id="99" x="2" y="454" width="14" height="18" xoffset="0" yoffset="13.5" xadvance="18" page="0" chnl="15"/>
<char id="100" x="2" y="474" width="14" height="27" xoffset="0" yoffset="4.5" xadvance="18" page="0" chnl="15"/>
<char id="101" x="18" y="405" width="14" height="18" xoffset="0" yoffset="13.5" xadvance="18" page="0" chnl="15"/>
<char id="102" x="22" y="376" width="9" height="23" xoffset="0" yoffset="9" xadvance="13.5" page="0" chnl="15"/>
<char id="103" x="33" y="376" width="14" height="27" xoffset="0" yoffset="13.5" xadvance="18" page="0" chnl="15"/>
<char id="104" x="38" y="335" width="14" height="27" xoffset="0" yoffset="4.5" xadvance="18" page="0" chnl="15"/>
<char id="105" x="42" y="306" width="5" height="27" xoffset="0" yoffset="4.5" xadvance="9" page="0" chnl="15"/>
<char id="106" x="18" y="425" width="9" height="32" xoffset="0" yoffset="4.5" xadvance="13.5" page="0" chnl="15"/>
<char id="107" x="49" y="306" width="14" height="23" xoffset="0" yoffset="9" xadvance="18" page="0" chnl="15"/>
<char id="108" x="63" y="263" width="5" height="27" xoffset="0" yoffset="4.5" xadvance="9" page="0" chnl="15"/>
<char id="109" x="69" y="234" width="23" height="18" xoffset="0" yoffset="13.5" xadvance="27" page="0" chnl="15"/>
<char id="110" x="83" y="199" width="18" height="18" xoffset="0" yoffset="13.5" xadvance="22.5" page="0" chnl="15"/>
<char id="111" x="87" y="170" width="18" height="18" xoffset="0" yoffset="13.5" xadvance="22.5" page="0" chnl="15"/>
<char id="112" x="98" y="118" width="14" height="27" xoffset="0" yoffset="13.5" xadvance="18" page="0" chnl="15"/>
<char id="113" x="110" y="89" width="18" height="27" xoffset="0" yoffset="13.5" xadvance="22.5" page="0" chnl="15"/>
<char id="114" x="98" y="147" width="14" height="18" xoffset="0" yoffset="13.5" xadvance="18" page="0" chnl="15"/>
<char id="115" x="118" y="60" width="14" height="18" xoffset="0" yoffset="13.5" xadvance="18" page="0" chnl="15"/>
<char id="116" x="18" y="459" width="9" height="23" xoffset="0" yoffset="9" xadvance="13.5" page="0" chnl="15"/>
<char id="117" x="18" y="484" width="18" height="18" xoffset="0" yoffset="13.5" xadvance="22.5" page="0" chnl="15"/>
<char id="118" x="119" y="2" width="18" height="18" xoffset="0" yoffset="13.5" xadvance="22.5" page="0" chnl="15"/>
<char id="119" x="119" y="22" width="23" height="18" xoffset="0" yoffset="13.5" xadvance="27" page="0" chnl="15"/>
<char id="120" x="139" y="2" width="14" height="18" xoffset="0" yoffset="13.5" xadvance="18" page="0" chnl="15"/>
<char id="121" x="29" y="425" width="14" height="27" xoffset="0" yoffset="13.5" xadvance="18" page="0" chnl="15"/>
<char id="122" x="34" y="405" width="14" height="18" xoffset="0" yoffset="13.5" xadvance="18" page="0" chnl="15"/>
<char id="123" x="49" y="364" width="14" height="32" xoffset="0" yoffset="0" xadvance="18" page="0" chnl="15"/>
<char id="124" x="29" y="454" width="5" height="27" xoffset="0" yoffset="4.5" xadvance="9" page="0" chnl="15"/>
<char id="125" x="38" y="454" width="14" height="32" xoffset="0" yoffset="0" xadvance="18" page="0" chnl="15"/>
<char id="126" x="63" y="292" width="18" height="9" xoffset="0" yoffset="13.5" xadvance="22.5" page="0" chnl="15"/>
<char id="32" x="0" y="0" width="0" height="0" xoffset="0" yoffset="13.5" xadvance="22.5" page="0" chnl="15"/>
</chars>
</font>

BIN
res/font/font0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

105
res/font/font1.fnt Normal file
View File

@ -0,0 +1,105 @@
<font>
<info face="font" size="72" bold="0" italic="0" charset="" unicode="" stretchH="100" smooth="1" aa="1" padding="2,2,2,2" spacing="0,0" outline="0"/>
<common lineHeight="113.91" base="63" scaleW="355" scaleH="512" pages="1" packed="0"/>
<pages>
<page id="0" file="font.png"/>
</pages>
<chars count="95">
<char id="32" x="2" y="2" width="0" height="0" xoffset="0" yoffset="63" xadvance="45" page="0" chnl="15"/>
<char id="33" x="2" y="4" width="9" height="54" xoffset="0" yoffset="9" xadvance="18" page="0" chnl="15"/>
<char id="34" x="2" y="60" width="27" height="18" xoffset="0" yoffset="9" xadvance="36" page="0" chnl="15"/>
<char id="35" x="13" y="2" width="45" height="45" xoffset="0" yoffset="9" xadvance="54" page="0" chnl="15"/>
<char id="36" x="2" y="80" width="45" height="63" xoffset="0" yoffset="0" xadvance="54" page="0" chnl="15"/>
<char id="37" x="2" y="145" width="27" height="45" xoffset="0" yoffset="18" xadvance="36" page="0" chnl="15"/>
<char id="38" x="2" y="192" width="45" height="54" xoffset="0" yoffset="9" xadvance="54" page="0" chnl="15"/>
<char id="39" x="31" y="49" width="9" height="18" xoffset="0" yoffset="9" xadvance="18" page="0" chnl="15"/>
<char id="40" x="2" y="248" width="27" height="54" xoffset="0" yoffset="9" xadvance="36" page="0" chnl="15"/>
<char id="41" x="2" y="304" width="27" height="54" xoffset="0" yoffset="9" xadvance="36" page="0" chnl="15"/>
<char id="42" x="42" y="49" width="27" height="27" xoffset="0" yoffset="27" xadvance="36" page="0" chnl="15"/>
<char id="43" x="60" y="2" width="27" height="27" xoffset="0" yoffset="27" xadvance="36" page="0" chnl="15"/>
<char id="44" x="31" y="145" width="18" height="18" xoffset="0" yoffset="54" xadvance="27" page="0" chnl="15"/>
<char id="45" x="60" y="31" width="27" height="9" xoffset="0" yoffset="36" xadvance="36" page="0" chnl="15"/>
<char id="46" x="31" y="69" width="9" height="9" xoffset="0" yoffset="54" xadvance="18" page="0" chnl="15"/>
<char id="47" x="49" y="78" width="27" height="54" xoffset="0" yoffset="9" xadvance="36" page="0" chnl="15"/>
<char id="48" x="2" y="360" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="49" x="2" y="416" width="27" height="54" xoffset="0" yoffset="9" xadvance="36" page="0" chnl="15"/>
<char id="50" x="31" y="416" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="51" x="31" y="248" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="52" x="31" y="304" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="53" x="40" y="360" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="54" x="49" y="165" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="55" x="69" y="416" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="56" x="78" y="42" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="57" x="78" y="98" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="58" x="89" y="2" width="9" height="36" xoffset="0" yoffset="27" xadvance="18" page="0" chnl="15"/>
<char id="59" x="69" y="221" width="18" height="45" xoffset="-9" yoffset="27" xadvance="18" page="0" chnl="15"/>
<char id="60" x="51" y="134" width="18" height="27" xoffset="0" yoffset="27" xadvance="27" page="0" chnl="15"/>
<char id="61" x="100" y="2" width="27" height="27" xoffset="0" yoffset="27" xadvance="36" page="0" chnl="15"/>
<char id="62" x="2" y="472" width="18" height="27" xoffset="0" yoffset="27" xadvance="27" page="0" chnl="15"/>
<char id="63" x="87" y="154" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="64" x="69" y="268" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="65" x="89" y="210" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="66" x="78" y="324" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="67" x="107" y="266" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="68" x="116" y="31" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="69" x="116" y="87" width="27" height="54" xoffset="0" yoffset="9" xadvance="36" page="0" chnl="15"/>
<char id="70" x="125" y="143" width="27" height="54" xoffset="0" yoffset="9" xadvance="36" page="0" chnl="15"/>
<char id="71" x="145" y="87" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="72" x="127" y="199" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="73" x="154" y="143" width="27" height="54" xoffset="0" yoffset="9" xadvance="36" page="0" chnl="15"/>
<char id="74" x="154" y="2" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="75" x="107" y="380" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="76" x="116" y="322" width="27" height="54" xoffset="0" yoffset="9" xadvance="36" page="0" chnl="15"/>
<char id="77" x="107" y="436" width="45" height="54" xoffset="0" yoffset="9" xadvance="54" page="0" chnl="15"/>
<char id="78" x="145" y="255" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="79" x="165" y="199" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="80" x="145" y="311" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="81" x="145" y="367" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="82" x="154" y="423" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="83" x="183" y="58" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="84" x="192" y="2" width="27" height="54" xoffset="0" yoffset="9" xadvance="36" page="0" chnl="15"/>
<char id="85" x="183" y="114" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="86" x="183" y="255" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="87" x="203" y="170" width="45" height="54" xoffset="0" yoffset="9" xadvance="54" page="0" chnl="15"/>
<char id="88" x="183" y="311" width="45" height="54" xoffset="0" yoffset="9" xadvance="54" page="0" chnl="15"/>
<char id="89" x="183" y="367" width="45" height="54" xoffset="0" yoffset="9" xadvance="54" page="0" chnl="15"/>
<char id="90" x="221" y="226" width="36" height="54" xoffset="0" yoffset="9" xadvance="45" page="0" chnl="15"/>
<char id="91" x="192" y="423" width="18" height="54" xoffset="0" yoffset="9" xadvance="27" page="0" chnl="15"/>
<char id="92" x="212" y="423" width="27" height="54" xoffset="0" yoffset="9" xadvance="36" page="0" chnl="15"/>
<char id="93" x="230" y="282" width="18" height="54" xoffset="0" yoffset="9" xadvance="27" page="0" chnl="15"/>
<char id="94" x="154" y="58" width="27" height="18" xoffset="0" yoffset="9" xadvance="36" page="0" chnl="15"/>
<char id="95" x="78" y="380" width="27" height="9" xoffset="0" yoffset="54" xadvance="36" page="0" chnl="15"/>
<char id="96" x="49" y="221" width="18" height="9" xoffset="0" yoffset="36" xadvance="27" page="0" chnl="15"/>
<char id="97" x="22" y="472" width="27" height="36" xoffset="0" yoffset="27" xadvance="36" page="0" chnl="15"/>
<char id="98" x="230" y="338" width="27" height="54" xoffset="0" yoffset="9" xadvance="36" page="0" chnl="15"/>
<char id="99" x="51" y="472" width="27" height="36" xoffset="0" yoffset="27" xadvance="36" page="0" chnl="15"/>
<char id="100" x="250" y="282" width="27" height="54" xoffset="0" yoffset="9" xadvance="36" page="0" chnl="15"/>
<char id="101" x="241" y="394" width="27" height="36" xoffset="0" yoffset="27" xadvance="36" page="0" chnl="15"/>
<char id="102" x="259" y="338" width="18" height="45" xoffset="0" yoffset="18" xadvance="27" page="0" chnl="15"/>
<char id="103" x="241" y="432" width="27" height="54" xoffset="0" yoffset="27" xadvance="36" page="0" chnl="15"/>
<char id="104" x="270" y="385" width="27" height="54" xoffset="0" yoffset="9" xadvance="36" page="0" chnl="15"/>
<char id="105" x="270" y="441" width="9" height="54" xoffset="0" yoffset="9" xadvance="18" page="0" chnl="15"/>
<char id="106" x="281" y="441" width="18" height="63" xoffset="0" yoffset="9" xadvance="27" page="0" chnl="15"/>
<char id="107" x="221" y="2" width="27" height="45" xoffset="0" yoffset="18" xadvance="36" page="0" chnl="15"/>
<char id="108" x="221" y="49" width="9" height="54" xoffset="0" yoffset="9" xadvance="18" page="0" chnl="15"/>
<char id="109" x="221" y="105" width="45" height="36" xoffset="0" yoffset="27" xadvance="54" page="0" chnl="15"/>
<char id="110" x="232" y="49" width="36" height="36" xoffset="0" yoffset="27" xadvance="45" page="0" chnl="15"/>
<char id="111" x="250" y="2" width="36" height="36" xoffset="0" yoffset="27" xadvance="45" page="0" chnl="15"/>
<char id="112" x="250" y="143" width="27" height="54" xoffset="0" yoffset="27" xadvance="36" page="0" chnl="15"/>
<char id="113" x="268" y="87" width="36" height="54" xoffset="0" yoffset="27" xadvance="45" page="0" chnl="15"/>
<char id="114" x="270" y="40" width="27" height="36" xoffset="0" yoffset="27" xadvance="36" page="0" chnl="15"/>
<char id="115" x="288" y="2" width="27" height="36" xoffset="0" yoffset="27" xadvance="36" page="0" chnl="15"/>
<char id="116" x="299" y="40" width="18" height="45" xoffset="0" yoffset="18" xadvance="27" page="0" chnl="15"/>
<char id="117" x="317" y="2" width="36" height="36" xoffset="0" yoffset="27" xadvance="45" page="0" chnl="15"/>
<char id="118" x="259" y="199" width="36" height="36" xoffset="0" yoffset="27" xadvance="45" page="0" chnl="15"/>
<char id="119" x="259" y="237" width="45" height="36" xoffset="0" yoffset="27" xadvance="54" page="0" chnl="15"/>
<char id="120" x="279" y="143" width="27" height="36" xoffset="0" yoffset="27" xadvance="36" page="0" chnl="15"/>
<char id="121" x="306" y="87" width="27" height="54" xoffset="0" yoffset="27" xadvance="36" page="0" chnl="15"/>
<char id="122" x="319" y="40" width="27" height="36" xoffset="0" yoffset="27" xadvance="36" page="0" chnl="15"/>
<char id="123" x="279" y="275" width="27" height="63" xoffset="0" yoffset="0" xadvance="36" page="0" chnl="15"/>
<char id="124" x="297" y="181" width="9" height="54" xoffset="0" yoffset="9" xadvance="18" page="0" chnl="15"/>
<char id="125" x="299" y="340" width="27" height="63" xoffset="0" yoffset="0" xadvance="36" page="0" chnl="15"/>
<char id="126" x="80" y="492" width="36" height="18" xoffset="0" yoffset="27" xadvance="45" page="0" chnl="15"/>
<char id="32" x="0" y="0" width="0" height="0" xoffset="0" yoffset="27" xadvance="45" page="0" chnl="15"/>
</chars>
</font>

BIN
res/font/font1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

105
res/font/font2.fnt Normal file
View File

@ -0,0 +1,105 @@
<font>
<info face="font" size="72" bold="0" italic="0" charset="" unicode="" stretchH="100" smooth="1" aa="1" padding="2,2,2,2" spacing="0,0" outline="0"/>
<common lineHeight="170.86" base="95" scaleW="725" scaleH="510" pages="1" packed="0"/>
<pages>
<page id="0" file="font.png"/>
</pages>
<chars count="95">
<char id="32" x="2" y="2" width="0" height="0" xoffset="0" yoffset="94.5" xadvance="67.5" page="0" chnl="15"/>
<char id="33" x="2" y="4" width="14" height="81" xoffset="0" yoffset="13.5" xadvance="27" page="0" chnl="15"/>
<char id="34" x="2" y="87" width="41" height="27" xoffset="0" yoffset="13.5" xadvance="54" page="0" chnl="15"/>
<char id="35" x="18" y="2" width="68" height="68" xoffset="0" yoffset="13.5" xadvance="81" page="0" chnl="15"/>
<char id="36" x="2" y="116" width="68" height="95" xoffset="0" yoffset="0" xadvance="81" page="0" chnl="15"/>
<char id="37" x="2" y="213" width="41" height="68" xoffset="0" yoffset="27" xadvance="54" page="0" chnl="15"/>
<char id="38" x="2" y="283" width="68" height="81" xoffset="0" yoffset="13.5" xadvance="81" page="0" chnl="15"/>
<char id="39" x="45" y="72" width="14" height="27" xoffset="0" yoffset="13.5" xadvance="27" page="0" chnl="15"/>
<char id="40" x="2" y="366" width="41" height="81" xoffset="0" yoffset="13.5" xadvance="54" page="0" chnl="15"/>
<char id="41" x="45" y="366" width="41" height="81" xoffset="0" yoffset="13.5" xadvance="54" page="0" chnl="15"/>
<char id="42" x="61" y="72" width="41" height="41" xoffset="0" yoffset="40.5" xadvance="54" page="0" chnl="15"/>
<char id="43" x="2" y="449" width="41" height="41" xoffset="0" yoffset="40.5" xadvance="54" page="0" chnl="15"/>
<char id="44" x="45" y="449" width="27" height="27" xoffset="0" yoffset="81" xadvance="40.5" page="0" chnl="15"/>
<char id="45" x="2" y="492" width="41" height="14" xoffset="0" yoffset="54" xadvance="54" page="0" chnl="15"/>
<char id="46" x="45" y="478" width="14" height="14" xoffset="0" yoffset="81" xadvance="27" page="0" chnl="15"/>
<char id="47" x="72" y="115" width="41" height="81" xoffset="0" yoffset="13.5" xadvance="54" page="0" chnl="15"/>
<char id="48" x="104" y="2" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="49" x="72" y="198" width="41" height="81" xoffset="0" yoffset="13.5" xadvance="54" page="0" chnl="15"/>
<char id="50" x="72" y="281" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="51" x="88" y="364" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="52" x="115" y="85" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="53" x="160" y="2" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="54" x="115" y="168" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="55" x="128" y="251" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="56" x="171" y="85" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="57" x="216" y="2" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="58" x="88" y="2" width="14" height="54" xoffset="0" yoffset="40.5" xadvance="27" page="0" chnl="15"/>
<char id="59" x="171" y="168" width="27" height="68" xoffset="-13.5" yoffset="40.5" xadvance="27" page="0" chnl="15"/>
<char id="60" x="74" y="449" width="27" height="41" xoffset="0" yoffset="40.5" xadvance="40.5" page="0" chnl="15"/>
<char id="61" x="103" y="447" width="41" height="41" xoffset="0" yoffset="40.5" xadvance="54" page="0" chnl="15"/>
<char id="62" x="144" y="334" width="27" height="41" xoffset="0" yoffset="40.5" xadvance="40.5" page="0" chnl="15"/>
<char id="63" x="146" y="377" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="64" x="184" y="238" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="65" x="227" y="85" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="66" x="272" y="2" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="67" x="202" y="321" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="68" x="202" y="404" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="69" x="240" y="168" width="41" height="81" xoffset="0" yoffset="13.5" xadvance="54" page="0" chnl="15"/>
<char id="70" x="258" y="251" width="41" height="81" xoffset="0" yoffset="13.5" xadvance="54" page="0" chnl="15"/>
<char id="71" x="283" y="85" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="72" x="328" y="2" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="73" x="283" y="168" width="41" height="81" xoffset="0" yoffset="13.5" xadvance="54" page="0" chnl="15"/>
<char id="74" x="258" y="334" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="75" x="301" y="251" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="76" x="326" y="168" width="41" height="81" xoffset="0" yoffset="13.5" xadvance="54" page="0" chnl="15"/>
<char id="77" x="339" y="85" width="68" height="81" xoffset="0" yoffset="13.5" xadvance="81" page="0" chnl="15"/>
<char id="78" x="384" y="2" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="79" x="258" y="417" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="80" x="314" y="334" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="81" x="357" y="251" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="82" x="369" y="168" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="83" x="409" y="85" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="84" x="440" y="2" width="41" height="81" xoffset="0" yoffset="13.5" xadvance="54" page="0" chnl="15"/>
<char id="85" x="314" y="417" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="86" x="370" y="334" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="87" x="413" y="251" width="68" height="81" xoffset="0" yoffset="13.5" xadvance="81" page="0" chnl="15"/>
<char id="88" x="425" y="168" width="68" height="81" xoffset="0" yoffset="13.5" xadvance="81" page="0" chnl="15"/>
<char id="89" x="465" y="85" width="68" height="81" xoffset="0" yoffset="13.5" xadvance="81" page="0" chnl="15"/>
<char id="90" x="483" y="2" width="54" height="81" xoffset="0" yoffset="13.5" xadvance="67.5" page="0" chnl="15"/>
<char id="91" x="370" y="417" width="27" height="81" xoffset="0" yoffset="13.5" xadvance="40.5" page="0" chnl="15"/>
<char id="92" x="399" y="417" width="41" height="81" xoffset="0" yoffset="13.5" xadvance="54" page="0" chnl="15"/>
<char id="93" x="426" y="334" width="27" height="81" xoffset="0" yoffset="13.5" xadvance="40.5" page="0" chnl="15"/>
<char id="94" x="146" y="460" width="41" height="27" xoffset="0" yoffset="13.5" xadvance="54" page="0" chnl="15"/>
<char id="95" x="45" y="494" width="41" height="14" xoffset="0" yoffset="81" xadvance="54" page="0" chnl="15"/>
<char id="96" x="173" y="334" width="27" height="14" xoffset="0" yoffset="54" xadvance="40.5" page="0" chnl="15"/>
<char id="97" x="442" y="417" width="41" height="54" xoffset="0" yoffset="40.5" xadvance="54" page="0" chnl="15"/>
<char id="98" x="455" y="334" width="41" height="81" xoffset="0" yoffset="13.5" xadvance="54" page="0" chnl="15"/>
<char id="99" x="483" y="251" width="41" height="54" xoffset="0" yoffset="40.5" xadvance="54" page="0" chnl="15"/>
<char id="100" x="495" y="168" width="41" height="81" xoffset="0" yoffset="13.5" xadvance="54" page="0" chnl="15"/>
<char id="101" x="535" y="85" width="41" height="54" xoffset="0" yoffset="40.5" xadvance="54" page="0" chnl="15"/>
<char id="102" x="200" y="168" width="27" height="68" xoffset="0" yoffset="27" xadvance="40.5" page="0" chnl="15"/>
<char id="103" x="539" y="2" width="41" height="81" xoffset="0" yoffset="40.5" xadvance="54" page="0" chnl="15"/>
<char id="104" x="485" y="417" width="41" height="81" xoffset="0" yoffset="13.5" xadvance="54" page="0" chnl="15"/>
<char id="105" x="498" y="307" width="14" height="81" xoffset="0" yoffset="13.5" xadvance="27" page="0" chnl="15"/>
<char id="106" x="514" y="307" width="27" height="95" xoffset="0" yoffset="13.5" xadvance="40.5" page="0" chnl="15"/>
<char id="107" x="528" y="404" width="41" height="68" xoffset="0" yoffset="27" xadvance="54" page="0" chnl="15"/>
<char id="108" x="538" y="141" width="14" height="81" xoffset="0" yoffset="13.5" xadvance="27" page="0" chnl="15"/>
<char id="109" x="526" y="251" width="68" height="54" xoffset="0" yoffset="40.5" xadvance="81" page="0" chnl="15"/>
<char id="110" x="543" y="307" width="54" height="54" xoffset="0" yoffset="40.5" xadvance="67.5" page="0" chnl="15"/>
<char id="111" x="554" y="141" width="54" height="54" xoffset="0" yoffset="40.5" xadvance="67.5" page="0" chnl="15"/>
<char id="112" x="596" y="197" width="41" height="81" xoffset="0" yoffset="40.5" xadvance="54" page="0" chnl="15"/>
<char id="113" x="582" y="2" width="54" height="81" xoffset="0" yoffset="40.5" xadvance="67.5" page="0" chnl="15"/>
<char id="114" x="578" y="85" width="41" height="54" xoffset="0" yoffset="40.5" xadvance="54" page="0" chnl="15"/>
<char id="115" x="610" y="141" width="41" height="54" xoffset="0" yoffset="40.5" xadvance="54" page="0" chnl="15"/>
<char id="116" x="638" y="2" width="27" height="68" xoffset="0" yoffset="27" xadvance="40.5" page="0" chnl="15"/>
<char id="117" x="621" y="85" width="54" height="54" xoffset="0" yoffset="40.5" xadvance="67.5" page="0" chnl="15"/>
<char id="118" x="667" y="2" width="54" height="54" xoffset="0" yoffset="40.5" xadvance="67.5" page="0" chnl="15"/>
<char id="119" x="571" y="363" width="68" height="54" xoffset="0" yoffset="40.5" xadvance="81" page="0" chnl="15"/>
<char id="120" x="599" y="280" width="41" height="54" xoffset="0" yoffset="40.5" xadvance="54" page="0" chnl="15"/>
<char id="121" x="639" y="197" width="41" height="81" xoffset="0" yoffset="40.5" xadvance="54" page="0" chnl="15"/>
<char id="122" x="653" y="141" width="41" height="54" xoffset="0" yoffset="40.5" xadvance="54" page="0" chnl="15"/>
<char id="123" x="641" y="336" width="41" height="95" xoffset="0" yoffset="0" xadvance="54" page="0" chnl="15"/>
<char id="124" x="677" y="58" width="14" height="81" xoffset="0" yoffset="13.5" xadvance="27" page="0" chnl="15"/>
<char id="125" x="682" y="197" width="41" height="95" xoffset="0" yoffset="0" xadvance="54" page="0" chnl="15"/>
<char id="126" x="528" y="474" width="54" height="27" xoffset="0" yoffset="40.5" xadvance="67.5" page="0" chnl="15"/>
<char id="32" x="0" y="0" width="0" height="0" xoffset="0" yoffset="40.5" xadvance="67.5" page="0" chnl="15"/>
</chars>
</font>

BIN
res/font/font2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 B

BIN
res/grid_tile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

BIN
res/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 516 B

BIN
res/splash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

BIN
res/splash.xcf Normal file

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 813 B

After

Width:  |  Height:  |  Size: 813 B

BIN
res/tileset/floor_grass.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
res/tileset/ground_dirt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
res/tileset/ground_dirt.xcf Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

BIN
res/tileset/wall_stone.xcf Normal file

Binary file not shown.

BIN
res/tileset/wall_wood.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
res/tileset/wall_wood.xcf Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

BIN
res/token/armor_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
res/token/bones.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

BIN
res/token/cadin_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
res/token/cadin_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
res/token/cadin_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
res/token/cleric_female.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
res/token/cleric_male.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
res/token/dragonfolk_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
res/token/dragonfolk_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
res/token/dragonfolk_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
res/token/drawf_m_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
res/token/druid_male.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
res/token/dwarf_m_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
res/token/dwarf_m_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 951 B

BIN
res/token/feline_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
res/token/knight_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
res/token/naexi_anthro.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
res/token/robot_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
res/token/rockfriend_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

BIN
res/token/rockfriend_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

BIN
res/token/rockfriend_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 782 B

BIN
res/token/rockfriend_4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 952 B

BIN
res/token/skeleton.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

BIN
res/token/tori_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
res/token/tori_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
res/token/tori_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
res/token/tori_4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
res/token/treasure.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

BIN
res/token/wizard_female.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
res/token/wizard_male.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
res/ui/button_generic.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 755 B

BIN
res/ui/button_grid.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 967 B

BIN
res/ui/button_side_menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
res/ui/quick_selector.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

BIN
res/ui/sidebar_bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

BIN
res/ui/sidebar_cursor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

BIN
res/ui/sidebar_folder.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

BIN
res/ui/sidebar_overlay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

BIN
res/ui/text_box.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

BIN
res/ui/text_input.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

58
src/Chat.ts Normal file
View File

@ -0,0 +1,58 @@
class Chat extends Phaser.GameObjects.Container {
textInput: TextInput;
messageContainer: Phaser.GameObjects.Container;
messages: ChatBox[] = [];
constructor(scene: MainScene, x: number, y: number) {
super(scene, x, y);
this.textInput = new TextInput(scene, 0, 0);
this.list.push(this.textInput);
this.messageContainer = new Phaser.GameObjects.Container(scene, 0, 0);
this.list.push(this.messageContainer);
}
update() {
this.textInput.y = -this.textInput.getHeight();
this.messageContainer.y = this.textInput.y - 3;
}
pushMessage(message: string): void {
this.messages.unshift(new ChatBox(this.scene, 0, 0, message));
this.messageContainer.list.push(this.messages[0]);
this.scene.tweens.add({
targets: this.messages[0],
alpha: {from: 0, to: 1},
ease: 'Cubic',
duration: 300,
repeat: 0
});
this.reflowMessages();
}
reflowMessages(): void {
let y = 0;
for (let message of this.messages) {
y -= message.getHeight() + 9;
if (y + message.getHeight() < -400) {
this.scene.tweens.add({
targets: message,
alpha: 0,
ease: 'Cubic',
duration: 300,
repeat: 0
});
}
this.scene.tweens.add({
targets: message,
y: y,
ease: 'Cubic',
duration: 300,
repeat: 0
});
}
}
}

76
src/Chatbox.ts Normal file
View File

@ -0,0 +1,76 @@
class ChatBox extends Phaser.GameObjects.Container {
str: string;
texture: string = "ui_text_box";
private FONT_SIZE = 4.3;
private chatboxHeight: number = 0;
constructor(scene: Phaser.Scene, x: number, y: number, str: string, tex?: string) {
super(scene, x, y);
this.str = str;
if (tex != undefined) this.texture = tex;
this.setText(str);
}
setText(text: string): void {
this.list.forEach((e) => e.destroy());
this.list = [];
this.str = text;
let testObj = new Phaser.GameObjects.BitmapText(this.scene, 15, 4, "font2x", "AB", this.FONT_SIZE, 0);
const letterWidth = testObj.getTextBounds().global.width / 2;
const maxLetters = 95 / letterWidth;
const split = this.str.split(/( )/g);
let lines = [];
function nextLine() {
let newLine = "";
while (`${newLine} ${split[0]}`.length < maxLetters && split.length) newLine += split.shift();
lines.push(newLine.trim());
if (split.length) nextLine();
}
nextLine();
let top = new Phaser.GameObjects.Sprite(this.scene, 0, 0, this.texture, 0);
top.setScale(3, 3);
top.setOrigin(0, 0);
top.setAlpha(0.6);
this.list.push(top);
let i = 0;
for (let line of lines) {
let elem = new Phaser.GameObjects.BitmapText(this.scene, 12, 7 + i * 18, "font2x", line, this.FONT_SIZE, 0);
elem.setScale(3, 3);
elem.setOrigin(0, 0);
this.list.push(elem);
i++;
}
let lastElem = (this.list[this.list.length - 1] as Phaser.GameObjects.BitmapText);
let height = Math.max(lastElem.y + lastElem.getTextBounds().global.height - 36, 2);
let middle = new Phaser.GameObjects.Sprite(this.scene, 0, 18, "ui_text_box", 1);
middle.setScale(3, height / 6);
middle.setOrigin(0, 0);
middle.setAlpha(0.6);
this.list.push(middle);
this.sendToBack(middle);
let bottom = new Phaser.GameObjects.Sprite(this.scene, 0, height + 18, this.texture, 2);
bottom.setScale(3, 3);
bottom.setOrigin(0, 0);
bottom.setAlpha(0.6);
this.list.push(bottom);
this.sendToBack(bottom);
this.chatboxHeight = height + 18 * 2;
}
getHeight() {
return this.chatboxHeight;
}
}

View File

@ -10,26 +10,64 @@ class HistoryElement {
}
undo() {
console.log("Undo", this.type);
if (this.type == "tile") {
for (let tile of this.data as {pos: Vec2, solid: boolean}[]) {
this.scene.map.setSolid(tile.pos.x, tile.pos.y, !tile.solid);
for (let tile of this.data as {pos: Vec2, solid: boolean, oldSolid: boolean, palette: number, oldPalette: number}[])
this.scene.map.setSolid(tile.pos.x, tile.pos.y, tile.oldPalette, tile.oldSolid);
}
else if (this.type == "token_modify") {
let data = this.data as { old: string, new: string };
let uuid = JSON.parse(this.data.old).uuid;
for (let token of this.scene.tokens) {
if (token.uuid == uuid) {
token.loadSerializedData(this.data.old);
return;
}
}
let token = new Token(this.scene, 0, 0, "");
token.loadSerializedData(this.data.old);
this.scene.add.existing(token);
this.scene.tokens.push(token);
}
else if (this.type == "token_create") {
let uuid = JSON.parse(this.data.data).uuid;
for (let i = 0; i < this.scene.tokens.length; i++) {
if (this.scene.tokens[i].uuid == uuid) {
this.scene.tokens[i].destroy();
this.scene.tokens.splice(i, 1);
}
}
else if (this.type == "token_move") {
let data = this.data as { start: Vec2, end: Vec2, token: Token }
data.token.setPosition(data.start.x, data.start.y);
}
}
redo() {
console.log("Redo", this.type);
if (this.type == "tile") {
for (let tile of this.data as {pos: Vec2, solid: boolean}[]) {
this.scene.map.setSolid(tile.pos.x, tile.pos.y, tile.solid);
for (let tile of this.data as {pos: Vec2, solid: boolean, wasSolid: boolean, palette: number, oldPalette: number}[])
this.scene.map.setSolid(tile.pos.x, tile.pos.y, tile.palette, tile.solid);
}
else if (this.type == "token_modify") {
let data = this.data as { old: string, new: string };
let uuid = JSON.parse(this.data.old).uuid;
for (let token of this.scene.tokens) {
if (token.uuid == uuid) {
token.loadSerializedData(this.data.new);
return;
}
}
else if (this.type == "token_move") {
let data = this.data as { start: Vec2, end: Vec2, token: Token }
data.token.setPosition(data.end.x, data.end.y);
let token = new Token(this.scene, 0, 0, "");
token.loadSerializedData(this.data.new);
this.scene.add.existing(token);
this.scene.tokens.push(token);
}
else if (this.type == "token_create") {
let data = JSON.parse(this.data.data);
let token = new Token(this.scene, 0, 0, "");
token.loadSerializedData(this.data.data);
this.scene.add.existing(token);
this.scene.tokens.push(token);
}
}
}

View File

@ -1,175 +0,0 @@
// class IntroScene extends Phaser.Scene {
// stars: Star[] = [];
// pickups: Pickup[] = [];
// spark: Spark;
// text: Phaser.GameObjects.Text;
// speed: number;
// angleChange: number;
// controllingSpark: boolean;
// animationRange: number;
// starAngle: number;
// collided: boolean;
// canDie: boolean;
// constructor() {
// super({key: "IntroScene"});
// }
// preload(): void {
// this.load.spritesheet("star", "res/star.png", {frameWidth: 8, frameHeight: 8, startFrame: 0, endFrame: 16});
// this.load.spritesheet("spark", "res/spark.png", {frameWidth: 16, frameHeight: 16, startFrame: 0, endFrame: 64});
// this.load.spritesheet("pickup", "res/pickup.png", {frameWidth: 16, frameHeight: 16});
// }
// create(): void {
// this.stars = [];
// this.pickups = [];
// this.speed = 0.25;
// this.angleChange = 0.001;
// this.controllingSpark = false;
// this.animationRange = -1;
// this.starAngle = -(Math.PI / 1.5);
// this.collided = false;
// this.canDie = false;
// //@ts-ignore
// $("#game").removeClass('active');
// for (let i = 0; i < 200; i++) {
// let x = Math.round(Math.random() * (this.cameras.main.width / 4));
// let y = Math.round(Math.random() * (this.cameras.main.height / 4));
// this.stars.push(new Star(this, x, y));
// }
// for (let i = 0; i < 8; i++) {
// let x = Math.round(Math.random() * (this.cameras.main.width / 4));
// let y = Math.round(Math.random() * (this.cameras.main.height / 4));
// this.pickups.push(new Pickup(this, x, y));
// }
// this.spark = new Spark(this, this.cameras.main.width / 2, this.cameras.main.height / 2);
// // this.text = this.add.text(4, 4, this.collisions.toString());
// }
// update(time: number, delta: number): void {
// if (this.input.mousePointer.primaryDown && !this.controllingSpark) {
// if (this.input.mousePointer.x > this.cameras.main.width / 2 - 16
// && this.input.mousePointer.x < this.cameras.main.width / 2 + 16
// && this.input.mousePointer.y > this.cameras.main.height / 2 - 16
// && this.input.mousePointer.y < this.cameras.main.height / 2 + 16) {
// this.controllingSpark = true;
// this.canDie = true;
// //@ts-ignore
// $("#game").addClass('active');
// this.animationRange = 0;
// }
// }
// if (this.controllingSpark) {
// this.spark.setPosition(Math.round(this.input.mousePointer.x / 4) * 4, Math.round(this.input.mousePointer.y / 4) * 4);
// }
// if (this.animationRange != -1) {
// if (!this.collided) {
// this.fadeIn(this.animationRange*this.cameras.main.width);
// this.animationRange += 0.02;
// if (this.animationRange >= 1) this.animationRange = -1;
// }
// else {
// this.fadeOut(this.animationRange*this.cameras.main.width);
// this.animationRange -= 0.05;
// if (this.animationRange <= 0) this.scene.restart();
// }
// }
// if (this.speed < 5) {
// if (this.controllingSpark) {
// this.starAngle += this.angleChange;
// this.speed *= 1.001;
// this.angleChange *= 1.000005;
// }
// }
// else {
// this.controllingSpark = false;
// this.canDie = false;
// this.starAngle = Math.PI * 1.5;
// this.speed *= 1.02;
// if (this.speed < 10) this.spark.moveToCenter();
// if (this.speed > 10) this.spark.y += this.speed;
// if (this.speed > 15) this.spark.explode();
// let hexColor = Phaser.Display.Color.Interpolate.ColorWithColor(new Phaser.Display.Color(15, 11, 31), new Phaser.Display.Color(255, 255, 255), 30, Math.min(Math.max(this.speed - 10, 0), 30));
// this.cameras.main.setBackgroundColor(hexColor);
// if (this.speed >= 60) {
// this.game.scene.start('MainScene');
// this.game.scene.stop('IntroScene');
// this.game.scene.swapPosition('MainScene', 'IntroScene');
// return;
// }
// }
// let yOff = Math.sin(this.starAngle);
// let xOff = Math.cos(this.starAngle);
// for (let star of this.stars) {
// star.push(xOff * this.speed, yOff * this.speed);
// star.stayOnScreen();
// }
// for (let pickup of this.pickups) {
// pickup.push(xOff * this.speed, yOff * this.speed);
// if (this.canDie) {
// let distance = Math.sqrt(Math.pow(Math.abs(pickup.x - this.spark.x), 2)
// + Math.pow(Math.abs(pickup.y - this.spark.y), 2));
// if (distance < 32 && !this.collided) {
// this.collided = true;
// this.animationRange = 0.7;
// this.controllingSpark = false;
// this.spark.explode();
// }
// }
// }
// }
// fadeIn(range: number) {
// for (let star of this.stars) {
// let distance = Math.sqrt(Math.pow(Math.abs(star.x - this.cameras.main.width/2), 2)
// + Math.pow(Math.abs(star.y - this.cameras.main.height/2), 2));
// if (range > distance && range < distance + 200) star.fadeIn();
// if (range > distance + 200) star.fadeReg();
// }
// for (let pickup of this.pickups) {
// let distance = Math.sqrt(Math.pow(Math.abs(pickup.x - this.cameras.main.width/2), 2)
// + Math.pow(Math.abs(pickup.y - this.cameras.main.height/2), 2));
// if (range + 200 > distance) pickup.makeExists();
// }
// let hexColor = Phaser.Display.Color.Interpolate.ColorWithColor(new Phaser.Display.Color(0, 0, 0), new Phaser.Display.Color(15, 11, 31), 1, this.animationRange);
// this.cameras.main.setBackgroundColor(hexColor);
// }
// fadeOut(range: number) {
// for (let star of this.stars) {
// let distance = Math.sqrt(Math.pow(Math.abs(star.x - this.cameras.main.width/2), 2)
// + Math.pow(Math.abs(star.y - this.cameras.main.height/2), 2));
// if (range > distance && range < distance + 200) star.fadeIn();
// if (range < distance) star.fadeOut();
// }
// for (let i = 0; i < this.pickups.length; i++) {
// let pickup = this.pickups[i];
// let distance = Math.sqrt(Math.pow(Math.abs(pickup.x - this.cameras.main.width/2), 2)
// + Math.pow(Math.abs(pickup.y - this.cameras.main.height/2), 2));
// if (range - 200 < distance) {
// pickup.setAlpha(0);
// }
// }
// let hexColor = Phaser.Display.Color.Interpolate.ColorWithColor(new Phaser.Display.Color(0, 0, 0), new Phaser.Display.Color(15, 11, 31), 0.8, this.animationRange);
// this.cameras.main.setBackgroundColor(hexColor);
// }
// }

View File

@ -1,22 +0,0 @@
class LoadScene extends Phaser.Scene {
constructor() {
super({key: "LoadScene"});
}
preload(): void {
this.cameras.main.setBackgroundColor("#300");
//TODO: Find out why loaded assets aren't propogating
}
create(): void {
this.game.scene.start('MainScene');
this.game.scene.stop('LoadScene');
this.game.scene.swapPosition('MainScene', 'LoadScene');
}
update(time: number, delta: number): void {
}
}

View File

@ -10,7 +10,7 @@ window.onload = () => {
parent: "game",
backgroundColor: "#000000",
antialias: false,
scene: [MainScene, LoadScene],
scene: [GetAssetsScene, LoadScene, MainScene],
physics: {
default: "arcade",
arcade: {

View File

@ -4,20 +4,30 @@ class OutlinePipeline extends Phaser.Renderer.WebGL.Pipelines.TextureTintPipelin
renderer: game.renderer,
fragShader: `
precision mediump float;
uniform sampler2D uMainSampler;
varying vec2 outTexCoord;
void main(void) {
vec4 color = texture2D(uMainSampler, outTexCoord);
vec4 colorU = texture2D(uMainSampler, vec2(outTexCoord.x, outTexCoord.y - 0.055));
vec4 colorD = texture2D(uMainSampler, vec2(outTexCoord.x, outTexCoord.y + 0.055));
vec4 colorL = texture2D(uMainSampler, vec2(outTexCoord.x + 0.055, outTexCoord.y));
vec4 colorR = texture2D(uMainSampler, vec2(outTexCoord.x - 0.055, outTexCoord.y));
gl_FragColor = color;
uniform sampler2D uMainSampler;
uniform float tex_size;
varying vec2 outTexCoord;
void main(void) {
float factor = 1.0 / tex_size;
vec4 color = texture2D(uMainSampler, outTexCoord);
vec4 colorU = texture2D(uMainSampler, vec2(outTexCoord.x, outTexCoord.y + factor));
vec4 colorD = texture2D(uMainSampler, vec2(outTexCoord.x, outTexCoord.y - factor));
vec4 colorL = texture2D(uMainSampler, vec2(outTexCoord.x + factor, outTexCoord.y));
vec4 colorR = texture2D(uMainSampler, vec2(outTexCoord.x - factor, outTexCoord.y));
if (color.a == 0.0 && (colorU.a != 0.0 || colorD.a != 0.0 || colorL.a != 0.0 || colorR.a != 0.0) ) {
gl_FragColor = vec4(1.0, 1.0, 1.0, .2);
}
else {
if (color.a == 0.0) discard;
color += vec4(0.1, 0.1, 0.1, 0);
gl_FragColor = color;
}
}`
};
super(config);

25
src/TextInput.ts Normal file
View File

@ -0,0 +1,25 @@
class TextInput extends ChatBox {
text: string = "";
constructor(scene: Phaser.Scene, x: number, y: number) {
super(scene, x, y, " ", "ui_text_input");
document.addEventListener("keydown", (e) => {
let code = e.keyCode;
if (code == 8) {
this.text = this.text.substr(0, this.text.length - 1);
this.setText(this.text);
return;
}
else if (code == 13) {
//Send
return;
}
else if (e.key.length != 1) return;
this.text += e.key;
this.setText(this.text.length == 0 ? " " : this.text);
})
}
}

View File

@ -1,5 +1,5 @@
class TileMap {
scene: Phaser.Scene;
scene: MainScene;
key: string;
dimensions: {x: number, y: number}
@ -7,94 +7,116 @@ class TileMap {
SOLID: number = 10;
map: Phaser.Tilemaps.Tilemap;
layer: Phaser.Tilemaps.DynamicTilemapLayer;
layers: (Phaser.Tilemaps.DynamicTilemapLayer | null)[] = [];
constructor(key: string, scene: Phaser.Scene, xwid: number, ywid: number) {
solid_at: boolean[][];
palette_at: number[][];
constructor(key: string, scene: MainScene, xwid: number, ywid: number) {
this.key = key;
this.scene = scene;
this.dimensions = {x: xwid, y: ywid};
this.map = this.scene.add.tilemap(null, 16, 16, 0, 0);
let tileset = this.map.addTilesetImage("tileset", "tileset", 16, 16, 0, 0);
this.layer = this.map.createBlankDynamicLayer("layer_0", "tileset", 0, 0, 50*16, 50*16, 16, 16);
this.layer.setScale(4, 4);
this.layer.setInteractive();
// this.map.addTilesetImage("grid_tile", "grid_tile", 16, 16, 0, 0);
// this.map.setLayer("grid");
// let gridlayer = this.map.createBlankDynamicLayer("grid", "grid_tile", 0, 0, 50*16, 50*16, 16, 16);
// gridlayer.setScale(4, 4);
// for (let i = 0; i < xwid; i++) {
// for (let j = 0; j < ywid; j++) {
// if ((j % 2 == 0 && i % 2 == 0) || (j % 2 != 0 && i % 2 != 0)) gridlayer.putTileAt(0, i, j);
// }
// }
this.solid_at = [];
this.palette_at = [];
for (let i = 0; i < xwid; i++) {
this.solid_at[i] = [];
this.palette_at[i] = [];
for (let j = 0; j < ywid; j++) {
this.solid_at[i][j] = false;
this.palette_at[i][j] = 1;
}
}
fillMap(tid?: number): void {
if (!tid) tid = this.SOLID;
this.map = this.scene.add.tilemap(null, 16, 16, 0, 0);
for (let i = 0; i < this.scene.TILESET_COUNT; i++) {
let tileset = this.map.addTilesetImage("tileset_" + i, "tileset_" + i, 16, 16, 0, 0);
this.layers[i] = null;
}
this.createLayer(0);
this.layers[0].setInteractive();
this.map.addTilesetImage("grid_tile", "grid_tile", 16, 16, 0, 0);
this.map.setLayer("grid");
let gridlayer = this.map.createBlankDynamicLayer("grid", "grid_tile", 0, 0, 50*16, 50*16, 16, 16);
gridlayer.setScale(4, 4);
gridlayer.setDepth(500);
for (let i = 0; i < xwid; i++) {
for (let j = 0; j < ywid; j++) {
if ((j % 2 == 0 && i % 2 == 0) || (j % 2 != 0 && i % 2 != 0)) gridlayer.putTileAt(0, i, j);
}
}
for (let x = 0; x < this.dimensions.x; x ++) {
for (let y = 0; y < this.dimensions.y; y ++) {
this.setTile(x, y, tid);
this.setTile(x, y, 1, 13);
}
}
}
setSolid(x: number, y: number, solid: boolean): boolean {
let alreadySolid = this.getSolid(x, y);
if (alreadySolid == solid) return false;
private createLayer(palette: number) {
this.map.setLayer("layer_" + palette);
this.layers[palette] = this.map.createBlankDynamicLayer("layer_" + palette, "tileset_" + palette, 0, 0, 50*16, 50*16, 16, 16);
this.layers[palette].setScale(4, 4);
this.layers[palette].setDepth(-500 + palette);
}
if (solid) this.setTile(x, y, this.SOLID);
else this.setTile(x, y, 13);
setSolid(x: number, y: number, palette: number, solid: boolean): boolean {
if (x < 0 || y < 0 || x > this.dimensions.x - 1 || y > this.dimensions.y - 1) return false;
let oldPalette = this.palette_at[x][y];
let wasSolid = this.solid_at[x][y];
if (wasSolid == solid && palette == oldPalette) return false;
this.setTile(x, y, palette, (solid ? this.SOLID : 13));
this.calculateEdgesAround(x, y);
return true;
}
getSolid(x: number, y: number) {
return this.getTile(x, y) == this.SOLID;
getSolid(x: number, y: number): number {
if (x < 0 || y < 0 || x > this.dimensions.x - 1 || y > this.dimensions.y - 1) return -1;
return (this.solid_at[x][y]) ? this.palette_at[x][y] : -1;
}
private setTile(x: number, y: number, tid: number): void {
this.layer.removeTileAt(x, y, true);
this.layer.putTileAt(tid, x, y);
getPalette(x: number, y: number): number {
if (x < 0 || y < 0 || x > this.dimensions.x - 1 || y > this.dimensions.y - 1) return -1;
return this.palette_at[x][y];
}
private getTile(x: number, y: number): number {
if (x < 0 || y < 0 || x > this.dimensions.x - 1 || y > this.dimensions.y - 1) return this.SOLID;
return this.layer.getTileAt(x, y, true).index;
private setTile(x: number, y: number, palette: number, tid: number): void {
if (this.layers[palette] == null) this.createLayer(palette);
this.layers[this.palette_at[x][y]].removeTileAt(x, y, true);
this.layers[palette].putTileAt(tid, x, y);
this.palette_at[x][y] = palette;
this.solid_at[x][y] = tid == this.SOLID;
}
private calculateEdgesAround(x: number, y: number) {
for (let i = clamp(x - 1, this.dimensions.x - 1, 0); i <= clamp(x + 1, this.dimensions.x + 1, 0); i++) {
for (let j = clamp(y - 1, this.dimensions.y - 1, 0); j <= clamp(y + 1, this.dimensions.y + 1, 0); j++) {
this.calculateEdges(i, j);
for (let i = clamp(x - 1, this.dimensions.x - 1, 0); i <= clamp(x + 1, this.dimensions.x - 1, 0); i++) {
for (let j = clamp(y - 1, this.dimensions.y - 1, 0); j <= clamp(y + 1, this.dimensions.y - 1, 0); j++) {
let tile = this.calculateEdges(i, j);
if (tile != -1) this.setTile(i, j, this.palette_at[i][j], tile);
}
}
}
private getSurroundingTiles(x: number, y: number): number[] {
let tiles: number[] = [];
for (let i = -1; i <= 1; i++) {
for (let j = -1; j <= 1; j++) {
tiles.push(this.getTile(x + j, y + i));
}
}
return tiles;
}
private getSurroundingSolid(x: number, y: number): boolean[] {
let tiles: (number|boolean)[] = this.getSurroundingTiles(x, y);
for (let i = 0; i < 9; i++) {
tiles[i] = (tiles[i] == this.SOLID);
let solid: boolean[] = [];
for (let i = -1; i <= 1; i++) {
for (let j = -1; j <= 1; j++) {
solid.push(this.getSolid(x + j, y + i) != -1);
}
return tiles as boolean[];
}
return solid;
}
private calculateEdges(x: number, y: number): void {
if (this.getTile(x, y) == this.SOLID) return;
private calculateEdges(x: number, y: number): number {
if (this.getSolid(x, y) != -1) return -1;
let adjacents = this.getSurroundingSolid(x, y);
let tile = 13;
@ -188,7 +210,7 @@ class TileMap {
}
else if (adjacents[8] /*Bottom right*/) tile = 0;
this.setTile(x, y, tile);
return tile;
}
}

14
src/TilesetPatcher.ts Normal file
View File

@ -0,0 +1,14 @@
class TilesetPatcher {
constructor(scene: Phaser.Scene) {
let renderTex = new Phaser.GameObjects.RenderTexture(scene, 0, 0, 9 * 16, 7 * 16 * 8);
renderTex.drawFrame("tileset_0", 0, 0, 7 * 16 * 0);
renderTex.drawFrame("tileset_1", 0, 0, 7 * 16 * 1);
renderTex.drawFrame("tileset_2", 0, 0, 7 * 16 * 2);
scene.add.existing(renderTex);
// scene.textures.addRenderTexture("tileset_16x", renderTex);
// let spr = scene.add.sprite(300, 300, "tileset_16x");
// console.log(spr);
}
}

View File

@ -1,35 +1,73 @@
interface SerializedToken {
uuid: string,
sprite: string,
frame: number,
x: number,
y: number
}
class Token extends Phaser.GameObjects.Container {
sprite: Phaser.GameObjects.Sprite;
shadow: Phaser.GameObjects.Sprite;
sprite: Phaser.GameObjects.Sprite | null = null;
shadow: Phaser.GameObjects.Sprite | null = null;
currentFrame: number = 0;
uuid: string;
width: number;
height: number;
constructor(scene: Phaser.Scene, x: number, y: number, tex: string) {
super(scene, x, y);
this.setTexture(tex);
this.shadow = new Phaser.GameObjects.Sprite(scene, -4, -4, tex);
this.uuid = generateId(32);
}
private setTexture(tex: string) {
if (this.shadow != null) this.shadow.setTexture(tex);
else {
this.shadow = new Phaser.GameObjects.Sprite(this.scene, -4, -4, tex);
this.shadow.setOrigin(0, 0);
this.shadow.setScale(4, 1);
this.shadow.setTint(0x000000);
this.shadow.setAlpha(0.1, 0.1, 0.3, 0.3);
this.list.push(this.shadow);
}
this.width = this.shadow.width * 4;
this.height = this.shadow.height * 4;
this.shadow.y = this.height - 24;
this.sprite = new Phaser.GameObjects.Sprite(scene, -4, -4, tex);
if (this.sprite != null) this.sprite.setTexture(tex);
else {
this.sprite = new Phaser.GameObjects.Sprite(this.scene, -4, -4, tex);
this.sprite.setOrigin(0, 0);
this.sprite.setScale(4, 4);
this.setPosition(x, y);
this.setPosition(this.x / 4, this.y / 4);
this.list.push(this.sprite);
}
}
this.scene.add.existing(this);
setFrame(frame: number) {
this.currentFrame = frame;
this.sprite.setFrame(frame);
this.shadow.setFrame(frame);
}
getFrame(): number {
return this.currentFrame;
}
frameCount(): number {
return Object.keys(this.sprite.texture.frames).length - 1;
}
toggleOutline(outline: boolean) {
if (outline) this.sprite.setPipeline("outline");
if (outline) {
this.sprite.setPipeline("outline");
this.sprite.pipeline.setFloat1("tex_size", this.sprite.texture.source[0].width);
}
else this.sprite.resetPipeline();
}
@ -41,4 +79,30 @@ class Token extends Phaser.GameObjects.Container {
getPosition(): Vec2 {
return new Vec2(this.x / 4, this.y / 4);
}
// For converting token to / from serialized data
serialize(): string {
return JSON.stringify(({
uuid: this.uuid,
sprite: this.sprite.texture.key,
frame: this.currentFrame,
x: this.x / 4,
y: this.y / 4
} as SerializedToken));
}
static deserialize(scene: Phaser.Scene, serialized: string): Token {
let tkn = new Token(scene, 0, 0, "");
tkn.loadSerializedData(serialized);
return tkn;
}
loadSerializedData(serialized: string) {
let tbl: SerializedToken = JSON.parse(serialized);
this.uuid = tbl.uuid;
this.setTexture(tbl.sprite);
this.setFrame(tbl.frame)
this.setPosition(tbl.x, tbl.y);
}
}

View File

@ -1,12 +1,16 @@
class UIView {
scene: Phaser.Scene;
scene: MainScene;
camera: Phaser.Cameras.Scene2D.Camera;
o: Phaser.GameObjects.Container;
visibleMenu: number = 0;
uiActive: boolean = false;
constructor(scene) {
tileSidebar: UITileSidebar;
tokenSidebar: UITokenSidebar;
constructor(scene: MainScene) {
this.scene = scene;
this.camera = this.scene.cameras.add(0, 0, this.scene.cameras.main.width, this.scene.cameras.main.height, false, "ui_camera");
this.camera.scrollX = -10000;
@ -14,11 +18,83 @@ class UIView {
this.o = this.scene.add.container(-10000, 0);
}
createElements() {
this.o.add(new UIModeSwitchButton(this.scene, 14 + 10, 1));
this.o.add(new UIHistoryManipulation(this.scene, 14 + 25, 1));
this.tokenSidebar = new UITokenSidebar(this.scene, -205, 0);
this.o.add(this.tokenSidebar);
for (let t of TOKENS) {
this.tokenSidebar.addToken(t.key);
}
this.tileSidebar = new UITileSidebar(this.scene, 0, 0);
this.o.add(this.tileSidebar);
this.tileSidebar.addPalette(0);
this.tileSidebar.addPalette(1);
this.tileSidebar.addPalette(2);
}
update() {
this.uiActive = false;
for (let o of this.o.list) {
o.update();
if (!this.uiActive && (o as UIComponent).mouseIntersects()) this.uiActive = true;
}
if (this.visibleMenu != this.scene.mode) {
this.visibleMenu = this.scene.mode;
if (this.scene.mode == 0) {
this.displayArchitect();
this.hideToken();
}
else {
this.hideArchitect();
this.displayToken();
}
}
}
displayArchitect() {
this.o.bringToTop(this.tileSidebar);
this.scene.tweens.add({
targets: this.tileSidebar,
x: 0,
ease: 'Cubic',
duration: 300,
repeat: 0
});
}
hideToken() {
this.scene.tweens.add({
targets: this.tokenSidebar,
x: -205,
ease: 'Cubic',
duration: 300,
repeat: 0
});
}
displayToken() {
this.o.bringToTop(this.tokenSidebar);
this.scene.tweens.add({
targets: this.tokenSidebar,
x: 0,
ease: 'Cubic',
duration: 300,
repeat: 0
});
}
hideArchitect() {
this.scene.tweens.add({
targets: this.tileSidebar,
x: -205,
ease: 'Cubic',
duration: 300,
repeat: 0
});
}
}

View File

@ -6,3 +6,15 @@ function clamp(x: number, min: number, max: number) {
}
return Math.max(Math.min(x, max), min);
}
function dec2hex (dec) {
return ('0' + dec.toString(16)).substr(-2)
}
function generateId(len): string {
let arr = new Uint8Array((len || 40) / 2)
window.crypto.getRandomValues(arr);
let stringArr: string[] = [];
for (let i = 0; i < arr.length; i++) stringArr.push(dec2hex(arr[i]));
return stringArr.join('');
}

View File

@ -1,5 +1,5 @@
class WorldView {
scene: Phaser.Scene;
scene: MainScene;
camera: Phaser.Cameras.Scene2D.Camera;
cursorScreen: Vec2 = new Vec2();
@ -10,7 +10,7 @@ class WorldView {
zoomLevels: number[] = [10, 17, 25, 33, 40, 50, 60, 67, 75, 80, 90, 100, 110, 125, 150, 175, 200, 250, 300, 400, 500];
zoomLevel = 11;
constructor(scene) {
constructor(scene: MainScene) {
this.scene = scene;
this.camera = this.scene.cameras.main;
@ -27,10 +27,12 @@ class WorldView {
}
private onWheel(e: WheelEvent) {
if (!(this.scene.mode == 1 && this.scene.token.currentToken != null)) {
let dir = (e.deltaY < 0 ? 1 : -1);
this.zoomLevel = clamp(this.zoomLevel + dir, 0, this.zoomLevels.length - 1);
this.camera.setZoom(this.zoomLevels[this.zoomLevel] / 100);
}
}
private pan() {
if (this.scene.input.mousePointer.middleButtonDown()) {

46
src/data/TOKENS.ts Normal file
View File

@ -0,0 +1,46 @@
interface TokenFileProps {
name: string,
key: string,
file: string,
split_by?: number
}
const TOKENS: TokenFileProps[] = [
{ name: "Armor 1", key: "tkn_armor_1", file: "res/token/armor_1", split_by: 18 },
{ name: "Cadin 1", key: "tkn_cadin_1", file: "res/token/cadin_1", split_by: 18 },
{ name: "Cadin 2", key: "tkn_cadin_2", file: "res/token/cadin_2", split_by: 18 },
{ name: "Cadin 3", key: "tkn_cadin_3", file: "res/token/cadin_3", split_by: 18 },
{ name: "Cleric F", key: "tkn_cleric_f", file: "res/token/cleric_female", split_by: 18 },
{ name: "Cleric M", key: "tkn_cleric_m", file: "res/token/cleric_male", split_by: 18 },
{ name: "Dragonfolk 1", key: "tkn_dragonfolk_1", file: "res/token/dragonfolk_1", split_by: 18 },
{ name: "Dragonfolk 2", key: "tkn_dragonfolk_2", file: "res/token/dragonfolk_2", split_by: 18 },
{ name: "Dragonfolk 3", key: "tkn_dragonfolk_3", file: "res/token/dragonfolk_3", split_by: 18 },
{ name: "Tori 1", key: "tkn_tori_1", file: "res/token/tori_1", split_by: 18 },
{ name: "Tori 2", key: "tkn_tori_2", file: "res/token/tori_2", split_by: 18 },
{ name: "Tori 3", key: "tkn_tori_3", file: "res/token/tori_3", split_by: 18 },
{ name: "Tori 4", key: "tkn_tori_4", file: "res/token/tori_4", split_by: 18 },
{ name: "Dragonfolk Knight 1", key: "tkn_dragonknight_1", file: "res/token/dragonfolk_knight_1", split_by: 18 },
{ name: "Dragonfolk Knight 2", key: "tkn_dragonknight_2", file: "res/token/dragonfolk_knight_2", split_by: 18 },
{ name: "Dragonfolk Knight 3", key: "tkn_dragonknight_3", file: "res/token/dragonfolk_knight_3", split_by: 18 },
{ name: "Druid M", key: "tkn_druid_m", file: "res/token/druid_male", split_by: 18 },
{ name: "Feline 1", key: "tkn_feline_1", file: "res/token/feline_1", split_by: 18 },
{ name: "Knight 1", key: "tkn_knight_1", file: "res/token/knight_1", split_by: 18 },
{ name: "Robot 1", key: "tkn_robot_1", file: "res/token/robot_1", split_by: 18 },
{ name: "Rockfriend Green", key: "tkn_rockfriend_g", file: "res/token/rockfriend_1", split_by: 18 },
{ name: "Rockfriend Blue", key: "tkn_rockfriend_b", file: "res/token/rockfriend_2", split_by: 18 },
{ name: "Rockfriend Red", key: "tkn_rockfriend_r", file: "res/token/rockfriend_3", split_by: 18 },
{ name: "Rockfriend Teal", key: "tkn_rockfriend_t", file: "res/token/rockfriend_4", split_by: 18 },
{ name: "Wizard F", key: "tkn_wizard_f", file: "res/token/wizard_female", split_by: 18 },
{ name: "Wizard M", key: "tkn_wizard_m", file: "res/token/wizard_male", split_by: 18 },
{ name: "Cloaked Person", key: "tkn_cloaked_person", file: "res/token/cloaked_person", split_by: 18 },
{ name: "Dwarf M 1", key: "tkn_dwarf_m_1", file: "res/token/dwarf_m_1", split_by: 18 },
{ name: "Dwarf M 2", key: "tkn_dwarf_m_2", file: "res/token/dwarf_m_2", split_by: 18 },
{ name: "Skeleton", key: "tkn_skeleton", file: "res/token/skeleton", split_by: 18 },
{ name: "Naexi", key: "tkn_naexi", file: "res/token/naexi_human_noweapon", split_by: 18 },
{ name: "Naexi w/ Yklwa", key: "tkn_naexi_yklwa", file: "res/token/naexi_human_yklwa", split_by: 18 },
{ name: "Naexi Anthro Form", key: "tkn_naexi_anthro", file: "res/token/naexi_anthro", split_by: 18 },
{ name: "bones", key: "tkn_bones", file: "res/token/bones" },
{ name: "treasure", key: "tkn_treasure", file: "res/token/treasure" },
];

View File

@ -3,9 +3,14 @@ class ArchitectMode {
active: boolean = false;
cursor: Phaser.GameObjects.Sprite;
primitives: Phaser.GameObjects.Line[] = [];
startTilePos: Vec2 = new Vec2();
placeMode: string = "brush";
pointerDown: boolean = false;
manipulated: {pos: Vec2, solid: boolean}[] = [];
pointerPrimaryDown: boolean = false;
manipulated: {pos: Vec2, solid: boolean, oldSolid: boolean, palette: number, oldPalette: number}[] = [];
constructor(scene: MainScene) {
this.scene = scene;
@ -15,6 +20,11 @@ class ArchitectMode {
this.cursor.setScale(4, 4);
this.cursor.setDepth(1000);
this.cursor.setOrigin(0, 0);
this.scene.snapKey.addListener("down", () => { if (!this.scene.input.activePointer.isDown) this.placeMode = "line" });
this.scene.modifierKey.addListener("down", () => { if (!this.scene.input.activePointer.isDown) this.placeMode = "rect" });
this.scene.snapKey.addListener("up", () => { if (!this.scene.input.activePointer.isDown) this.placeMode = "brush" });
this.scene.modifierKey.addListener("up", () => { if (!this.scene.input.activePointer.isDown) this.placeMode = "brush" });
}
update() {
@ -27,15 +37,131 @@ class ArchitectMode {
this.cursor.setVisible((selectedTilePos.x >= 0 && selectedTilePos.y >= 0 &&
selectedTilePos.x < this.scene.map.dimensions.x && selectedTilePos.y < this.scene.map.dimensions.y));
if (this.scene.input.activePointer.isDown && !this.pointerDown) this.pointerDown = true;
// Place Tiles
switch(this.placeMode) {
case "brush": {
this.drawBrush(selectedTilePos);
break;
}
case "line": {
this.drawLine(selectedTilePos);
break;
}
case "rect": {
this.drawRect(selectedTilePos);
break;
}
}
// Push history to HistoryManager
if (this.scene.input.activePointer.isDown && !this.pointerDown) {
this.pointerDown = true;
this.pointerPrimaryDown = this.scene.input.activePointer.leftButtonDown();
}
else if (!this.scene.input.activePointer.isDown && this.pointerDown) {
if (this.manipulated.length != 0) {
this.scene.history.push("tile", this.manipulated);
this.manipulated = [];
}
this.pointerDown = false;
this.pointerPrimaryDown = false;
}
}
drawLine(selectedTilePos: Vec2) {
if (this.scene.input.mousePointer.leftButtonDown() || this.scene.input.mousePointer.rightButtonDown()) {
if (!this.pointerDown) this.startTilePos = selectedTilePos;
let a = new Vec2(this.startTilePos.x, this.startTilePos.y);
let b = new Vec2(selectedTilePos.x, selectedTilePos.y);
if (Math.abs(b.x - a.x) > Math.abs(b.y - a.y)) b.y = a.y;
else b.x = a.x;
this.cursor.setPosition(b.x * 64, b.y * 64);
this.primitives.forEach((v) => v.destroy());
this.primitives = [];
this.primitives.push(this.scene.add.line(0, 0, a.x + 0.5, a.y + 0.5, b.x + 0.5, b.y + 0.5, 0xffffff, 1));
this.primitives.forEach((v) => {
v.setOrigin(0, 0);
v.setScale(64, 64);
v.setLineWidth(0.03);
v.setDepth(300);
});
this.primitives.push(this.scene.add.sprite(this.startTilePos.x * 64, this.startTilePos.y * 64, "cursor") as any as Phaser.GameObjects.Line);
this.primitives[1].setOrigin(0, 0);
this.primitives[1].setScale(4, 4);
this.primitives[1].setAlpha(0.5);
}
else if (!this.scene.input.mousePointer.leftButtonDown() && !this.scene.input.mousePointer.rightButtonDown() && this.pointerDown) {
let a = new Vec2(this.startTilePos.x * 64, this.startTilePos.y * 64);
let b = new Vec2(selectedTilePos.x * 64, selectedTilePos.y * 64);
if (Math.abs(b.x - a.x) > Math.abs(b.y - a.y)) b.y = a.y;
else b.x = a.x;
let change = new Vec2(b.x - a.x, b.y - a.y);
let normalizeFactor = Math.sqrt(change.x * change.x + change.y * change.y);
change.x /= normalizeFactor;
change.y /= normalizeFactor;
while (Math.abs(b.x - a.x) >= 1 || Math.abs(b.y - a.y) >= 1) {
this.placeTileAndPushManip(new Vec2(Math.floor(a.x / 64), Math.floor(a.y / 64)), this.pointerPrimaryDown);
a.x += change.x;
a.y += change.y;
}
this.placeTileAndPushManip(new Vec2(b.x / 64, b.y / 64), this.pointerPrimaryDown);
this.primitives.forEach((v) => v.destroy());
this.primitives = [];
}
}
drawRect(selectedTilePos: Vec2) {
if (this.scene.input.mousePointer.leftButtonDown() || this.scene.input.mousePointer.rightButtonDown()) {
if (!this.pointerDown) this.startTilePos = selectedTilePos;
let a = new Vec2(Math.min(this.startTilePos.x, selectedTilePos.x), Math.min(this.startTilePos.y, selectedTilePos.y));
let b = new Vec2(Math.max(this.startTilePos.x, selectedTilePos.x), Math.max(this.startTilePos.y, selectedTilePos.y));
this.primitives.forEach((v) => v.destroy());
this.primitives = [];
const fac = 0.03;
this.primitives.push(this.scene.add.line(0, 0, a.x + fac, a.y + fac, b.x + 1 - fac, a.y + fac, 0xffffff, 1));
this.primitives.push(this.scene.add.line(0, 0, a.x + fac, a.y + fac / 2, a.x + fac, b.y + 1 - fac / 2, 0xffffff, 1));
this.primitives.push(this.scene.add.line(0, 0, a.x + fac, b.y + 1 - fac, b.x + 1 - fac, b.y + 1 - fac, 0xffffff, 1));
this.primitives.push(this.scene.add.line(0, 0, b.x + 1 - fac, a.y + fac / 2, b.x + 1 - fac, b.y + 1 - fac / 2, 0xffffff, 1));
this.primitives.forEach((v) => {
v.setOrigin(0, 0);
v.setScale(64, 64);
v.setLineWidth(0.03);
v.setDepth(300);
});
}
else if (!this.scene.input.mousePointer.leftButtonDown() && !this.scene.input.mousePointer.rightButtonDown() && this.pointerDown) {
let a = new Vec2(Math.min(this.startTilePos.x, selectedTilePos.x), Math.min(this.startTilePos.y, selectedTilePos.y));
let b = new Vec2(Math.max(this.startTilePos.x, selectedTilePos.x), Math.max(this.startTilePos.y, selectedTilePos.y));
for (let i = a.x; i <= b.x; i++) {
for (let j = a.y; j <= b.y; j++) {
this.placeTileAndPushManip(new Vec2(i, j), this.pointerPrimaryDown);
}
}
this.primitives.forEach((v) => v.destroy());
this.primitives = [];
}
}
drawBrush(selectedTilePos: Vec2) {
if (this.scene.input.mousePointer.leftButtonDown() || this.scene.input.mousePointer.rightButtonDown()) {
let change = new Vec2(this.scene.world.cursorWorld.x - this.scene.world.lastCursorWorld.x,
this.scene.world.cursorWorld.y - this.scene.world.lastCursorWorld.y);
@ -47,16 +173,30 @@ class ArchitectMode {
let place = new Vec2(this.scene.world.lastCursorWorld.x, this.scene.world.lastCursorWorld.y);
while (Math.abs(this.scene.world.cursorWorld.x - place.x) >= 1 || Math.abs(this.scene.world.cursorWorld.y - place.y) >= 1) {
if (this.scene.map.setSolid(Math.floor(place.x / 64), Math.floor(place.y / 64), this.scene.input.mousePointer.rightButtonDown())) {
this.manipulated.push({pos: new Vec2(Math.floor(place.x / 64), Math.floor(place.y / 64)), solid: this.scene.input.mousePointer.rightButtonDown()});
}
this.placeTileAndPushManip(new Vec2(Math.floor(place.x / 64), Math.floor(place.y / 64)), this.scene.input.mousePointer.leftButtonDown());
place.x += change.x;
place.y += change.y;
}
if (this.scene.map.setSolid(selectedTilePos.x, selectedTilePos.y, this.scene.input.mousePointer.rightButtonDown())) {
this.manipulated.push({pos: selectedTilePos, solid: this.scene.input.mousePointer.rightButtonDown()});
this.placeTileAndPushManip(new Vec2(selectedTilePos.x, selectedTilePos.y), this.scene.input.mousePointer.leftButtonDown());
}
}
placeTileAndPushManip(manipPos: Vec2, solid: boolean) {
let wasSolid = this.scene.map.getSolid (manipPos.x, manipPos.y) != -1;
let lastPalette = this.scene.map.getPalette(manipPos.x, manipPos.y);
let changed = this.scene.map.setSolid(manipPos.x, manipPos.y, this.scene.activePalette, solid);
if (!changed) return;
this.manipulated.push({
pos: manipPos,
solid: solid,
oldSolid: wasSolid,
palette: this.scene.activePalette,
oldPalette: lastPalette
});
}
cleanup() {

View File

@ -6,36 +6,66 @@ class TokenMode {
pointerDown: boolean = false;
grabOffset: Vec2;
startPosition: Vec2;
currentSerialized: string = "";
constructor(scene: MainScene) {
this.scene = scene;
this.onWheel = this.onWheel.bind(this);
document.documentElement.addEventListener("wheel", this.onWheel);
this.scene.events.on('destroy', () => document.documentElement.removeEventListener("wheel", this.onWheel));
}
onWheel(e: WheelEvent) {
if (this.currentToken != null) {
let dir = e.deltaY > 0 ? 1 : -1;
let frame = this.currentToken.getFrame() + dir;
if (frame < 0) frame += this.currentToken.frameCount();
frame %= this.currentToken.frameCount();
this.currentToken.setFrame(frame);
}
}
update() {
this.active = true;
let foundToHighlight = false;
for (let token of this.scene.tokens) {
if (this.scene.world.cursorWorld.x >= token.x && this.scene.world.cursorWorld.y >= token.y
for (let i = this.scene.tokens.length - 1; i >= 0; i--) {
let token = this.scene.tokens[i];
if (!foundToHighlight && this.scene.world.cursorWorld.x >= token.x && this.scene.world.cursorWorld.y >= token.y
&& this.scene.world.cursorWorld.x <= token.x + token.width && this.scene.world.cursorWorld.y <= token.y + token.height) {
token.toggleOutline(true);
foundToHighlight = true;
if (this.scene.input.mousePointer.leftButtonDown() && !this.pointerDown && this.currentToken == null) {
this.grabOffset = new Vec2(this.scene.world.cursorWorld.x - token.x, this.scene.world.cursorWorld.y - token.y);
this.startPosition = token.getPosition();
this.currentToken = token;
this.currentSerialized = this.currentToken.serialize();
this.pointerDown = true;
}
}
else token.toggleOutline(false);
else if (this.currentToken != token) token.toggleOutline(false);
}
if (this.currentToken == null && this.scene.input.mousePointer.leftButtonDown()) {
let token = new Token(this.scene, Math.floor(this.scene.world.cursorWorld.x / 4 / 16) * 16,
Math.floor(this.scene.world.cursorWorld.y / 4 / 16) * 16, this.scene.activeToken);
this.scene.add.existing(token);
this.scene.tokens.push(token);
this.scene.history.push("token_create", { data: token.serialize() });
}
if (!this.scene.input.mousePointer.leftButtonDown() && this.pointerDown && this.currentToken != null) {
for (let token of this.scene.tokens) token.toggleOutline(false);
for (let token of this.scene.tokens) if (token != this.currentToken) token.toggleOutline(false);
if (this.currentToken.getPosition().x != this.startPosition.x || this.currentToken.getPosition().y != this.startPosition.y)
this.scene.history.push("token_move", { start: this.startPosition, end: this.currentToken.getPosition(), token: this.currentToken });
if (JSON.stringify(this.currentToken.serialize()) != JSON.stringify(this.currentSerialized))
this.scene.history.push("token_modify", { old: this.currentSerialized, new: this.currentToken.serialize() });
this.currentToken = null;
this.currentSerialized = "";
this.pointerDown = false;
}

View File

@ -0,0 +1,45 @@
class GetAssetsScene extends Phaser.Scene {
constructor() {
super({key: "GetAssetsScene"});
}
preload(): void {
this.cameras.main.setBackgroundColor("#6a655a");
this.load.image('splash', '/res/splash.png');
this.load.text("assets", "res/_assets.txt");
}
create(): void {
let assets = this.cache.text.get("assets");
let lines: string[] = assets.split("\n");
let assetsParsed = "";
let prefixes = {};
lines.forEach((v: string) => {
if (v.substr(0, "FOLDERPREFIX".length) == "FOLDERPREFIX") {
let tokens = v.split(" ");
prefixes[tokens[1]] = tokens[2];
return;
}
if (v.length == 0) return;
let slash = v.indexOf('/');
let prefix = "";
if (slash != -1 && prefixes[v.substr(0, slash)] != undefined) prefix = prefixes[v.substr(0, slash)];
if (slash == -1) assetsParsed += `${v.split(" ")[0]} ${v}\n`;
else assetsParsed += `${prefix}${v.substring(slash + 1, v.length).split(" ")[0]} ${v}\n`;
});
this.cache.text.remove("assets");
this.cache.text.add("assets", assetsParsed);
this.game.scene.start('LoadScene');
this.game.scene.stop('GetAssetsScene');
this.game.scene.swapPosition('LoadScene', 'GetAssetsScene');
}
}

37
src/scene/LoadScene.ts Normal file
View File

@ -0,0 +1,37 @@
class LoadScene extends Phaser.Scene {
constructor() {
super({key: "LoadScene"});
}
preload(): void {
this.cameras.main.setBackgroundColor("#6a655a");
this.add.sprite(this.cameras.main.width / 2, this.cameras.main.height /2, "splash");
this.load.bitmapFont('font1x', '/res/font/font1.png', '/res/font/font1.fnt');
this.load.bitmapFont('font2x', '/res/font/font2.png', '/res/font/font2.fnt');
this.load.bitmapFont('font3x', '/res/font/font3.png', '/res/font/font3.fnt');
for (let s of this.cache.text.get("assets").split("\n")) {
let tokens = s.split(" ");
if (tokens.length == 2) this.load.image(tokens[0], "/res/" + tokens[1] + ".png");
else if (tokens.length == 4) this.load.spritesheet(tokens[0], "/res/" + tokens[1] + ".png", {frameWidth: parseInt(tokens[2]), frameHeight: parseInt(tokens[3])});
}
for (let t of TOKENS) {
if (t.split_by != undefined) this.load.spritesheet(t.key, t.file + ".png", {frameWidth: t.split_by, frameHeight: t.split_by});
else this.load.image(t.key, t.file + ".png");
}
}
create(): void {
this.cache.text.remove("assets");
setTimeout(() => {
this.game.scene.start('MainScene');
this.game.scene.stop('LoadScene');
this.game.scene.swapPosition('MainScene', 'LoadScene');
}, 50)
}
}

Some files were not shown because too many files have changed in this diff Show More