Cleanup
This commit is contained in:
+1
-50
@@ -1,50 +1 @@
|
|||||||
/home/justin/Haskell/loop/src/Dodge/Render/HUD.hs:317:1-10: warning: [-Wunused-top-binds]
|
All good (608 modules, at 14:21:16)
|
||||||
Defined but not used: ‘tweakItems’
|
|
||||||
|
|
|
||||||
317 | tweakItems = textSelItems . ammoTweakStrings
|
|
||||||
| ^^^^^^^^^^
|
|
||||||
/home/justin/Haskell/loop/src/Dodge/Render/HUD.hs:320:1-16: warning: [-Wunused-top-binds]
|
|
||||||
Defined but not used: ‘ammoTweakStrings’
|
|
||||||
|
|
|
||||||
320 | ammoTweakStrings _ = []-- case it ^? _Just . itTweaks . tweakParams of
|
|
||||||
| ^^^^^^^^^^^^^^^^
|
|
||||||
/home/justin/Haskell/loop/src/Dodge/Render/HUD.hs:326:1-11: warning: [-Wunused-top-binds]
|
|
||||||
Defined but not used: ‘tweakString’
|
|
||||||
|
|
|
||||||
326 | tweakString tp = rightPad 12 ' ' (show $ _tweakType tp) ++ " " ++ showTweak tp
|
|
||||||
| ^^^^^^^^^^^
|
|
||||||
/home/justin/Haskell/loop/src/Dodge/Render/HUD.hs:379:1-12: warning: [-Wunused-top-binds]
|
|
||||||
Defined but not used: ‘textSelItems’
|
|
||||||
|
|
|
||||||
379 | textSelItems = map (picsToSelectable . (: []))
|
|
||||||
| ^^^^^^^^^^^^
|
|
||||||
/home/justin/Haskell/loop/src/Dodge/Render/HUD.hs:382:1-16: warning: [-Wunused-top-binds]
|
|
||||||
Defined but not used: ‘picsToSelectable’
|
|
||||||
|
|
|
||||||
382 | picsToSelectable pics =
|
|
||||||
| ^^^^^^^^^^^^^^^^
|
|
||||||
/home/justin/Haskell/loop/src/Dodge/Update/Scroll.hs:15:1-18: warning: [-Wunused-imports]
|
|
||||||
The import of ‘Dodge.Tweak’ is redundant
|
|
||||||
|
|
|
||||||
15 | import Dodge.Tweak
|
|
||||||
| ^^^^^^^^^^^^^^^^^^
|
|
||||||
/home/justin/Haskell/loop/src/Dodge/Update/Input/InGame.hs:9:1-21: warning: [-Wunused-imports]
|
|
||||||
The import of ‘Dodge.Base.You’ is redundant
|
|
||||||
|
|
|
||||||
9 | import Dodge.Base.You
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
/home/justin/Haskell/loop/src/Dodge/Item/Held/BatteryGuns.hs:19:1-33: warning: [-Wunused-imports]
|
|
||||||
The qualified import of ‘IntMapHelp’ is redundant
|
|
||||||
|
|
|
||||||
19 | import qualified IntMapHelp as IM
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
/home/justin/Haskell/loop/src/Dodge/Item/Held/BatteryGuns.hs:79:1-11: warning: [-Wunused-top-binds]
|
|
||||||
Defined but not used: ‘lasGunTweak’
|
|
||||||
|
|
|
||||||
79 | lasGunTweak =
|
|
||||||
| ^^^^^^^^^^^
|
|
||||||
/home/justin/Haskell/loop/src/Dodge/Item/Held/BatteryGuns.hs:102:1-15: warning: [-Wunused-top-binds]
|
|
||||||
Defined but not used: ‘tractorGunTweak’
|
|
||||||
|
|
|
||||||
102 | tractorGunTweak =
|
|
||||||
| ^^^^^^^^^^^^^^^
|
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ useRootItem crid w = fromMaybe w $ do
|
|||||||
|
|
||||||
itemUseEffect :: Creature -> LabelDoubleTree ComposeLinkType Item -> World -> World
|
itemUseEffect :: Creature -> LabelDoubleTree ComposeLinkType Item -> World -> World
|
||||||
itemUseEffect cr it w = case it ^. ldtValue . itUse of
|
itemUseEffect cr it w = case it ^. ldtValue . itUse of
|
||||||
HeldUse{ } -> heldEffect it cr w
|
UseHeld{} -> heldEffect it cr w
|
||||||
& pointerToItem itm . itUse . heldHammer .~ HammerDown
|
& pointerToItem itm . itUse . heldHammer .~ HammerDown
|
||||||
LeftUse{} -> doequipmentchange
|
UseHotkey{} -> doequipmentchange
|
||||||
EquipUse{} -> doequipmentchange
|
EquipUse{} -> doequipmentchange
|
||||||
(ConsumeUse eff) -> useC eff (_ldtValue it) cr w
|
(ConsumeUse eff) -> useC eff (_ldtValue it) cr w
|
||||||
CraftUse{} -> w
|
CraftUse{} -> w
|
||||||
@@ -103,13 +103,11 @@ useItemLeftClick cr w = fromMaybe w $ do
|
|||||||
invid <- cr ^? crManipulation . manObject . imSelectedItem
|
invid <- cr ^? crManipulation . manObject . imSelectedItem
|
||||||
ituse <- cr ^? crInv . ix invid . itUse
|
ituse <- cr ^? crInv . ix invid . itUse
|
||||||
case ituse of
|
case ituse of
|
||||||
--HeldUse{} -> return $ hammerTest (cWorld . lWorld . creatures . ix (_crID cr) %~ crReloadToggle)
|
UseHeld{} -> return w
|
||||||
HeldUse{} -> return w
|
|
||||||
ConsumeUse{} -> return $ useItemLeftClick' cr w
|
ConsumeUse{} -> return $ useItemLeftClick' cr w
|
||||||
EquipUse{} -> return $ useItemLeftClick' cr w
|
EquipUse{} -> return $ useItemLeftClick' cr w
|
||||||
LeftUse{} -> return $ useItemLeftClick' cr w
|
UseHotkey{} -> return $ useItemLeftClick' cr w
|
||||||
AmmoMagUse{} -> return w
|
AmmoMagUse{} -> return w
|
||||||
--AmmoMagUse{} -> return $ hammerTest (cWorld . lWorld . creatures . ix (_crID cr) %~ crReloadToggle)
|
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
|
||||||
useItemLeftClick' :: Creature -> World -> World
|
useItemLeftClick' :: Creature -> World -> World
|
||||||
|
|||||||
+1
-19
@@ -5,7 +5,6 @@ module Dodge.Data.Item (
|
|||||||
module Dodge.Data.Item,
|
module Dodge.Data.Item,
|
||||||
module Dodge.Data.Item.Effect,
|
module Dodge.Data.Item.Effect,
|
||||||
module Dodge.Data.Item.Misc,
|
module Dodge.Data.Item.Misc,
|
||||||
module Dodge.Data.Item.Tweak,
|
|
||||||
module Dodge.Data.Item.Params,
|
module Dodge.Data.Item.Params,
|
||||||
module Dodge.Data.Item.Use,
|
module Dodge.Data.Item.Use,
|
||||||
module Dodge.Data.Item.CurseStatus,
|
module Dodge.Data.Item.CurseStatus,
|
||||||
@@ -17,7 +16,6 @@ module Dodge.Data.Item (
|
|||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import Data.Set (Set)
|
|
||||||
import Dodge.Data.Item.Combine
|
import Dodge.Data.Item.Combine
|
||||||
import Dodge.Data.Item.CurseStatus
|
import Dodge.Data.Item.CurseStatus
|
||||||
import Dodge.Data.Item.Effect
|
import Dodge.Data.Item.Effect
|
||||||
@@ -25,12 +23,10 @@ import Dodge.Data.Item.Location
|
|||||||
import Dodge.Data.Item.Misc
|
import Dodge.Data.Item.Misc
|
||||||
import Dodge.Data.Item.Params
|
import Dodge.Data.Item.Params
|
||||||
import Dodge.Data.Item.Scope
|
import Dodge.Data.Item.Scope
|
||||||
import Dodge.Data.Item.Tweak
|
|
||||||
import Dodge.Data.Item.Use
|
import Dodge.Data.Item.Use
|
||||||
import NewInt
|
import NewInt
|
||||||
|
|
||||||
data ItID = ItID
|
data ItID = ItID deriving (Eq, Ord, Show, Read)
|
||||||
deriving (Eq, Ord, Show, Read)
|
|
||||||
|
|
||||||
data Item = Item
|
data Item = Item
|
||||||
{ _itUse :: ItemUse
|
{ _itUse :: ItemUse
|
||||||
@@ -41,23 +37,9 @@ data Item = Item
|
|||||||
, _itInvSize :: Int
|
, _itInvSize :: Int
|
||||||
, _itDimension :: ItemDimension
|
, _itDimension :: ItemDimension
|
||||||
, _itCurseStatus :: CurseStatus
|
, _itCurseStatus :: CurseStatus
|
||||||
-- , _itTweaks :: ItemTweaks
|
|
||||||
, _itParams :: ItemParams
|
, _itParams :: ItemParams
|
||||||
, _itAttachments :: Set ItemAttachment
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data ItemAttachment
|
|
||||||
= ScopeAttachment
|
|
||||||
| BulletClipAttachment
|
|
||||||
| BulletBeltAttachment
|
|
||||||
| StandAttachment
|
|
||||||
| PowerSourceAttachment
|
|
||||||
deriving (Eq, Ord)
|
|
||||||
|
|
||||||
_itUseAimStance :: Item -> AimStance
|
|
||||||
_itUseAimStance = _aimStance . _heldAim . _itUse
|
|
||||||
|
|
||||||
makeLenses ''Item
|
makeLenses ''Item
|
||||||
deriveJSON defaultOptions ''ItID
|
deriveJSON defaultOptions ''ItID
|
||||||
deriveJSON defaultOptions ''ItemAttachment
|
|
||||||
deriveJSON defaultOptions ''Item
|
deriveJSON defaultOptions ''Item
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
{-# LANGUAGE DeriveGeneric #-}
|
|
||||||
{-# LANGUAGE DeriveAnyClass #-}
|
|
||||||
{-# LANGUAGE StrictData #-}
|
|
||||||
{-# LANGUAGE TemplateHaskell #-}
|
|
||||||
|
|
||||||
module Dodge.Data.Item.Tweak where
|
|
||||||
|
|
||||||
import Control.Lens
|
|
||||||
import Data.Aeson
|
|
||||||
import Data.Aeson.TH
|
|
||||||
import qualified IntMapHelp as IM
|
|
||||||
|
|
||||||
data ItemTweaks
|
|
||||||
= NoTweaks
|
|
||||||
| Tweakable
|
|
||||||
{ _tweakParams :: IM.IntMap TweakParam
|
|
||||||
}
|
|
||||||
deriving (Eq, Show, Read) --Generic, Flat)
|
|
||||||
|
|
||||||
data TweakType
|
|
||||||
= TweakPhaseV
|
|
||||||
| TweakTractionPower
|
|
||||||
| TweakSpinDrag
|
|
||||||
| TweakSpinAmount
|
|
||||||
| TweakThrustDelay
|
|
||||||
deriving (Eq, Show, Read) --Generic, Flat)
|
|
||||||
|
|
||||||
data TweakParam = TweakParam
|
|
||||||
{ _tweakType :: TweakType -- Int -> Item -> Item
|
|
||||||
, _tweakVal :: Int
|
|
||||||
, _tweakMax :: Int
|
|
||||||
}
|
|
||||||
deriving (Eq, Show, Read) --Generic, Flat)
|
|
||||||
|
|
||||||
makeLenses ''TweakParam
|
|
||||||
makeLenses ''ItemTweaks
|
|
||||||
deriveJSON defaultOptions ''TweakType
|
|
||||||
deriveJSON defaultOptions ''TweakParam
|
|
||||||
deriveJSON defaultOptions ''ItemTweaks
|
|
||||||
@@ -34,19 +34,15 @@ import Geometry.Data
|
|||||||
import Sound.Data
|
import Sound.Data
|
||||||
|
|
||||||
data ItemUse
|
data ItemUse
|
||||||
= HeldUse
|
= UseHeld
|
||||||
{ -- _heldUse :: Huse
|
{ _heldDelay :: UseDelay
|
||||||
_heldDelay :: UseDelay
|
|
||||||
-- , _heldMods :: HeldMod
|
|
||||||
, _heldHammer :: HammerPosition
|
, _heldHammer :: HammerPosition
|
||||||
, _heldAim :: AimParams
|
, _heldAim :: AimParams
|
||||||
, _heldAmmoTypes :: IM.IntMap AmmoType
|
, _heldAmmoTypes :: IM.IntMap AmmoType
|
||||||
, _heldParams :: HeldParams
|
, _heldParams :: HeldParams
|
||||||
, _heldTriggerType :: TriggerType
|
, _heldTriggerType :: TriggerType
|
||||||
, _heldUsageTime :: Int -- this is not yet implemented
|
|
||||||
-- , _useTargeting :: Maybe TargetType
|
|
||||||
}
|
}
|
||||||
| LeftUse
|
| UseHotkey
|
||||||
{ _leftUse :: Luse
|
{ _leftUse :: Luse
|
||||||
, _leftDelay :: UseDelay
|
, _leftDelay :: UseDelay
|
||||||
, _leftHammer :: HammerPosition
|
, _leftHammer :: HammerPosition
|
||||||
|
|||||||
@@ -30,9 +30,6 @@ defaultHeldItem = Item
|
|||||||
, _itDimension = defaultItemDimension
|
, _itDimension = defaultItemDimension
|
||||||
, _itUse = defaultHeldUse
|
, _itUse = defaultHeldUse
|
||||||
, _itParams = NoParams
|
, _itParams = NoParams
|
||||||
-- , _itTweaks = NoTweaks
|
|
||||||
-- , _itScope = NoScope
|
|
||||||
, _itAttachments = mempty
|
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultLeftItem :: Item
|
defaultLeftItem :: Item
|
||||||
|
|||||||
@@ -12,14 +12,13 @@ import Dodge.Default.Item.Use.Consumption
|
|||||||
import Dodge.Default.Item.Use.Equipment
|
import Dodge.Default.Item.Use.Equipment
|
||||||
|
|
||||||
defaultLeftUse :: ItemUse
|
defaultLeftUse :: ItemUse
|
||||||
defaultLeftUse =
|
defaultLeftUse = UseHotkey
|
||||||
LeftUse
|
{ _leftUse = LDoNothing
|
||||||
{ _leftUse = LDoNothing
|
, _leftDelay = FixedRate{_rateMax = 8, _rateTime = 0}
|
||||||
, _leftDelay = FixedRate{_rateMax = 8, _rateTime = 0}
|
, _leftHammer = HammerUp
|
||||||
, _leftHammer = HammerUp
|
, _equipEffect = defaultEquip
|
||||||
, _equipEffect = defaultEquip
|
, _leftConsumption = defaultLeftLoadable
|
||||||
, _leftConsumption = defaultLeftLoadable
|
}
|
||||||
}
|
|
||||||
|
|
||||||
defaultEquipUse :: ItemUse
|
defaultEquipUse :: ItemUse
|
||||||
defaultEquipUse = EquipUse
|
defaultEquipUse = EquipUse
|
||||||
@@ -28,24 +27,21 @@ defaultEquipUse = EquipUse
|
|||||||
}
|
}
|
||||||
|
|
||||||
defaultHeldUse :: ItemUse
|
defaultHeldUse :: ItemUse
|
||||||
defaultHeldUse =
|
defaultHeldUse = UseHeld
|
||||||
HeldUse
|
{ _heldDelay = FixedRate{_rateMax = 8, _rateTime = 0}
|
||||||
{ _heldDelay = FixedRate{_rateMax = 8, _rateTime = 0}
|
, _heldHammer = HammerUp
|
||||||
-- , _heldMods = DoNothingMod
|
, _heldAim = defaultAimParams
|
||||||
, _heldHammer = HammerUp
|
, _heldAmmoTypes = mempty
|
||||||
, _heldAim = defaultAimParams
|
, _heldParams = BulletShooterParams
|
||||||
, _heldAmmoTypes = mempty
|
{ _muzVel = ConstFloat 0.8
|
||||||
, _heldParams = BulletShooterParams
|
, _rifling = ConstFloat 0.8
|
||||||
{ _muzVel = ConstFloat 0.8
|
, _recoil = 10
|
||||||
, _rifling = ConstFloat 0.8
|
, _torqueAfter = 0.2
|
||||||
, _recoil = 10
|
, _randomOffset = 0
|
||||||
, _torqueAfter = 0.2
|
, _sidePush = 0
|
||||||
, _randomOffset = 0
|
, _bulGunSound = Just (tap3S, 0)
|
||||||
, _sidePush = 0
|
, _weaponInvLock = 0
|
||||||
, _bulGunSound = Just (tap3S, 0)
|
, _weaponRepeat = []
|
||||||
, _weaponInvLock = 0
|
|
||||||
, _weaponRepeat = []
|
|
||||||
}
|
|
||||||
, _heldTriggerType = HammerTrigger
|
|
||||||
, _heldUsageTime = 0
|
|
||||||
}
|
}
|
||||||
|
, _heldTriggerType = HammerTrigger
|
||||||
|
}
|
||||||
|
|||||||
@@ -109,15 +109,12 @@ showAutoRechargeProgress lc = case lc of
|
|||||||
|
|
||||||
itemNumberDisplay :: Creature -> Item -> [String]
|
itemNumberDisplay :: Creature -> Item -> [String]
|
||||||
itemNumberDisplay cr itm = case iu of
|
itemNumberDisplay cr itm = case iu of
|
||||||
--HeldUse{} -> [showReloadProgress cr itm]
|
UseHeld{} -> []
|
||||||
HeldUse{} -> []
|
UseHotkey{} -> [showAutoRechargeProgress (_leftConsumption iu)]
|
||||||
LeftUse{} -> [showAutoRechargeProgress (_leftConsumption iu)]
|
|
||||||
EquipUse{} -> showEquipmentNumber cr itm
|
EquipUse{} -> showEquipmentNumber cr itm
|
||||||
--CraftUse x -> [show $ x ^. getItAmount]
|
|
||||||
CraftUse -> []
|
CraftUse -> []
|
||||||
--ConsumeUse {_useAmount = x} -> [show $ x ^. getItAmount]
|
|
||||||
ConsumeUse {} -> []
|
ConsumeUse {} -> []
|
||||||
AttachUse {} -> [] --[showReloadProgress cr itm]
|
AttachUse {} -> []
|
||||||
AmmoMagUse {} -> [maybe "" shortShow $ itm ^? itUse . amagLoadStatus . iaLoaded]
|
AmmoMagUse {} -> [maybe "" shortShow $ itm ^? itUse . amagLoadStatus . iaLoaded]
|
||||||
ScopeUse OpticScope {_opticZoom = x} -> [shortShow x]
|
ScopeUse OpticScope {_opticZoom = x} -> [shortShow x]
|
||||||
ScopeUse {} -> []
|
ScopeUse {} -> []
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import ShapePicture
|
|||||||
|
|
||||||
itemEquipPict :: Creature -> LabelDoubleTree ComposeLinkType PartiallyComposedItem -> SPic
|
itemEquipPict :: Creature -> LabelDoubleTree ComposeLinkType PartiallyComposedItem -> SPic
|
||||||
itemEquipPict cr itmtree = case itm ^. itUse of
|
itemEquipPict cr itmtree = case itm ^. itUse of
|
||||||
HeldUse{} | itm ^? itLocation . ilIsRoot == Just True
|
UseHeld{} | itm ^? itLocation . ilIsRoot == Just True
|
||||||
-> overPosSP (heldItemOffset itm cr) (itemSPic itmtree)
|
-> overPosSP (heldItemOffset itm cr) (itemSPic itmtree)
|
||||||
ituse -> fromMaybe mempty $ do
|
ituse -> fromMaybe mempty $ do
|
||||||
attachpos <- ituse ^? equipEffect . eeAttachPos
|
attachpos <- ituse ^? equipEffect . eeAttachPos
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import Dodge.Data.Item
|
|||||||
--import Dodge.Reloading.Action
|
--import Dodge.Reloading.Action
|
||||||
import Dodge.Tesla.ItemParams
|
import Dodge.Tesla.ItemParams
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
import qualified IntMapHelp as IM
|
--import qualified IntMapHelp as IM
|
||||||
|
|
||||||
sparkGun :: Item
|
sparkGun :: Item
|
||||||
sparkGun =
|
sparkGun =
|
||||||
@@ -75,13 +75,13 @@ lasGun =
|
|||||||
-- & itUse . heldAim . aimMuzPos .~ 30
|
-- & itUse . heldAim . aimMuzPos .~ 30
|
||||||
& itType .~ HELD LASGUN
|
& itType .~ HELD LASGUN
|
||||||
|
|
||||||
lasGunTweak :: TweakParam
|
--lasGunTweak :: TweakParam
|
||||||
lasGunTweak =
|
--lasGunTweak =
|
||||||
TweakParam
|
-- TweakParam
|
||||||
{ _tweakType = TweakPhaseV
|
-- { _tweakType = TweakPhaseV
|
||||||
, _tweakVal = 1
|
-- , _tweakVal = 1
|
||||||
, _tweakMax = 3
|
-- , _tweakMax = 3
|
||||||
}
|
-- }
|
||||||
|
|
||||||
tractorGun :: Item
|
tractorGun :: Item
|
||||||
tractorGun =
|
tractorGun =
|
||||||
@@ -98,13 +98,13 @@ tractorGun =
|
|||||||
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleTractor
|
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleTractor
|
||||||
& itType .~ HELD TRACTORGUN
|
& itType .~ HELD TRACTORGUN
|
||||||
|
|
||||||
tractorGunTweak :: TweakParam
|
--tractorGunTweak :: TweakParam
|
||||||
tractorGunTweak =
|
--tractorGunTweak =
|
||||||
TweakParam
|
-- TweakParam
|
||||||
{ _tweakType = TweakTractionPower
|
-- { _tweakType = TweakTractionPower
|
||||||
, _tweakVal = 1
|
-- , _tweakVal = 1
|
||||||
, _tweakMax = 4
|
-- , _tweakMax = 4
|
||||||
}
|
-- }
|
||||||
|
|
||||||
--lasWide :: Int -> Item
|
--lasWide :: Int -> Item
|
||||||
--lasWide n =
|
--lasWide n =
|
||||||
|
|||||||
@@ -63,34 +63,34 @@ launcherX i =
|
|||||||
-- & itScope .~ RemoteScope (V2 0 0) 1
|
-- & itScope .~ RemoteScope (V2 0 0) 1
|
||||||
---- & itUse . heldConsumption . laAmmoType . amPjDraw .~ DrawRemoteShell
|
---- & itUse . heldConsumption . laAmmoType . amPjDraw .~ DrawRemoteShell
|
||||||
|
|
||||||
basicAmPjMoves :: IM.IntMap TweakParam
|
--basicAmPjMoves :: IM.IntMap TweakParam
|
||||||
basicAmPjMoves =
|
--basicAmPjMoves =
|
||||||
IM.fromList . zip [0 ..] $
|
-- IM.fromList . zip [0 ..] $
|
||||||
[ spinDrag
|
-- [ spinDrag
|
||||||
, spinStart
|
-- , spinStart
|
||||||
, thrustParam
|
-- , thrustParam
|
||||||
]
|
-- ]
|
||||||
|
|
||||||
spinDrag :: TweakParam
|
--spinDrag :: TweakParam
|
||||||
spinDrag =
|
--spinDrag =
|
||||||
TweakParam
|
-- TweakParam
|
||||||
{ _tweakType = TweakSpinDrag
|
-- { _tweakType = TweakSpinDrag
|
||||||
, _tweakVal = 1
|
-- , _tweakVal = 1
|
||||||
, _tweakMax = 5
|
-- , _tweakMax = 5
|
||||||
}
|
-- }
|
||||||
|
--
|
||||||
spinStart :: TweakParam
|
--spinStart :: TweakParam
|
||||||
spinStart =
|
--spinStart =
|
||||||
TweakParam
|
-- TweakParam
|
||||||
{ _tweakType = TweakSpinAmount
|
-- { _tweakType = TweakSpinAmount
|
||||||
, _tweakVal = 2
|
-- , _tweakVal = 2
|
||||||
, _tweakMax = 5
|
-- , _tweakMax = 5
|
||||||
}
|
-- }
|
||||||
|
--
|
||||||
thrustParam :: TweakParam
|
--thrustParam :: TweakParam
|
||||||
thrustParam =
|
--thrustParam =
|
||||||
TweakParam
|
-- TweakParam
|
||||||
{ _tweakType = TweakThrustDelay
|
-- { _tweakType = TweakThrustDelay
|
||||||
, _tweakVal = 1
|
-- , _tweakVal = 1
|
||||||
, _tweakMax = 5
|
-- , _tweakMax = 5
|
||||||
}
|
-- }
|
||||||
|
|||||||
+14
-26
@@ -30,12 +30,12 @@ import Dodge.Render.List
|
|||||||
import Dodge.ScreenPos
|
import Dodge.ScreenPos
|
||||||
import Dodge.SelectionSections
|
import Dodge.SelectionSections
|
||||||
import Dodge.SelectionSections.Draw
|
import Dodge.SelectionSections.Draw
|
||||||
import Dodge.Tweak.Show
|
--import Dodge.Tweak.Show
|
||||||
import Geometry
|
import Geometry
|
||||||
import qualified IntMapHelp as IM
|
import qualified IntMapHelp as IM
|
||||||
import Justify
|
import Justify
|
||||||
--import ListHelp
|
--import ListHelp
|
||||||
import Padding
|
--import Padding
|
||||||
import Picture
|
import Picture
|
||||||
import SDL (MouseButton (..))
|
import SDL (MouseButton (..))
|
||||||
|
|
||||||
@@ -313,18 +313,6 @@ lnkMidPosInvSelsCol cfig w i col = foldMap f
|
|||||||
invcol <- selSecSelCol 0 j sss
|
invcol <- selSecSelCol 0 j sss
|
||||||
return $ zConnectCol (rp - V2 5 0) (lp + V2 175 0) col col col invcol
|
return $ zConnectCol (rp - V2 5 0) (lp + V2 175 0) col col col invcol
|
||||||
|
|
||||||
tweakItems :: Maybe Item -> [SelectionItem ()]
|
|
||||||
tweakItems = textSelItems . ammoTweakStrings
|
|
||||||
|
|
||||||
ammoTweakStrings :: Maybe Item -> [String]
|
|
||||||
ammoTweakStrings _ = []-- case it ^? _Just . itTweaks . tweakParams of
|
|
||||||
--ammoTweakStrings it = case it ^? _Just . itTweaks . tweakParams of
|
|
||||||
-- Just l -> map tweakString $ IM.elems l
|
|
||||||
-- _ -> ["NOT TWEAKABLE"]
|
|
||||||
|
|
||||||
tweakString :: TweakParam -> String
|
|
||||||
tweakString tp = rightPad 12 ' ' (show $ _tweakType tp) ++ " " ++ showTweak tp
|
|
||||||
|
|
||||||
invHead :: Configuration -> String -> Picture
|
invHead :: Configuration -> String -> Picture
|
||||||
invHead cfig =
|
invHead cfig =
|
||||||
translateScreenPos cfig (fromTopLeft (V2 (subInvX - 5) 80))
|
translateScreenPos cfig (fromTopLeft (V2 (subInvX - 5) 80))
|
||||||
@@ -375,19 +363,19 @@ invHead cfig =
|
|||||||
-- ( halfHeight cfig - 20* (fromIntegral invPos +1) + 2.5)
|
-- ( halfHeight cfig - 20* (fromIntegral invPos +1) + 2.5)
|
||||||
-- return . winScale cfig . color col $ lConnect p itScreenPos
|
-- return . winScale cfig . color col $ lConnect p itScreenPos
|
||||||
|
|
||||||
textSelItems :: [String] -> [SelectionItem ()]
|
--textSelItems :: [String] -> [SelectionItem ()]
|
||||||
textSelItems = map (picsToSelectable . (: []))
|
--textSelItems = map (picsToSelectable . (: []))
|
||||||
|
|
||||||
picsToSelectable :: [String] -> SelectionItem ()
|
--picsToSelectable :: [String] -> SelectionItem ()
|
||||||
picsToSelectable pics =
|
--picsToSelectable pics =
|
||||||
SelectionItem
|
-- SelectionItem
|
||||||
{ _siPictures = pics
|
-- { _siPictures = pics
|
||||||
, _siHeight = length pics
|
-- , _siHeight = length pics
|
||||||
, _siIsSelectable = True
|
-- , _siIsSelectable = True
|
||||||
, _siColor = white
|
-- , _siColor = white
|
||||||
, _siOffX = 0
|
-- , _siOffX = 0
|
||||||
, _siPayload = ()
|
-- , _siPayload = ()
|
||||||
}
|
-- }
|
||||||
|
|
||||||
-- would be nice to add parameter to orient this with NSEW, cf cursor
|
-- would be nice to add parameter to orient this with NSEW, cf cursor
|
||||||
selNumPos ::
|
selNumPos ::
|
||||||
|
|||||||
+7
-7
@@ -3,13 +3,13 @@ module Dodge.Tweak where
|
|||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Dodge.Data.Item
|
import Dodge.Data.Item
|
||||||
|
|
||||||
doTweak :: TweakType -> Int -> Item -> Item
|
--doTweak :: TweakType -> Int -> Item -> Item
|
||||||
doTweak tt = case tt of
|
--doTweak tt = case tt of
|
||||||
TweakPhaseV -> tweakPhaseV
|
-- TweakPhaseV -> tweakPhaseV
|
||||||
TweakTractionPower -> tweakTractionPower
|
-- TweakTractionPower -> tweakTractionPower
|
||||||
TweakSpinDrag -> \i -> itParams . shellSpinDrag .~ i
|
-- TweakSpinDrag -> \i -> itParams . shellSpinDrag .~ i
|
||||||
TweakSpinAmount -> \i -> itParams . shellSpinAmount .~ i
|
-- TweakSpinAmount -> \i -> itParams . shellSpinAmount .~ i
|
||||||
TweakThrustDelay -> \i -> itParams . shellThrustDelay .~ i
|
-- TweakThrustDelay -> \i -> itParams . shellThrustDelay .~ i
|
||||||
|
|
||||||
tweakTractionPower :: Int -> Item -> Item
|
tweakTractionPower :: Int -> Item -> Item
|
||||||
tweakTractionPower 0 = itParams . attractionPower .~ 1
|
tweakTractionPower 0 = itParams . attractionPower .~ 1
|
||||||
|
|||||||
+24
-24
@@ -1,27 +1,27 @@
|
|||||||
module Dodge.Tweak.Show where
|
module Dodge.Tweak.Show where
|
||||||
|
|
||||||
import Dodge.Data.Item.Tweak
|
--import Dodge.Data.Item.Tweak
|
||||||
|
|
||||||
showTweak :: TweakParam -> String
|
--showTweak :: TweakParam -> String
|
||||||
showTweak tp = case tt of
|
--showTweak tp = case tt of
|
||||||
TweakPhaseV -> showPhaseV ct
|
-- TweakPhaseV -> showPhaseV ct
|
||||||
TweakTractionPower -> showTractionPower ct
|
-- TweakTractionPower -> showTractionPower ct
|
||||||
TweakSpinDrag -> show ct
|
-- TweakSpinDrag -> show ct
|
||||||
TweakSpinAmount -> show ct
|
-- TweakSpinAmount -> show ct
|
||||||
TweakThrustDelay -> show ct
|
-- TweakThrustDelay -> show ct
|
||||||
where
|
-- where
|
||||||
tt = _tweakType tp
|
-- tt = _tweakType tp
|
||||||
ct = _tweakVal tp
|
-- ct = _tweakVal tp
|
||||||
|
--
|
||||||
showPhaseV :: Int -> String
|
--showPhaseV :: Int -> String
|
||||||
showPhaseV 0 = "V"
|
--showPhaseV 0 = "V"
|
||||||
showPhaseV 1 = "/"
|
--showPhaseV 1 = "/"
|
||||||
showPhaseV 2 = "Z"
|
--showPhaseV 2 = "Z"
|
||||||
showPhaseV i = show i ++ " should not be possible"
|
--showPhaseV i = show i ++ " should not be possible"
|
||||||
|
--
|
||||||
showTractionPower :: Int -> String
|
--showTractionPower :: Int -> String
|
||||||
showTractionPower 0 = "+"
|
--showTractionPower 0 = "+"
|
||||||
showTractionPower 1 = "-"
|
--showTractionPower 1 = "-"
|
||||||
showTractionPower 2 = "#"
|
--showTractionPower 2 = "#"
|
||||||
showTractionPower 3 = "0" -- object should stay in the center of the beam
|
--showTractionPower 3 = "0" -- object should stay in the center of the beam
|
||||||
showTractionPower i = "THIS SHOULD NOT BE POSSIBLE" ++ show i
|
--showTractionPower i = "THIS SHOULD NOT BE POSSIBLE" ++ show i
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import qualified Data.IntMap.Strict as IM
|
|||||||
import Data.List (sort)
|
import Data.List (sort)
|
||||||
import qualified Data.Map.Strict as M
|
import qualified Data.Map.Strict as M
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import Dodge.Base.You
|
--import Dodge.Base.You
|
||||||
import Dodge.Button.Event
|
import Dodge.Button.Event
|
||||||
import Dodge.Camera
|
import Dodge.Camera
|
||||||
import Dodge.Creature.Action
|
import Dodge.Creature.Action
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import Dodge.Inventory
|
|||||||
import Dodge.SelectionSections
|
import Dodge.SelectionSections
|
||||||
--import Dodge.SoundLogic
|
--import Dodge.SoundLogic
|
||||||
import Dodge.Terminal
|
import Dodge.Terminal
|
||||||
import Dodge.Tweak
|
--import Dodge.Tweak
|
||||||
import qualified IntMapHelp as IM
|
import qualified IntMapHelp as IM
|
||||||
import LensHelp
|
import LensHelp
|
||||||
import SDL
|
import SDL
|
||||||
|
|||||||
Reference in New Issue
Block a user