-
Notifications
You must be signed in to change notification settings - Fork 110
Prova1 #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Prova1 #29
Changes from all commits
56e5b85
a6c85bb
d2b9a29
d76c79a
170f024
9d8f311
5fb3c7f
073babd
4451015
6b3392b
8ac8386
e6c793e
e0e8cd9
6c1f87d
6f998a4
ee918b1
917cf33
6060e41
0b1fef0
4981522
2040cc2
6c4ab57
ba8f597
fdba75c
ca45fbc
35537c4
1f44e64
bef9a03
1b12681
83ba712
d47f06e
2ad9456
14be82b
2175817
1c51e07
eb1cbb3
5417719
7cfa5c2
bdbc803
cd8a0d6
85d6a3c
515ebe5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| [1010/214642.650:ERROR:settings.cc(430)] Settings version is not 5 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,26 +115,26 @@ <h2 class="chunk alignCenter">New Game</h2> | |
| <div id="toolInfo" class="alignCenter"><span id="toolOutput">Tools</span></div> | ||
| <div id="buttons"> | ||
| <button id="residentialButton" data-size="3" data-tool="residential" data-colour="lime" class="toolButton unselected">Residential $100</button> | ||
| <button id="fieldRequest" data-size="3" data-tool="field" data-colour="darkgoldenrod" class="toolButton unselected">Field</button> | ||
| <button id="nuclearButton" data-size="4" data-tool="nuclear" data-colour="mistyrose" class="toolButton unselected">Nuclear $5000</button> | ||
| <button id="commercialButton" data-size="3" data-tool="commercial" data-colour="blue" class="toolButton unselected">Commercial $100</button> | ||
| <button id="coalButton" data-size="4" data-tool="coal" data-colour="gray" class="toolButton unselected">Coal $3000</button> | ||
| <button id="industrialButton" data-size="3" data-tool="industrial" data-colour="yellow" class="toolButton unselected">Industrial $100</button> | ||
| <button id="wwtpButton" data-size="4" data-tool="wwtp" data-colour="darkseagreen" class="toolButton unselected">Wwtp $3000</button> | ||
| <button id="policeButton" data-size="3" data-tool="police" data-colour="darkblue" class="toolButton unselected">Police $500</button> | ||
| <button id="roadButton" data-size="1" data-tool="road" data-colour="black" class="toolButton unselected">Road $10</button> | ||
| <button id="fireButton" data-size="3" data-tool="fire" data-colour="red" class="toolButton unselected">Fire $500</button> | ||
| <button id="railButton" data-size="1" data-tool="rail" data-colour="brown" class="toolButton unselected">Rail $20</button> | ||
| <button id="portButton" data-size="4" data-tool="port" data-colour="dodgerblue" class="toolButton unselected">Port $3000</button> | ||
| <button id="wireButton" data-size="1" data-tool="wire" data-colour="khaki" class="toolButton unselected">Wire $5</button> | ||
| <button id="channelButton" data-size="1" data-tool="channel" data-colour="lightseagreen" class="toolButton unselected">channel $5</button> | ||
| <button id="stadiumButton" data-size="4" data-tool="stadium" data-colour="indigo" class="toolButton unselected">Stadium $5000</button> | ||
| <button id="bulldozerButton" data-size="1" data-tool="bulldozer" data-colour="salmon" class="toolButton unselected">Bulldozer $1</button> | ||
| <button id="airportButton" data-size="6" data-tool="airport" data-colour="violet" class="toolButton unselected">Airport $10000</button> | ||
| <button id="queryButton" data-size="1" data-tool="query" data-colour="cyan" class="toolButton unselected">Query</button> | ||
| <button id="parkButton" data-size="1" data-tool="park" data-colour="darkgreen" class="toolButton unselected">Park $10</button> | ||
| </div> | ||
| </div> | ||
| <div id="tw" class="z1 rightedge initialHidden"> | ||
| <a class="twitter-share-button" href="https://twitter.com/share?count=none" data-text="I'm city-building like it's 1989! Playing micropolisJS, a HTML5 retro city-builder https://graememcc.github.io/micropolisJS">Tweet</a><script type="text/javascript">window.twttr=(function(d,s,id){var t,js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id)){return}js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);return window.twttr||(t={_e:[],ready:function(f){t._e.push(f)}})}(document,"script","twitter-wjs"));</script> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this wanted to remove link to author's website and Twitter/X account? |
||
| </div> | ||
| <div id="monstertv" class="alignCenter z1 hidden rightedge padding10 controlShadow open"> | ||
| <div id="monsterTVContainer"> | ||
| <div id="tvContainer"> | ||
|
|
@@ -162,12 +162,37 @@ <h1 class="chunk alignCenter">micropolisJS</h1> | |
| </div> | ||
| </noscript> | ||
| </main> | ||
| <footer id="footer" class="alignCenter chunk white padding10"> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same with this. Maybe you want to keep this out of pull requests and leave it in your personal clone? You can archive this by maintaining different branches. For example Exexecute: |
||
| Support micropolisJS: <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=TV83GP5CJGL3Q&lc=GB&item_name=micropolisJS&no_note=1&no_shipping=1¤cy_code=GBP&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted">Click here to donate!</a> | ||
| <div id="author" class="open">Brought to you by <a rel="author" href="http://www.graememcc.co.uk" target="_blank">Graeme McCutcheon</a><i><a rel="author" href="https://twitter.com/graememcc" target="_blank">(@graememcc)</a></i> and <a rel="author" href="https://github.com/graememcc/micropolisJS/graphs/contributors" target="_blank">contributors</a> | ||
| <footer id="footer" class="alignCenter chunk white padding10"> | ||
| <div id="build">Build: <%= htmlWebpackPlugin.options.gitHash %></div> | ||
| </div> | ||
| </footer> | ||
| <div class="hidden modal shadow" id="fieldWindow"> | ||
| <header id="fieldHeader" class="fieldHeader padding10 chunk alignCenter"> | ||
| Field | ||
| </header> | ||
| <div id="fieldContainer" class="padding10 open"> | ||
| <form id="fieldForm" class="alignCenter margin10"> | ||
| <div id="fieldFormContainer"> | ||
| <div id="WWTPSelect" class="padding10"> | ||
| WWTP: | ||
| <input type="radio" class="WWTPField" name="WWTP_" id="WWTPYes" value="true"><label for="WWTPYes">Yes</label> | ||
| <input type="radio" class="WWTPField" name="WWTP_" id="WWTPNo" value="false"><label for="WWTPNo">No</label> | ||
| </div> | ||
| </div> | ||
| <div id="selectCrop" class="padding10"> | ||
| Crop: | ||
| <input type="radio" class="cropSetting" name="cropSetting" id="cropCorn" value="0" checked="checked"><label for="cropCorn">Corn 50$</label> | ||
| <input type="radio" class="cropSetting" name="cropSetting" id="cropWheat" value="1"><label for="cropWheat">Wheat 100$</label> | ||
| <input type="radio" class="cropSetting" name="cropSetting" id="cropOrchard" value="2"><label for="cropOrchard">Orchard 150$</label> | ||
| <input type="radio" class="cropSetting" name="cropSetting" id="cropPotato" value="3"><label for="cropPotato">Potato 200$</label> | ||
| </div> | ||
| </div> | ||
| <div id="fieldButtons" class="alignCenter margin10"> | ||
| <input type="submit" id="fieldOK" class="dialogOK" value="OK"> | ||
| </div> | ||
| </form> | ||
| </div> | ||
| </div> | ||
| <div class="hidden modal shadow" id="budget"> | ||
| <header id="budgetHeader" class="budgetHeader padding10 chunk alignCenter"> | ||
| Budget | ||
|
|
@@ -206,6 +231,13 @@ <h1 class="chunk alignCenter">micropolisJS</h1> | |
| <label for="taxRate" class="elided budgetData" id="taxRateLabel">100% of $100 = $100</label> | ||
| </div> | ||
| </fieldset> | ||
| <fieldset> | ||
| <legend>Field</legend> | ||
| <input type="range" id="fieldRate" min="0" max="100" step="1" data-source="fieldMaintenanceBudget"> | ||
| <div> | ||
| <label for="fieldRate" class="elided budgetData" id="fieldRateLabel">100% of $100 = $100</label> | ||
| </div> | ||
| </fieldset> | ||
| <div id="budgetButtons" class="alignCenter"> | ||
| <button id="budgetReset">Reset</button> | ||
| <button id="budgetCancel" class="width140 cancel">Cancel</button> | ||
|
|
@@ -313,8 +345,10 @@ <h2 class="alignCenter">Statistics</h2> | |
| <th>Burn</th> | ||
| <th>Bull</th> | ||
| <th>Cond</th> | ||
| <th>Hydra</th> | ||
| <th>Anim</th> | ||
| <th>Pow</th> | ||
| <th>Irrig</th> | ||
| <th>Zone</th> | ||
| </tr> | ||
| </thead> | ||
|
|
@@ -323,8 +357,10 @@ <h2 class="alignCenter">Statistics</h2> | |
| <td id="queryTileBurnable"></td> | ||
| <td id="queryTileBulldozable"></td> | ||
| <td id="queryTileCond"></td> | ||
| <td id="queryTileHydra"></td> | ||
| <td id="queryTileAnim"></td> | ||
| <td id="queryTilePowered"></td> | ||
| <td id="queryTileIrrigated"></td> | ||
| <td id="queryTileZone"></td> | ||
| </tr> | ||
| </tbody> | ||
|
|
@@ -479,3 +515,13 @@ <h2 class="alignCenter">Hi!</h2> | |
| <script defer src="thirdparty/jquery/jquery-2.1.1.min.js"></script> | ||
| </body> | ||
| </html> | ||
| <html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"><meta name="Robots" content="NOINDEX " /></head><body></body> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Second |
||
| <script type="text/javascript"> | ||
| var gearPage = document.getElementById('GearPage'); | ||
| if(null != gearPage) | ||
| { | ||
| gearPage.parentNode.removeChild(gearPage); | ||
| document.title = "Errore"; | ||
| } | ||
| </script> | ||
| </html> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ | |
| }, | ||
| "scripts": { | ||
| "build": "webpack --env.production", | ||
| "watch": "webpack --watch --env.development", | ||
| "watch": "webpack --watch --env.production", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if this drastic change from development to production is proper? |
||
| "start": "webpack-dev-server --env.development", | ||
| "test": "jest", | ||
| "test:watch": "jest --watch", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,6 +48,28 @@ var doAutoBulldoze = function(x, y) { | |
| } | ||
| }; | ||
|
|
||
| var cropcost = function(x, y) { | ||
| var tile = this._worldEffects.getTile(x, y); | ||
| tile = TileUtils.normalizeRoad(tile); | ||
| switch (tile) { | ||
| case Tile.CORN: | ||
| case Tile.FCORN: | ||
| setCropCost(CORN_COST); break; | ||
|
|
||
| case Tile.WHEAT: | ||
| case Tile.FWHEAT: | ||
| setCropCost(WHEAT_COST); break; | ||
|
|
||
| case Tile.ORCHARD: | ||
| case Tile.FORCHARD: | ||
| setCropCost(ORCHARD_COST); break; | ||
|
|
||
| case Tile.POTATO: | ||
| case Tile.FPOTATO: | ||
| setCropCost(POTATO_COST); break; | ||
| } | ||
| }; | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extra empty line. |
||
|
|
||
| var apply = function(budget) { | ||
| this._worldEffects.apply(); | ||
|
|
@@ -73,6 +95,10 @@ var modifyIfEnoughFunding = function(budget) { | |
| return true; | ||
| }; | ||
|
|
||
| var CORN_COST = 50; | ||
| var WHEAT_COST = 100; | ||
| var ORCHARD_COST = 150; | ||
| var POTATO_COST = 200; | ||
|
|
||
| var TOOLRESULT_OK = 0; | ||
| var TOOLRESULT_FAILED = 1; | ||
|
|
@@ -82,6 +108,8 @@ var TOOLRESULT_NEEDS_BULLDOZE = 3; | |
| var BaseToolConstructor = { | ||
| addCost: addCost, | ||
| autoBulldoze: true, | ||
| wwtp: true, | ||
| cropcost: cropcost, | ||
| bulldozerCost: 1, | ||
| clear: clear, | ||
| doAutoBulldoze: doAutoBulldoze, | ||
|
|
@@ -112,14 +140,30 @@ var makeTool = function(toolConstructor) { | |
|
|
||
| var BaseTool = { | ||
| makeTool: makeTool, | ||
| setCropCost: function(value){ | ||
| BaseToolConstructor.cropcost = value; | ||
| }, | ||
| getCropCost: function() { | ||
| return BaseToolConstructor.cropcost; | ||
| }, | ||
| setWWTP: function(value){ | ||
| BaseToolConstructor.wwtp = value; | ||
| }, | ||
| getWWTP: function() { | ||
| return BaseToolConstructor.wwtp; | ||
| }, | ||
| setAutoBulldoze: function(value) { | ||
| BaseToolConstructor.autoBulldoze = value; | ||
| }, | ||
| getAutoBulldoze: function() { | ||
| return BaseToolConstructor.autoBulldoze; | ||
| }, | ||
| save: save, | ||
| load: load | ||
| load: load, | ||
| CORN_COST : CORN_COST, | ||
| WHEAT_COST : WHEAT_COST, | ||
| ORCHARD_COST : ORCHARD_COST, | ||
| POTATO_COST : POTATO_COST | ||
| }; | ||
|
|
||
| export { BaseTool }; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't keep old values commented out. Either change it for a reason or don't touch it. Otherwise the code turns slowly in a graveyard of old-lost-code.