Commit f3926d01 authored by Bas Lijnse's avatar Bas Lijnse

Merge branch...

Merge branch '224-older-applications-are-not-working-with-the-new-api-incidone-shipadventure' into 'master'

Resolve "Older applications are not working with the new API (Incidone, ShipAdventure)"

Closes #224

See merge request !160
parents 815c8f7e 5578633c
Pipeline #12436 passed with stage
in 2 minutes and 36 seconds
test:
before_script:
- install_clean.sh bundle-complete && apt-get update -qq && apt-get install -y -qq build-essential
- install_clean.sh bundle-complete && apt-get update -qq && apt-get install -y -qq build-essential libsqlite3-dev libmariadbclient-dev-compat
image: "camilstaps/clean:nightly"
script:
- bash Tests/ci-tests.bash
......@@ -120,7 +120,7 @@ manageIncidentWeather incidentNo
where
weather = sdsFocus incidentNo incidentWeather
log = logIncidentWeatherUpdated incidentNo
viewWebWeather widgets = viewInformation (Title "Web weather info") [] (RawText widgets)
viewWebWeather widgets = viewInformation (Title "Web weather info") [] (Html widgets)
manageIncidentLog :: IncidentNo -> Task ()
manageIncidentLog incidentNo
......
......@@ -57,7 +57,7 @@ doAuthenticated task
= ( enterCredentials
>>* [OnAction (Action "Login")
(hasValue (\cred -> verifyCredentials cred >>- executeTask task))
] ) <<@ ApplyLayout (beforeStep (sequenceLayouts (setUIAttributes (titleAttr "Login")) frameCompact)) //Compact layout before login, full screen afterwards
] ) <<@ ApplyLayout (beforeStep (sequenceLayouts [setUIAttributes (titleAttr "Login"), frameCompact])) //Compact layout before login, full screen afterwards
where
enterCredentials :: Task Credentials
enterCredentials
......@@ -90,7 +90,7 @@ where
workOnTasks = doIndependent tasks <<@ ArrangeWithTabs True
layoutControlDash = foldl1 sequenceLayouts
layoutControlDash = sequenceLayouts
[moveSubUIs (SelectByPath [0,0]) [] 1
,moveSubUIs (SelectByPath [0,0]) [] 2
,removeSubUIs (SelectByPath [0])
......
Version: 1.4
Global
ProjectRoot: .
Target: iTasks
Exec: {Project}/IncidoneCCC.exe
CodeGen
CheckStacks: False
CheckIndexes: True
Application
HeapSize: 209715200
StackSize: 1512000
ExtraMemory: 8192
IntialHeapSize: 204800
HeapSizeMultiplier: 4096
ShowExecutionTime: False
ShowGC: False
ShowStackSize: False
MarkingCollector: False
DisableRTSFlags: False
StandardRuntimeEnv: True
Profile
Memory: False
MemoryMinimumHeapSize: 0
Time: False
Stack: False
Dynamics: True
GenericFusion: False
DescExL: False
Output
Output: ShowConstructors
Font: Monaco
FontSize: 9
WriteStdErr: False
Link
LinkMethod: Static
GenerateRelocations: False
GenerateSymbolTable: False
GenerateLinkMap: False
LinkResources: False
ResourceSource:
GenerateDLL: False
ExportedNames:
Paths
Path: {Project}
Precompile:
Postlink:
MainModule
Name: IncidoneCCC
Dir: {Project}
Compiler
NeverMemoryProfile: False
NeverTimeProfile: False
StrictnessAnalysis: True
ListTypes: StrictExportTypes
ListAttributes: True
Warnings: True
Verbose: True
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
......@@ -15,8 +15,11 @@ import C2.Apps.ShipAdventure.Images
import qualified Data.Map as DM
import qualified Data.IntMap.Strict as DIS
import qualified Data.Set as DS
from Graphics.Scalable import normalFontDef, above, class margin(..), instance margin (Span,Span), px
from Graphics.Scalable import :: ImageOffset, :: Host(..)
import Graphics.Scalable.Image => qualified grid
import Graphics.Scalable.Types
//from Graphics.Scalable import normalFontDef, above, class margin(..), instance margin (Span,Span), px
//from Graphics.Scalable import :: ImageOffset, :: Host(..)
derive JSEncode Map2D, Section, Maybe, Coord2D, Borders, Border, IntMap, Device, DeviceType, DeviceKind, CableType, Map
derive JSEncode Network, Cable, Object, ObjectType, MapAction, SectionStatus, Dir
......@@ -193,7 +196,8 @@ where
imageEditor = fromSVGEditor
{ initView = fst
, renderImage = \((_, act), ((inventoryMap, network), allDevices)) (ms2d, _) _ ->
above [] [] [margin (px 5.0, px zero) (editLayoutImage act allDevices network inventoryMap idx m2d) \\ m2d <- ms2d & idx <- [0..]] NoHost
//TODO above [] [] [margin (px 5.0, px zero) (editLayoutImage act allDevices network inventoryMap idx m2d) \\ m2d <- ms2d & idx <- [0..]] NoHost
above [] [] Nothing [] [margin (px 5.0, px zero) (editLayoutImage act allDevices network inventoryMap idx m2d) \\ m2d <- ms2d & idx <- [0..]] NoHost
, updView = \m v -> fst m
, updModel = \(_,data) newClSt -> (newClSt,data)
}
......@@ -209,10 +213,10 @@ editLayout
, OnAction (Action "Remove outer borders" ) (hasValue (uncurry (editOuterBorders Open)))
]
) @! ()
] <<@ ApplyLayout layout @! ()
] @! ()//TODO <<@ ApplyLayout layout @! ()
/*
where
layout = idLayout
/*
layout = sequenceLayouts
[ insertSubAt [1] (ui UIContainer) // Group the 'tool' tasks
, moveSubAt[2] [1,0]
......@@ -265,7 +269,7 @@ editSectionContents
[ChooseFromCheckGroup (\d -> d.Cable.description)]
(mapRead ('DIS'.elems o fst) (myCables |+< focusedShare)) focusedShare
)
] <<@ ApplyLayout layout @! ()
] @! () //TODO <<@ ApplyLayout layout @! ()
where
updateSectionEditor :: !String ![ChoiceOption a] (Shared [a]) (Shared [a]) -> Task [a] | iTask a
updateSectionEditor d updOpts listShare focusedShare
......@@ -279,8 +283,8 @@ editSectionContents
_ = viewInformation (Title "Please select section") [] "Please select section" @! ()
)
layout = idLayout
/*
layout = idLayout
layout = sequenceLayouts
[insertSubAt [1] (uia UIContainer (directionAttr Horizontal))
,moveSubAt [2] [1,0]
......@@ -497,7 +501,7 @@ initSection = {Section | sectionName = ""
, borders = initBorders
, hops = []
}
initBorders = {n=Open,e=Open,s=Open,w=Open}
initBorders = {Borders|n=Open,e=Open,s=Open,w=Open}
frigate_outline =: [(0.0,0.5)] ++ port ++ [(1.0,0.5)] ++ starboard
where
port = [(0.006,0.048),(0.107,0.01),(0.179,0.0),(0.684,0.0),(0.719,0.01),(0.752,0.029),(0.787,0.067),(0.829,0.106),(0.852,0.135),(0.898,0.212),(0.926,0.279),(0.999,0.462)]
......
......@@ -3,15 +3,20 @@ implementation module C2.Apps.ShipAdventure.Images
import C2.Framework.MapEnvironment
import C2.Apps.ShipAdventure.Core
import C2.Apps.ShipAdventure.Types
import qualified Graphics.Scalable as GS
from Graphics.Scalable import <@<, class tuneImage
from Graphics.Scalable import px, rect, normalFontDef, overlay, above, text, scale, beside, empty, collage, line, xline, yline, polygon
from Graphics.Scalable import class toSVGColor(..), class margin(..), class *.(..), instance toSVGColor String
from Graphics.Scalable import instance tuneImage OnClickAttr, instance tuneImage FillAttr, instance tuneImage OpacityAttr
from Graphics.Scalable import instance tuneImage StrokeAttr, instance tuneImage DashAttr, instance tuneImage MaskAttr, instance tuneImage StrokeWidthAttr
from Graphics.Scalable import instance margin (Span,Span), instance margin (Span,Span,Span), instance *. Span, instance zero Span
from Graphics.Scalable import :: Span, :: FontDef, :: DashAttr(..), :: StrokeAttr(..), :: FillAttr(..), :: OnClickAttr(..), :: OpacityAttr(..), :: MaskAttr(..)
from Graphics.Scalable import :: StrokeWidthAttr(..), :: Host(..), :: ImageOffset, :: XYAlign(..), :: XAlign(..), :: YAlign(..), :: Slash(..), :: Markers
import qualified Graphics.Scalable.Image as GS
import Graphics.Scalable.Image => qualified grid
import Graphics.Scalable.Types
//import qualified Graphics.Scalable as GS
//
//from Graphics.Scalable import <@<, class tuneImage
//from Graphics.Scalable import px, rect, normalFontDef, overlay, above, text, scale, beside, empty, collage, line, xline, yline, polygon
//from Graphics.Scalable import class toSVGColor(..), class margin(..), class *.(..), instance toSVGColor String
//from Graphics.Scalable import instance tuneImage OnClickAttr, instance tuneImage FillAttr, instance tuneImage OpacityAttr
//from Graphics.Scalable import instance tuneImage StrokeAttr, instance tuneImage DashAttr, instance tuneImage MaskAttr, instance tuneImage StrokeWidthAttr
//from Graphics.Scalable import instance margin (Span,Span), instance margin (Span,Span,Span), instance *. Span, instance zero Span
//from Graphics.Scalable import :: Span, :: FontDef, :: DashAttr(..), :: StrokeAttr(..), :: FillAttr(..), :: OnClickAttr(..), :: OpacityAttr(..), :: MaskAttr(..)
//from Graphics.Scalable import :: StrokeWidthAttr(..), :: Host(..), :: ImageOffset, :: XYAlign(..), :: XAlign(..), :: YAlign(..), :: Slash(..), :: Markers
import qualified Data.IntMap.Strict as DIS
import qualified Data.Map as DM
......@@ -39,7 +44,8 @@ mapTitleImage idx hilite size2D=:(w, _) mapId
maps2DImage :: !(Set Coord3D) !(MapAction SectionStatus) !RenderMode !Maps2D !SectionExitLockMap !SectionHopLockMap !MySectionInventoryMap !MySectionStatusMap !SectionUsersMap !(UserActorMap ObjectType ActorStatus) !(IntMap Device) !Network !*TagSource
-> Image (Maps2D, MapAction SectionStatus)
maps2DImage disabledSections act mngmnt ms2d exitLocks hopLocks inventoryMap statusMap sectionUsersMap userActorMap allDevices network tsrc
= above [] [] ('DL'.strictTRMap ((margin (px 5.0, px zero)) o (map2DImage disabledSections act mngmnt exitLocks hopLocks inventoryMap statusMap sectionUsersMap userActorMap allDevices network)) (zip2 [0..] ms2d)) NoHost
//TODO = above [] [] ('DL'.strictTRMap ((margin (px 5.0, px zero)) o (map2DImage disabledSections act mngmnt exitLocks hopLocks inventoryMap statusMap sectionUsersMap userActorMap allDevices network)) (zip2 [0..] ms2d)) NoHost
= above [] [] Nothing [] ('DL'.strictTRMap ((margin (px 5.0, px zero)) o (map2DImage disabledSections act mngmnt exitLocks hopLocks inventoryMap statusMap sectionUsersMap userActorMap allDevices network)) (zip2 [0..] ms2d)) NoHost
map2DImage :: !(Set Coord3D) !(MapAction SectionStatus) !RenderMode !SectionExitLockMap !SectionHopLockMap !MySectionInventoryMap !MySectionStatusMap !SectionUsersMap !(UserActorMap ObjectType ActorStatus) !(IntMap Device) !Network !(!Maps2DIndex, !Map2D)
-> Image (Maps2D, MapAction SectionStatus)
......@@ -47,13 +53,15 @@ map2DImage disabledSections act mngmnt exitLocks hopLocks inventoryMap statusMap
#! titleImg = mapTitleImage floorIdx (hilite act) size2D (toString mapId)
#! sectionsImg = sectionsImage disabledSections act mngmnt exitLocks hopLocks inventoryMap statusMap sectionUsersMap userActorMap allDevices network doors2D size2D floorIdx map2D
#! lowerImg = mask sectionsImg size2D shape2D
= above [] [] [titleImg, lowerImg] NoHost
//TODO = above [] [] [titleImg, lowerImg] NoHost
= above [] [] Nothing [] [titleImg, lowerImg] NoHost
mask :: !(Image m) !Size2D !(Maybe Shape2D) -> Image m
mask image _ Nothing
= image
mask image (w,h) (Just shape)
#! shipshape = polygon Nothing [(px x, px y) \\ (x, y) <- shape]
//TODO #! shipshape = polygon Nothing [(px x, px y) \\ (x, y) <- shape]
#! shipshape = polygon [(px x, px y) \\ (x, y) <- shape]
#! maskshape = overlay [] [] [shipshape <@< {fill = toSVGColor "white"} <@< {stroke = toSVGColor "white"}] (Host (rect (px w) (px h)))
= overlay [] [] [image, shipshape <@< {fill = toSVGColor "none"} <@< {stroke = toSVGColor "black"}] NoHost <@< {MaskAttr | mask = maskshape}
......@@ -100,8 +108,10 @@ sectionImage disabledSections hilite mngmnt zoomed exitLocks hopLocks inventoryM
!(Image (Maps2D, MapAction SectionStatus)) !(Image (Maps2D, MapAction SectionStatus)) !(Image (Maps2D, MapAction SectionStatus))
-> Image (Maps2D, MapAction SectionStatus)
mkRest hilite mngmnt exitLocks statusMap actorMap (swidth, sheight) {Section | borders={Borders | n, e, s, w},hops} canCloseDoors c3d inventory devices multiplier inventoryBadges deviceBadges cableBadges upDownExits hdoor vdoor hwall vwall
#! actorBadges = above (repeat AtMiddleX) [] ('DL'.strictTRMap (scale multiplier multiplier o mkActorBadge) actorMap) NoHost
#! statusBadges = above (repeat AtLeft) []
// TODO #! actorBadges = above (repeat AtMiddleX) [] ('DL'.strictTRMap (scale multiplier multiplier o mkActorBadge) actorMap) NoHost
#! actorBadges = above (repeat AtMiddleX) [] Nothing [] ('DL'.strictTRMap (scale multiplier multiplier o mkActorBadge) actorMap) NoHost
//TODO #! statusBadges = above (repeat AtLeft) []
#! statusBadges = above (repeat AtLeft) [] Nothing []
[ mkStatusBadges statusMap c3d mngmnt multiplier [HasSmallFire, HasMediumFire, HasBigFire]
, mkStatusBadges statusMap c3d mngmnt multiplier [HasSmoke]
, mkStatusBadges statusMap c3d mngmnt multiplier [HasSomeWater, IsFlooded]
......@@ -116,8 +126,8 @@ sectionImage disabledSections hilite mngmnt zoomed exitLocks hopLocks inventoryM
<@< {fill = if (hiliteThisSection hilite c3d) hiliteSectionBackgroundColor (toSVGColor "white")}
#! host = if (mngmnt === DOffMode && 'DS'.member c3d disabledSections)
(overlay (repeat (AtMiddleX, AtMiddleY)) [] [ host
, line Nothing Slash pxswidth pxsheight <@< {stroke = toSVGColor "red" }
, line Nothing Backslash pxswidth pxsheight <@< {stroke = toSVGColor "red" }
, line /*Nothing Slash */pxswidth pxsheight <@< {stroke = toSVGColor "red" }
, line /*Nothing Backslash */pxswidth pxsheight <@< {stroke = toSVGColor "red" }
] NoHost)
host
= overlay [ (AtMiddleX, AtTop), (AtRight, AtMiddleY), (AtMiddleX, AtBottom), (AtLeft, AtMiddleY) // Walls
......@@ -127,23 +137,28 @@ sectionImage disabledSections hilite mngmnt zoomed exitLocks hopLocks inventoryM
, (px 3.0, px 3.0), (px -3.0, px 3.0), (px 3.0, px -3.0), (px -6.0, px -3.0) // Badges
]
[ case n of Wall = hwall
Door = above (repeat AtMiddleX) [] [hwall, doorClick canCloseDoors c3d N (hdoor <@< doorFill exitLocks c3d N)] NoHost
//TODO Door = above (repeat AtMiddleX) [] [hwall, doorClick canCloseDoors c3d N (hdoor <@< doorFill exitLocks c3d N)] NoHost
Door = above (repeat AtMiddleX) [] Nothing [] [hwall, doorClick canCloseDoors c3d N (hdoor <@< doorFill exitLocks c3d N)] NoHost
Open = empty zero zero
, case e of Wall = vwall
Door = beside (repeat AtMiddleY) [] [doorClick canCloseDoors c3d E (vdoor <@< doorFill exitLocks c3d E), vwall] NoHost
//TODO Door = beside (repeat AtMiddleY) [] [doorClick canCloseDoors c3d E (vdoor <@< doorFill exitLocks c3d E), vwall] NoHost
Door = beside (repeat AtMiddleY) [] Nothing [] [doorClick canCloseDoors c3d E (vdoor <@< doorFill exitLocks c3d E), vwall] NoHost
Open = empty zero zero
, case s of Wall = hwall
Door = above (repeat AtMiddleX) [] [doorClick canCloseDoors c3d S (hdoor <@< doorFill exitLocks c3d S), hwall] NoHost
//TODO Door = above (repeat AtMiddleX) [] [doorClick canCloseDoors c3d S (hdoor <@< doorFill exitLocks c3d S), hwall] NoHost
Door = above (repeat AtMiddleX) [] Nothing [] [doorClick canCloseDoors c3d S (hdoor <@< doorFill exitLocks c3d S), hwall] NoHost
Open = empty zero zero
, case w of Wall = vwall
Door = beside (repeat AtMiddleY) [] [vwall, doorClick canCloseDoors c3d W (vdoor <@< doorFill exitLocks c3d W)] NoHost
//TODO Door = beside (repeat AtMiddleY) [] [vwall, doorClick canCloseDoors c3d W (vdoor <@< doorFill exitLocks c3d W)] NoHost
Door = beside (repeat AtMiddleY) [] Nothing [] [vwall, doorClick canCloseDoors c3d W (vdoor <@< doorFill exitLocks c3d W)] NoHost
Open = empty zero zero
, statusBadges, actorBadges, inventoryBadges, upDownExits
]
(Host host)
where
mkStatusBadges :: !SectionStatus !Coord3D !RenderMode !Real ![SectionStatus] -> Image (a, MapAction SectionStatus)
mkStatusBadges statusMap c3d mngmnt multiplier xs = beside (repeat AtMiddleY) [] ('DL'.reverseTR ('DL'.strictFoldl (mkStatusBadge statusMap c3d mngmnt multiplier) [] xs)) NoHost
//TODO mkStatusBadges statusMap c3d mngmnt multiplier xs = beside (repeat AtMiddleY) [] ('DL'.reverseTR ('DL'.strictFoldl (mkStatusBadge statusMap c3d mngmnt multiplier) [] xs)) NoHost
mkStatusBadges statusMap c3d mngmnt multiplier xs = beside (repeat AtMiddleY) [] Nothing [] ('DL'.reverseTR ('DL'.strictFoldl (mkStatusBadge statusMap c3d mngmnt multiplier) [] xs)) NoHost
doorFill :: !SectionExitLockMap !Coord3D !Dir -> FillAttr a
doorFill exitLocks c3d dir
......@@ -168,18 +183,21 @@ sectionImage` f mngmnt zoomed hopLocks inventoryMap allDevices network (doorw, d
#! deviceBadges = 'DL'.strictTRMap (drawDevice c3d multiplier) devices
#! allBadges = inventoryBadges ++ deviceBadges
#! inventoryBadges = if (length allBadges > 0)
(beside (repeat AtMiddleY) [] allBadges NoHost)
//TODO (beside (repeat AtMiddleY) [] allBadges NoHost)
(beside (repeat AtMiddleY) [] Nothing [] allBadges NoHost)
(empty zero zero)
#! cables = cablesForSection c3d network
#! cableBadges = if (length cables > 0)
(above (repeat AtMiddleX) [] ('DL'.strictTRMap mkCable cables) NoHost)
//TODO (above (repeat AtMiddleX) [] ('DL'.strictTRMap mkCable cables) NoHost)
(above (repeat AtMiddleX) [] Nothing [] ('DL'.strictTRMap mkCable cables) NoHost)
(empty zero zero)
#! canCloseDoors = mngmnt === KitchenMode || mngmnt === DOffMode
#! upDownExits = beside [] [(px -3.0,zero)] ('DL'.strictTRMap (drawHop c3d hopLocks multiplier) hops) NoHost
//TODO #! upDownExits = beside [] [(px -3.0,zero)] ('DL'.strictTRMap (drawHop c3d hopLocks multiplier) hops) NoHost
#! upDownExits = beside [] [px -3.0] Nothing [] ('DL'.strictTRMap (drawHop c3d hopLocks multiplier) hops) NoHost
#! hdoor = rect (px doorw) (px doord)
#! vdoor = rect (px doord) (px doorw)
#! hwall = xline Nothing (px swidth)
#! vwall = yline Nothing (px sheight)
#! hwall = xline (px swidth)
#! vwall = yline (px sheight)
= f canCloseDoors c3d inventory devices multiplier inventoryBadges deviceBadges cableBadges upDownExits hdoor vdoor hwall vwall
where
drawInventory :: !Real !(Object ObjectType) -> Image a
......@@ -193,8 +211,9 @@ sectionImage` f mngmnt zoomed hopLocks inventoryMap allDevices network (doorw, d
mkCable :: !Cable -> Image a
mkCable cable
#! linePiece = xline Nothing (px 4.0)
= beside (repeat AtMiddleY) [] [linePiece, text (mapFont mapTitleFontSize) (cable.Cable.description % (0, 1)), linePiece] NoHost
#! linePiece = xline (px 4.0)
//TODO = beside (repeat AtMiddleY) [] [linePiece, text (mapFont mapTitleFontSize) (cable.Cable.description % (0, 1)), linePiece] NoHost
= beside (repeat AtMiddleY) [] Nothing [] [linePiece, text (mapFont mapTitleFontSize) (cable.Cable.description % (0, 1)), linePiece] NoHost
mkUpDown :: !Coord3D !Coord3D !SectionHopLockMap -> Image a
mkUpDown cur=:(curFloor, _) next=:(nextFloor, _) hopLocks
......@@ -202,7 +221,8 @@ mkUpDown cur=:(curFloor, _) next=:(nextFloor, _) hopLocks
Just xs -> 'DL'.elem next xs
_ -> False
#! goesUp = curFloor > nextFloor
= beside (repeat AtBottom) [] ('DL'.strictTRMap (\n -> rect (px 3.0) ((px 3.0) *. n)) (if goesUp [1,2,3] [3,2,1])) NoHost <@< { opacity = if l 0.3 1.0 }
//TODO = beside (repeat AtBottom) [] ('DL'.strictTRMap (\n -> rect (px 3.0) ((px 3.0) *. n)) (if goesUp [1,2,3] [3,2,1])) NoHost <@< { opacity = if l 0.3 1.0 }
= beside (repeat AtBottom) [] Nothing [] ('DL'.strictTRMap (\n -> rect (px 3.0) ((px 3.0) *. n)) (if goesUp [1,2,3] [3,2,1])) NoHost <@< { opacity = if l 0.3 1.0 }
mkStatusBadge :: !SectionStatus Coord3D !RenderMode !Real ![Image (a, MapAction SectionStatus)] !SectionStatus
-> [Image (a, MapAction SectionStatus)]
......@@ -233,7 +253,8 @@ mkActorBadge {actorStatus = {occupied}, userName, carrying}
#! userInitial = text myFontDef (userStr % (0,0)) <@< { fill = toSVGColor "white" }
#! actorBadge = overlay [(AtMiddleX, AtMiddleY)] [] [userInitial] (Host actorBadge)
#! inventory = 'DL'.strictTRMap (\i -> mkInventoryBadge False True (toString i % (0, 1))) carrying
= above (repeat AtMiddleX) [] [actorBadge : inventory] NoHost
//TODO = above (repeat AtMiddleX) [] [actorBadge : inventory] NoHost
= above (repeat AtMiddleX) [] Nothing [] [actorBadge : inventory] NoHost
mkActorBadgeBackground :: !Availability -> Image a
mkActorBadgeBackground occupied = medBadgeImage <@< { fill = toSVGColor (case occupied of
......@@ -298,7 +319,8 @@ editLayoutImage act allDevices network inventoryMap idx {Map2D | shape2D, doors2
#! titleImg = mapTitleImage idx (hilite act) size2D (hint mapId) <@< {onclick = onClick (FocusOnMap idx), local = False}
#! editImg = editSectionsImage (hilite act) allDevices network inventoryMap idx doors2D size2D map2D
#! bottomImg = mask editImg size2D shape2D
= above [] [] [titleImg, bottomImg] NoHost
= above [] [] Nothing [] [titleImg, bottomImg] NoHost
//TODO = above [] [] [titleImg, bottomImg] NoHost
hint msg = msg +++ " (click in this area to edit this map)"
......
......@@ -23,7 +23,13 @@ import C2.Apps.ShipAdventure.Editor
derive gLexOrd CableType, Capability
derive class iTask ObjectType, ActorStatus, Availability, ActorHealth, ActorEnergy, DeviceType, SectionStatus
derive class iTask Cable, Priority, Network, Device, CableType, DeviceKind, CommandAim, Set, Capability, CapabilityExpr
derive class iTask Cable, Priority, Network, Device, CableType, DeviceKind, CommandAim, Capability, CapabilityExpr
derive gEditor Set
derive gDefault Set
derive gText Set
derive JSONEncode Set
derive JSONDecode Set
derive JSEncode Map2D, Coord2D, Map, IntMap, Dir, User, Maybe, Section, Borders, Border, MapAction, Object, Actor
derive JSEncode ObjectType, ActorStatus, Availability, ActorHealth, ActorEnergy, DeviceType, SectionStatus
......@@ -286,7 +292,7 @@ deviceIdInNetworkSectionShare = sdsLens "deviceIdInNetworkSectionShare" (const (
write c3d network devIds = Ok (Just ({network & devices = 'DM'.put c3d devIds network.devices}))
notify :: !Coord3D !Network ![DeviceId] -> SDSNotifyPred Coord3D
notify c3d network devIds = \idx` -> c3d == idx`
notify c3d network devIds = \_ idx` -> c3d == idx`
devicesInSectionShare :: RWShared Coord3D [Device] [Device]
devicesInSectionShare
......@@ -360,8 +366,8 @@ cablesInSectionShare = sdsLens "cablesInSectionShare" (const ()) (SDSRead read)
in if inList network
{network & cableMapping = 'DIS'.put cable.cableId [(True, c3d) : coords] network.cableMapping}
) network cables))
notify :: !Coord3D !Network ![Cable] -> (Coord3D -> Bool)
notify c3d oldNetwork newCables = \c3d` -> c3d === c3d`
notify :: !Coord3D !Network ![Cable] -> SDSNotifyPred Coord3D
notify c3d oldNetwork newCables = \_ c3d` -> c3d === c3d`
cablesForSection :: !Coord3D !Network -> [Cable]
cablesForSection c3d { Network | cables, cableMapping }
......
......@@ -36,7 +36,7 @@ selectedContactShare = sdsLens "selectedContactShare" (const ()) (SDSRead read)
write _ st=:{selection, entities} e = Ok (Just {st & entities = 'DIS'.put selection e entities})
notify :: () MapState Entity -> SDSNotifyPred ()
notify _ _ _ = \_ -> False
notify _ _ _ = \_ _ -> False
userMapState :: User -> Shared MapState
userMapState u = sharedStore ("userMapState" +++ toString u) defSettings
......@@ -70,7 +70,7 @@ contactWithId = sdsLens "contactWithId" (const ()) (SDSRead read) (SDSWrite writ
write idx st=:{entities} e = Ok (Just {st & entities = 'DIS'.put idx e entities})
notify :: Int MapState Entity -> SDSNotifyPred Int
notify idx _ _ = \idx` -> idx == idx`
notify idx _ _ = \_ idx` -> idx == idx`
resetMapState :: Task ()
resetMapState = set defSettings mapState @! ()
......
......@@ -29,7 +29,7 @@ where
>>| allTasks (map (\f -> f me) (regEntities me))
>>~ \ents -> (allTasks (map (\f -> f me ents) (contBgTasks me)))
||-
whileAuthenticated me ents alwaysOnTasks tlist <<@ ApplyLayout (foldl1 sequenceLayouts [removeSubUIs (SelectByPath [0]),unwrapUI])
whileAuthenticated me ents alwaysOnTasks tlist <<@ ApplyLayout (sequenceLayouts [removeSubUIs (SelectByPath [0]),unwrapUI])
whileAuthenticated :: User [Entity]
(User -> [(String, User [Entity] -> Task ())])
......@@ -59,7 +59,7 @@ whileAuthenticated user ents alwaysOnTasks tlist
doOpen :: Workspace [(TaskId, WorklistRow)] -> Task ()
doOpen ws xs = sequence "openAssignedTasks" (map (\(taskId, _) -> appendOnce taskId (workOn taskId @! ()) ws) xs) @! ()
layout = foldl1 sequenceLayouts
layout = sequenceLayouts
[removeSubUIs (SelectByPath [1]) //Don't show the openAssignedTasks UI
,arrangeWithSideBar 0 RightSide 300 True
,layoutSubUIs (SelectByPath [0]) (arrangeWithTabs True)
......
......@@ -80,7 +80,7 @@ sharedGraph = sdsLens "sharedGraph" (const ()) (SDSRead read) (SDSWriteConst wri
write _ _ = Ok Nothing
notify _ _ = const True
notify _ _ = const (const True)
sectionUsersShare :: SectionUsersShare
sectionUsersShare = sharedStore "sectionUsersShare" 'DM'.newMap
......@@ -393,9 +393,9 @@ uiAbove refs = UIAbove refs
/*
modifyUI :: (TaskUITree -> TaskUILayout) -> Layout
modifyUI f = idLayout
/*
modifyUI f = \(uichange, json) -> case uichange of
ReplaceUI ui -> (ReplaceUI (toLayout ui (f (uiToRefs ui))), json)
_ -> (uichange, json)
......@@ -415,7 +415,7 @@ moveAround :: !(DrawMapForActor r o a) !User
moveAround viewDeck user inventoryForSectionShare
shipStatusShare userToActorShare inventoryForAllSectionsShare
= forever ( walkAround -||- changeDecks
-||- pickUpItems -||- dropItems) <<@ ApplyLayout (modifyUI moveAroundUI)
-||- pickUpItems -||- dropItems) //<<@ ApplyLayout (idLayout modifyUI moveAroundUI)
where
walkAround :: Task ()
walkAround
......@@ -526,7 +526,7 @@ sectionForSectionNumberShare = sdsLens "sectionForSectionNumberShare" (const ())
write (floorIdx, c2d) ms2d section = Ok (Just (updMap2D floorIdx (setSection c2d section) ms2d))
notify :: Coord3D Maps2D Section -> SDSNotifyPred Coord3D
notify c3d _ _ = \c3d` -> c3d == c3d`
notify c3d _ _ = \_ c3d` -> c3d == c3d`
pickupObject :: !Coord3D !(Object o) !User !(UserActorShare o a) !(FocusedSectionInventoryShare o)
-> Task () | iTask o & iTask a
......@@ -633,7 +633,7 @@ actorsInSectionShare userActorShare = sdsLens "actorsInSectionShare" (const ())
write c3d (sectionUsersMap, userActorMap) actors = Ok (Just ('DM'.put c3d (map (\a -> a.userName) actors) sectionUsersMap, 'DM'.fromList [(a.userName, a) \\ a <- actors]))
notify :: Coord3D (SectionUsersMap, UserActorMap o a) [Actor o a] -> SDSNotifyPred Coord3D
notify c3d _ _ = \c3d` -> c3d == c3d`
notify c3d _ _ = \_ c3d` -> c3d == c3d`
actorForUserShare :: (UserActorShare o a) -> FocusedUserActorShare o a | iTask o & iTask a
actorForUserShare userActorShare = mapMaybeLens "actorForUserShare" userActorShare
......
......@@ -53,7 +53,11 @@ damagePrediction
resetSections = set 'DS'.newSet disabledSections >>| damagePrediction
isDisabled c3d disSects = 'DS'.member c3d disSects
derive class iTask Set
derive gEditor Set
derive gDefault Set
derive gText Set
derive JSONEncode Set
derive JSONDecode Set
showCommandAims :: Task ()
showCommandAims = viewSharedInformation "Current Command Aims" [] commandAims @! ()
......
Version: 1.4
Global
ProjectRoot: .
Target: iTasks
Exec: {Project}/main.exe
CodeGen
CheckStacks: False
CheckIndexes: True
Application
HeapSize: 524288000
StackSize: 10485760
ExtraMemory: 81920
IntialHeapSize: 8388608
HeapSizeMultiplier: 4096
ShowExecutionTime: False
ShowGC: False
ShowStackSize: False
MarkingCollector: False
DisableRTSFlags: False
StandardRuntimeEnv: True
Profile
Memory: False
MemoryMinimumHeapSize: 0
Time: False
Stack: False
Dynamics: True
GenericFusion: False
DescExL: False
Output
Output: ShowConstructors
Font: Courier
FontSize: 9
WriteStdErr: False
Link
LinkMethod: Static
GenerateRelocations: False
GenerateSymbolTable: False
GenerateLinkMap: False
LinkResources: False
ResourceSource:
GenerateDLL: False
ExportedNames:
Paths
Path: {Project}
Precompile:
Postlink:
MainModule
Name: main
Dir: {Project}
Compiler
NeverMemoryProfile: False
NeverTimeProfile: False
StrictnessAnalysis: True
ListTypes: NoTypes
ListAttributes: True
Warnings: True
Verbose: True
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
......@@ -10,5 +10,4 @@ find . -name "*.prj.default" | while read f; do
done
find . -name "*.prj" | xargs dirname | sort -u | xargs -I{} sh -c "cd {}; cpm make"
#Run the tests
( cd Tools; ./RunUnitTestsForCI; )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment