Skip to content

Commit

Permalink
#206 Gui improvemens.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich2 committed Jan 9, 2023
1 parent 2792754 commit ba887d5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
5 changes: 4 additions & 1 deletion Dev/srcGrand/dless/DLessGui.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ case class DLessGui(canv: CanvasPlatform, scenIn: DLessScen, viewIn: HGView, isF
val t2 = terrs(hs.tile2Reg)
ife( t1 == t2, Some(ls.draw(t1.contrastBW)), None)
}
def lines2: GraphicElems = proj.ifTileScale(50, lines)

def hexStrs: GraphicElems = proj.hCenSizedMap(15){ (pt, hc) => pt.textAt(hc.rcStr32, 12, terrs(hc).contrastBW) }

def hexStrs2: GraphicElems = proj.ifTileScale(50, hexStrs)

/** Creates the turn button and the action to commit on mouse click. */
def bTurn: PolygonCompound = clickButton("Turn " + (scen.turn + 1).toString) { _ =>
//scen = scen.endTurn()
Expand Down Expand Up @@ -51,7 +54,7 @@ case class DLessGui(canv: CanvasPlatform, scenIn: DLessScen, viewIn: HGView, isF
def thisTop(): Unit = reTop(bTurn %: proj.buttons)

thisTop()
override def frame: GraphicElems = polyFills ++ actives ++ straits ++ lines ++ hexStrs
override def frame: GraphicElems = polyFills ++ actives ++ straits ++ lines2 ++ hexStrs2

proj.getFrame = () => frame
proj.setStatusText = { str =>
Expand Down
11 changes: 3 additions & 8 deletions Tiling/src/eg320/Grids320Systems.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2018-22 Richard Oliver. Licensed under Apache Licence version 2.0. */
/* Copyright 2018-23 Richard Oliver. Licensed under Apache Licence version 2.0. */
package ostrat; package eg320
import prid._, phex._, egrid._, pEarth._

Expand Down Expand Up @@ -105,6 +105,7 @@ object Scen320S8E10 extends EScenLongMulti
override lazy val sTerrs: HSideBoolLayer = fullTerrsSubSideLayer
}

/** 2 320km grid system for Northern Canada 120W and 90W. */
object GridsNCanada extends EGrid320LongMulti
{ override val grids: RArr[EGridLongFull] = EGrid320.grids(2, 8,156,158)
override def headGridInt: Int = 8
Expand All @@ -113,16 +114,10 @@ object GridsNCanada extends EGrid320LongMulti
override def adjTilesOfTile(tile: HCen): HCenArr = ???
}

/** Scenario for 3 320km grid system for Northern Canada 120W and 90W. */
/** Scenario for 2 320km grid system for Northern Canada 120W and 90W. */
object ScenNCanada extends EScenLongMulti
{ override val title: String = "320km Far North Canada"
implicit override val gridSys: EGrid320LongMulti = GridsNCanada
override lazy val terrs: HCenLayer[WTile] = fullTerrsSubHCenLayer
override lazy val sTerrs: HSideBoolLayer = fullTerrsSubSideLayer
val hc1 = gridSys.sideTile1(HSide(158, 9724))
debvar(hc1)
val hc2 = gridSys.sideTile1(HSide(159, 9725))
debvar(hc2)
val hc3 = gridSys.sideTile1(HSide(157, 9725))
debvar(hc3)
}
2 changes: 1 addition & 1 deletion Tiling/src/egrid/GridWorldGui.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class GridWorldGui(val canv: CanvasPlatform, scenIn: EScenBasic, viewIn: HGView,
}
}

def rcTexts2 = proj.ifTileScale(82, rcTexts1)
def rcTexts2: GraphicElems = proj.ifTileScale(82, rcTexts1)

def tiles = gridSys.optMap{ hc => proj.transTile(hc).map(poly => poly.fill(terrs(hc).colour)) }
def sides1: GraphicElems = sTerrs.projTruesLineSegMap{ls => Rectangle.fromAxisRatio(ls, 0.3).fill(Colour.DarkBlue) }
Expand Down
2 changes: 1 addition & 1 deletion Tiling/src/prid/phex/HCenLayer.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2018-22 Richard Oliver. Licensed under Apache Licence version 2.0. */
/* Copyright 2018-23 Richard Oliver. Licensed under Apache Licence version 2.0. */
package ostrat; package prid; package phex
import geom._, reflect.ClassTag

Expand Down
4 changes: 2 additions & 2 deletions Tiling/src/prid/phex/HSide.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Copyright 2018-22 Richard Oliver. Licensed under Apache Licence version 2.0. */
/* Copyright 2018-23 Richard Oliver. Licensed under Apache Licence version 2.0. */
package ostrat; package prid; package phex
import geom._, Colour.Black, collection.mutable.ArrayBuffer
import collection.mutable.ArrayBuffer

/** A Hex side coordinate in a Hex Grid.
* So Side 1 on its primary Hex tile goes from Vert 6 to 1 while it is Side 4 on its secondary Hex tile and goes from Vertex 4 to vertex 3
Expand Down

0 comments on commit ba887d5

Please sign in to comment.