Cleanup, split CWorld into separate file

This commit is contained in:
2022-07-26 21:19:12 +01:00
parent c2707719fb
commit 6554d219dc
27 changed files with 1049 additions and 911 deletions
+3 -3
View File
@@ -141,7 +141,7 @@ subInventoryDisplay subinv cfig w = case subinv of
equipcursors = IM.foldMapWithKey (f yellow) (_crInvEquipped cr)
f col invid epos = listTextPictureAt 144 0 cfig (selNumPos invid w) . color col $ text $ eqPosText epos
rboptions = if ButtonRight `M.member` _mouseButtons w
then drawRBOptions cfig w (_rbOptions (_cWorld w))
then drawRBOptions cfig w (_rbOptions w)
else mempty
itmInfo :: Maybe Item -> [String]
@@ -187,7 +187,7 @@ drawRBOptions cfig w EquipOptions{_opEquip = es,_opSel=i, _opAllocateEquipment=a
where
midtext str = listTextPictureAt 252 0 cfig curpos (text str)
extratext str = listTextPictureAt 432 0 cfig curpos (text (str ++ deactivatetext))
deactivatetext = case w ^? cWorld . rbOptions . opActivateEquipment . deactivateEquipment of
deactivatetext = case w ^? rbOptions . opActivateEquipment . deactivateEquipment of
Just k -> " DEACTIVATES " ++ show (_iyBase $ _itType (_crInv (you w) IM.! k))
Nothing -> ""
curpos = invSelPos w
@@ -255,7 +255,7 @@ topCursorTypeWidth ctype width cfig w i
= ctype 0 0 cfig (selNumPos i w) (selNumCol i w) width (selNumSlots i w)
determineInvSelCursorWidth :: World -> Int
determineInvSelCursorWidth w = case _rbOptions (_cWorld w) of
determineInvSelCursorWidth w = case _rbOptions w of
NoRightButtonOptions -> topInvW
EquipOptions {} -> if ButtonRight `M.member` _mouseButtons w
then 47