Commit 0f027c30 authored by Mart Lubbers's avatar Mart Lubbers

Fix multiuser stuff and remove trailing space in examples

parent 0f6de3a5
Pipeline #12627 passed with stage
in 3 minutes and 38 seconds
......@@ -33,7 +33,7 @@ import Incidone.OP.Concepts
}
:: ActionTasks
= E.c: ActionTasks
= E.c: ActionTasks
([ContactNo] [IncidentNo] -> Task (c,ActionStatus)) //Configuration task
(c (Shared ActionStatus) -> Task ()) & iTask c //An action item that needs to be configured before it can be deployed
......@@ -97,7 +97,7 @@ import Incidone.OP.Concepts
:: CommunicationMeanSuggestion
= CommunicateUsingPhone
| CommunicateUsingVHF
| CommunicateUsingP2000
| CommunicateUsingP2000
| CommunicateUsingEmail
:: UserActionListDefinition =
......
implementation module Incidone.ContactPosition
import iTasks, iTasks.UI.Editor, iTasks.UI.Editor.Controls, iTasks.UI.Editor.Modifiers, iTasks.UI.Definition
import qualified Data.Map as DM
import Data.Functor, Data.List, Text
import Data.Functor, Data.List, Text
import qualified Text.Parsers.ZParsers.ParsersKernel as PK
import qualified Text.Parsers.ZParsers.ParsersDerived as PD
import qualified Control.Applicative as CA
......@@ -15,7 +15,7 @@ import Incidone.Util.TaskPatterns
derive JSONEncode ContactPosition
derive JSONDecode ContactPosition
gEditor{|ContactPosition|} = bijectEditorValue printPosition parsePosition textField
gEditor{|ContactPosition|} = bijectEditorValue printPosition parsePosition textField
gText{|ContactPosition|} _ val = [maybe "" printPosition val]
derive gDefault ContactPosition
......
......@@ -7,7 +7,7 @@ import Text.HTML
selectVideoWallContent :: Task ()
selectVideoWallContent
= (header ||- selectContent) <<@ (ArrangeWithSideBar 0 TopSide 30 False)
= (header ||- selectContent) <<@ (ArrangeWithSideBar 0 TopSide 30 False)
@! ()
where
header
......
......@@ -38,7 +38,7 @@ answerPhoneCall communicationNo
>>| connectInboundPhoneCall communicationNo
||- ((manageCommunicationContact communicationNo
-&&-
manageVoiceCallContent PhoneCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide 300 True)
manageVoiceCallContent PhoneCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide 300 True)
<<@ ArrangeWithSideBar 0 TopSide 60 False
<<@ Title ("Answer phone call")
/* <<@ AfterLayout (uiDefSetSize (ExactSize 800) (ExactSize 600)) */ //FIXME
......
......@@ -26,7 +26,7 @@ selectContact = withShared Nothing
(viewContactsOnMap mapContacts sel <<@ Title "Map")
<<@ ArrangeWithTabs True
)
where
where
mapContacts = mapRead (\(x,y) -> x++y) (contactsOfOpenIncidentsGeo |+| contactsProvidingHelpGeo)
selectContactFromLists :: (Shared (Maybe (Either ContactNo MMSI))) -> Task (Either ContactNo MMSI)
......@@ -40,7 +40,7 @@ where
/*
,(editSharedSelectionWithShared (Title "AIS") False
(SelectInTree ungrouped) (mapRead (sortBy (\x y -> contactTitle x < contactTitle y) o map aisToContact) allAISContacts) (Right o contactIdentity)) sel
*/ ] <<@ (ArrangeSplit Horizontal True) @? tvHd
*/ ] <<@ (ArrangeSplit Horizontal True) @? tvHd
fromOpenOption [{ContactShortWithIncidents|contactNo}] = contactNo
......@@ -195,7 +195,7 @@ manageContactCommunicationMeans compact contactNo = forever (
>^* [OnAction ActionAdd (always (addMean contactNo <<@ InWindow @! ()))
,OnAction ActionEdit (hasValue (\{CommunicationMean|id} -> editMean id <<@ InWindow @! ()))
,OnAction ActionRemove (hasValue (\{CommunicationMean|id} -> removeMean id))
]
]
)
where
ActionAdd = Action (if compact "Add" "/Add")
......@@ -263,7 +263,7 @@ manageContactIncidents :: Workspace ContactNo -> Task ()
manageContactIncidents ws contactNo
= feedForward choose
( \sel ->
withSelection viewNoSelection viewIncidentDetails sel
withSelection viewNoSelection viewIncidentDetails sel
-&&-
doAddRemoveOpen (add <<@ InWindow) (\c -> (remove c) <<@ InWindow) (\c -> doOrClose (open c)) ws sel
) <<@ (ArrangeWithSideBar 1 RightSide 300 True) <<@ (Icon "incidents") <<@ (Title "Incidents")
......@@ -596,7 +596,7 @@ where
selection _ = NoValue
sharePerspective (_,perspective) = set (WallOverview perspective) wallContent @! ()
toMarkers sel contacts
= [contactGeoToMapMarker ais (isSelected contactNo sel) c \\ (ais,c=:{ContactGeo|contactNo,name=Just _,position=Just _}) <- contacts]
......@@ -609,7 +609,7 @@ where
| startsWith "c" markerId = Just (Left (toInt (subString 1 (textSize markerId) markerId)))
| startsWith "a" markerId = Just (Right (toInt (subString 1 (textSize markerId) markerId)))
= updateSelection ms
findContactNo title contacts = case [(isAis,contactNo) \\ (isAis,{ContactGeo|contactNo,name}) <- contacts | name == title] of
[(False,contactNo)] = Just (Left contactNo)
[(True,mmsi)] = Just (Right mmsi)
......
......@@ -94,11 +94,11 @@ where
contactSummary :: Contact -> ContactShort
contactSummary {Contact|contactNo,name,type,group}
= {ContactShort|contactNo = contactNo, name = name, type = type, group = group}
incidentDetails :: Incident -> IncidentDetails
incidentDetails {Incident|incidentNo,title,summary,type,phase}
= {IncidentDetails|incidentNo = incidentNo, title = title, summary = summary, type = type, phase = phase}
contactDetails :: Contact -> ContactDetails
contactDetails {Contact|contactNo,name,type,position,notes}
= {ContactDetails|contactNo = contactNo, name = name, type = type, position = position, notes = notes}
......
......@@ -27,7 +27,7 @@ manageIncidentInformation ws incidentNo
,(Embedded, \_ -> manageIncidentContacts ws incidentNo)
,(Embedded, \_ -> manageIncidentActions incidentNo)
,(Embedded, \_ -> manageIncidentWeather incidentNo)
,(Embedded, \_ -> manageIncidentLog incidentNo)
,(Embedded, \_ -> manageIncidentLog incidentNo)
] [] <<@ ArrangeWithTabs False)
@! ()
......@@ -101,7 +101,7 @@ manageIncidentActions incidentNo
@! ()
where
selectAndWorkOnPlannedActions
= (feedForward (chooseActionItem (Title "Overview") False True (sdsFocus incidentNo actionStatusesByIncident) /* <<@ AfterLayout (tweakUI fill) */)
= (feedForward (chooseActionItem (Title "Overview") False True (sdsFocus incidentNo actionStatusesByIncident) /* <<@ AfterLayout (tweakUI fill) */)
(\s -> whileUnchanged s
(\t -> case t of
Just taskId = workOnActionItem taskId
......@@ -152,7 +152,7 @@ where
( enterInformation () [] @ string
>>* [OnAction (Action "Add log message") (hasValue (\msg -> addLogMessage msg incidentNo))]
)
string :: String -> String
string x = x
......@@ -350,7 +350,7 @@ createIncident incident
logIncidentCreated incidentNo incident
@! incidentNo
where
create :: NewIncident -> Task IncidentNo
create :: NewIncident -> Task IncidentNo
create {NewIncident|type,title,summary}
= get databaseDef
>>- \db -> sqlExecute db ["allIncidents"] (execInsert "INSERT INTO Incident (type,title,summary) VALUES (?,?,?)"
......
......@@ -143,7 +143,7 @@ where
# (err,cur) = execute "INSERT INTO PhoneCall (communicationNo,externalNo) VALUES (?,?)"
(flatten [toSQL communicationNo,mbToSQL externalNo]) cur
| isJust err
# (err,cur) = execute "UPDATE PhoneCall SET externalNo = ? WHERE communicationNo = ?"
# (err,cur) = execute "UPDATE PhoneCall SET externalNo = ? WHERE communicationNo = ?"
(flatten [mbToSQL externalNo,toSQL communicationNo]) cur
| isJust err = (Error (toString (fromJust err)),cur)
= (Ok (), cur)
......@@ -193,7 +193,7 @@ where
detailsIncidents :: (Maybe RowFilterDef) -> ReadOnlyShared [IncidentDetails]
detailsIncidents mbWhere = mapRead (map prj) (baseIncidents mbWhere)
where
where
prj {Incident|incidentNo,title,summary,type,phase}
= {IncidentDetails|incidentNo=incidentNo,title=title,summary=summary,type=type,phase=phase}
......@@ -327,7 +327,7 @@ where
, communications = fromMaybe [] ('DM'.get incident.Incident.incidentNo cmlinks)
, log = log
}
writePrj (incident=:{Incident|incidentNo,contacts,communications}) (((_,cnlinks),cmlinks),_)
= Just ((incident,'DM'.put incidentNo contacts cnlinks),'DM'.put incidentNo communications cmlinks)
writePrj _ _ = Nothing
......@@ -758,7 +758,7 @@ where
# (err,mbRow,cur) = fetchOne cur
| isJust err = (Error (toString (fromJust err)),cur)
= (Ok (fmap fromSQL mbRow), cur)
writeFun mmsi Nothing cur = (Ok (), cur) //Only write on Just
writeFun mmsi (Just contact=:{Contact|contactNo,type,name,group,position,heading,track,positionUpdated,needsHelp,providesHelp,notes,status}) cur
//Update contact info
......@@ -795,7 +795,7 @@ contactCommunicationMeans = sdsTranslate "contactCommunicationMeans" query (dbRe
where
query contactNo = {columns=columns,rows=rows contactNo,order = Nothing}
rows contactNo = Just (EqualsValue ("communicationMeans1_communicationMeans2","communicationMeans2") [SQLVInteger contactNo])
columns = InnerJoin columnsCommunicationMean
columns = InnerJoin columnsCommunicationMean
{name="communicationMeans1_communicationMeans2",alias="communicationMeans1_communicationMeans2",columns=[]}
("communicationMeans1_communicationMeans2","communicationMeans1") ("CommunicationMean","id")
......@@ -880,7 +880,7 @@ airplaneDetailsByNo = sdsTranslate "airplaneDetailsByNo" query (dbReadWriteOneSD
where
query contactNo = {columns=columnsAirplaneDetails,rows=Just (EqualsValue ("Airplane","contactNo") [SQLVInteger contactNo]), order=Nothing}
helicopterDetailsByNo :: RWShared ContactNo HelicopterDetails HelicopterDetails
helicopterDetailsByNo :: RWShared ContactNo HelicopterDetails HelicopterDetails
helicopterDetailsByNo = sdsTranslate "helicopterDetailsByNo" query (dbReadWriteOneSDS "helicopterDetailsByNo")
where
query contactNo = {columns=columnsHelicopterDetails,rows=Just (EqualsValue ("Helicopter","contactNo") [SQLVInteger contactNo]), order=Nothing}
......@@ -947,7 +947,7 @@ where
writeFun mmsi (Just {AISContact|position,heading,track,lastPositionMsg,lastInfoMsg,positionUpdated,infoUpdated}) cur
//Brute force upsert, try insert, if it fails, try update
# (res,cur) = execInsert "INSERT INTO AISContact (mmsi,position_lat,position_lon,position_desc,heading,track,lastPositionMsg,lastInfoMsg,positionUpdated,infoUpdated) VALUES (?,?,?,?,?,?,?,?,?,?)"
# (res,cur) = execInsert "INSERT INTO AISContact (mmsi,position_lat,position_lon,position_desc,heading,track,lastPositionMsg,lastInfoMsg,positionUpdated,infoUpdated) VALUES (?,?,?,?,?,?,?,?,?,?)"
(flatten [toSQL mmsi, mbToSQL position, mbToSQL heading, mbToSQL track, mbToSQL lastPositionMsg, mbToSQL lastInfoMsg,mbToSQL positionUpdated, mbToSQL infoUpdated]) cur
| res=:(Error _) //Try update
......
......@@ -141,7 +141,7 @@ manageUsers = forever (catchAll (
) (\e -> viewInformation "Error" [] e >>| return ()))
where
manageExistingUsers
= (enterChoiceWithSharedAs () [ChooseFromGrid id] allContactsShort contactIdentity
= (enterChoiceWithSharedAs () [ChooseFromGrid id] allContactsShort contactIdentity
>&> withSelection viewNoSelection manageContactAccess
)<<@ ArrangeWithSideBar 0 LeftSide 200 True
......@@ -222,7 +222,7 @@ configureMaps
where
previewMapLayers :: Task ContactMapPerspective
previewMapLayers = withShared defaultValue
\perspective -> updateSharedInformation (Title "Preview") [UpdateAs toPrj fromPrj] (perspective >*| standardMapLayers) <<@ ApplyLayout flexMap @ fst
\perspective -> updateSharedInformation (Title "Preview") [UpdateAs toPrj fromPrj] (perspective >*| standardMapLayers) <<@ ApplyLayout flexMap @ fst
where
toPrj (perspective,layers) = toLeafletMap {ContactMap|defaultValue & perspective=perspective,layers=layers}
fromPrj _ {LeafletMap|perspective} = fromLeafletPerspective perspective
......@@ -258,7 +258,7 @@ where
) (\e -> viewInformation "Failed import of web links" [] e @! ())
) <<@ Title "Import web links"
where
instructions = toString
instructions = toString
(PTag [] [Text "Please select a JSON export file to upload.",BrTag []
,Text "The file needs to be formatted like ",ATag [HrefAttr "/demo-content/weblinks.json",TargetAttr "_blank"] [Text "weblinks.json"]
])
......
......@@ -40,7 +40,7 @@ where
/*
* The incident dashboard gives an overview of all open incidents,
* provides ad-hoc creation of new incidents and provides
* provides ad-hoc creation of new incidents and provides
* a way to open the incident information browsing incident task for open incidents.
*/
browseIncidents :: Workspace -> Task ()
......@@ -91,7 +91,7 @@ where
{ status :: Maybe String
, title :: Maybe String
, createdOn :: Maybe String
, createdBy :: Maybe String
, createdBy :: Maybe String
}
derive class iTask ActionSet, ActionShort
......
......@@ -47,7 +47,7 @@ definition module Incidone.Util.AIS
, day :: Int // Day
, hour :: Int // Hour
, minute :: Int // Minute
, second :: Int // Second
, second :: Int // Second
, accuracy :: Bool // Fix quality
, lon :: Int // Longitude
, lat :: Int // Latitude
......
......@@ -56,7 +56,7 @@ TESTMESSAGES :==
, day :: Int // Day
, hour :: Int // Hour
, minute :: Int // Minute
, second :: Int // Second
, second :: Int // Second
, accuracy :: Bool // Fix quality
, lon :: Int // Longitude
, lat :: Int // Latitude
......@@ -113,7 +113,7 @@ where
= ([f6],remainder)
| otherwise
# (fragments,remainder) = decodeWrapper remainder
= ([f6:fragments],remainder)
= ([f6:fragments],remainder)
_ = ([],remainder)
//Decode the message data
......@@ -138,7 +138,7 @@ where
initMessage 4 = AIVDM4 initType4
initMessage 5 = AIVDM5 initType5
initMessage i = AIVDM i
initCNB type = {msgtype=type,repeat=0,mmsi=0,status=0,turn=0,speed=0,accuracy=False
,lon=0,lat=0,course=0,heading=0,second=0,maneuver=0,raim=False,radio=0}
initType4 = {msgtype=4,repeat=0,mmsi=0,year=0,month=0,day=0,hour=0,minute=0
......@@ -206,7 +206,7 @@ where
updMMSI i (AIVDM4 m) = AIVDM4 {AIVDM4|m & mmsi = i}
updMMSI i (AIVDM5 m) = AIVDM5 {AIVDM5|m & mmsi = i}
updMMSI i msg = msg
updCNB f i (AIVDM1 m) = AIVDM1 (f i m)
updCNB f i (AIVDM2 m) = AIVDM2 (f i m)
updCNB f i (AIVDM3 m) = AIVDM3 (f i m)
......
......@@ -4,7 +4,7 @@ import iTasks.Extensions.DateTime
import Text, System.Time
import Incidone.Util.TaskPatterns
//Notifications are stored newest first
//Notifications are stored newest first
notifications :: Shared [(DateTime,String)]
notifications = sharedStore "notifications" []
......@@ -15,7 +15,7 @@ where
prj (now,notifications) = [toString dt +++ msg \\ (dt,msg) <- notifications | limit now dt ]
limit t1 t2 = False //FIXME: We need an non-pure function to convert the datetime values, we can't do that with a mapRead...
/*
# (Timestamp s1) = datetimeToTimestamp t1
# (Timestamp s1) = datetimeToTimestamp t1
# (Timestamp s2) = datetimeToTimestamp t2
= s1 - s2 < 3
*/
......
......@@ -23,7 +23,7 @@ createNewIncident :: Task (Maybe IncidentNo)
createNewIncident
= enterInformation ("Create new incident", "Fill in the following basic information to create a new incident") []
>>? createIncident
createNewContact :: Task (Maybe ContactNo)
createNewContact
= enterInformation ("New contact","Enter the basic information of the new contact") []
......@@ -167,7 +167,7 @@ manageSharedListWithDetails :: (Int -> Task ()) (Task Int) (Shared [Int]) -> Tas
manageSharedListWithDetails detailsTask addTask refsList //Not the best implementation, but good enough for now
= get refsList
>>- \initList ->
parallel ([(Embedded, removeWhenStable (detailsTask i)) \\ i <- initList] ++ [(Embedded,add)]) []
parallel ([(Embedded, removeWhenStable (detailsTask i)) \\ i <- initList] ++ [(Embedded,add)]) []
@! ()
where
add list
......@@ -210,7 +210,7 @@ syncNetworkChannel :: String Int String (String -> m) (m -> String) (Shared ([m]
syncNetworkChannel server port msgSeparator decodeFun encodeFun channel
= tcpconnect server port channel {ConnectionHandlers|onConnect=onConnect,onData=onData,onShareChange=onShareChange,onDisconnect=onDisconnect} @! ()
where
onConnect _ (received,receiveStopped,send,sendStopped)
onConnect _ (received,receiveStopped,send,sendStopped)
= (Ok "",if (not (isEmpty send)) (Just (received,False,[],sendStopped)) Nothing, map encodeFun send,False)
onData newData acc (received,receiveStopped,send,sendStopped)
......@@ -223,7 +223,7 @@ where
onShareChange acc (received,receiveStopped,send,sendStopped)
= (Ok acc,Nothing,[],False)
onDisconnect l (received,receiveStopped,send,sendStopped)
onDisconnect l (received,receiveStopped,send,sendStopped)
= (Ok l,Just (received,True,send,sendStopped))
consumeNetworkStream :: ([m] -> Task ()) (Shared ([m],Bool,[m],Bool)) -> Task () | iTask m
......
......@@ -54,7 +54,7 @@ where
doAuthenticated :: (User -> Task a) -> Task a | iTask a
doAuthenticated task
= ( enterCredentials
= ( enterCredentials
>>* [OnAction (Action "Login")
(hasValue (\cred -> verifyCredentials cred >>- executeTask task))
] ) <<@ ApplyLayout (beforeStep (sequenceLayouts [setUIAttributes (titleAttr "Login"), frameCompact])) //Compact layout before login, full screen afterwards
......@@ -66,7 +66,7 @@ where
verifyCredentials :: Credentials -> Task (Maybe User)
verifyCredentials credentials=:{Credentials|username,password}
| username === Username "admin"
| username === Username "admin"
= get adminPassword >>- \password` -> if (password === password`)
(return (Just (AuthenticatedUser "admin" [] (Just "Administrator"))))
(return Nothing)
......@@ -82,7 +82,7 @@ whileAuthenticated user tasks
= (controlDash -|| workOnTasks) <<@ (ArrangeWithSideBar 0 TopSide 30 False)
where
controlDash = (
viewInformation () [] ("Welcome " +++ toString user)
viewInformation () [] ("Welcome " +++ toString user)
-&&-
viewNotifications
>>* [OnAction (Action "Log out") (always (return ()))]
......
......@@ -195,7 +195,7 @@ graphicalMapEditor
where
imageEditor = fromSVGEditor
{ initView = fst
, renderImage = \((_, act), ((inventoryMap, network), allDevices)) (ms2d, _) _ ->
, renderImage = \((_, act), ((inventoryMap, network), allDevices)) (ms2d, _) _ ->
//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
......@@ -241,10 +241,10 @@ editOuterBorders border ship mapID = case getMap2DIndex mapID ship of
#! m2d = foldr (\rowIdx -> updSection {row = rowIdx, col = lastColIdx} (editBorder E border)) m2d [0..lastRowIdx]
= m2d
editBorders _ m2d = m2d
editBorder :: !Dir !Border !Section -> Section
editBorder dir border s = {Section | s & borders = edit dir border s.Section.borders}
edit :: !Dir !Border !Borders -> Borders
edit N border b = {Borders | b & n = border}
edit E border b = {Borders | b & e = border}
......@@ -376,7 +376,7 @@ where
where
curNoOfRows = length sections
curNoOfColumns = length (hd sections)
heighten :: ![[Section]] -> [[Section]]
heighten sects = if (newNoOfRows < curNoOfRows) (take newNoOfRows sects)
(if (newNoOfRows > curNoOfRows) (sects ++ [ [ initSection
......@@ -393,7 +393,7 @@ where
\\ row <- sects & row_no <- [0..]
]
sects)
updateNoOfMaps :: !Int !Maps2D -> Maps2D
updateNoOfMaps newNoOfMaps maps
| newNoOfMaps <= 0 = maps
......@@ -408,7 +408,7 @@ where
(dim,mapsize,doorsize)
= if (isEmpty maps) ((1,1),initMap2DSize,initDoors2DSize)
(let map = hd maps in (dimension map,map.Map2D.size2D,map.Map2D.doors2D))
noUpStairs :: !Section -> Section
noUpStairs s=:{Section | hops}
= {Section | s & hops = filter (\(idx,_) -> idx <= topfloor) hops}
......@@ -460,7 +460,7 @@ fromMapActionForm (maps,edit) sectionE=:{EditForm | map2DIndex = idx,section=c,n
= (updMap2D idx ((updateMapID newMapId) o (updSection c (updateSection (idx,c) sectionE))) (updHops (idx,c) up down maps),updateSelection (idx,c) edit)
where
new_hops = if up [(idx-1,c)] [] ++ if down [(idx+1,c)] []
updHops :: !Coord3D !Bool !Bool !Maps2D -> Maps2D
updHops source=:(idx,c) up down maps
= case getMap2D idx maps of
......@@ -474,14 +474,14 @@ where
where
removeHop c maps (idx,c`) = updMap2D idx (updSection c` (\s=:{Section | hops} -> {Section | s & hops = removeMember c hops})) maps
addHop c maps (idx,c`) = updMap2D idx (updSection c` (\s=:{Section | hops} -> {Section | s & hops = [c:hops]})) maps
updateMapID :: !MapID !Map2D -> Map2D
updateMapID newId map = {Map2D | map & mapId = newId}
updateSection :: !Coord3D !EditForm !Section -> Section
updateSection (idx,c) {EditForm | sectionName,up,down} s
= {Section | s & sectionName=fromMaybe "" sectionName,hops = new_hops}
updateSelection :: !Coord3D !(MapAction s) -> MapAction s
updateSelection c3d (FocusOnMap _) = FocusOnSection c3d
updateSelection c3d (FocusOnSection _) = FocusOnSection c3d
......
......@@ -224,7 +224,7 @@ mkUpDown cur=:(curFloor, _) next=:(nextFloor, _) hopLocks
//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
mkStatusBadge :: !SectionStatus Coord3D !RenderMode !Real ![Image (a, MapAction SectionStatus)] !SectionStatus
-> [Image (a, MapAction SectionStatus)]
mkStatusBadge activeSectionStatus c3d mngmnt badgeMult acc roomStatus
#! high = activeSectionStatus === roomStatus
......
......@@ -4,7 +4,7 @@ import C2.Framework.MapEnvironment
import C2.Apps.ShipAdventure.Types
// returns: distance, number of objects found, location of object, distance to object, shortest path to obejct
//shipPathToClosestObject :: Object Coord3D MyMap -> (Int,(Coord3D,Distance, Maybe ([Exit], Distance)))
//shipPathToClosestObject :: Object Coord3D MyMap -> (Int,(Coord3D,Distance, Maybe ([Exit], Distance)))
//shipPathToClosestObject kind actorLoc curMap = pathToClosestObject shipShortestPath kind actorLoc curMap
smartShipPathToClosestObject :: !ObjectType !MySectionInventoryMap !Coord3D !Coord3D !MySectionStatusMap !SectionExitLockMap !SectionHopLockMap !Graph
......
definition module C2.Apps.ShipAdventure.Scripting
import iTasks
import C2.Apps.ShipAdventure.Types
......@@ -15,7 +15,7 @@ import C2.Apps.ShipAdventure.Types
| Take ObjectType
| Drop ObjectType
| Use ObjectType
| ReSetTargetDetector
| ReSetTargetDetector
| If Condition [Script] [Script]
:: Condition = ObjectInCurrentSection ObjectType
| CarriesObject ObjectType
......
......@@ -22,13 +22,13 @@ handleSmokeScript :: Shared [Script]
handleSmokeScript = sharedStore "handleSmokeScript" []
changeFireScript :: Task ()
changeFireScript = changeScript "Handling Fire" handleFireScript
changeFireScript = changeScript "Handling Fire" handleFireScript
changeFloodScript :: Task ()
changeFloodScript = changeScript "Handling Flood" handleFloodScript
changeFloodScript = changeScript "Handling Flood" handleFloodScript
changeSmokeScript :: Task ()
changeSmokeScript = changeScript "Handling Smoke" handleSmokeScript
changeSmokeScript = changeScript "Handling Smoke" handleSmokeScript
changeScript :: !String !(Shared [Script]) -> Task ()
changeScript prompt script
......
definition module C2.Apps.ShipAdventure.Types
import C2.Framework.MapEnvironment
import Data.GenLexOrd
from C2.Apps.ShipAdventure.Images import :: RenderMode
......
implementation module C2.Apps.ShipAdventure.Types
//import iTasks
import iTasks.Internal.Tonic
import iTasks.Extensions.Admin.TonicAdmin
import iTasks.Extensions.SVG.SVGEditor
......@@ -431,7 +431,7 @@ updateMapStatus mode
where
editor = fromSVGEditor