From 7bc535780c3dba0ca169b1dec91864cf47823987 Mon Sep 17 00:00:00 2001 From: juanjp600 Date: Wed, 14 Jun 2017 17:30:40 -0300 Subject: [PATCH] Reducing usage of #if CLIENT / #elif SERVER The server will implement some classes it probably shouldn't need because certain items or game states depend on them. --- BarotraumaClient/BarotraumaClient.csproj | 1322 +---------------- .../BackgroundSprite/BackgroundCreature.cs | 0 .../BackgroundCreatureManager.cs | 0 .../BackgroundCreaturePrefab.cs | 0 .../BackgroundSpriteManager.cs | 0 .../BackgroundSpritePrefab.cs | 0 .../Source/GameMain.cs | 3 - BarotraumaClient/Source/Items/Item.cs | 555 +++++++ BarotraumaClient/Source/Map/MapEntity.cs | 647 ++++++++ .../Source/Map/MapEntityPrefab.cs | 50 + .../Source/Networking/GameClient.cs | 0 BarotraumaClient/Source/PlayerInput.cs | 166 +++ .../Source/Program.cs | 0 BarotraumaClient/Source/Screens/GameScreen.cs | 166 +-- .../Source/Screens/NetLobbyScreen.cs | 234 ++- BarotraumaClient/Source/Screens/Screen.cs | 33 +- .../Source/{ => Sprite}/Sprite.cs | 177 +-- .../Source/{ => Sprite}/SpriteSheet.cs | 0 BarotraumaServer/BarotraumaServer.csproj | 21 + BarotraumaServer/BarotraumaServer.csproj.rej | 12 + BarotraumaServer/Source/Camera.cs | 235 +++ BarotraumaServer/Source/GameMain.cs | 35 + .../Source/Networking/GameClient.cs | 19 + BarotraumaServer/Source/PlayerInput.cs | 134 ++ BarotraumaServer/Source/Program.cs | 174 +++ BarotraumaServer/Source/Sprite/Sprite.cs | 25 + BarotraumaShared/BarotraumaShared.projitems | 1272 +++++++++++++++- .../BackgroundCreaturePrefabs.xml | 0 .../BackgroundSpritePrefabs.xml | 0 .../Content/BackgroundSprites/bgFish1.png | Bin .../Content/BackgroundSprites/ice.png | Bin .../Content/BackgroundSprites/vegetation.png | Bin .../Content/BackgroundSprites/vegetation2.png | Bin .../Content/BackgroundSprites/vegetation3.png | Bin .../Content/BackgroundSprites/vegetation4.png | Bin .../Content/BackgroundSprites/vegetation5.png | Bin .../Content/Characters/Carrier/alarm1.ogg | Bin .../Content/Characters/Carrier/carrier.png | Bin .../Content/Characters/Carrier/carrier.xml | 0 .../Content/Characters/Carrier/carrier1.ogg | Bin .../Content/Characters/Carrier/carrier2.ogg | Bin .../Content/Characters/Carrier/carrier3.ogg | Bin .../Content/Characters/Carrier/ping.ogg | Bin .../Characters/Charybdis/charybdis.png | Bin .../Characters/Charybdis/charybdis.xml | 0 .../Characters/Charybdis/charybdisattack.ogg | Bin .../Content/Characters/Coelanth/attack1.ogg | Bin .../Content/Characters/Coelanth/coelanth.png | Bin .../Content/Characters/Coelanth/coelanth.xml | 0 .../Content/Characters/Coelanth/idle1.ogg | Bin .../Content/Characters/Coelanth/idle2.ogg | Bin .../Content/Characters/Crawler/attack1.ogg | Bin .../Content/Characters/Crawler/attack2.ogg | Bin .../Content/Characters/Crawler/crawler.png | Bin .../Content/Characters/Crawler/crawler.xml | 0 .../Content/Characters/Crawler/idle1.ogg | Bin .../Content/Characters/Crawler/idle2.ogg | Bin .../Content/Characters/Endworm/endworm.png | Bin .../Content/Characters/Endworm/endworm.xml | 0 .../Characters/Endworm/endwormattack1.ogg | Bin .../Characters/Endworm/endwormattack2.ogg | Bin .../Characters/Endworm/endwormidle.ogg | Bin .../Characters/Fractalguardian/Die1.ogg | Bin .../Characters/Fractalguardian/Die2.ogg | Bin .../Fractalguardian/fractalguardian.png | Bin .../Fractalguardian/fractalguardian.xml | 0 .../Characters/Fractalguardian/guardian1.ogg | Bin .../Characters/Fractalguardian/guardian2.ogg | Bin .../Fractalguardian2/fractalguardian2.xml | 0 .../Content/Characters/Human/damagedhead.png | Bin .../Content/Characters/Human/damagedlegs.png | Bin .../Content/Characters/Human/damagedtorso.png | Bin .../Content/Characters/Human/ffirstnames.txt | 0 .../Content/Characters/Human/fhead1.png | Bin .../Content/Characters/Human/fhead2.png | Bin .../Content/Characters/Human/fhead3.png | Bin .../Content/Characters/Human/fhead4.png | Bin .../Content/Characters/Human/fhead5.png | Bin .../Content/Characters/Human/fhead6.png | Bin .../Characters/Human/fhead7[black].png | Bin .../Content/Characters/Human/fhead8.png | Bin .../Content/Characters/Human/firstnames.txt | 0 .../Content/Characters/Human/flegs.png | Bin .../Content/Characters/Human/ftorso.png | Bin .../Characters/Human/ftorso[black].png | Bin .../Content/Characters/Human/head1.png | Bin .../Content/Characters/Human/head2.png | Bin .../Content/Characters/Human/head3.png | Bin .../Content/Characters/Human/head4.png | Bin .../Content/Characters/Human/head5.png | Bin .../Content/Characters/Human/head6.png | Bin .../Content/Characters/Human/head7[black].png | Bin .../Content/Characters/Human/head8[black].png | Bin .../Content/Characters/Human/human.xml | 0 .../Content/Characters/Human/humanhusk.xml | 0 .../Characters/Human/huskappendage.xml | 0 .../Content/Characters/Human/lastnames.txt | 0 .../Content/Characters/Human/legs.png | Bin .../Content/Characters/Human/torso.png | Bin .../Content/Characters/Human/torso[black].png | Bin .../Content/Characters/Husk/DivingSuit.png | Bin .../Content/Characters/Husk/Husk1.ogg | Bin .../Content/Characters/Husk/Husk2.ogg | Bin .../Content/Characters/Husk/Husk3.ogg | Bin .../Content/Characters/Husk/husk.xml | 0 .../Content/Characters/Husk/legs.png | Bin .../Content/Characters/Mantis/attack1.ogg | Bin .../Content/Characters/Mantis/attack2.ogg | Bin .../Content/Characters/Mantis/idle1.ogg | Bin .../Content/Characters/Mantis/idle2.ogg | Bin .../Content/Characters/Mantis/idle3.ogg | Bin .../Content/Characters/Mantis/mantis.png | Bin .../Content/Characters/Mantis/mantis.xml | 0 .../Content/Characters/Moloch/attack1.ogg | Bin .../Content/Characters/Moloch/attack2.ogg | Bin .../Content/Characters/Moloch/idle1.ogg | Bin .../Content/Characters/Moloch/idle2.ogg | Bin .../Content/Characters/Moloch/moloch.png | Bin .../Content/Characters/Moloch/moloch.xml | 0 .../Content/Characters/Scorpion/scorpion.png | Bin .../Content/Characters/Scorpion/scorpion.xml | 0 .../Characters/Scorpion/scorpionattack1.ogg | Bin .../Characters/Scorpion/scorpionidle1.ogg | Bin .../Characters/Scorpion/scorpionidle2.ogg | Bin .../Tigerthresher/damagedtigerthresher.png | Bin .../Tigerthresher/tigerthresher.png | Bin .../Tigerthresher/tigerthresher.xml | 0 .../Content/Characters/Watcher/attack1.ogg | Bin .../Content/Characters/Watcher/attack2.ogg | Bin .../Content/Characters/Watcher/attack3.ogg | Bin .../Content/Characters/Watcher/watch1.ogg | Bin .../Content/Characters/Watcher/watch2.ogg | Bin .../Content/Characters/Watcher/watch3.ogg | Bin .../Content/Characters/Watcher/watch4.ogg | Bin .../Content/Characters/Watcher/watch5.ogg | Bin .../Content/Characters/Watcher/watch6.ogg | Bin .../Content/Characters/Watcher/watcher.png | Bin .../Content/Characters/Watcher/watcher.xml | 0 .../Content/Code Pro Bold.otf | Bin .../Content/Content.mgcb | 0 .../Content/Exo2-Light.otf | Bin .../Content/Exo2-Medium.otf | Bin .../Content/InfoTexts.xml | 0 .../Content/Items/Artifacts/aliendoor.ogg | Bin .../Content/Items/Artifacts/alientools.png | Bin .../Content/Items/Artifacts/alienweapon.ogg | Bin .../Content/Items/Artifacts/artifact.png | Bin .../Items/Artifacts/artifactholder.png | Bin .../Content/Items/Artifacts/artifacts.xml | 0 .../Content/Items/Button/beep.ogg | Bin .../Content/Items/Button/button.png | Bin .../Content/Items/Button/button.xml | 0 .../Content/Items/Containers/cabinets.png | Bin .../Content/Items/Containers/containers.xml | 0 .../Content/Items/Containers/crates.png | Bin .../Content/Items/Containers/locker.png | Bin .../Content/Items/Diving/DivingMask.png | Bin .../Content/Items/Diving/DivingSuit.png | Bin .../Content/Items/Diving/divingSuit.ogg | Bin .../Content/Items/Diving/divinggear.xml | 0 .../Content/Items/Diving/scooter.ogg | Bin .../Content/Items/Door/dockingport.png | Bin .../Content/Items/Door/dockingport1.ogg | Bin .../Content/Items/Door/dockingport2.ogg | Bin .../Content/Items/Door/dockingport2.png | Bin .../Content/Items/Door/door.ogg | Bin .../Content/Items/Door/door.png | Bin .../Content/Items/Door/doors.xml | 0 .../Content/Items/Electricity/battery.png | Bin .../Content/Items/Electricity/junctionbox.png | Bin .../Content/Items/Electricity/lamp.png | Bin .../Content/Items/Electricity/lights.xml | 0 .../Content/Items/Electricity/lightsprite.png | Bin .../Content/Items/Electricity/monitor.png | Bin .../Content/Items/Electricity/monitors.xml | 0 .../Content/Items/Electricity/powerOn.ogg | Bin .../Content/Items/Electricity/poweritems.xml | 0 .../Content/Items/Electricity/signalcomp.png | Bin .../Content/Items/Electricity/signalitems.xml | 0 .../Items/Electricity/supercapacitor.png | Bin .../Content/Items/Electricity/zap1.ogg | Bin .../Content/Items/Electricity/zap2.ogg | Bin .../Content/Items/Electricity/zap3.ogg | Bin .../Content/Items/Electricity/zap4.ogg | Bin .../Content/Items/Engine/engine.ogg | Bin .../Content/Items/Engine/engine.png | Bin .../Content/Items/Engine/engine.xml | 0 .../Content/Items/Engine/pingCircle.png | Bin .../Content/Items/Engine/radarBlip.png | Bin .../Content/Items/Engine/radarOverlay.png | Bin .../Content/Items/Engine/radarPing.ogg | Bin .../Items/Fabricators/deconstructor.ogg | Bin .../Content/Items/Fabricators/fabricator.ogg | Bin .../Content/Items/Fabricators/fabricators.xml | 0 .../Content/Items/Fabricators/materials.png | Bin .../Content/Items/Fabricators/materials.xml | 0 .../Content/Items/Jobgear/captainLegs.png | Bin .../Content/Items/Jobgear/captainTorso.png | Bin .../Content/Items/Jobgear/captaingear.xml | 0 .../Content/Items/Jobgear/captainhat.png | Bin .../Content/Items/Jobgear/clownmask.png | Bin .../Content/Items/Jobgear/clownpants.png | Bin .../Content/Items/Jobgear/clownshirt.png | Bin .../Content/Items/Jobgear/doctorgear.png | Bin .../Content/Items/Jobgear/doctorgear.xml | 0 .../Content/Items/Jobgear/engigear.png | Bin .../Content/Items/Jobgear/engigear.xml | 0 .../Content/Items/Jobgear/headset.png | Bin .../Content/Items/Jobgear/misc.xml | 0 .../Content/Items/Jobgear/securitygear.png | Bin .../Content/Items/Jobgear/securitygear.xml | 0 .../Content/Items/Ladder/ladder.png | Bin .../Content/Items/Ladder/ladder.xml | 0 .../Content/Items/Medical/bandage.ogg | Bin .../Content/Items/Medical/med.png | Bin .../Content/Items/Medical/medical.xml | 0 .../Content/Items/Medical/syringe.ogg | Bin .../Content/Items/MiniMap/item.xml | 0 .../Items/OxygenGenerator/oxygengenerator.ogg | Bin .../Items/OxygenGenerator/oxygengenerator.png | Bin .../Items/OxygenGenerator/oxygengenerator.xml | 0 .../Content/Items/OxygenGenerator/vent.png | Bin .../Items/OxygenGenerator/ventilation.ogg | Bin .../Content/Items/Pump/pump.ogg | Bin .../Content/Items/Pump/pump.png | Bin .../Content/Items/Pump/pump.xml | 0 .../Content/Items/Pump/smallpump.png | Bin .../Content/Items/Reactor/explosion.ogg | Bin .../Content/Items/Reactor/fuelrod.png | Bin .../Content/Items/Reactor/heatabsorber.png | Bin .../Content/Items/Reactor/reactor.ogg | Bin .../Content/Items/Reactor/reactor.png | Bin .../Content/Items/Reactor/reactor.xml | 0 .../Content/Items/Tools/extinguisher.ogg | Bin .../Content/Items/Tools/extinguisher.png | Bin .../Content/Items/Tools/flare.ogg | Bin .../Content/Items/Tools/plasmaCutter.ogg | Bin .../Content/Items/Tools/tools.png | Bin .../Content/Items/Tools/tools.xml | 0 .../Content/Items/Tools/weldingTool.ogg | Bin .../Content/Items/Weapons/bigexplosion.ogg | Bin .../Content/Items/Weapons/depthcharge.xml | 0 .../Content/Items/Weapons/explosives.xml | 0 .../Content/Items/Weapons/harpoon1.ogg | Bin .../Content/Items/Weapons/harpoon2.ogg | Bin .../Content/Items/Weapons/honk.ogg | Bin .../Content/Items/Weapons/railgun.ogg | Bin .../Content/Items/Weapons/railgun.xml | 0 .../Content/Items/Weapons/railgunbarrel.png | Bin .../Content/Items/Weapons/railgunbase.png | Bin .../Content/Items/Weapons/railgunetc.png | Bin .../Content/Items/Weapons/rope.png | Bin .../Content/Items/Weapons/smack.ogg | Bin .../Content/Items/Weapons/stunbaton.ogg | Bin .../Content/Items/Weapons/stungrenade.ogg | Bin .../Content/Items/Weapons/stungrenade.png | Bin .../Content/Items/Weapons/weapons.png | Bin .../Content/Items/Weapons/weapons.xml | 0 .../Content/Items/blank.png | Bin .../Content/Items/circuitboard.png | Bin .../Content/Items/connectionpanel.png | Bin .../Content/Items/connector.png | Bin .../Content/Items/idcard.png | Bin .../Content/Items/idcard.xml | 0 .../Content/Items/itemlabel.xml | 0 .../Content/Items/machines.png | Bin .../Content/Items/warningBeep.ogg | Bin .../Content/Items/warningSiren.ogg | Bin .../Content/Items/wireCorner.png | Bin .../Content/Items/wireHorizontal.png | Bin .../Content/Items/wireVertical.png | Bin .../Content/Jobs.xml | 0 .../Content/Lights/alphaOne.png | Bin .../Content/Lights/light.png | Bin .../Content/Lights/lightcone.png | Bin .../Content/Lights/penumbra.png | Bin .../Content/Lights/visioncircle.png | Bin .../Content/Map/LevelGenerationParameters.xml | 0 .../Content/Map/RuinConfig.xml | 0 .../Content/Map/StructurePrefabs.xml | 0 .../Content/Map/TutorialSub.sub | Bin .../Content/Map/background.png | Bin .../Content/Map/background2.png | Bin .../Content/Map/beaconSymbol.png | Bin .../Content/Map/beaconbackground.jpg | Bin .../Content/Map/citySymbol.png | Bin .../Content/Map/citybackground.jpg | Bin .../Content/Map/dustparticles.png | Bin .../Content/Map/iceCrack.png | Bin .../Content/Map/iceCraters.png | Bin .../Content/Map/iceSurface.png | Bin .../Content/Map/iceWall.png | Bin .../Content/Map/locationNames.txt | 0 .../Content/Map/locationTypes.xml | 0 .../Content/Map/militarySymbol.png | Bin .../Content/Map/militarybackground.jpg | Bin .../Content/Map/researchSymbol.png | Bin .../Content/Map/researchbackground.jpg | Bin .../Content/Map/ruins.png | Bin .../Content/Map/ruins2.png | Bin .../Content/Map/ruins3.png | Bin .../Content/Map/shaft.png | Bin .../Content/Map/structures2.png | Bin .../Content/Map/testroom.png | Bin .../Content/Map/walldamage.png | Bin .../Content/Map/waypointIcons.png | Bin .../Content/Missions.xml | 0 .../Content/Orders.xml | 0 .../Particles/FlameRoundParticleSheet.png | Bin .../Content/Particles/ParticlePrefabs.xml | 0 .../Content/Particles/SmokeParticleSheet.png | Bin .../Content/Particles/bubbles.png | Bin .../Content/Particles/explosion.png | Bin .../Content/Particles/fire.png | Bin .../Content/Particles/flames.png | Bin .../Content/Particles/shrapnel.png | Bin .../Content/Particles/spatter.png | Bin .../Content/Sounds/Ambient/Ambient1.ogg | Bin .../Content/Sounds/Ambient/Ambient10.ogg | Bin .../Content/Sounds/Ambient/Ambient11.ogg | Bin .../Content/Sounds/Ambient/Ambient12.ogg | Bin .../Content/Sounds/Ambient/Ambient13.ogg | Bin .../Content/Sounds/Ambient/Ambient2.ogg | Bin .../Content/Sounds/Ambient/Ambient3.ogg | Bin .../Content/Sounds/Ambient/Ambient4.ogg | Bin .../Content/Sounds/Ambient/Ambient5.ogg | Bin .../Content/Sounds/Ambient/Ambient6.ogg | Bin .../Content/Sounds/Ambient/Ambient7.ogg | Bin .../Content/Sounds/Ambient/Ambient8.ogg | Bin .../Content/Sounds/Ambient/Ambient9.ogg | Bin .../Content/Sounds/Ambient/DistantPod1.ogg | Bin .../Content/Sounds/Ambient/DistantPod2.ogg | Bin .../Content/Sounds/Ambient/DistantPod3.ogg | Bin .../Sounds/Ambient/GlacialMovement.ogg | Bin .../Content/Sounds/Damage/GlassBreak1.ogg | Bin .../Content/Sounds/Damage/GlassBreak2.ogg | Bin .../Content/Sounds/Damage/GlassBreak3.ogg | Bin .../Content/Sounds/Damage/GlassImpact1.ogg | Bin .../Content/Sounds/Damage/GlassImpact2.ogg | Bin .../Content/Sounds/Damage/GlassImpact3.ogg | Bin .../Content/Sounds/Damage/HitArmor1.ogg | Bin .../Content/Sounds/Damage/HitArmor2.ogg | Bin .../Content/Sounds/Damage/HitArmor3.ogg | Bin .../Content/Sounds/Damage/LimbBlunt1.ogg | Bin .../Content/Sounds/Damage/LimbBlunt2.ogg | Bin .../Content/Sounds/Damage/LimbBlunt3.ogg | Bin .../Content/Sounds/Damage/LimbBlunt4.ogg | Bin .../Content/Sounds/Damage/LimbBlunt5.ogg | Bin .../Content/Sounds/Damage/LimbSlash1.ogg | Bin .../Content/Sounds/Damage/LimbSlash2.ogg | Bin .../Content/Sounds/Damage/LimbSlash3.ogg | Bin .../Content/Sounds/Damage/StructureBlunt1.ogg | Bin .../Sounds/Damage/StructureBlunt10.ogg | Bin .../Content/Sounds/Damage/StructureBlunt2.ogg | Bin .../Content/Sounds/Damage/StructureBlunt3.ogg | Bin .../Content/Sounds/Damage/StructureBlunt4.ogg | Bin .../Content/Sounds/Damage/StructureBlunt5.ogg | Bin .../Content/Sounds/Damage/StructureBlunt6.ogg | Bin .../Content/Sounds/Damage/StructureBlunt7.ogg | Bin .../Content/Sounds/Damage/StructureBlunt8.ogg | Bin .../Content/Sounds/Damage/StructureBlunt9.ogg | Bin .../Sounds/Damage/StructureCrunch1.ogg | Bin .../Sounds/Damage/StructureCrunch2.ogg | Bin .../Sounds/Damage/StructureCrunch3.ogg | Bin .../Sounds/Damage/StructureCrunch4.ogg | Bin .../Sounds/Damage/StructureCrunch5.ogg | Bin .../Content/Sounds/Damage/creak1.ogg | Bin .../Content/Sounds/Damage/creak2.ogg | Bin .../Content/Sounds/Damage/creak3.ogg | Bin .../Content/Sounds/Damage/creak4.ogg | Bin .../Content/Sounds/Damage/creak5.ogg | Bin .../Content/Sounds/Damage/implode.ogg | Bin .../Sounds/Music/Controlled Chaos 2.ogg | Bin .../Content/Sounds/Music/Controlled Chaos.ogg | Bin .../Content/Sounds/Music/Enter the Maze.ogg | Bin .../Sounds/Music/Phantom From Space.ogg | Bin .../Content/Sounds/Music/Road to Hell.ogg | Bin .../Content/Sounds/Music/Simplex.ogg | Bin .../Content/Sounds/Music/Static Motion.ogg | Bin .../Tenebrous Brothers Carnival - Prelude.ogg | Bin .../Content/Sounds/Music/The Descent.ogg | Bin .../Content/Sounds/Music/Unseen Horrors.ogg | Bin .../Music/amb_JD_drone_clattering_machine.ogg | Bin .../Content/Sounds/UI/UImsg.ogg | Bin .../Content/Sounds/UI/beep-shinymetal.ogg | Bin .../Content/Sounds/UI/deadmsg.ogg | Bin .../Content/Sounds/UI/radiomsg.ogg | Bin .../Content/Sounds/UI/tap-zipper.ogg | Bin .../Content/Sounds/Water/Drown1.ogg | Bin .../Content/Sounds/Water/Drown2.ogg | Bin .../Content/Sounds/Water/Drown3.ogg | Bin .../Content/Sounds/Water/Drown4.ogg | Bin .../Content/Sounds/Water/DrownLoop.ogg | Bin .../Content/Sounds/Water/FlowLarge.ogg | Bin .../Content/Sounds/Water/FlowMedium.ogg | Bin .../Content/Sounds/Water/FlowSmall.ogg | Bin .../Content/Sounds/Water/Splash0.ogg | Bin .../Content/Sounds/Water/Splash1.ogg | Bin .../Content/Sounds/Water/Splash2.ogg | Bin .../Content/Sounds/Water/Splash3.ogg | Bin .../Content/Sounds/Water/Splash4.ogg | Bin .../Content/Sounds/Water/Splash5.ogg | Bin .../Content/Sounds/Water/Splash6.ogg | Bin .../Content/Sounds/Water/Splash7.ogg | Bin .../Content/Sounds/Water/Splash8.ogg | Bin .../Content/Sounds/Water/Splash9.ogg | Bin .../Content/Sounds/Water/WaterAmbience1.ogg | Bin .../Content/Sounds/Water/WaterAmbience2.ogg | Bin .../Content/Sounds/Water/splashLoop.ogg | Bin .../Content/Sounds/fire.ogg | Bin .../Content/Sounds/firelarge.ogg | Bin .../Content/Sounds/pickItem.ogg | Bin .../Content/Sounds/sounds.xml | 0 .../Content/Sounds/startDrone.ogg | Bin .../Content/Sounds/stepMetal.ogg | Bin .../Content/UI/UI_Atlas.png | Bin .../Content/UI/caret.png | Bin .../Content/UI/cursor.png | Bin .../Content/UI/damageOverlay.png | Bin .../Content/UI/inventoryIcons.png | Bin .../Content/UI/noise.png | Bin .../Content/UI/statusIcons.png | Bin .../Content/UI/style.xml | 0 .../Content/UI/textboxTexture.png | Bin .../Content/UI/titleBackground.png | Bin .../Content/UI/titleMonster.png | Bin .../Content/UI/titleText.png | Bin .../Content/UI/uiBackground.png | Bin .../Content/UI/uiButton.png | Bin .../Content/UI/uiIcons.png | Bin .../Content/blurshader.fx | 0 .../Content/blurshader.xnb | Bin .../Content/blurshader_opengl.xnb | Bin .../Content/damageshader.fx | 0 .../Content/damageshader.xnb | Bin .../Content/damageshader_opengl.xnb | Bin .../Content/effects.mgfx | Bin .../Content/randomevents.xml | 0 .../Content/step.ogg | Bin .../Content/utg_4.mp4 | Bin .../Content/utg_4.xnb | Bin .../Content/waterbump.png | Bin .../Content/watershader.fx | 0 .../Content/watershader.xnb | Bin .../Content/watershader_opengl.xnb | Bin .../Data/ContentPackages/Vanilla 0.3.xml | 0 .../Icon.ico | Bin .../Mods/info.txt | 0 .../readme.txt => BarotraumaShared/README.txt | 0 .../Source/Characters/AI/CrewCommander.cs | 4 +- BarotraumaShared/Source/Items/Item.cs | 553 +------ BarotraumaShared/Source/Map/MapEntity.cs | 640 +------- .../Source/Map/MapEntityPrefab.cs | 40 +- .../Source/Networking/INetSerializable.cs | 4 + BarotraumaShared/Source/PlayerInput.cs | 161 -- BarotraumaShared/Source/Screens/GameScreen.cs | 135 ++ .../Source/Screens/NetLobbyScreen.cs | 67 + BarotraumaShared/Source/Screens/Screen.cs | 42 + .../Source/Screens/sygwkgy0.iv5 | 0 BarotraumaShared/Source/Sprite/Sprite.cs | 162 ++ BarotraumaShared/Source/Sprite/SpriteSheet.cs | 55 + .../Submarines/Aegir Mark III.sub | Bin .../Submarines/Nehalennia.sub | Bin .../Submarines/The Blind Carp.sub | Bin .../Submarines/The Nibbler.sub | Bin .../Submarines/TutorialSub.sub | Bin .../Submarines/Vellamo.sub | Bin .../changelog.txt | 0 .../config.xml | 0 .../packages.config | 0 Barotrauma_Solution.sln | 1 + 471 files changed, 3985 insertions(+), 3159 deletions(-) rename {BarotraumaShared => BarotraumaClient}/Source/Characters/BackgroundSprite/BackgroundCreature.cs (100%) rename {BarotraumaShared => BarotraumaClient}/Source/Characters/BackgroundSprite/BackgroundCreatureManager.cs (100%) rename {BarotraumaShared => BarotraumaClient}/Source/Characters/BackgroundSprite/BackgroundCreaturePrefab.cs (100%) rename {BarotraumaShared => BarotraumaClient}/Source/Characters/BackgroundSprite/BackgroundSpriteManager.cs (100%) rename {BarotraumaShared => BarotraumaClient}/Source/Characters/BackgroundSprite/BackgroundSpritePrefab.cs (100%) rename {BarotraumaShared => BarotraumaClient}/Source/GameMain.cs (99%) create mode 100644 BarotraumaClient/Source/Items/Item.cs create mode 100644 BarotraumaClient/Source/Map/MapEntity.cs create mode 100644 BarotraumaClient/Source/Map/MapEntityPrefab.cs rename {BarotraumaShared => BarotraumaClient}/Source/Networking/GameClient.cs (100%) create mode 100644 BarotraumaClient/Source/PlayerInput.cs rename {BarotraumaShared => BarotraumaClient}/Source/Program.cs (100%) rename BarotraumaClient/Source/{ => Sprite}/Sprite.cs (70%) rename BarotraumaClient/Source/{ => Sprite}/SpriteSheet.cs (100%) create mode 100644 BarotraumaServer/BarotraumaServer.csproj.rej create mode 100644 BarotraumaServer/Source/Camera.cs create mode 100644 BarotraumaServer/Source/GameMain.cs create mode 100644 BarotraumaServer/Source/Networking/GameClient.cs create mode 100644 BarotraumaServer/Source/PlayerInput.cs create mode 100644 BarotraumaServer/Source/Program.cs create mode 100644 BarotraumaServer/Source/Sprite/Sprite.cs rename {BarotraumaClient => BarotraumaShared}/Content/BackgroundSprites/BackgroundCreaturePrefabs.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/BackgroundSprites/BackgroundSpritePrefabs.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/BackgroundSprites/bgFish1.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/BackgroundSprites/ice.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/BackgroundSprites/vegetation.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/BackgroundSprites/vegetation2.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/BackgroundSprites/vegetation3.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/BackgroundSprites/vegetation4.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/BackgroundSprites/vegetation5.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Carrier/alarm1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Carrier/carrier.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Carrier/carrier.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Carrier/carrier1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Carrier/carrier2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Carrier/carrier3.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Carrier/ping.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Charybdis/charybdis.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Charybdis/charybdis.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Charybdis/charybdisattack.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Coelanth/attack1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Coelanth/coelanth.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Coelanth/coelanth.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Coelanth/idle1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Coelanth/idle2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Crawler/attack1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Crawler/attack2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Crawler/crawler.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Crawler/crawler.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Crawler/idle1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Crawler/idle2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Endworm/endworm.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Endworm/endworm.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Endworm/endwormattack1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Endworm/endwormattack2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Endworm/endwormidle.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Fractalguardian/Die1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Fractalguardian/Die2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Fractalguardian/fractalguardian.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Fractalguardian/fractalguardian.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Fractalguardian/guardian1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Fractalguardian/guardian2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Fractalguardian2/fractalguardian2.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/damagedhead.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/damagedlegs.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/damagedtorso.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/ffirstnames.txt (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/fhead1.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/fhead2.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/fhead3.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/fhead4.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/fhead5.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/fhead6.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/fhead7[black].png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/fhead8.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/firstnames.txt (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/flegs.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/ftorso.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/ftorso[black].png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/head1.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/head2.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/head3.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/head4.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/head5.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/head6.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/head7[black].png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/head8[black].png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/human.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/humanhusk.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/huskappendage.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/lastnames.txt (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/legs.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/torso.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Human/torso[black].png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Husk/DivingSuit.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Husk/Husk1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Husk/Husk2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Husk/Husk3.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Husk/husk.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Husk/legs.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Mantis/attack1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Mantis/attack2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Mantis/idle1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Mantis/idle2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Mantis/idle3.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Mantis/mantis.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Mantis/mantis.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Moloch/attack1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Moloch/attack2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Moloch/idle1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Moloch/idle2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Moloch/moloch.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Moloch/moloch.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Scorpion/scorpion.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Scorpion/scorpion.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Scorpion/scorpionattack1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Scorpion/scorpionidle1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Scorpion/scorpionidle2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Tigerthresher/damagedtigerthresher.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Tigerthresher/tigerthresher.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Tigerthresher/tigerthresher.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Watcher/attack1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Watcher/attack2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Watcher/attack3.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Watcher/watch1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Watcher/watch2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Watcher/watch3.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Watcher/watch4.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Watcher/watch5.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Watcher/watch6.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Watcher/watcher.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Characters/Watcher/watcher.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Code Pro Bold.otf (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Content.mgcb (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Exo2-Light.otf (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Exo2-Medium.otf (100%) rename {BarotraumaClient => BarotraumaShared}/Content/InfoTexts.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Artifacts/aliendoor.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Artifacts/alientools.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Artifacts/alienweapon.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Artifacts/artifact.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Artifacts/artifactholder.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Artifacts/artifacts.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Button/beep.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Button/button.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Button/button.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Containers/cabinets.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Containers/containers.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Containers/crates.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Containers/locker.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Diving/DivingMask.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Diving/DivingSuit.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Diving/divingSuit.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Diving/divinggear.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Diving/scooter.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Door/dockingport.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Door/dockingport1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Door/dockingport2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Door/dockingport2.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Door/door.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Door/door.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Door/doors.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Electricity/battery.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Electricity/junctionbox.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Electricity/lamp.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Electricity/lights.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Electricity/lightsprite.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Electricity/monitor.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Electricity/monitors.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Electricity/powerOn.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Electricity/poweritems.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Electricity/signalcomp.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Electricity/signalitems.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Electricity/supercapacitor.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Electricity/zap1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Electricity/zap2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Electricity/zap3.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Electricity/zap4.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Engine/engine.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Engine/engine.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Engine/engine.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Engine/pingCircle.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Engine/radarBlip.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Engine/radarOverlay.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Engine/radarPing.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Fabricators/deconstructor.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Fabricators/fabricator.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Fabricators/fabricators.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Fabricators/materials.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Fabricators/materials.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Jobgear/captainLegs.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Jobgear/captainTorso.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Jobgear/captaingear.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Jobgear/captainhat.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Jobgear/clownmask.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Jobgear/clownpants.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Jobgear/clownshirt.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Jobgear/doctorgear.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Jobgear/doctorgear.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Jobgear/engigear.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Jobgear/engigear.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Jobgear/headset.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Jobgear/misc.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Jobgear/securitygear.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Jobgear/securitygear.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Ladder/ladder.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Ladder/ladder.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Medical/bandage.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Medical/med.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Medical/medical.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Medical/syringe.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/MiniMap/item.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/OxygenGenerator/oxygengenerator.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/OxygenGenerator/oxygengenerator.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/OxygenGenerator/oxygengenerator.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/OxygenGenerator/vent.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/OxygenGenerator/ventilation.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Pump/pump.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Pump/pump.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Pump/pump.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Pump/smallpump.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Reactor/explosion.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Reactor/fuelrod.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Reactor/heatabsorber.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Reactor/reactor.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Reactor/reactor.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Reactor/reactor.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Tools/extinguisher.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Tools/extinguisher.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Tools/flare.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Tools/plasmaCutter.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Tools/tools.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Tools/tools.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Tools/weldingTool.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Weapons/bigexplosion.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Weapons/depthcharge.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Weapons/explosives.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Weapons/harpoon1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Weapons/harpoon2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Weapons/honk.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Weapons/railgun.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Weapons/railgun.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Weapons/railgunbarrel.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Weapons/railgunbase.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Weapons/railgunetc.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Weapons/rope.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Weapons/smack.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Weapons/stunbaton.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Weapons/stungrenade.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Weapons/stungrenade.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Weapons/weapons.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/Weapons/weapons.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/blank.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/circuitboard.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/connectionpanel.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/connector.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/idcard.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/idcard.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/itemlabel.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/machines.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/warningBeep.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/warningSiren.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/wireCorner.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/wireHorizontal.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Items/wireVertical.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Jobs.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Lights/alphaOne.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Lights/light.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Lights/lightcone.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Lights/penumbra.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Lights/visioncircle.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/LevelGenerationParameters.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/RuinConfig.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/StructurePrefabs.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/TutorialSub.sub (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/background.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/background2.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/beaconSymbol.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/beaconbackground.jpg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/citySymbol.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/citybackground.jpg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/dustparticles.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/iceCrack.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/iceCraters.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/iceSurface.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/iceWall.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/locationNames.txt (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/locationTypes.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/militarySymbol.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/militarybackground.jpg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/researchSymbol.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/researchbackground.jpg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/ruins.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/ruins2.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/ruins3.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/shaft.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/structures2.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/testroom.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/walldamage.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Map/waypointIcons.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Missions.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Orders.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Particles/FlameRoundParticleSheet.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Particles/ParticlePrefabs.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Particles/SmokeParticleSheet.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Particles/bubbles.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Particles/explosion.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Particles/fire.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Particles/flames.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Particles/shrapnel.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Particles/spatter.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Ambient/Ambient1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Ambient/Ambient10.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Ambient/Ambient11.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Ambient/Ambient12.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Ambient/Ambient13.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Ambient/Ambient2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Ambient/Ambient3.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Ambient/Ambient4.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Ambient/Ambient5.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Ambient/Ambient6.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Ambient/Ambient7.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Ambient/Ambient8.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Ambient/Ambient9.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Ambient/DistantPod1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Ambient/DistantPod2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Ambient/DistantPod3.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Ambient/GlacialMovement.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/GlassBreak1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/GlassBreak2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/GlassBreak3.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/GlassImpact1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/GlassImpact2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/GlassImpact3.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/HitArmor1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/HitArmor2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/HitArmor3.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/LimbBlunt1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/LimbBlunt2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/LimbBlunt3.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/LimbBlunt4.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/LimbBlunt5.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/LimbSlash1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/LimbSlash2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/LimbSlash3.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/StructureBlunt1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/StructureBlunt10.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/StructureBlunt2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/StructureBlunt3.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/StructureBlunt4.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/StructureBlunt5.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/StructureBlunt6.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/StructureBlunt7.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/StructureBlunt8.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/StructureBlunt9.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/StructureCrunch1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/StructureCrunch2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/StructureCrunch3.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/StructureCrunch4.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/StructureCrunch5.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/creak1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/creak2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/creak3.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/creak4.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/creak5.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Damage/implode.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Music/Controlled Chaos 2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Music/Controlled Chaos.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Music/Enter the Maze.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Music/Phantom From Space.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Music/Road to Hell.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Music/Simplex.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Music/Static Motion.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Music/Tenebrous Brothers Carnival - Prelude.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Music/The Descent.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Music/Unseen Horrors.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Music/amb_JD_drone_clattering_machine.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/UI/UImsg.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/UI/beep-shinymetal.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/UI/deadmsg.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/UI/radiomsg.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/UI/tap-zipper.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/Drown1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/Drown2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/Drown3.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/Drown4.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/DrownLoop.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/FlowLarge.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/FlowMedium.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/FlowSmall.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/Splash0.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/Splash1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/Splash2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/Splash3.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/Splash4.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/Splash5.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/Splash6.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/Splash7.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/Splash8.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/Splash9.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/WaterAmbience1.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/WaterAmbience2.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/Water/splashLoop.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/fire.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/firelarge.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/pickItem.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/sounds.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/startDrone.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/Sounds/stepMetal.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/UI/UI_Atlas.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/UI/caret.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/UI/cursor.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/UI/damageOverlay.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/UI/inventoryIcons.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/UI/noise.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/UI/statusIcons.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/UI/style.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/UI/textboxTexture.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/UI/titleBackground.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/UI/titleMonster.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/UI/titleText.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/UI/uiBackground.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/UI/uiButton.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/UI/uiIcons.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/blurshader.fx (100%) rename {BarotraumaClient => BarotraumaShared}/Content/blurshader.xnb (100%) rename {BarotraumaClient => BarotraumaShared}/Content/blurshader_opengl.xnb (100%) rename {BarotraumaClient => BarotraumaShared}/Content/damageshader.fx (100%) rename {BarotraumaClient => BarotraumaShared}/Content/damageshader.xnb (100%) rename {BarotraumaClient => BarotraumaShared}/Content/damageshader_opengl.xnb (100%) rename {BarotraumaClient => BarotraumaShared}/Content/effects.mgfx (100%) rename {BarotraumaClient => BarotraumaShared}/Content/randomevents.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Content/step.ogg (100%) rename {BarotraumaClient => BarotraumaShared}/Content/utg_4.mp4 (100%) rename {BarotraumaClient => BarotraumaShared}/Content/utg_4.xnb (100%) rename {BarotraumaClient => BarotraumaShared}/Content/waterbump.png (100%) rename {BarotraumaClient => BarotraumaShared}/Content/watershader.fx (100%) rename {BarotraumaClient => BarotraumaShared}/Content/watershader.xnb (100%) rename {BarotraumaClient => BarotraumaShared}/Content/watershader_opengl.xnb (100%) rename {BarotraumaClient => BarotraumaShared}/Data/ContentPackages/Vanilla 0.3.xml (100%) rename {BarotraumaClient => BarotraumaShared}/Icon.ico (100%) rename {BarotraumaClient => BarotraumaShared}/Mods/info.txt (100%) rename BarotraumaClient/readme.txt => BarotraumaShared/README.txt (100%) create mode 100644 BarotraumaShared/Source/Screens/GameScreen.cs create mode 100644 BarotraumaShared/Source/Screens/NetLobbyScreen.cs create mode 100644 BarotraumaShared/Source/Screens/Screen.cs rename {BarotraumaClient => BarotraumaShared}/Source/Screens/sygwkgy0.iv5 (100%) create mode 100644 BarotraumaShared/Source/Sprite/Sprite.cs create mode 100644 BarotraumaShared/Source/Sprite/SpriteSheet.cs rename {BarotraumaClient => BarotraumaShared}/Submarines/Aegir Mark III.sub (100%) rename {BarotraumaClient => BarotraumaShared}/Submarines/Nehalennia.sub (100%) rename {BarotraumaClient => BarotraumaShared}/Submarines/The Blind Carp.sub (100%) rename {BarotraumaClient => BarotraumaShared}/Submarines/The Nibbler.sub (100%) rename {BarotraumaClient => BarotraumaShared}/Submarines/TutorialSub.sub (100%) rename {BarotraumaClient => BarotraumaShared}/Submarines/Vellamo.sub (100%) rename {BarotraumaClient => BarotraumaShared}/changelog.txt (100%) rename {BarotraumaClient => BarotraumaShared}/config.xml (100%) rename {BarotraumaClient => BarotraumaShared}/packages.config (100%) diff --git a/BarotraumaClient/BarotraumaClient.csproj b/BarotraumaClient/BarotraumaClient.csproj index 2e5256448..d618be416 100644 --- a/BarotraumaClient/BarotraumaClient.csproj +++ b/BarotraumaClient/BarotraumaClient.csproj @@ -57,7 +57,8 @@ false - Icon.ico + + @@ -65,6 +66,7 @@ + @@ -86,14 +88,13 @@ + + - - - @@ -132,757 +133,12 @@ - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - Designer - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - Designer - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - Designer - PreserveNewest - - - PreserveNewest - - - Designer - PreserveNewest - - - PreserveNewest - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - Designer - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - Designer - PreserveNewest - - - PreserveNewest - - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - Designer - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - - - Designer - PreserveNewest - - - PreserveNewest - - - Designer - PreserveNewest - - - PreserveNewest - - - Designer - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - Designer - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - Always - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer - - - PreserveNewest - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer - PreserveNewest - - - PreserveNewest - PreserveNewest - - PreserveNewest - PreserveNewest @@ -909,573 +165,7 @@ true - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - - - - + {0aad36e3-51a5-4a07-ab60-5c8a66bd38b7} diff --git a/BarotraumaShared/Source/Characters/BackgroundSprite/BackgroundCreature.cs b/BarotraumaClient/Source/Characters/BackgroundSprite/BackgroundCreature.cs similarity index 100% rename from BarotraumaShared/Source/Characters/BackgroundSprite/BackgroundCreature.cs rename to BarotraumaClient/Source/Characters/BackgroundSprite/BackgroundCreature.cs diff --git a/BarotraumaShared/Source/Characters/BackgroundSprite/BackgroundCreatureManager.cs b/BarotraumaClient/Source/Characters/BackgroundSprite/BackgroundCreatureManager.cs similarity index 100% rename from BarotraumaShared/Source/Characters/BackgroundSprite/BackgroundCreatureManager.cs rename to BarotraumaClient/Source/Characters/BackgroundSprite/BackgroundCreatureManager.cs diff --git a/BarotraumaShared/Source/Characters/BackgroundSprite/BackgroundCreaturePrefab.cs b/BarotraumaClient/Source/Characters/BackgroundSprite/BackgroundCreaturePrefab.cs similarity index 100% rename from BarotraumaShared/Source/Characters/BackgroundSprite/BackgroundCreaturePrefab.cs rename to BarotraumaClient/Source/Characters/BackgroundSprite/BackgroundCreaturePrefab.cs diff --git a/BarotraumaShared/Source/Characters/BackgroundSprite/BackgroundSpriteManager.cs b/BarotraumaClient/Source/Characters/BackgroundSprite/BackgroundSpriteManager.cs similarity index 100% rename from BarotraumaShared/Source/Characters/BackgroundSprite/BackgroundSpriteManager.cs rename to BarotraumaClient/Source/Characters/BackgroundSprite/BackgroundSpriteManager.cs diff --git a/BarotraumaShared/Source/Characters/BackgroundSprite/BackgroundSpritePrefab.cs b/BarotraumaClient/Source/Characters/BackgroundSprite/BackgroundSpritePrefab.cs similarity index 100% rename from BarotraumaShared/Source/Characters/BackgroundSprite/BackgroundSpritePrefab.cs rename to BarotraumaClient/Source/Characters/BackgroundSprite/BackgroundSpritePrefab.cs diff --git a/BarotraumaShared/Source/GameMain.cs b/BarotraumaClient/Source/GameMain.cs similarity index 99% rename from BarotraumaShared/Source/GameMain.cs rename to BarotraumaClient/Source/GameMain.cs index e89728181..7ad903abe 100644 --- a/BarotraumaShared/Source/GameMain.cs +++ b/BarotraumaClient/Source/GameMain.cs @@ -12,7 +12,6 @@ using Microsoft.Xna.Framework.Input; namespace Barotrauma { -#if CLIENT class GameMain : Game { public static bool DebugDraw; @@ -414,7 +413,5 @@ namespace Barotrauma base.OnExiting(sender, args); } - } -#endif } diff --git a/BarotraumaClient/Source/Items/Item.cs b/BarotraumaClient/Source/Items/Item.cs new file mode 100644 index 000000000..e09372970 --- /dev/null +++ b/BarotraumaClient/Source/Items/Item.cs @@ -0,0 +1,555 @@ +using Barotrauma.Items.Components; +using Barotrauma.Networking; +using FarseerPhysics; +using FarseerPhysics.Dynamics; +using FarseerPhysics.Dynamics.Contacts; +using Lidgren.Network; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Xml.Linq; + +namespace Barotrauma +{ + partial class Item : MapEntity, IDamageable, IPropertyObject, IServerSerializable, IClientSerializable + { + public override Sprite Sprite + { + get { return prefab.sprite; } + } + + + public override void Draw(SpriteBatch spriteBatch, bool editing, bool back = true) + { + if (!Visible) return; + Color color = (IsSelected && editing) ? color = Color.Red : spriteColor; + if (isHighlighted) color = Color.Orange; + + SpriteEffects oldEffects = prefab.sprite.effects; + prefab.sprite.effects ^= SpriteEffects; + + if (prefab.sprite != null) + { + float depth = Sprite.Depth; + depth += (ID % 255) * 0.000001f; + + if (body == null) + { + if (prefab.ResizeHorizontal || prefab.ResizeVertical || SpriteEffects.HasFlag(SpriteEffects.FlipHorizontally) || SpriteEffects.HasFlag(SpriteEffects.FlipVertically)) + { + prefab.sprite.DrawTiled(spriteBatch, new Vector2(DrawPosition.X - rect.Width / 2, -(DrawPosition.Y + rect.Height / 2)), new Vector2(rect.Width, rect.Height), color); + } + else + { + prefab.sprite.Draw(spriteBatch, new Vector2(DrawPosition.X, -DrawPosition.Y), color, 0.0f, 1.0f, SpriteEffects.None, depth); + } + + } + else if (body.Enabled) + { + var holdable = GetComponent(); + if (holdable != null && holdable.Picker?.AnimController != null) + { + if (holdable.Picker.SelectedItems[0] == this) + { + depth = holdable.Picker.AnimController.GetLimb(LimbType.RightHand).sprite.Depth + 0.000001f; + } + else if (holdable.Picker.SelectedItems[1] == this) + { + depth = holdable.Picker.AnimController.GetLimb(LimbType.LeftArm).sprite.Depth - 0.000001f; + } + + body.Draw(spriteBatch, prefab.sprite, color, depth); + } + else + { + body.Draw(spriteBatch, prefab.sprite, color, depth); + } + } + } + + prefab.sprite.effects = oldEffects; + + List staticDrawableComponents = new List(drawableComponents); //static list to compensate for drawable toggling + for (int i = 0; i < staticDrawableComponents.Count; i++) + { + staticDrawableComponents[i].Draw(spriteBatch, editing); + } + + if (GameMain.DebugDraw && aiTarget != null) aiTarget.Draw(spriteBatch); + + if (!editing || (body != null && !body.Enabled)) + { + return; + } + + if (IsSelected || isHighlighted) + { + GUI.DrawRectangle(spriteBatch, new Vector2(DrawPosition.X - rect.Width / 2, -(DrawPosition.Y + rect.Height / 2)), new Vector2(rect.Width, rect.Height), Color.Green, false, 0, (int)Math.Max((1.5f / GameScreen.Selected.Cam.Zoom), 1.0f)); + + foreach (Rectangle t in prefab.Triggers) + { + Rectangle transformedTrigger = TransformTrigger(t); + + Vector2 rectWorldPos = new Vector2(transformedTrigger.X, transformedTrigger.Y); + if (Submarine != null) rectWorldPos += Submarine.Position; + rectWorldPos.Y = -rectWorldPos.Y; + + GUI.DrawRectangle(spriteBatch, + rectWorldPos, + new Vector2(transformedTrigger.Width, transformedTrigger.Height), + Color.Green, + false, + 0, + (int)Math.Max((1.5f / GameScreen.Selected.Cam.Zoom), 1.0f)); + } + } + + if (!ShowLinks) return; + + foreach (MapEntity e in linkedTo) + { + GUI.DrawLine(spriteBatch, + new Vector2(WorldPosition.X, -WorldPosition.Y), + new Vector2(e.WorldPosition.X, -e.WorldPosition.Y), + Color.Red * 0.3f); + } + } + + public override void UpdateEditing(Camera cam) + { + if (editingHUD == null || editingHUD.UserData as Item != this) + { + editingHUD = CreateEditingHUD(Screen.Selected != GameMain.EditMapScreen); + } + + editingHUD.Update((float)Timing.Step); + + if (Screen.Selected != GameMain.EditMapScreen) return; + + if (!prefab.IsLinkable) return; + + if (!PlayerInput.LeftButtonClicked() || !PlayerInput.KeyDown(Keys.Space)) return; + + Vector2 position = cam.ScreenToWorld(PlayerInput.MousePosition); + + foreach (MapEntity entity in mapEntityList) + { + if (entity == this || !entity.IsHighlighted) continue; + if (linkedTo.Contains(entity)) continue; + if (!entity.IsMouseOn(position)) continue; + + linkedTo.Add(entity); + if (entity.IsLinkable && entity.linkedTo != null) entity.linkedTo.Add(this); + } + } + + public override void DrawEditing(SpriteBatch spriteBatch, Camera cam) + { + if (editingHUD != null) editingHUD.Draw(spriteBatch); + } + + private GUIComponent CreateEditingHUD(bool inGame = false) + { + List editableProperties = inGame ? GetProperties() : GetProperties(); + + int requiredItemCount = 0; + if (!inGame) + { + foreach (ItemComponent ic in components) + { + requiredItemCount += ic.requiredItems.Count; + } + } + + int width = 450; + int height = 80 + requiredItemCount * 20; + int x = GameMain.GraphicsWidth / 2 - width / 2, y = 10; + foreach (var objectProperty in editableProperties) + { + var editable = objectProperty.Attributes.OfType().FirstOrDefault(); + if (editable != null) height += (int)(Math.Ceiling(editable.MaxLength / 40.0f) * 18.0f) + 5; + } + + editingHUD = new GUIFrame(new Rectangle(x, y, width, height), ""); + editingHUD.Padding = new Vector4(10, 10, 0, 0); + editingHUD.UserData = this; + + new GUITextBlock(new Rectangle(0, 0, 100, 20), prefab.Name, "", + Alignment.TopLeft, Alignment.TopLeft, editingHUD, false, GUI.LargeFont); + + y += 25; + + if (!inGame) + { + if (prefab.IsLinkable) + { + new GUITextBlock(new Rectangle(0, 5, 0, 20), "Hold space to link to another item", + "", Alignment.TopRight, Alignment.TopRight, editingHUD).Font = GUI.SmallFont; + } + foreach (ItemComponent ic in components) + { + foreach (RelatedItem relatedItem in ic.requiredItems) + { + new GUITextBlock(new Rectangle(0, y, 100, 15), ic.Name + ": " + relatedItem.Type.ToString() + " required", "", Alignment.TopLeft, Alignment.CenterLeft, editingHUD, false, GUI.SmallFont); + GUITextBox namesBox = new GUITextBox(new Rectangle(-10, y, 160, 15), Alignment.Right, "", editingHUD); + namesBox.Font = GUI.SmallFont; + + PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(relatedItem); + PropertyDescriptor property = properties.Find("JoinedNames", false); + + namesBox.Text = relatedItem.JoinedNames; + namesBox.UserData = new ObjectProperty(property, relatedItem); + namesBox.OnEnterPressed = EnterProperty; + namesBox.OnTextChanged = PropertyChanged; + + y += 20; + } + } + if (requiredItemCount > 0) y += 10; + } + + foreach (var objectProperty in editableProperties) + { + int boxHeight = 18; + var editable = objectProperty.Attributes.OfType().FirstOrDefault(); + if (editable != null) boxHeight = (int)(Math.Ceiling(editable.MaxLength / 40.0f) * 18.0f); + + object value = objectProperty.GetValue(); + + if (value is bool) + { + GUITickBox propertyTickBox = new GUITickBox(new Rectangle(10, y, 18, 18), objectProperty.Name, + Alignment.Left, editingHUD); + propertyTickBox.Font = GUI.SmallFont; + + propertyTickBox.Selected = (bool)value; + + propertyTickBox.UserData = objectProperty; + propertyTickBox.OnSelected = EnterProperty; + } + else + { + new GUITextBlock(new Rectangle(0, y, 100, 18), objectProperty.Name, "", Alignment.TopLeft, Alignment.Left, editingHUD, false, GUI.SmallFont); + + GUITextBox propertyBox = new GUITextBox(new Rectangle(180, y, 250, boxHeight), "", editingHUD); + propertyBox.Font = GUI.SmallFont; + if (boxHeight > 18) propertyBox.Wrap = true; + + if (value != null) + { + if (value is float) + { + propertyBox.Text = ((float)value).ToString("G", System.Globalization.CultureInfo.InvariantCulture); + } + else + { + + propertyBox.Text = value.ToString(); + } + } + + propertyBox.UserData = objectProperty; + propertyBox.OnEnterPressed = EnterProperty; + propertyBox.OnTextChanged = PropertyChanged; + + } + y = y + boxHeight + 5; + + } + return editingHUD; + } + public virtual void DrawHUD(SpriteBatch spriteBatch, Camera cam, Character character) + { + if (condition <= 0.0f) + { + FixRequirement.DrawHud(spriteBatch, this, character); + return; + } + + if (HasInGameEditableProperties) + { + DrawEditing(spriteBatch, cam); + } + + foreach (ItemComponent ic in components) + { + if (ic.CanBeSelected) ic.DrawHUD(spriteBatch, character); + } + } + + public override void AddToGUIUpdateList() + { + if (Screen.Selected is EditMapScreen) + { + if (editingHUD != null) editingHUD.AddToGUIUpdateList(); + } + else + { + if (HasInGameEditableProperties) + { + if (editingHUD != null) editingHUD.AddToGUIUpdateList(); + } + } + + if (Character.Controlled != null && Character.Controlled.SelectedConstruction == this) + { + if (condition <= 0.0f) + { + FixRequirement.AddToGUIUpdateList(); + return; + } + + foreach (ItemComponent ic in components) + { + if (ic.CanBeSelected) ic.AddToGUIUpdateList(); + } + } + } + + private bool EnterProperty(GUITickBox tickBox) + { + var objectProperty = tickBox.UserData as ObjectProperty; + if (objectProperty == null) return false; + + objectProperty.TrySetValue(tickBox.Selected); + + return true; + } + + private bool EnterProperty(GUITextBox textBox, string text) + { + textBox.Color = Color.DarkGreen; + + var objectProperty = textBox.UserData as ObjectProperty; + if (objectProperty == null) return false; + + object prevValue = objectProperty.GetValue(); + + textBox.Deselect(); + + if (objectProperty.TrySetValue(text)) + { + textBox.Text = text; + + if (GameMain.Server != null) + { + GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.ChangeProperty, objectProperty }); + } + else if (GameMain.Client != null) + { + GameMain.Client.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.ChangeProperty, objectProperty }); + } + + return true; + } + else + { + if (prevValue != null) + { + textBox.Text = prevValue.ToString(); + } + return false; + } + } + + private bool PropertyChanged(GUITextBox textBox, string text) + { + textBox.Color = Color.Red; + + return true; + } + + public override XElement Save(XElement parentElement) + { + XElement element = new XElement("Item"); + + element.Add(new XAttribute("name", prefab.Name), + new XAttribute("ID", ID)); + + System.Diagnostics.Debug.Assert(Submarine != null); + + if (ResizeHorizontal || ResizeVertical) + { + element.Add(new XAttribute("rect", + (int)(rect.X - Submarine.HiddenSubPosition.X) + "," + + (int)(rect.Y - Submarine.HiddenSubPosition.Y) + "," + + rect.Width + "," + rect.Height)); + } + else + { + element.Add(new XAttribute("rect", + (int)(rect.X - Submarine.HiddenSubPosition.X) + "," + + (int)(rect.Y - Submarine.HiddenSubPosition.Y))); + } + + if (linkedTo != null && linkedTo.Count > 0) + { + string[] linkedToIDs = new string[linkedTo.Count]; + + for (int i = 0; i < linkedTo.Count; i++) + { + linkedToIDs[i] = linkedTo[i].ID.ToString(); + } + + element.Add(new XAttribute("linked", string.Join(",", linkedToIDs))); + } + + + ObjectProperty.SaveProperties(this, element); + + foreach (ItemComponent ic in components) + { + ic.Save(element); + } + + parentElement.Add(element); + + return element; + } + + + public void ClientRead(ServerNetObject type, NetBuffer msg, float sendingTime) + { + if (type == ServerNetObject.ENTITY_POSITION) + { + ClientReadPosition(type, msg, sendingTime); + return; + } + + NetEntityEvent.Type eventType = + (NetEntityEvent.Type)msg.ReadRangedInteger(0, Enum.GetValues(typeof(NetEntityEvent.Type)).Length - 1); + + switch (eventType) + { + case NetEntityEvent.Type.ComponentState: + int componentIndex = msg.ReadRangedInteger(0, components.Count - 1); + (components[componentIndex] as IServerSerializable).ClientRead(type, msg, sendingTime); + break; + case NetEntityEvent.Type.InventoryState: + ownInventory.ClientRead(type, msg, sendingTime); + break; + case NetEntityEvent.Type.Status: + condition = msg.ReadRangedSingle(0.0f, 100.0f, 8); + + if (FixRequirements.Count > 0) + { + if (Condition <= 0.0f) + { + for (int i = 0; i < FixRequirements.Count; i++) + FixRequirements[i].Fixed = msg.ReadBoolean(); + } + else + { + for (int i = 0; i < FixRequirements.Count; i++) + FixRequirements[i].Fixed = true; + } + } + break; + case NetEntityEvent.Type.ApplyStatusEffect: + ActionType actionType = (ActionType)msg.ReadRangedInteger(0, Enum.GetValues(typeof(ActionType)).Length - 1); + ushort targetID = msg.ReadUInt16(); + + Character target = FindEntityByID(targetID) as Character; + ApplyStatusEffects(actionType, (float)Timing.Step, target, true); + break; + case NetEntityEvent.Type.ChangeProperty: + ReadPropertyChange(msg); + break; + } + } + + public void ClientWrite(NetBuffer msg, object[] extraData = null) + { + if (extraData == null || extraData.Length == 0 || !(extraData[0] is NetEntityEvent.Type)) + { + return; + } + + NetEntityEvent.Type eventType = (NetEntityEvent.Type)extraData[0]; + msg.WriteRangedInteger(0, Enum.GetValues(typeof(NetEntityEvent.Type)).Length - 1, (int)eventType); + switch (eventType) + { + case NetEntityEvent.Type.ComponentState: + int componentIndex = (int)extraData[1]; + msg.WriteRangedInteger(0, components.Count - 1, componentIndex); + + (components[componentIndex] as IClientSerializable).ClientWrite(msg, extraData); + break; + case NetEntityEvent.Type.InventoryState: + ownInventory.ClientWrite(msg, extraData); + break; + case NetEntityEvent.Type.Repair: + if (FixRequirements.Count > 0) + { + int requirementIndex = (int)extraData[1]; + msg.WriteRangedInteger(0, FixRequirements.Count - 1, requirementIndex); + } + break; + case NetEntityEvent.Type.ApplyStatusEffect: + //no further data needed, the server applies the effect + //on the character of the client who sent the message + break; + case NetEntityEvent.Type.ChangeProperty: + WritePropertyChange(msg, extraData); + break; + } + msg.WritePadBits(); + } + + public void ClientReadPosition(ServerNetObject type, NetBuffer msg, float sendingTime) + { + Vector2 newPosition = new Vector2(msg.ReadFloat(), msg.ReadFloat()); + float newRotation = msg.ReadRangedSingle(0.0f, MathHelper.TwoPi, 7); + bool awake = msg.ReadBoolean(); + Vector2 newVelocity = Vector2.Zero; + + if (awake) + { + newVelocity = new Vector2( + msg.ReadRangedSingle(-MaxVel, MaxVel, 12), + msg.ReadRangedSingle(-MaxVel, MaxVel, 12)); + } + + if (body == null) + { + DebugConsole.ThrowError("Received a position update for an item with no physics body (" + Name + ")"); + return; + } + + body.FarseerBody.Awake = awake; + if (body.FarseerBody.Awake) + { + if ((newVelocity - body.LinearVelocity).Length() > 8.0f) body.LinearVelocity = newVelocity; + } + else + { + body.FarseerBody.Enabled = false; + } + + if ((newPosition - SimPosition).Length() > body.LinearVelocity.Length() * 2.0f) + { + body.SetTransform(newPosition, newRotation); + + Vector2 displayPos = ConvertUnits.ToDisplayUnits(body.SimPosition); + rect.X = (int)(displayPos.X - rect.Width / 2.0f); + rect.Y = (int)(displayPos.Y + rect.Height / 2.0f); + } + } + + public void CreateClientEvent(T ic) where T : ItemComponent, IClientSerializable + { + if (GameMain.Client == null) return; + + int index = components.IndexOf(ic); + if (index == -1) return; + + GameMain.Client.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.ComponentState, index }); + } + } +} \ No newline at end of file diff --git a/BarotraumaClient/Source/Map/MapEntity.cs b/BarotraumaClient/Source/Map/MapEntity.cs new file mode 100644 index 000000000..daef42ec3 --- /dev/null +++ b/BarotraumaClient/Source/Map/MapEntity.cs @@ -0,0 +1,647 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Xml.Linq; +using FarseerPhysics; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using System.Collections.ObjectModel; +using Barotrauma.Items.Components; + +namespace Barotrauma +{ + abstract partial class MapEntity + { + protected static Vector2 selectionPos = Vector2.Zero; + protected static Vector2 selectionSize = Vector2.Zero; + + protected static Vector2 startMovingPos = Vector2.Zero; + + //which entities have been selected for editing + private static List selectedList = new List(); + public static List SelectedList + { + get + { + return selectedList; + } + } + private static List copiedList = new List(); + + private static List highlightedList = new List(); + + private static float highlightTimer; + + private static GUIListBox highlightedListBox; + public static GUIListBox HighlightedListBox + { + get { return highlightedListBox; } + } + + + protected static GUIComponent editingHUD; + public static GUIComponent EditingHUD + { + get + { + return editingHUD; + } + } + + //is the mouse inside the rect + protected bool isHighlighted; + + //protected bool isSelected; + + private static bool disableSelect; + public static bool DisableSelect + { + get { return disableSelect; } + set + { + disableSelect = value; + if (disableSelect) + { + startMovingPos = Vector2.Zero; + selectionSize = Vector2.Zero; + selectionPos = Vector2.Zero; + } + } + } + + public static bool SelectedAny + { + get { return selectedList.Count > 0; } + } + + + public bool IsHighlighted + { + get { return isHighlighted; } + set { isHighlighted = value; } + } + + public bool IsSelected + { + get { return selectedList.Contains(this); } + } + + protected bool ResizeHorizontal + { + get { return prefab != null && prefab.ResizeHorizontal; } + } + protected bool ResizeVertical + { + get { return prefab != null && prefab.ResizeVertical; } + } + + public virtual void Draw(SpriteBatch spriteBatch, bool editing, bool back = true) { } + + public virtual void DrawDamage(SpriteBatch spriteBatch, Effect damageEffect) { } + + + /// + /// Update the selection logic in submarine editor + /// + public static void UpdateSelecting(Camera cam) + { + if (resizing) + { + if (selectedList.Count == 0) resizing = false; + return; + } + + foreach (MapEntity e in mapEntityList) + { + e.isHighlighted = false; + } + + if (DisableSelect) + { + DisableSelect = false; + return; + } + + if (GUIComponent.MouseOn != null || !PlayerInput.MouseInsideWindow) + { + if (highlightedListBox == null || + (GUIComponent.MouseOn != highlightedListBox && !highlightedListBox.IsParentOf(GUIComponent.MouseOn))) + { + UpdateHighlightedListBox(null); + return; + } + } + + if (MapEntityPrefab.Selected != null) + { + selectionPos = Vector2.Zero; + selectedList.Clear(); + return; + } + + if (PlayerInput.KeyDown(Keys.Delete)) + { + selectedList.ForEach(e => e.Remove()); + selectedList.Clear(); + } + + if (PlayerInput.KeyDown(Keys.LeftControl) || PlayerInput.KeyDown(Keys.RightControl)) + { + if (PlayerInput.GetKeyboardState.IsKeyDown(Keys.C) && + PlayerInput.GetOldKeyboardState.IsKeyUp(Keys.C)) + { + CopyEntities(selectedList); + } + else if (PlayerInput.GetKeyboardState.IsKeyDown(Keys.X) && + PlayerInput.GetOldKeyboardState.IsKeyUp(Keys.X)) + { + CopyEntities(selectedList); + + selectedList.ForEach(e => e.Remove()); + selectedList.Clear(); + } + else if (copiedList.Count > 0 && + PlayerInput.GetKeyboardState.IsKeyDown(Keys.V) && + PlayerInput.GetOldKeyboardState.IsKeyUp(Keys.V)) + { + var clones = Clone(copiedList); + + Vector2 center = Vector2.Zero; + clones.ForEach(c => center += c.WorldPosition); + center = Submarine.VectorToWorldGrid(center / clones.Count); + + Vector2 moveAmount = Submarine.VectorToWorldGrid(cam.WorldViewCenter - center); + + selectedList = new List(clones); + foreach (MapEntity clone in selectedList) + { + clone.Move(moveAmount); + clone.Submarine = Submarine.MainSub; + } + } + } + + Vector2 position = cam.ScreenToWorld(PlayerInput.MousePosition); + + MapEntity highLightedEntity = null; + + if (startMovingPos == Vector2.Zero) + { + List highlightedEntities = new List(); + if (highlightedListBox != null && highlightedListBox.IsParentOf(GUIComponent.MouseOn)) + { + highLightedEntity = GUIComponent.MouseOn.UserData as MapEntity; + } + else + { + foreach (MapEntity e in mapEntityList) + { + if (!e.SelectableInEditor) continue; + + if (e.IsMouseOn(position)) + { + int i = 0; + while (i < highlightedEntities.Count && + e.Sprite != null && + (highlightedEntities[i].Sprite == null || highlightedEntities[i].Sprite.Depth < e.Sprite.Depth)) + { + i++; + } + + highlightedEntities.Insert(i, e); + + if (i == 0) highLightedEntity = e; + } + } + + if (PlayerInput.MouseSpeed.LengthSquared() > 10) + { + highlightTimer = 0.0f; + } + else + { + bool mouseNearHighlightBox = false; + + if (highlightedListBox != null) + { + Rectangle expandedRect = highlightedListBox.Rect; + expandedRect.Inflate(20, 20); + mouseNearHighlightBox = expandedRect.Contains(PlayerInput.MousePosition); + if (!mouseNearHighlightBox) highlightedListBox = null; + } + + highlightTimer += (float)Timing.Step; + if (highlightTimer > 1.0f) + { + if (!mouseNearHighlightBox) + { + UpdateHighlightedListBox(highlightedEntities); + highlightTimer = 0.0f; + } + } + } + } + + if (highLightedEntity != null) highLightedEntity.isHighlighted = true; + } + + //started moving selected entities + if (startMovingPos != Vector2.Zero) + { + if (PlayerInput.LeftButtonReleased()) + { + //mouse released -> move the entities to the new position of the mouse + + Vector2 moveAmount = position - startMovingPos; + moveAmount = Submarine.VectorToWorldGrid(moveAmount); + + if (moveAmount != Vector2.Zero) + { + //clone + if (PlayerInput.KeyDown(Keys.LeftControl) || PlayerInput.KeyDown(Keys.RightControl)) + { + var clones = Clone(selectedList); + selectedList = clones; + selectedList.ForEach(c => c.Move(moveAmount)); + } + else // move + { + foreach (MapEntity e in selectedList) e.Move(moveAmount); + } + } + + startMovingPos = Vector2.Zero; + } + + } + //started dragging a "selection rectangle" + else if (selectionPos != Vector2.Zero) + { + selectionSize.X = position.X - selectionPos.X; + selectionSize.Y = selectionPos.Y - position.Y; + + List newSelection = new List();// FindSelectedEntities(selectionPos, selectionSize); + if (Math.Abs(selectionSize.X) > Submarine.GridSize.X || Math.Abs(selectionSize.Y) > Submarine.GridSize.Y) + { + newSelection = FindSelectedEntities(selectionPos, selectionSize); + } + else + { + if (highLightedEntity != null) newSelection.Add(highLightedEntity); + } + + if (PlayerInput.LeftButtonReleased()) + { + if (PlayerInput.KeyDown(Keys.LeftControl) || + PlayerInput.KeyDown(Keys.RightControl)) + { + foreach (MapEntity e in newSelection) + { + if (selectedList.Contains(e)) + selectedList.Remove(e); + else + selectedList.Add(e); + } + } + else + { + selectedList = newSelection; + } + + //select wire if both items it's connected to are selected + var selectedItems = selectedList.Where(e => e is Item).Cast().ToList(); + foreach (Item item in selectedItems) + { + if (item.Connections == null) continue; + foreach (Connection c in item.Connections) + { + foreach (Wire w in c.Wires) + { + if (w == null || selectedList.Contains(w.Item)) continue; + + if (w.OtherConnection(c) != null && selectedList.Contains(w.OtherConnection(c).Item)) + { + selectedList.Add(w.Item); + } + } + } + } + + selectionPos = Vector2.Zero; + selectionSize = Vector2.Zero; + } + } + //default, not doing anything specific yet + else + { + if (PlayerInput.LeftButtonHeld() && + PlayerInput.KeyUp(Keys.Space) && + (highlightedListBox == null || (GUIComponent.MouseOn != highlightedListBox && !highlightedListBox.IsParentOf(GUIComponent.MouseOn)))) + { + //if clicking a selected entity, start moving it + foreach (MapEntity e in selectedList) + { + if (e.IsMouseOn(position)) startMovingPos = position; + } + + selectionPos = position; + } + } + } + + private static void UpdateHighlightedListBox(List highlightedEntities) + { + if (highlightedEntities == null || highlightedEntities.Count < 2) + { + highlightedListBox = null; + return; + } + if (highlightedListBox != null) + { + if (GUIComponent.MouseOn == highlightedListBox || highlightedListBox.IsParentOf(GUIComponent.MouseOn)) return; + if (highlightedEntities.SequenceEqual(highlightedList)) return; + } + + highlightedList = highlightedEntities; + + highlightedListBox = new GUIListBox( + new Rectangle((int)PlayerInput.MousePosition.X + 15, (int)PlayerInput.MousePosition.Y + 15, 150, highlightedEntities.Count * 18 + 5), + null, Alignment.TopLeft, "GUIToolTip", null, false); + + foreach (MapEntity entity in highlightedEntities) + { + var textBlock = new GUITextBlock( + new Rectangle(0, 0, highlightedListBox.Rect.Width, 18), + ToolBox.LimitString(entity.Name, GUI.SmallFont, 140), "", Alignment.TopLeft, Alignment.CenterLeft, highlightedListBox, false, GUI.SmallFont); + + textBlock.UserData = entity; + } + + highlightedListBox.OnSelected = (GUIComponent component, object obj) => + { + MapEntity entity = obj as MapEntity; + + if (PlayerInput.KeyDown(Keys.LeftControl) || + PlayerInput.KeyDown(Keys.RightControl)) + { + if (selectedList.Contains(entity)) + selectedList.Remove(entity); + else + selectedList.Add(entity); + } + else + { + SelectEntity(entity); + } + + return true; + }; + } + + + /// + /// Draw the "selection rectangle" and outlines of entities that are being dragged (if any) + /// + public static void DrawSelecting(SpriteBatch spriteBatch, Camera cam) + { + if (GUIComponent.MouseOn != null) return; + + Vector2 position = PlayerInput.MousePosition; + position = cam.ScreenToWorld(position); + + if (startMovingPos != Vector2.Zero) + { + Vector2 moveAmount = position - startMovingPos; + moveAmount = Submarine.VectorToWorldGrid(moveAmount); + moveAmount.Y = -moveAmount.Y; + //started moving the selected entities + if (moveAmount != Vector2.Zero) + { + foreach (MapEntity e in selectedList) + GUI.DrawRectangle(spriteBatch, + new Vector2(e.WorldRect.X, -e.WorldRect.Y) + moveAmount, + new Vector2(e.rect.Width, e.rect.Height), + Color.DarkRed, false, 0, (int)Math.Max(1.5f / GameScreen.Selected.Cam.Zoom, 1.0f)); + + //stop dragging the "selection rectangle" + selectionPos = Vector2.Zero; + } + } + if (selectionPos != null && selectionPos != Vector2.Zero) + { + GUI.DrawRectangle(spriteBatch, new Vector2(selectionPos.X, -selectionPos.Y), selectionSize, Color.DarkRed, false, 0, (int)Math.Max(1.5f / GameScreen.Selected.Cam.Zoom, 1.0f)); + } + } + + public static void UpdateEditor(Camera cam) + { + if (highlightedListBox != null) highlightedListBox.Update((float)Timing.Step); + + if (selectedList.Count == 1) + { + selectedList[0].UpdateEditing(cam); + + if (selectedList[0].ResizeHorizontal || selectedList[0].ResizeVertical) + { + selectedList[0].UpdateResizing(cam); + } + } + + if (editingHUD != null) + { + if (selectedList.Count == 0 || editingHUD.UserData != selectedList[0]) + { + foreach (GUIComponent component in editingHUD.children) + { + var textBox = component as GUITextBox; + if (textBox == null) continue; + + textBox.Deselect(); + } + + editingHUD = null; + } + } + } + + public static void DrawEditor(SpriteBatch spriteBatch, Camera cam) + { + if (selectedList.Count == 1) + { + selectedList[0].DrawEditing(spriteBatch, cam); + + if (selectedList[0].ResizeHorizontal || selectedList[0].ResizeVertical) + { + selectedList[0].DrawResizing(spriteBatch, cam); + } + } + + if (highlightedListBox != null) + { + highlightedListBox.Draw(spriteBatch); + } + } + + public static void DeselectAll() + { + selectedList.Clear(); + } + + + public static void SelectEntity(MapEntity entity) + { + DeselectAll(); + + selectedList.Add(entity); + } + + /// + /// copies a list of entities to the "clipboard" (copiedList) + /// + private static void CopyEntities(List entities) + { + List prevEntities = new List(mapEntityList); + + copiedList = Clone(entities); + + //find all new entities created during cloning + var newEntities = mapEntityList.Except(prevEntities).ToList(); + + //do a "shallow remove" (removes the entities from the game without removing links between them) + // -> items will stay in their containers + newEntities.ForEach(e => e.ShallowRemove()); + } + + public virtual void AddToGUIUpdateList() + { + if (editingHUD != null && editingHUD.UserData == this) editingHUD.AddToGUIUpdateList(); + } + + public virtual void UpdateEditing(Camera cam) { } + + public virtual void DrawEditing(SpriteBatch spriteBatch, Camera cam) { } + + private void UpdateResizing(Camera cam) + { + isHighlighted = true; + + int startX = ResizeHorizontal ? -1 : 0; + int StartY = ResizeVertical ? -1 : 0; + + for (int x = startX; x < 2; x += 2) + { + for (int y = StartY; y < 2; y += 2) + { + Vector2 handlePos = cam.WorldToScreen(Position + new Vector2(x * (rect.Width * 0.5f + 5), y * (rect.Height * 0.5f + 5))); + + bool highlighted = Vector2.Distance(PlayerInput.MousePosition, handlePos) < 5.0f; + + if (highlighted && PlayerInput.LeftButtonDown()) + { + selectionPos = Vector2.Zero; + resizeDirX = x; + resizeDirY = y; + resizing = true; + } + } + } + + if (resizing) + { + Vector2 placePosition = new Vector2(rect.X, rect.Y); + Vector2 placeSize = new Vector2(rect.Width, rect.Height); + + Vector2 mousePos = Submarine.MouseToWorldGrid(cam, Submarine.MainSub); + + if (resizeDirX > 0) + { + mousePos.X = Math.Max(mousePos.X, rect.X + Submarine.GridSize.X); + placeSize.X = mousePos.X - placePosition.X; + } + else if (resizeDirX < 0) + { + mousePos.X = Math.Min(mousePos.X, rect.Right - Submarine.GridSize.X); + + placeSize.X = (placePosition.X + placeSize.X) - mousePos.X; + placePosition.X = mousePos.X; + } + if (resizeDirY < 0) + { + mousePos.Y = Math.Min(mousePos.Y, rect.Y - Submarine.GridSize.Y); + placeSize.Y = placePosition.Y - mousePos.Y; + } + else if (resizeDirY > 0) + { + mousePos.Y = Math.Max(mousePos.Y, rect.Y - rect.Height + Submarine.GridSize.X); + + placeSize.Y = mousePos.Y - (rect.Y - rect.Height); + placePosition.Y = mousePos.Y; + } + + if ((int)placePosition.X != rect.X || (int)placePosition.Y != rect.Y || (int)placeSize.X != rect.Width || (int)placeSize.Y != rect.Height) + { + Rect = new Rectangle((int)placePosition.X, (int)placePosition.Y, (int)placeSize.X, (int)placeSize.Y); + } + + if (!PlayerInput.LeftButtonHeld()) + { + resizing = false; + } + } + } + + private void DrawResizing(SpriteBatch spriteBatch, Camera cam) + { + isHighlighted = true; + + int startX = ResizeHorizontal ? -1 : 0; + int StartY = ResizeVertical ? -1 : 0; + + for (int x = startX; x < 2; x += 2) + { + for (int y = StartY; y < 2; y += 2) + { + Vector2 handlePos = cam.WorldToScreen(Position + new Vector2(x * (rect.Width * 0.5f + 5), y * (rect.Height * 0.5f + 5))); + + bool highlighted = Vector2.Distance(PlayerInput.MousePosition, handlePos) < 5.0f; + + GUI.DrawRectangle(spriteBatch, + handlePos - new Vector2(3.0f, 3.0f), + new Vector2(6.0f, 6.0f), + Color.White * (highlighted ? 1.0f : 0.6f), + true, 0, + (int)Math.Max(1.5f / GameScreen.Selected.Cam.Zoom, 1.0f)); + } + } + } + + /// + /// Find entities whose rect intersects with the "selection rect" + /// + public static List FindSelectedEntities(Vector2 pos, Vector2 size) + { + List foundEntities = new List(); + + Rectangle selectionRect = Submarine.AbsRect(pos, size); + + foreach (MapEntity e in mapEntityList) + { + if (!e.SelectableInEditor) continue; + + if (Submarine.RectsOverlap(selectionRect, e.rect)) foundEntities.Add(e); + } + + return foundEntities; + } + + + public virtual XElement Save(XElement parentElement) + { + DebugConsole.ThrowError("Saving entity " + GetType() + " failed."); + return null; + } + + } +} diff --git a/BarotraumaClient/Source/Map/MapEntityPrefab.cs b/BarotraumaClient/Source/Map/MapEntityPrefab.cs new file mode 100644 index 000000000..d40ed0588 --- /dev/null +++ b/BarotraumaClient/Source/Map/MapEntityPrefab.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; + +namespace Barotrauma +{ + partial class MapEntityPrefab + { + public virtual void DrawPlacing(SpriteBatch spriteBatch, Camera cam) + { + Vector2 placeSize = Submarine.GridSize; + + if (placePosition == Vector2.Zero) + { + Vector2 position = Submarine.MouseToWorldGrid(cam, Submarine.MainSub); + + GUI.DrawLine(spriteBatch, new Vector2(position.X - GameMain.GraphicsWidth, -position.Y), new Vector2(position.X + GameMain.GraphicsWidth, -position.Y), Color.White, 0, (int)(2.0f / cam.Zoom)); + + GUI.DrawLine(spriteBatch, new Vector2(position.X, -(position.Y - GameMain.GraphicsHeight)), new Vector2(position.X, -(position.Y + GameMain.GraphicsHeight)), Color.White, 0, (int)(2.0f / cam.Zoom)); + } + else + { + Vector2 position = Submarine.MouseToWorldGrid(cam, Submarine.MainSub); + + if (resizeHorizontal) placeSize.X = position.X - placePosition.X; + if (resizeVertical) placeSize.Y = placePosition.Y - position.Y; + + Rectangle newRect = Submarine.AbsRect(placePosition, placeSize); + newRect.Width = (int)Math.Max(newRect.Width, Submarine.GridSize.X); + newRect.Height = (int)Math.Max(newRect.Height, Submarine.GridSize.Y); + + if (Submarine.MainSub != null) + { + newRect.Location -= Submarine.MainSub.Position.ToPoint(); + } + + newRect.Y = -newRect.Y; + GUI.DrawRectangle(spriteBatch, newRect, Color.DarkBlue); + } + } + + public void DrawListLine(SpriteBatch spriteBatch, Vector2 pos, Color color) + { + GUI.Font.DrawString(spriteBatch, name, pos, color); + } + } +} diff --git a/BarotraumaShared/Source/Networking/GameClient.cs b/BarotraumaClient/Source/Networking/GameClient.cs similarity index 100% rename from BarotraumaShared/Source/Networking/GameClient.cs rename to BarotraumaClient/Source/Networking/GameClient.cs diff --git a/BarotraumaClient/Source/PlayerInput.cs b/BarotraumaClient/Source/PlayerInput.cs new file mode 100644 index 000000000..eb63c8b82 --- /dev/null +++ b/BarotraumaClient/Source/PlayerInput.cs @@ -0,0 +1,166 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Input; + +namespace Barotrauma +{ + public static class PlayerInput + { + static MouseState mouseState, oldMouseState; + static MouseState latestMouseState; //the absolute latest state, do NOT use for player interaction + static KeyboardState keyboardState, oldKeyboardState; + + static double timeSinceClick; + + const double doubleClickDelay = 0.4; + + static bool doubleClicked; + + public static Keys selectKey = Keys.E; + + public static Vector2 MousePosition + { + get { return new Vector2(mouseState.Position.X, mouseState.Position.Y); } + } + + public static Vector2 LatestMousePosition + { + get { return new Vector2(latestMouseState.Position.X, latestMouseState.Position.Y); } + } + + //public static MouseState GetMouseState + //{ + // get { return mouseState; } + //} + //public static MouseState GetOldMouseState + //{ + // get { return oldMouseState; } + //} + + public static bool MouseInsideWindow + { + get { return new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight).Contains(MousePosition); } + } + + public static Vector2 MouseSpeed + { + get + { + return GameMain.WindowActive ? MousePosition - new Vector2(oldMouseState.X, oldMouseState.Y) : Vector2.Zero; + } + } + + public static KeyboardState GetKeyboardState + { + get { return keyboardState; } + } + + public static KeyboardState GetOldKeyboardState + { + get { return oldKeyboardState; } + } + + public static int ScrollWheelSpeed + { + get { return GameMain.WindowActive ? mouseState.ScrollWheelValue - oldMouseState.ScrollWheelValue : 0; } + + } + + public static bool LeftButtonHeld() + { + return GameMain.WindowActive && mouseState.LeftButton == ButtonState.Pressed; + } + + public static bool LeftButtonDown() + { + return GameMain.WindowActive && + oldMouseState.LeftButton == ButtonState.Released && + mouseState.LeftButton == ButtonState.Pressed; + } + + public static bool LeftButtonReleased() + { + return GameMain.WindowActive && mouseState.LeftButton == ButtonState.Released; + } + + + public static bool LeftButtonClicked() + { + return (GameMain.WindowActive && + oldMouseState.LeftButton == ButtonState.Pressed + && mouseState.LeftButton == ButtonState.Released); + } + + public static bool RightButtonHeld() + { + return GameMain.WindowActive && mouseState.RightButton == ButtonState.Pressed; + } + + public static bool RightButtonClicked() + { + return (GameMain.WindowActive && + oldMouseState.RightButton == ButtonState.Pressed + && mouseState.RightButton == ButtonState.Released); + } + + public static bool DoubleClicked() + { + return GameMain.WindowActive && doubleClicked; + } + + public static bool KeyHit(InputType inputType) + { + return GameMain.WindowActive && GameMain.Config.KeyBind(inputType).IsHit(); + } + + public static bool KeyDown(InputType inputType) + { + return GameMain.WindowActive && GameMain.Config.KeyBind(inputType).IsDown(); + } + + public static bool KeyUp(InputType inputType) + { + return GameMain.WindowActive && !GameMain.Config.KeyBind(inputType).IsDown(); + } + + public static bool KeyHit(Keys button) + { + return (GameMain.WindowActive && oldKeyboardState.IsKeyDown(button) && keyboardState.IsKeyUp(button)); + } + + public static bool KeyDown(Keys button) + { + return (GameMain.WindowActive && keyboardState.IsKeyDown(button)); + } + + public static bool KeyUp(Keys button) + { + return GameMain.WindowActive && keyboardState.IsKeyUp(button); + } + + public static void Update(double deltaTime) + { + timeSinceClick += deltaTime; + + oldMouseState = mouseState; + mouseState = latestMouseState; + UpdateVariable(); + + oldKeyboardState = keyboardState; + keyboardState = Keyboard.GetState(); + + doubleClicked = false; + if (LeftButtonClicked()) + { + if (timeSinceClick < doubleClickDelay) doubleClicked = true; + timeSinceClick = 0.0; + } + } + + public static void UpdateVariable() + { + //do NOT use this for actual interaction with the game, this is to be used for debugging and rendering ONLY + + latestMouseState = Mouse.GetState(); + } + } +} diff --git a/BarotraumaShared/Source/Program.cs b/BarotraumaClient/Source/Program.cs similarity index 100% rename from BarotraumaShared/Source/Program.cs rename to BarotraumaClient/Source/Program.cs diff --git a/BarotraumaClient/Source/Screens/GameScreen.cs b/BarotraumaClient/Source/Screens/GameScreen.cs index d35cddc8c..6c2e21abb 100644 --- a/BarotraumaClient/Source/Screens/GameScreen.cs +++ b/BarotraumaClient/Source/Screens/GameScreen.cs @@ -6,42 +6,33 @@ using Microsoft.Xna.Framework.Input; namespace Barotrauma { - class GameScreen : Screen + partial class GameScreen : Screen { - private Camera cam; - - private Color waterColor = new Color(0.75f, 0.8f, 0.9f, 1.0f); - + private BlurEffect lightBlur; + readonly RenderTarget2D renderTargetBackground; readonly RenderTarget2D renderTarget; readonly RenderTarget2D renderTargetWater; readonly RenderTarget2D renderTargetAir; - private BlurEffect lightBlur; - private Effect damageEffect; private Texture2D damageStencil; public BackgroundCreatureManager BackgroundCreatureManager; - - public override Camera Cam - { - get { return cam; } - } - + public GameScreen(GraphicsDevice graphics, ContentManager content) { cam = new Camera(); cam.Translate(new Vector2(-10.0f, 50.0f)); - renderTargetBackground = new RenderTarget2D(graphics, GameMain.GraphicsWidth, GameMain.GraphicsHeight); - renderTarget = new RenderTarget2D(graphics, GameMain.GraphicsWidth, GameMain.GraphicsHeight); - renderTargetWater = new RenderTarget2D(graphics, GameMain.GraphicsWidth, GameMain.GraphicsHeight); - renderTargetAir = new RenderTarget2D(graphics, GameMain.GraphicsWidth, GameMain.GraphicsHeight); + renderTargetBackground = new RenderTarget2D(graphics, GameMain.GraphicsWidth, GameMain.GraphicsHeight); + renderTarget = new RenderTarget2D(graphics, GameMain.GraphicsWidth, GameMain.GraphicsHeight); + renderTargetWater = new RenderTarget2D(graphics, GameMain.GraphicsWidth, GameMain.GraphicsHeight); + renderTargetAir = new RenderTarget2D(graphics, GameMain.GraphicsWidth, GameMain.GraphicsHeight); var files = GameMain.SelectedPackage.GetFilesOfType(ContentType.BackgroundCreaturePrefabs); - if(files.Count > 0) + if (files.Count > 0) BackgroundCreatureManager = new BackgroundCreatureManager(files); else BackgroundCreatureManager = new BackgroundCreatureManager("Content/BackgroundSprites/BackgroundCreaturePrefabs.xml"); @@ -61,33 +52,7 @@ namespace Barotrauma lightBlur = new BlurEffect(blurEffect, 0.001f, 0.001f); } - - public override void Select() - { - base.Select(); - - if (Character.Controlled!=null) - { - cam.Position = Character.Controlled.WorldPosition; - cam.UpdateTransform(); - } - else if (Submarine.MainSub != null) - { - cam.Position = Submarine.MainSub.WorldPosition; - cam.UpdateTransform(); - } - - foreach (MapEntity entity in MapEntity.mapEntityList) - entity.IsHighlighted = false; - } - - public override void Deselect() - { - base.Deselect(); - - Sounds.SoundManager.LowPassHFGain = 1.0f; - } - + public override void AddToGUIUpdateList() { if (Character.Controlled != null && Character.Controlled.SelectedConstruction != null) @@ -103,92 +68,7 @@ namespace Barotrauma Character.AddAllToGUIUpdateList(); } - /// - /// Allows the game to run logic such as updating the world, - /// checking for collisions, gathering input, and playing audio. - /// - public override void Update(double deltaTime) - { -#if DEBUG - if (GameMain.GameSession != null && GameMain.GameSession.Level != null && GameMain.GameSession.Submarine != null && - !DebugConsole.IsOpen) - { - var closestSub = Submarine.FindClosest(cam.WorldViewCenter); - if (closestSub == null) closestSub = GameMain.GameSession.Submarine; - - Vector2 targetMovement = Vector2.Zero; - if (PlayerInput.KeyDown(Keys.I)) targetMovement.Y += 1.0f; - if (PlayerInput.KeyDown(Keys.K)) targetMovement.Y -= 1.0f; - if (PlayerInput.KeyDown(Keys.J)) targetMovement.X -= 1.0f; - if (PlayerInput.KeyDown(Keys.L)) targetMovement.X += 1.0f; - - if (targetMovement != Vector2.Zero) - closestSub.ApplyForce(targetMovement * closestSub.SubBody.Body.Mass * 100.0f); - } -#endif - - foreach (MapEntity e in MapEntity.mapEntityList) - { - e.IsHighlighted = false; - } - - if (GameMain.GameSession != null) GameMain.GameSession.Update((float)deltaTime); - - if (Level.Loaded != null) Level.Loaded.Update((float)deltaTime); - - if (Character.Controlled != null && Character.Controlled.SelectedConstruction != null) - { - if (Character.Controlled.SelectedConstruction == Character.Controlled.ClosestItem) - { - Character.Controlled.SelectedConstruction.UpdateHUD(cam, Character.Controlled); - } - } - Character.UpdateAll(cam, (float)deltaTime); - - BackgroundCreatureManager.Update(cam, (float)deltaTime); - - GameMain.ParticleManager.Update((float)deltaTime); - - StatusEffect.UpdateAll((float)deltaTime); - - if (Character.Controlled != null && Lights.LightManager.ViewTarget != null) - { - cam.TargetPos = Lights.LightManager.ViewTarget.WorldPosition; - } - - GameMain.LightManager.Update((float)deltaTime); - cam.MoveCamera((float)deltaTime); - - foreach (Submarine sub in Submarine.Loaded) - { - sub.SetPrevTransform(sub.Position); - } - - foreach (PhysicsBody pb in PhysicsBody.list) - { - pb.SetPrevTransform(pb.SimPosition, pb.Rotation); - } - - MapEntity.UpdateAll(cam, (float)deltaTime); - - Character.UpdateAnimAll((float)deltaTime); - - Ragdoll.UpdateAll(cam, (float)deltaTime); - - foreach (Submarine sub in Submarine.Loaded) - { - sub.Update((float)deltaTime); - } - - GameMain.World.Step((float)deltaTime); - - if (!PlayerInput.LeftButtonHeld()) - { - Inventory.draggingSlot = null; - Inventory.draggingItem = null; - } - } public override void Draw(double deltaTime, GraphicsDevice graphics, SpriteBatch spriteBatch) { @@ -222,9 +102,9 @@ namespace Barotrauma } } } - + GUI.Draw((float)deltaTime, spriteBatch, cam); - + spriteBatch.End(); } @@ -251,7 +131,7 @@ namespace Barotrauma //---------------------------------------------------------------------------------------- graphics.SetRenderTarget(renderTargetBackground); - + if (Level.Loaded == null) { graphics.Clear(new Color(11, 18, 26, 255)); @@ -367,7 +247,7 @@ namespace Barotrauma Submarine.DrawFront(spriteBatch, false, s => s is Structure); spriteBatch.End(); - + GameMain.LightManager.DrawLOS(spriteBatch, lightBlur.Effect, true); } @@ -387,7 +267,7 @@ namespace Barotrauma } Hull.renderer.Render(graphics, cam, renderTargetAir, Cam.ShaderTransform); - + //---------------------------------------------------------------------------------------- //3. draw the sections of the map that are on top of the water //---------------------------------------------------------------------------------------- @@ -398,17 +278,17 @@ namespace Barotrauma cam.Transform); Submarine.DrawFront(spriteBatch, false, null); - + spriteBatch.End(); - + spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied, SamplerState.LinearWrap, - null, null, + null, null, damageEffect, cam.Transform); Submarine.DrawDamageable(spriteBatch, damageEffect, false); - + spriteBatch.End(); GameMain.LightManager.DrawLightMap(spriteBatch, lightBlur.Effect); @@ -418,22 +298,22 @@ namespace Barotrauma null, null, null, cam.Transform); - if (Level.Loaded != null) Level.Loaded.DrawFront(spriteBatch); + if (Level.Loaded != null) Level.Loaded.DrawFront(spriteBatch); - foreach (Character c in Character.CharacterList) c.DrawFront(spriteBatch,cam); + foreach (Character c in Character.CharacterList) c.DrawFront(spriteBatch, cam); spriteBatch.End(); if (Character.Controlled != null && GameMain.LightManager.LosEnabled) { - GameMain.LightManager.DrawLOS(spriteBatch, lightBlur.Effect,false); + GameMain.LightManager.DrawLOS(spriteBatch, lightBlur.Effect, false); spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearWrap, DepthStencilState.None, RasterizerState.CullNone, null); float r = Math.Min(CharacterHUD.damageOverlayTimer * 0.5f, 0.5f); spriteBatch.Draw(renderTarget, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), - Color.Lerp(GameMain.LightManager.AmbientLight*0.5f, Color.Red, r)); + Color.Lerp(GameMain.LightManager.AmbientLight * 0.5f, Color.Red, r)); spriteBatch.End(); } diff --git a/BarotraumaClient/Source/Screens/NetLobbyScreen.cs b/BarotraumaClient/Source/Screens/NetLobbyScreen.cs index f5b648cb2..bba259f11 100644 --- a/BarotraumaClient/Source/Screens/NetLobbyScreen.cs +++ b/BarotraumaClient/Source/Screens/NetLobbyScreen.cs @@ -9,7 +9,7 @@ using System.ComponentModel; namespace Barotrauma { - class NetLobbyScreen : Screen + partial class NetLobbyScreen : Screen { private GUIFrame menu; private GUIFrame infoFrame; @@ -29,7 +29,7 @@ namespace Barotrauma private GUIButton[] missionTypeButtons; private GUIComponent missionTypeBlock; - + private GUIListBox jobList; private GUITextBox textBox, seedBox; @@ -44,15 +44,6 @@ namespace Barotrauma private GUIDropDown shuttleList; - public bool IsServer; - public string ServerName = "Server"; - - private UInt16 lastUpdateID; - public UInt16 LastUpdateID - { - get { if (GameMain.Server != null && lastUpdateID < 1) lastUpdateID++; return lastUpdateID; } - set { if (GameMain.Server != null) return; lastUpdateID = value; } - } private Sprite backgroundSprite; @@ -115,12 +106,7 @@ namespace Barotrauma set { missionTypeBlock.UserData = value; } } - //for guitextblock delegate - public string GetServerName() - { - return ServerName; - } - + public List JobPreferences { get @@ -136,8 +122,6 @@ namespace Barotrauma } } - private string levelSeed; - public string LevelSeed { get @@ -154,26 +138,13 @@ namespace Barotrauma } } - private float autoRestartTimer; - public string AutoRestartText() - { - if (GameMain.Server != null) - { - if (!GameMain.Server.AutoRestart) return ""; - return "Restarting in " + ToolBox.SecondsToReadableTime(Math.Max(GameMain.Server.AutoRestartTimer, 0)); - } - - if (autoRestartTimer == 0.0f) return ""; - return "Restarting in " + ToolBox.SecondsToReadableTime(Math.Max(autoRestartTimer, 0)); - } - public NetLobbyScreen() { int width = Math.Min(GameMain.GraphicsWidth - 80, 1500); int height = Math.Min(GameMain.GraphicsHeight - 80, 800); - Rectangle panelRect = new Rectangle(0,0,width,height); + Rectangle panelRect = new Rectangle(0, 0, width, height); menu = new GUIFrame(panelRect, Color.Transparent, Alignment.Center, null); //menu.Padding = GUI.style.smallPadding; @@ -182,7 +153,7 @@ namespace Barotrauma infoFrame = new GUIFrame(new Rectangle(0, 0, (int)(panelRect.Width * 0.7f), (int)(panelRect.Height * 0.6f)), "", menu); infoFrame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f); - + //chatbox ---------------------------------------------------------------------- GUIFrame chatFrame = new GUIFrame( new Rectangle(0, (int)(panelRect.Height * 0.6f + 20), @@ -191,7 +162,7 @@ namespace Barotrauma "", menu); chatFrame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 40.0f); - chatBox = new GUIListBox(new Rectangle(0,0,0,chatFrame.Rect.Height-80), Color.White, "", chatFrame); + chatBox = new GUIListBox(new Rectangle(0, 0, 0, chatFrame.Rect.Height - 80), Color.White, "", chatFrame); textBox = new GUITextBox(new Rectangle(0, 25, 0, 25), Alignment.Bottom, "", chatFrame); textBox.MaxTextLength = ChatMessage.MaxLength; textBox.Font = GUI.SmallFont; @@ -213,7 +184,7 @@ namespace Barotrauma playerListFrame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 40.0f); - playerList = new GUIListBox(new Rectangle(0,0,0,0), null, "", playerListFrame); + playerList = new GUIListBox(new Rectangle(0, 0, 0, 0), null, "", playerListFrame); playerList.OnSelected = SelectPlayer; //submarine list ------------------------------------------------------------------ @@ -238,14 +209,14 @@ namespace Barotrauma new GUITextBlock(new Rectangle(columnX, 120, 20, 20), "Respawn shuttle:", "", infoFrame); shuttleList = new GUIDropDown(new Rectangle(columnX, 150, 200, 20), "", "", infoFrame); - + //gamemode ------------------------------------------------------------------ new GUITextBlock(new Rectangle(columnX, 180, 0, 30), "Game mode: ", "", infoFrame); modeList = new GUIListBox(new Rectangle(columnX, 200, columnWidth, infoFrame.Rect.Height - 300), "", infoFrame); modeList.OnSelected = VotableClicked; - + voteText = new GUITextBlock(new Rectangle(columnX, 120, columnWidth, 30), "Votes: ", "", Alignment.TopLeft, Alignment.TopRight, infoFrame); voteText.UserData = "modevotes"; voteText.Visible = false; @@ -263,13 +234,13 @@ namespace Barotrauma textBlock.Padding = new Vector4(10.0f, 0.0f, 0.0f, 0.0f); textBlock.UserData = mode; } - + //mission type ------------------------------------------------------------------ missionTypeBlock = new GUITextBlock(new Rectangle(columnX, -10, 300, 20), "Mission type:", "", Alignment.BottomLeft, Alignment.CenterLeft, infoFrame); missionTypeBlock.Padding = Vector4.Zero; missionTypeBlock.UserData = 0; - + missionTypeButtons = new GUIButton[2]; missionTypeButtons[0] = new GUIButton(new Rectangle(100, 0, 20, 20), "<", Alignment.BottomLeft, "", missionTypeBlock); @@ -279,13 +250,13 @@ namespace Barotrauma missionTypeButtons[1] = new GUIButton(new Rectangle(200, 0, 20, 20), ">", Alignment.BottomLeft, "", missionTypeBlock); missionTypeButtons[1].UserData = 1; - + missionTypeBlock.Visible = false; columnX += columnWidth + 20; //gamemode description ------------------------------------------------------------------ - + //var modeDescription = new GUITextBlock( // new Rectangle(columnX, 150, (int)(columnWidth * 1.2f), infoFrame.Rect.Height - 150 - 80), // "", "", Alignment.TopLeft, Alignment.TopLeft, infoFrame, true, GUI.SmallFont); @@ -296,11 +267,11 @@ namespace Barotrauma //columnX += modeDescription.Rect.Width + 20; //seed ------------------------------------------------------------------ - + new GUITextBlock(new Rectangle(columnX, 120, 180, 20), "Level Seed: ", "", Alignment.Left, Alignment.TopLeft, infoFrame); - seedBox = new GUITextBox(new Rectangle(columnX, 150, columnWidth/2, 20), + seedBox = new GUITextBox(new Rectangle(columnX, 150, columnWidth / 2, 20), Alignment.TopLeft, "", infoFrame); seedBox.OnTextChanged = SelectSeed; LevelSeed = ToolBox.RandomSeed(8); @@ -314,7 +285,7 @@ namespace Barotrauma traitorProbabilityButtons[0] = new GUIButton(new Rectangle(columnX, 205, 20, 20), "<", "", infoFrame); traitorProbabilityButtons[0].UserData = -1; - traitorProbabilityText = new GUITextBlock(new Rectangle(columnX+20, 205, 80, 20), "No", null,null, Alignment.Center, "", infoFrame); + traitorProbabilityText = new GUITextBlock(new Rectangle(columnX + 20, 205, 80, 20), "No", null, null, Alignment.Center, "", infoFrame); traitorProbabilityButtons[1] = new GUIButton(new Rectangle(columnX + 100, 205, 20, 20), ">", "", infoFrame); traitorProbabilityButtons[1].UserData = 1; @@ -330,7 +301,7 @@ namespace Barotrauma restartText.TextGetter = AutoRestartText; //server info ------------------------------------------------------------------ - + var serverName = new GUITextBox(new Rectangle(0, 0, 200, 20), null, null, Alignment.TopLeft, Alignment.TopLeft, "", infoFrame); serverName.TextGetter = GetServerName; serverName.Enabled = GameMain.Server != null; @@ -339,7 +310,7 @@ namespace Barotrauma serverMessage = new GUITextBox(new Rectangle(0, 30, 360, 70), null, null, Alignment.TopLeft, Alignment.TopLeft, "", infoFrame); serverMessage.Wrap = true; serverMessage.OnTextChanged = UpdateServerMessage; - + var showLogButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Server Log", Alignment.TopRight, "", infoFrame); showLogButton.UserData = "showlog"; showLogButton.OnClicked = (GUIButton button, object userData) => @@ -367,22 +338,22 @@ namespace Barotrauma if (GameMain.NetworkMember == null) return; GameMain.LightManager.LosEnabled = false; - + textBox.Select(); - + textBox.OnEnterPressed = GameMain.NetworkMember.EnterChatMessage; textBox.OnTextChanged = GameMain.NetworkMember.TypingChatMessage; Character.Controlled = null; //GameMain.GameScreen.Cam.TargetPos = Vector2.Zero; - subList.Enabled = GameMain.Server != null || GameMain.NetworkMember.Voting.AllowSubVoting; - shuttleList.Enabled = subList.Enabled; + subList.Enabled = GameMain.Server != null || GameMain.NetworkMember.Voting.AllowSubVoting; + shuttleList.Enabled = subList.Enabled; //playerList.Enabled = GameMain.Server != null; - modeList.Enabled = GameMain.Server != null || GameMain.NetworkMember.Voting.AllowModeVoting; - seedBox.Enabled = GameMain.Server != null; - serverMessage.Enabled = GameMain.Server != null; - autoRestartBox.Enabled = GameMain.Server != null; + modeList.Enabled = GameMain.Server != null || GameMain.NetworkMember.Voting.AllowModeVoting; + seedBox.Enabled = GameMain.Server != null; + serverMessage.Enabled = GameMain.Server != null; + autoRestartBox.Enabled = GameMain.Server != null; traitorProbabilityButtons[0].Enabled = GameMain.Server != null; traitorProbabilityButtons[1].Enabled = GameMain.Server != null; @@ -434,7 +405,7 @@ namespace Barotrauma if (shuttleList.Selected == null) { var shuttles = shuttleList.GetChildren().FindAll(c => c.UserData is Submarine && ((Submarine)c.UserData).HasTag(SubmarineTag.Shuttle)); - if (prevSelectedShuttle==-1 && shuttles.Any()) + if (prevSelectedShuttle == -1 && shuttles.Any()) { shuttleList.SelectItem(shuttles[0].UserData); } @@ -542,9 +513,9 @@ namespace Barotrauma int i = 1; foreach (JobPrefab job in JobPrefab.List) { - GUITextBlock jobText = new GUITextBlock(new Rectangle(0, 0, 0, 20), i + ". " + job.Name+" ", - "",Alignment.Left, Alignment.Right, jobList, false, - GameMain.GraphicsWidth<1000 ? GUI.SmallFont : GUI.Font); + GUITextBlock jobText = new GUITextBlock(new Rectangle(0, 0, 0, 20), i + ". " + job.Name + " ", + "", Alignment.Left, Alignment.Right, jobList, false, + GameMain.GraphicsWidth < 1000 ? GUI.SmallFont : GUI.Font); jobText.UserData = job; GUIButton infoButton = new GUIButton(new Rectangle(0, 2, 15, 15), "?", "", jobText); @@ -554,12 +525,12 @@ namespace Barotrauma GUIButton upButton = new GUIButton(new Rectangle(30, 2, 15, 15), "", "", jobText); //TODO: make GUIImages align correctly when scaled/rotated //so there's no need to do this ↓ - new GUIImage(new Rectangle(3,2,0,0), GUI.Arrow, Alignment.Center, upButton).Scale = 0.6f; + new GUIImage(new Rectangle(3, 2, 0, 0), GUI.Arrow, Alignment.Center, upButton).Scale = 0.6f; upButton.UserData = -1; upButton.OnClicked += ChangeJobPreference; GUIButton downButton = new GUIButton(new Rectangle(50, 2, 15, 15), "", "", jobText); - var downArrow = new GUIImage(new Rectangle(13,14,0,0), GUI.Arrow, Alignment.Center, downButton); + var downArrow = new GUIImage(new Rectangle(13, 14, 0, 0), GUI.Arrow, Alignment.Center, downButton); downArrow.Rotation = MathHelper.Pi; downArrow.Scale = 0.6f; @@ -606,7 +577,7 @@ namespace Barotrauma private bool ToggleAutoRestart(GUITickBox tickBox) { if (GameMain.Server == null) return false; - + GameMain.Server.AutoRestart = tickBox.Selected; lastUpdateID++; @@ -629,8 +600,8 @@ namespace Barotrauma int missionTypeIndex = (int)missionTypeBlock.UserData; missionTypeIndex += (int)userData; - if (missionTypeIndex<0) missionTypeIndex = Mission.MissionTypes.Count-1; - if (missionTypeIndex>=Mission.MissionTypes.Count) missionTypeIndex=0; + if (missionTypeIndex < 0) missionTypeIndex = Mission.MissionTypes.Count - 1; + if (missionTypeIndex >= Mission.MissionTypes.Count) missionTypeIndex = 0; SetMissionType(missionTypeIndex); @@ -641,39 +612,10 @@ namespace Barotrauma public bool ToggleTraitorsEnabled(GUIButton button, object userData) { - if (GameMain.Server == null) return false; - - lastUpdateID++; - - int dir = (int)userData; - - int index = (int)GameMain.Server.TraitorsEnabled + dir; - if (index < 0) index = 2; - if (index > 2) index = 0; - - SetTraitorsEnabled((YesNoMaybe)index); - - + ToggleTraitorsEnabled((int)userData); return true; } - - public void SetTraitorsEnabled(YesNoMaybe enabled) - { - if (GameMain.Server != null) GameMain.Server.TraitorsEnabled = enabled; - (traitorProbabilityText as GUITextBlock).Text = enabled.ToString(); - } - - public List GetSubList() - { - List subs = new List(); - foreach (GUIComponent component in subList.children) - { - if (component.UserData is Submarine) subs.Add((Submarine)component.UserData); - } - - return subs; - } - + private bool SelectSub(GUIComponent component, object obj) { if (GameMain.Server == null) return false; @@ -681,14 +623,14 @@ namespace Barotrauma lastUpdateID++; var hash = obj is Submarine ? ((Submarine)obj).MD5Hash.Hash : ""; - + //hash will be null if opening the sub file failed -> don't select the sub if (string.IsNullOrWhiteSpace(hash)) { (component as GUITextBlock).TextColor = Color.DarkRed * 0.8f; component.CanBeFocused = false; - - StartButton.Enabled = false; + + StartButton.Enabled = false; return false; } @@ -708,7 +650,7 @@ namespace Barotrauma { DebugConsole.ThrowError("No submarines found!"); } - + foreach (Submarine sub in submarines) { AddSubmarine(subList, sub); @@ -755,8 +697,7 @@ namespace Barotrauma shuttleText.ToolTip = subTextBlock.ToolTip; } } - - + public bool VotableClicked(GUIComponent component, object userData) { if (GameMain.Client == null) return false; @@ -803,7 +744,7 @@ namespace Barotrauma public void AddPlayer(string name) { GUITextBlock textBlock = new GUITextBlock( - new Rectangle(0, 0, playerList.Rect.Width-20, 25), name, + new Rectangle(0, 0, playerList.Rect.Width - 20, 25), name, "", Alignment.Left, Alignment.Left, playerList); @@ -868,25 +809,25 @@ namespace Barotrauma permissionTick.Selected = selectedClient.HasPermission(permission); permissionTick.OnSelected = (tickBox) => - { - var client = tickBox.Parent.UserData as Client; - if (client == null) return false; + { + var client = tickBox.Parent.UserData as Client; + if (client == null) return false; - var thisPermission = (ClientPermissions)tickBox.UserData; + var thisPermission = (ClientPermissions)tickBox.UserData; - if (tickBox.Selected) - client.GivePermission(thisPermission); - else - client.RemovePermission(thisPermission); + if (tickBox.Selected) + client.GivePermission(thisPermission); + else + client.RemovePermission(thisPermission); - GameMain.Server.UpdateClientPermissions(client); + GameMain.Server.UpdateClientPermissions(client); - return true; - }; + return true; + }; y += 20; - if (y >= permissionsBox.Rect.Height-40) + if (y >= permissionsBox.Rect.Height - 40) { y = 0; x += 100; @@ -932,15 +873,15 @@ namespace Barotrauma { if (userData == null) return false; - if (GameMain.Server!=null) + if (GameMain.Server != null) { GameMain.Server.KickPlayer(userData.ToString(), false); } else if (GameMain.Client != null && GameMain.Client.HasPermission(ClientPermissions.Kick)) { GameMain.Client.KickPlayer(userData.ToString(), false); - } - + } + return false; } @@ -1000,11 +941,22 @@ namespace Barotrauma menu.AddToGUIUpdateList(); } } + + public List GetSubList() + { + List subs = new List(); + foreach (GUIComponent component in subList.children) + { + if (component.UserData is Submarine) subs.Add((Submarine)component.UserData); + } + + return subs; + } public override void Update(double deltaTime) { base.Update(deltaTime); - + if (jobInfoFrame != null) { jobInfoFrame.Update((float)deltaTime); @@ -1023,28 +975,27 @@ namespace Barotrauma autoRestartTimer = Math.Max(autoRestartTimer - (float)deltaTime, 0.0f); } } - public override void Draw(double deltaTime, GraphicsDevice graphics, SpriteBatch spriteBatch) { graphics.Clear(Color.Black); - + spriteBatch.Begin(SpriteSortMode.Immediate, null, null, null, GameMain.ScissorTestEnable); - if (backgroundSprite!=null) + if (backgroundSprite != null) { spriteBatch.Draw(backgroundSprite.Texture, Vector2.Zero, null, Color.White, 0.0f, Vector2.Zero, - Math.Max((float)GameMain.GraphicsWidth / backgroundSprite.SourceRect.Width, (float)GameMain.GraphicsHeight / backgroundSprite.SourceRect.Height), + Math.Max((float)GameMain.GraphicsWidth / backgroundSprite.SourceRect.Width, (float)GameMain.GraphicsHeight / backgroundSprite.SourceRect.Height), SpriteEffects.None, 0.0f); } menu.Draw(spriteBatch); - + if (jobInfoFrame != null) jobInfoFrame.Draw(spriteBatch); //if (previewPlayer!=null) previewPlayer.Draw(spriteBatch); if (playerFrame != null) playerFrame.Draw(spriteBatch); - + GUI.Draw((float)deltaTime, spriteBatch, null); spriteBatch.End(); @@ -1058,10 +1009,10 @@ namespace Barotrauma { chatBox.RemoveChild(chatBox.children[1]); } - - GUITextBlock msg = new GUITextBlock(new Rectangle(0, 0, chatBox.Rect.Width-20, 0), - message.TextWithSender, - ((chatBox.CountChildren % 2) == 0) ? Color.Transparent : Color.Black*0.1f, message.Color, + + GUITextBlock msg = new GUITextBlock(new Rectangle(0, 0, chatBox.Rect.Width - 20, 0), + message.TextWithSender, + ((chatBox.CountChildren % 2) == 0) ? Color.Transparent : Color.Black * 0.1f, message.Color, Alignment.Left, Alignment.TopLeft, "", null, true, GUI.SmallFont); msg.UserData = message; msg.CanBeFocused = false; @@ -1098,7 +1049,7 @@ namespace Barotrauma { Gender gender = (Gender)obj; GameMain.NetworkMember.CharacterInfo.Gender = gender; - + UpdatePreviewPlayer(GameMain.NetworkMember.CharacterInfo); return true; } @@ -1107,7 +1058,7 @@ namespace Barotrauma { modeList.Select(modeIndex, true); - missionTypeBlock.Visible = SelectedMode != null && SelectedMode.Name == "Mission"; + missionTypeBlock.Visible = SelectedMode != null && SelectedMode.Name == "Mission"; } private bool SelectMode(GUIComponent component, object obj) @@ -1128,7 +1079,6 @@ namespace Barotrauma return true; } - private bool SelectSeed(GUITextBox textBox, string seed) { if (GameMain.Server == null) return false; @@ -1167,7 +1117,7 @@ namespace Barotrauma if (jobPrefab == null) return false; jobInfoFrame = jobPrefab.CreateInfoFrame(); - GUIButton closeButton = new GUIButton(new Rectangle(0,0,100,20), "Close", Alignment.BottomRight, "", jobInfoFrame.children[0]); + GUIButton closeButton = new GUIButton(new Rectangle(0, 0, 100, 20), "Close", Alignment.BottomRight, "", jobInfoFrame.children[0]); closeButton.OnClicked = CloseJobInfo; return true; } @@ -1209,9 +1159,9 @@ namespace Barotrauma listBox.children[i].HoverColor = color; listBox.children[i].SelectedColor = color; - (listBox.children[i] as GUITextBlock).Text = (i+1) + ". " + (listBox.children[i].UserData as JobPrefab).Name; + (listBox.children[i] as GUITextBlock).Text = (i + 1) + ". " + (listBox.children[i].UserData as JobPrefab).Name; } - + } public bool TrySelectSub(string subName, string md5Hash, GUIListBox subList) @@ -1260,7 +1210,7 @@ namespace Barotrauma //already showing a message about the same sub if (GUIMessageBox.MessageBoxes.Any(mb => mb.UserData as string == "request" + subName)) { - return false; + return false; } var requestFileBox = new GUIMessageBox("Submarine not found!", errorMsg, new string[] { "Yes", "No" }, 400, 300); @@ -1268,18 +1218,18 @@ namespace Barotrauma requestFileBox.Buttons[0].UserData = new string[] { subName, md5Hash }; requestFileBox.Buttons[0].OnClicked += requestFileBox.Close; requestFileBox.Buttons[0].OnClicked += (GUIButton button, object userdata) => - { - string[] fileInfo = (string[])userdata; - GameMain.Client.RequestFile(FileTransferType.Submarine, fileInfo[0], fileInfo[1]); - return true; - }; + { + string[] fileInfo = (string[])userdata; + GameMain.Client.RequestFile(FileTransferType.Submarine, fileInfo[0], fileInfo[1]); + return true; + }; requestFileBox.Buttons[1].OnClicked += requestFileBox.Close; - + return false; } return true; } - + } } diff --git a/BarotraumaClient/Source/Screens/Screen.cs b/BarotraumaClient/Source/Screens/Screen.cs index 56dfa3421..b155070a3 100644 --- a/BarotraumaClient/Source/Screens/Screen.cs +++ b/BarotraumaClient/Source/Screens/Screen.cs @@ -5,42 +5,12 @@ using System.Collections.Generic; namespace Barotrauma { - class Screen + partial class Screen { - private static Screen selected; - - public static Screen Selected - { - get { return selected; } - } - - public virtual void Deselect() - { - } - - public virtual void Select() - { - if (selected != null && selected != this) - { - selected.Deselect(); - GUIComponent.KeyboardDispatcher.Subscriber = null; - } - selected = this; - } - - public virtual Camera Cam - { - get { return null; } - } - public virtual void AddToGUIUpdateList() { } - public virtual void Update(double deltaTime) - { - } - public virtual void Draw(double deltaTime, GraphicsDevice graphics, SpriteBatch spriteBatch) { } @@ -94,6 +64,5 @@ namespace Barotrauma GUI.Arrow.Draw(spriteBatch, iconPos + arrowOffset, color, MathUtils.VectorToAngle(arrowOffset) + MathHelper.PiOver2); } } - } } diff --git a/BarotraumaClient/Source/Sprite.cs b/BarotraumaClient/Source/Sprite/Sprite.cs similarity index 70% rename from BarotraumaClient/Source/Sprite.cs rename to BarotraumaClient/Source/Sprite/Sprite.cs index 4369d2dbc..d87686ea0 100644 --- a/BarotraumaClient/Source/Sprite.cs +++ b/BarotraumaClient/Source/Sprite/Sprite.cs @@ -7,130 +7,15 @@ using System.Xml.Linq; namespace Barotrauma { - public class Sprite + public partial class Sprite { - static List list = new List(); - //the file from which the texture is loaded - //if two sprites use the same file, they share the same texture - string file; - protected Texture2D texture; - //the area in the texture that is supposed to be drawn - Rectangle sourceRect; - - //the offset used when drawing the sprite - protected Vector2 offset; - - protected Vector2 origin; - - //the size of the drawn sprite, if larger than the source, - //the sprite is tiled to fill the target size - public Vector2 size; - - public float rotation; - - public SpriteEffects effects; - - protected float depth; - - public Rectangle SourceRect - { - get { return sourceRect; } - set { sourceRect = value; } - } - - public float Depth - { - get { return depth; } - set { depth = MathHelper.Clamp(value, 0.0f, 1.0f); } - } - - public Vector2 Origin - { - get { return origin; } - set { origin = value; } - } - public Texture2D Texture { get { return texture; } } - public string FilePath - { - get { return file; } - } - - public override string ToString() - { - return FilePath + ": " + sourceRect; - } - - public Sprite(XElement element, string path = "", string file = "") - { - if (file == "") - { - file = ToolBox.GetAttributeString(element, "texture", ""); - } - - if (file == "") - { - DebugConsole.ThrowError("Sprite " + element + " doesn't have a texture specified!"); - return; - } - - if (!string.IsNullOrEmpty(path)) - { - if (!path.EndsWith("/")) path += "/"; - } - - this.file = path + file; - - texture = LoadTexture(this.file); - - if (texture == null) return; - - Vector4 sourceVector = ToolBox.GetAttributeVector4(element, "sourcerect", Vector4.Zero); - - if (sourceVector.Z == 0.0f) sourceVector.Z = texture.Width; - if (sourceVector.W == 0.0f) sourceVector.W = texture.Height; - - sourceRect = new Rectangle( - (int)sourceVector.X, (int)sourceVector.Y, - (int)sourceVector.Z, (int)sourceVector.W); - - origin = ToolBox.GetAttributeVector2(element, "origin", new Vector2(0.5f, 0.5f)); - origin.X = origin.X * sourceRect.Width; - origin.Y = origin.Y * sourceRect.Height; - - size = ToolBox.GetAttributeVector2(element, "size", Vector2.One); - size.X *= sourceRect.Width; - size.Y *= sourceRect.Height; - - Depth = ToolBox.GetAttributeFloat(element, "depth", 0.0f); - - list.Add(this); - } - - public Sprite(string newFile, Vector2 newOrigin) - { - file = newFile; - texture = LoadTexture(file); - - if (texture == null) return; - - sourceRect = new Rectangle(0, 0, texture.Width, texture.Height); - - size = new Vector2(sourceRect.Width, sourceRect.Height); - - origin = new Vector2((float)texture.Width * newOrigin.X, (float)texture.Height * newOrigin.Y); - - effects = SpriteEffects.None; - - list.Add(this); - } - public Sprite(Texture2D texture, Rectangle? sourceRectangle, Vector2? newOffset, float newRotation = 0.0f) { this.texture = texture; @@ -150,51 +35,53 @@ namespace Barotrauma list.Add(this); } - public Sprite(string newFile, Rectangle? sourceRectangle, Vector2? newOffset, float newRotation = 0.0f) + private void LoadTexture(ref Vector4 sourceVector,ref bool shouldReturn) { - file = newFile; - texture = LoadTexture(file); + texture = LoadTexture(this.file); - sourceRect = sourceRectangle ?? new Rectangle(0, 0, texture.Width, texture.Height); - - offset = newOffset ?? Vector2.Zero; - - size = new Vector2(sourceRect.Width, sourceRect.Height); + if (texture == null) + { + shouldReturn = true; + return; + } - origin = Vector2.Zero; - - rotation = newRotation; - - list.Add(this); + if (sourceVector.Z == 0.0f) sourceVector.Z = texture.Width; + if (sourceVector.W == 0.0f) sourceVector.W = texture.Height; } - + + private void CalculateSourceRect() + { + sourceRect = new Rectangle(0, 0, texture.Width, texture.Height); + } + + public static Texture2D LoadTexture(string file) { foreach (Sprite s in list) { - if (s.file == file) return s.texture; + if (s.file == file) return s.texture; } - + if (File.Exists(file)) { return TextureLoader.FromFile(file); } else { - DebugConsole.ThrowError("Sprite \""+file+"\" not found!"); + DebugConsole.ThrowError("Sprite \"" + file + "\" not found!"); } return null; } - public void Draw(SpriteBatch spriteBatch, Vector2 pos, float rotate=0.0f, float scale=1.0f, SpriteEffects spriteEffect = SpriteEffects.None) + public void Draw(SpriteBatch spriteBatch, Vector2 pos, float rotate = 0.0f, float scale = 1.0f, SpriteEffects spriteEffect = SpriteEffects.None) { this.Draw(spriteBatch, pos, Color.White, rotate, scale, spriteEffect); } public void Draw(SpriteBatch spriteBatch, Vector2 pos, Color color, float rotate = 0.0f, float scale = 1.0f, SpriteEffects spriteEffect = SpriteEffects.None, float? depth = null) { - this.Draw(spriteBatch, pos, color, this.origin, rotate, new Vector2(scale,scale), spriteEffect, depth); + this.Draw(spriteBatch, pos, color, this.origin, rotate, new Vector2(scale, scale), spriteEffect, depth); } public void Draw(SpriteBatch spriteBatch, Vector2 pos, Color color, Vector2 origin, float rotate = 0.0f, float scale = 1.0f, SpriteEffects spriteEffect = SpriteEffects.None, float? depth = null) @@ -217,12 +104,12 @@ namespace Barotrauma spriteBatch.Draw(texture, pos + offset, sourceRect, color, rotation + rotate, origin, scale, spriteEffect, depth == null ? this.depth : (float)depth); } - + public void DrawTiled(SpriteBatch spriteBatch, Vector2 pos, Vector2 targetSize, Color color) { DrawTiled(spriteBatch, pos, targetSize, Vector2.Zero, color); } - + public void DrawTiled(SpriteBatch spriteBatch, Vector2 pos, Vector2 targetSize, Color color, Point offset, float? overrideDepth = null) { //how many times the texture needs to be drawn on the x-axis @@ -242,12 +129,12 @@ namespace Barotrauma float top = pos.Y; texPerspective.Height = (int)Math.Min(targetSize.Y, sourceRect.Height); - + for (int y = 0; y < yTiles; y++) { var movementY = texPerspective.Height; texPerspective.Height = Math.Min((int)(targetSize.Y - texPerspective.Height * y), texPerspective.Height); - + float left = pos.X; texPerspective.Width = (int)Math.Min(targetSize.X, sourceRect.Width); @@ -303,16 +190,16 @@ namespace Barotrauma { DrawTiled(spriteBatch, pos, targetSize, startOffset, sourceRect, color); } - + public void DrawTiled(SpriteBatch spriteBatch, Vector2 pos, Vector2 targetSize, Vector2 startOffset, Rectangle sourceRect, Color color) { //pos.X = (int)pos.X; //pos.Y = (int)pos.Y; //how many times the texture needs to be drawn on the x-axis - int xTiles = (int)Math.Ceiling((targetSize.X+startOffset.X) / sourceRect.Width); + int xTiles = (int)Math.Ceiling((targetSize.X + startOffset.X) / sourceRect.Width); //how many times the texture needs to be drawn on the y-axis - int yTiles = (int)Math.Ceiling((targetSize.Y+startOffset.Y) / sourceRect.Height); + int yTiles = (int)Math.Ceiling((targetSize.Y + startOffset.Y) / sourceRect.Height); Vector2 position = pos - startOffset; Rectangle drawRect = sourceRect; @@ -372,13 +259,10 @@ namespace Barotrauma position.X += sourceRect.Width; } - } - public void Remove() + private void DisposeTexture() { - list.Remove(this); - //check if another sprite is using the same texture foreach (Sprite s in list) { @@ -392,7 +276,6 @@ namespace Barotrauma texture = null; } } - } } diff --git a/BarotraumaClient/Source/SpriteSheet.cs b/BarotraumaClient/Source/Sprite/SpriteSheet.cs similarity index 100% rename from BarotraumaClient/Source/SpriteSheet.cs rename to BarotraumaClient/Source/Sprite/SpriteSheet.cs diff --git a/BarotraumaServer/BarotraumaServer.csproj b/BarotraumaServer/BarotraumaServer.csproj index 1ee835d63..aa79783fd 100644 --- a/BarotraumaServer/BarotraumaServer.csproj +++ b/BarotraumaServer/BarotraumaServer.csproj @@ -34,6 +34,7 @@ 4 + @@ -44,11 +45,31 @@ + + + + + + {0aad36e3-51a5-4a07-ab60-5c8a66bd38b7} + Farseer Physics MonoGame + + + {3b8f9edb-6e5e-450c-abc2-ec49075d0b50} + Hyper.ComponentModel + + + {49ba1c69-6104-41ac-a5d8-b54fa9f696e8} + Lidgren.Network + + + + +