diff --git a/Dev/srcGrand/dless/DLessGui.scala b/Dev/srcGrand/dless/DLessGui.scala index aeeb951ff..84d832531 100644 --- a/Dev/srcGrand/dless/DLessGui.scala +++ b/Dev/srcGrand/dless/DLessGui.scala @@ -1,6 +1,6 @@ /* Copyright 2018-23 Richard Oliver. Licensed under Apache Licence version 2.0. */ package ostrat; package dless -import geom._, pEarth._, prid._, phex._, pgui._, egrid._ +import geom._, prid._, phex._, pgui._, egrid._ case class DLessGui(canv: CanvasPlatform, scenIn: DLessScen, viewIn: HGView, isFlat: Boolean = false) extends HGridSysGui("Diceless Gui") { var scen = scenIn @@ -23,22 +23,33 @@ case class DLessGui(canv: CanvasPlatform, scenIn: DLessScen, viewIn: HGView, isF def tileFills: RArr[PolygonFill] = proj.hCensMap { hc => corners.tilePoly(hc).map { hvo => hvo.toPt2(proj.transCoord(_)) }.fill(terrs(hc).colour) } + val islands: GraphicElems = terrs.hcOptMap { (tile, hc) => + tile match { + case island: Island => { + val poly = hc.vertsIn(7).map(hv => hv.toPt2(proj.transCoord)) + Some(poly.fill(island.landColour)) + } + case _ => None + } + } def tileActives: RArr[PolygonActive] = proj.hCensMap { hc => corners.tilePoly(hc).map { hvo => hvo.toPt2(proj.transCoord(_)) }.active(hc) } def straits: GraphicElems = proj.sidesOptMap { (hs: HSide) => val sTerr: Option[WSide] = sTerrs(hs) - sTerr.map { st => corners.sideVerts(hs).project(proj).fill(st.colour) } + val sTerr2 = sTerr.flatMap { + case s: WSideLands => Some(s) + case _ => None + } + sTerr2.map { st => corners.sideVerts(hs).project(proj).fill(st.colour) } } def lines1: GraphicElems = proj.linksOptMap { hs => val hc1 = hs.tileLt - val hc2 = hs.tileRt val t1 = terrs(hc1) + def t2: WTile = terrs(hs.tileRt) - def t2 = terrs(hs.tileRt) - - if (sTerrs(hs).nonEmpty | t1 != t2) None + if (sTerrs(hs).nonEmpty | t1.colour != t2.colour) None else { val cs: (HCen, Int, Int) = hs.corners val ls1 = corners.sideLine(cs._1, cs._2, cs._3) @@ -68,7 +79,7 @@ case class DLessGui(canv: CanvasPlatform, scenIn: DLessScen, viewIn: HGView, isF /** This is the graphical display of the planned move orders. */ def moveGraphics: GraphicElems = moveSegPairs.pairFlatMap { (seg, pl) => seg.draw(pl.colour).arrow } - tileFills ++ tileActives ++ straits ++ lines2 ++ hexStrs2 ++ units ++ moveGraphics + tileFills ++ islands ++ tileActives ++ straits ++ lines2 ++ hexStrs2 ++ units ++ moveGraphics } /** Creates the turn button and the action to commit on mouse click. */ diff --git a/EGrid/src/eg320/Terr320E0.scala b/EGrid/src/eg320/Terr320E0.scala index 4ed829fcc..833438d5e 100644 --- a/EGrid/src/eg320/Terr320E0.scala +++ b/EGrid/src/eg320/Terr320E0.scala @@ -16,7 +16,7 @@ object Terr320E0 extends Long320Terrs wr(156, sea * 3) wr(154, sea * 4) - wr(152, sea * 3, taigaHills) + wr(152, sea * 3, taigaHills) wr(150, sea * 3, taigaHills) wr(148, sea * 3, taigaHills, taiga) wr(146, sea, hills, sea, plain, forest) @@ -27,7 +27,7 @@ object Terr320E0 extends Long320Terrs wr(136, sea * 3, plain, hills, mtain, plain) wr(134, sea, hills * 3, sea, SeaIsland(Hilly, OpenTerrain), hills) wr(132, sea, hills, plain * 2, sea, SeaIsland(Hilly, OpenTerrain), sea) - wr(130, sea, plain, hills * 2, sea * 3, hills) + wr(130, sea, plain, hills * 2, sea * 2, hills, SeaIsland(Hilly, OpenTerrain)) wr(128, sea * 2, hills * 5, sea) wr(126, sea * 2, mtain, desertHills, desert * 4) wr(124, sea * 2, hills, desert * 6) @@ -41,7 +41,9 @@ object Terr320E0 extends Long320Terrs res.setSomeInts(SISea, 133,521)//Sardinia - Corsica res.setSomeInts(SLSea, 135,523)//Corsica res.setSomeInts(SRSea, 135,521, 134,524)//Corsica - res.setSomeInts(SCSea, 129,507, 129,509, 129,511, 129,525, 130,528, 131,527, 134,528, 135,527, 136,526)//Mediterranean + res.setSomeInts(SCSea, 129,507, 129,509, 129,511, 134,528, 135,527, 136,526)//Mediterranean + res.setSomeInts(SRSea, 129,525)//Sicily - Tunis + res.setSomeInts(SLSea, 130,528, 131,527)//Sicily - Italy res } @@ -77,21 +79,11 @@ object Terr320E0 extends Long320Terrs res.setCornerIn(134, 526, 1)//Adriatic res.setCorner(134, 526, 2, HVDL)//Adriatic - res.setCornerPair(132, 524, 2, HVUR, HVUL)//Sicily Italy - res.setCorner(130, 526, 0, HVUL)//Sicily Italy - res.setCornerIn(130, 526, 1)//Sicily Italy - res.setCornerIn(130, 526, 2)//Sicily Italy - res.setCornerPair(128, 528, 0, HVUL, HVUR)//Sicily Italy south mouth - - res.setMouth1(128, 504)//Gibraltar res.setVert0In(128, 508)//South Spain res.setVert3In(130, 510)//South Spain res.setMouth4(130, 514)//East end of Gibraltar Straits - res.setMouth2(130, 522) //Tunis Sicily west - res.setMouth5(128, 528) //Tunis Sicily east - res } } diff --git a/EGrid/src/eg320/Terr320E30.scala b/EGrid/src/eg320/Terr320E30.scala index f60efce85..dc104da57 100644 --- a/EGrid/src/eg320/Terr320E30.scala +++ b/EGrid/src/eg320/Terr320E30.scala @@ -36,8 +36,8 @@ object Terr320E30 extends Long320Terrs res.setSomeInts(SCLake, 149, 1537) res.setSomeInts(SCSea, 145,1527, 146,1528, 147,1529, 147,1531, 147,1533, 148,1530, 149,1531, 150,1532, 151,1533, 152,1534)//Baltic res.setSomeInts(SCSea, 133,1525, 133,1535, 134,1524, 135,1523, 136,1522, 136,1542, 137,1541, 137,1543) - res.setSomeInts(SCSea, 130,1520, 130,1524, 131,1525, 131,1533, 132,1534, 132,1526, 132,1530) - res.setSomeInts(SCSea, 131,1521) + res.setSomeInts(SCSea, 130,1524, 131,1525, 131,1533, 132,1534, 132,1526, 132,1530) + res.setSomeInts(SLSea, 130,1520, 131,1521)//Sicily - Italy res } @@ -98,11 +98,6 @@ object Terr320E30 extends Long320Terrs res.setVert5In(132, 1536)//Sea of Marmara res.setMouth4(134, 1538)//Constantinople - res.setCorner(132, 1524, 4, HVUR)//Sicily - Italy north, has to be upright rather than down right because the end rows are 132,524 and 130,526 - res.setCorner(130, 1522, 0, HVUR)//Sicily - Italy north, has to be upright rather than down right because the end rows are 132,524 and 130,526 - res.setCornerIn(130, 1522, 5)//Sicily Italy - res.setCornerIn(130, 1522, 4)//Sicily Italy south - res } } \ No newline at end of file diff --git a/EGrid/src/egrid/WSide.scala b/EGrid/src/egrid/WSide.scala index 3891b212b..c2143f572 100644 --- a/EGrid/src/egrid/WSide.scala +++ b/EGrid/src/egrid/WSide.scala @@ -3,9 +3,6 @@ package ostrat; package egrid import Colour._ trait WSide extends Coloured// with ShowSimple -{ - -} /** A Side between 2 lands. */ trait WSideLands extends WSide