From cb486fa0e873b03411cda0f3b2d60efbeef5421b Mon Sep 17 00:00:00 2001 From: sofronaspe Date: Thu, 26 Sep 2024 00:20:25 -0700 Subject: [PATCH 01/66] reinstate economics logic --- index.css | 44 +++ index.html | 312 ++++++++++++++- main.js | 19 +- modules/burgs-and-states.js | 24 ++ modules/io/load.js | 10 + modules/io/save.js | 81 ++-- modules/production-generator.js | 114 ++++++ modules/resources-generator.js | 616 ++++++++++++++++++++++++++++++ modules/trade-generator.js | 239 ++++++++++++ modules/ui/burg-editor.js | 38 ++ modules/ui/general.js | 8 + modules/ui/heightmap-editor.js | 3 + modules/ui/hotkeys.js | 1 + modules/ui/layers.js | 45 +++ modules/ui/resources-editor.js | 645 ++++++++++++++++++++++++++++++++ modules/ui/style.js | 13 + modules/ui/tools.js | 9 + 17 files changed, 2179 insertions(+), 42 deletions(-) create mode 100644 modules/production-generator.js create mode 100644 modules/resources-generator.js create mode 100644 modules/trade-generator.js create mode 100644 modules/ui/resources-editor.js diff --git a/index.css b/index.css index eb1e82fc1..259873b4b 100644 --- a/index.css +++ b/index.css @@ -1563,6 +1563,45 @@ div.states > .riverType { pointer-events: none; } +div.states > .resourceIcon { + margin: 0; + cursor: pointer; + vertical-align: middle; +} + +div.states > .resourceIcon > * { + pointer-events: none; +} + +div.states > .resourceCategory, +div.states > .resourceModel { + cursor: pointer; + width: 7em; + overflow: hidden; + vertical-align: middle; + white-space: nowrap; +} + +div.states > .resourceBonus { + color: #666; + width: 5em; + cursor: pointer; +} + +div.states > div.resourceBonus > span { + pointer-events: none; + margin: 0 0.15em; +} + +div.states > div.resourceBonus > span.icon-anchor { + font-size: 0.85em; + margin: 0 0.25em; +} + +div.states > div.resourceBonus > span.icon-male { + margin: 0 0.1em; +} + #diplomacyBodySection > div { cursor: pointer; } @@ -1631,6 +1670,7 @@ div.states > .riverType { #stateNameEditor div.label, #provinceNameEditor div.label, #regimentBody div.label, +#resourceIconEditor div.label, #markerEditor div.label { display: inline-block; width: 5.5em; @@ -2257,6 +2297,10 @@ svg.button { user-select: none; } +#goods > g > use { + pointer-events: none; +} + .dontAsk { margin: 0.9em 0 0 0.6em; display: inline-flex; diff --git a/index.html b/index.html index 4bc616526..67ebe4215 100644 --- a/index.html +++ b/index.html @@ -449,6 +449,7 @@ + @@ -651,6 +652,15 @@ > Precipitation +
  • + Resources +
  • Provinces + @@ -1415,6 +1426,15 @@ + + + + + + + + + @@ -2067,6 +2087,9 @@ + @@ -2089,6 +2112,7 @@ Burgs + + @@ -3466,6 +3491,25 @@ style="font-size: 1em" > +
    +
    Production:
    + +
    + +
    +
    Export:
    + +
    + +
    +
    Import:
    + +
    + +
    +
    Consumption:
    + +
    @@ -5148,6 +5192,57 @@ JPG + +
    +
    Resource 
    +
    Category 
    +
    Chance 
    +
    Model 
    +
    Cells 
    +
    Value 
    +
    Bonuses 
    +
    +
    + +
    +
    Resources: 0
    +
    + +
    + + + + + + +
    + + + +
    +
    Select:
    + +
    +
    +
    Upload:
    + + +
    +
    + Comperess raster + | + Optimize vector +
    +
    + +
    +
    +
    ViewBox:
    + + + + +
    @@ -5846,6 +5864,83 @@ + + + +