Compare commits

...

1606 Commits

Author SHA1 Message Date
Chris Forbes
2747fadd96 #657 give a useful error message when a sequence references frames outside the range that actually exist 2011-12-03 19:23:14 +13:00
Chris Forbes
66c59add94 write RadarWidget transforms sanely 2011-12-03 11:38:09 +13:00
Chris Forbes
4610461a81 fix naming convention in RadarWidget 2011-12-03 11:29:27 +13:00
Chris Forbes
c1cbe0f0f5 Simplify some of the mess in RadarBinWidget 2011-12-03 11:28:42 +13:00
Chris Forbes
a566a372f5 (2/2) #1210 Remove QueueResupplyActivities entirely, just queue ResupplyAircraft 2011-12-03 10:16:10 +13:00
Chris Forbes
7b06e39390 (1/2) #1210 Untangling QueueResupplyActivities 2011-12-03 10:16:10 +13:00
Chris Forbes
b8c4ff8668 tidy GetTargetQueue 2011-11-29 11:46:57 +13:00
Chris Forbes
3d25e59e9e update AUTHORS 2011-11-29 10:13:17 +13:00
Chris Forbes
1df572e6ee tidy in MasterServerPinger 2011-11-29 10:01:55 +13:00
Kenny Hoxworth
98d4af18a4 Don't cancel the FlyAttack activity if the activity has already been canceled. The Tick routine calls Cancel() on FlyAttack, which removes any NextActivity that may have been set by an outside listener. This is the case with a rare bug causing planes to be killed, removed from the playable game, but still existing in the game world. 2011-11-29 08:57:04 +13:00
Matthew Bowra-Dean
0f97466a75 Remove spurious .swp file 2011-11-28 09:19:46 +13:00
Chris Forbes
58a6c01c3b add framelimiter as per Joseph_Vissarion's patch 2011-11-26 16:17:34 +13:00
Chris Forbes
8bdab6a5f2 tidy in Settings 2011-11-26 15:54:43 +13:00
Mark Olson
f043aa6366 DISCONNECT should use a LeaveGame'ish method.
It should be moved out of IngameChromeLogic, but I don't know where to..
2011-11-25 18:03:12 +13:00
Mark Olson
8933b201f1 Add buttons to Observe or Leave after a user's game ends. 2011-11-25 18:03:04 +13:00
Mark Olson
2bb968d0d3 Hide Chrome once we have Won or Lost 2011-11-25 18:01:34 +13:00
Raymond Martineau
bf222425fc Fix bug #1271 2011-11-25 17:49:05 +13:00
Chris Forbes
0ea9e06c22 remove spurious parameter from ScanAndAttack 2011-11-25 17:41:19 +13:00
Chris Forbes
54e8266e37 tidy AttackOrderTargeter 2011-11-25 17:38:58 +13:00
Chris Forbes
2679e91b03 remove duplication in cnc order button wiring 2011-11-25 17:22:22 +13:00
Chris Forbes
2462902d8b remove some duplication in binding order buttons 2011-11-25 15:12:04 +13:00
Chris Forbes
55f811faf5 remove some duplication in global order OGs 2011-11-25 15:11:49 +13:00
Chris Forbes
45c41b6696 allow building repair always 2011-11-24 15:23:08 +13:00
Chris Forbes
6040b55d17 update CHANGELOG 2011-11-08 09:17:23 +13:00
Curtis S
77fc6199fe New serverbrowser for RA and CNC 2011-11-06 22:49:40 -07:00
Curtis S
49bf93085f Added support to GivesBounty for setting player Stances which give bounties 2011-11-06 13:24:20 -07:00
Curtis S
aa7d688905 Update ra mapchooser chrome as per lobby code merge 2011-11-06 10:12:16 -07:00
Chris Forbes
83929af62a tidy 2011-11-06 22:13:21 +13:00
Chris Forbes
6cb8ee1f9f expose appropriate *Inits, and make them work in editor 2011-11-06 18:17:13 +13:00
Chris Forbes
772734d032 merge cnc and ra lobby, fixes #1267, #1224, #106, others 2011-11-06 17:01:00 +13:00
Chris Forbes
4576eaadd6 more tidy 2011-11-06 11:39:49 +13:00
Chris Forbes
c20d71c9af make CncLobbyLogic tolerant of missing music button 2011-11-06 11:38:44 +13:00
Chris Forbes
40b89d177f make some cnc helper functions not public 2011-11-06 11:34:08 +13:00
Chris Forbes
314db743fc change CncConnectingLogic to CncConnectionLogic to match filename 2011-11-06 11:21:47 +13:00
Chris Forbes
9b5c7c2379 remove dead GetInheritanceChain in ActorInfo 2011-11-06 11:09:30 +13:00
Chris Forbes
564fdd650d add mechanism for traits to export the *Inits they can use 2011-11-05 12:29:55 +13:00
Chris Forbes
bd90666c07 tidy 2011-11-05 11:40:13 +13:00
Chris Forbes
cd155b21c9 tidy up some bizarre namespacing 2011-11-04 20:13:41 +13:00
Chris Forbes
cbee1513f3 fix formatting in CanPowerDown 2011-11-04 20:02:09 +13:00
Chris Forbes
6932db1d05 fixed #1264 - squish sound is positioned now 2011-11-04 19:45:02 +13:00
Chris Forbes
718742be4a fixed #1263 - don't trash the current directory on exporting a minimap 2011-11-04 19:28:19 +13:00
Chris Forbes
4ad7af8a58 fixed #1245 - repopulate the player chooser in the editor after refreshing the playerlist 2011-11-04 19:21:33 +13:00
Chris Forbes
57e2d4f9b1 fixed #1237 - crash in UpdateCurrentMap 2011-11-04 19:16:53 +13:00
Chris Forbes
5a029e337a fixed #1257 - predict stance changes on the client 2011-11-04 19:09:46 +13:00
Chris Forbes
bc5efa3fc5 #1241 fixed - crash in ChooseBuildTabOnSelect.SelectionChanged 2011-11-04 19:03:38 +13:00
Chris Forbes
192cbaf744 fix namespace for ChooseBuildTabOnSelect 2011-11-04 19:00:34 +13:00
Chris Forbes
053d661ed7 #1251 fixed - ss,msub,stnk have correct initial stance and can autotarget 2011-11-04 16:40:43 +13:00
Chris Forbes
9ac912fa0e #1262 fixed -- initial unit stance via AutoTarget:InitialStance: 2011-11-04 16:33:20 +13:00
Chris Forbes
b6c2b928cb fixed #1249 - use unit priority logic to select initial unit in doubleclick 2011-11-04 08:46:14 +13:00
Chris Forbes
58b437b7ea fix #1246 2011-11-04 08:29:46 +13:00
Curtis S
7498af6b66 Update CHANGELOG 2011-11-01 20:54:04 -06:00
Chris Forbes
b88a32759c fixed #800 - infantry can walk on AT mines 2011-11-01 22:16:35 +13:00
Chris Forbes
c9fd874b07 unify colorpickers across ra and cnc 2011-11-01 22:00:29 +13:00
Chris Forbes
a060d99780 add dropdown in editor for choosing owner of new actors 2011-11-01 22:00:29 +13:00
Seru
7bc7fbc006 Added ra map: Asymetric Battle 2011-11-01 22:00:29 +13:00
Nukem
ce8bcd1576 Updated ra map: Pandemonium 2011-11-01 22:00:29 +13:00
Curtis S
465f917836 Removed ra map: bavarian redux 2011-11-01 22:00:29 +13:00
Curtis S
de7fbfc927 Fixed a spawnpoint on map River War 2 2011-11-01 22:00:28 +13:00
Chris Forbes
2eac701aab make SpawnMPUnits initial unit configurable 2011-11-01 22:00:28 +13:00
Chris Forbes
0edda0fb31 make bot building repair controllable via yaml 2011-11-01 22:00:28 +13:00
Raymond Martineau
72c6a428c9 Fix exception, requiring usage of IComparable 2011-11-01 22:00:28 +13:00
Chris Forbes
986bf039fa remove HackyAI -> MPStartLocations dep; implement aggro as per alzeih's old patch 2011-11-01 22:00:28 +13:00
Chris Forbes
4dc3013cd0 slight tidy to HackyAI 2011-11-01 22:00:28 +13:00
Chris Forbes
58cae272c6 push unit queues for HackyAI out to yaml 2011-11-01 22:00:28 +13:00
Chris Forbes
1df9003fec fixed #1169 - bot rallypoint debug changed to BotDebug() 2011-11-01 22:00:20 +13:00
Chris Forbes
f83c9fd4d7 add IEnum<T>.JoinWith, use it to clean up a bunch of things 2011-11-01 21:57:58 +13:00
Chris Forbes
8111ccbea6 tidy projectfiles, Map 2011-11-01 21:57:58 +13:00
Chris Forbes
c50aae25d3 remove spurious .ToArray() in MainMenuButtonsLogic 2011-11-01 21:57:57 +13:00
Chris Forbes
7a6f4d3b04 relax items type for DropDownButtonLogic.ShowDropDown 2011-11-01 21:57:57 +13:00
Chris Forbes
eaa4d06052 tidy readiness checks in lobby 2011-11-01 21:57:57 +13:00
Chris Forbes
53599f062c fix indent in UnitOrders 2011-11-01 21:57:57 +13:00
Chris Forbes
2a64df997a fixed #1244 - cnc lobby crash on player joining 2011-10-31 09:12:10 +13:00
Chris Forbes
5bb535b50c factor out Marshal.SizeOf calls 2011-10-31 09:11:47 +13:00
Chris Forbes
77ebd5d6de removing more renderer code duplication; cleanup 2011-10-31 09:11:47 +13:00
Chris Forbes
9279161de6 tidy in OreRefinery, Harvester, CncLobbyLogic, ScaredyCat 2011-10-31 09:11:33 +13:00
Chris Forbes
268f06caf0 use actor type string rather than ProductionItem in ChooseBuildLocation 2011-10-31 09:10:01 +13:00
Chris Forbes
3a5cce1f1f Split HackyAI.BaseBuilder into its own file; Move hackyAI components into OpenRA.Mods.RA.AI namespace and dir 2011-10-31 09:10:01 +13:00
Chris Forbes
bfddbeeb02 fixed #1232 -- bots repair their own damaged buildings 2011-10-31 09:10:01 +13:00
Chris Forbes
92f5d67ef1 fix stupid naming in Reservable 2011-10-31 09:10:01 +13:00
Chris Forbes
e602e086f3 remove unused ReplaceWithActor trait 2011-10-24 17:27:11 +13:00
Chris Forbes
35b0231746 fixed #669 -- helicopters bob slightly in flight 2011-10-24 17:12:23 +13:00
Curtis S
f5807f5f3b Fix #1230: crash when no hpad owned by player 2011-10-23 14:53:33 -06:00
Curtis S
d9fbee6e01 Update CHANGELOG 2011-10-23 18:44:23 +13:00
Curtis S
a04ab94717 Hellfire (longbow) missiles now fire in bursts of 2 2011-10-22 18:50:03 -06:00
Tirili
4f505eb6a1 Add ability to disable the shellmap 2011-10-23 13:24:26 +13:00
Tirili
6174ccc882 Change World.DisableTick to World.EnableTick 2011-10-23 13:11:39 +13:00
Chris Forbes
7cc0a45727 give migs 4 salvos x 2 missiles, slightly increase damage per missile 2011-10-23 12:55:13 +13:00
Chris Forbes
deeef336a1 group IPostRenderSelection impls by type, not by actor 2011-10-23 12:40:08 +13:00
Chris Forbes
ce8267992a remove self parameter from IPostRenderSelection.RenderAfterWorld 2011-10-23 12:23:15 +13:00
Chris Forbes
b9ac25e044 split sprite-based and line-based things in Selectable into two traits 2011-10-23 12:13:11 +13:00
Chris Forbes
4168e54715 tidy in Selectable 2011-10-23 11:50:53 +13:00
Chris Forbes
aef3ff6e65 remove some redundant SelectableInfo lookups 2011-10-23 11:49:38 +13:00
Curtis S
eebfb34ea2 Fix #1187; aircraft rearm properly now 2011-10-22 13:41:09 -06:00
Curtis S
b1b9d1fca2 Fixed open areas on map Man to Man 2011-10-22 13:27:34 -06:00
Curtis S
7d9641e195 Update helis logic for returning to hpad, to mirror that of planes returning to aflds 2011-10-22 13:26:51 -06:00
Curtis S
9e21282341 Fix #725; planes don't stack afld / planes will fly to empty aflds 2011-10-22 13:23:30 -06:00
Curtis S
935c2eff31 Changed SupplyTruck's order string to something more appropriate 2011-10-22 13:21:42 -06:00
Chris Forbes
ff86c4d7fa update AUTHORS 2011-10-22 16:43:03 +13:00
Nukem
143f9e0e84 added RA map: Man to Man 2011-10-22 13:05:48 +13:00
Christer Ulfsparre
dec8c8ba4b Added ability to join a server on startup, for gamelist apps. 2011-10-22 12:33:46 +13:00
Chris Forbes
c0b5455016 fixed #649 - remember last played map 2011-10-22 11:51:32 +13:00
Chris Forbes
e7ed9a1ff7 tidy up select-all-on-screen 2011-10-22 11:30:09 +13:00
Chris Forbes
eec751f76a remove duplicated edgescroll code in cnc 2011-10-22 10:25:50 +13:00
Chris Forbes
52cec1e170 reduce default tooltip delay in cnc to a playable level 2011-10-21 23:20:30 +13:00
Chris Forbes
a290af6fb5 tidy SiloBarWidget 2011-10-21 23:12:06 +13:00
Chris Forbes
c8122a13ff tidy in ProductionPaletteWidget 2011-10-21 23:00:23 +13:00
Chris Forbes
00372f4748 more general tidying in CNC widget code 2011-10-21 22:58:49 +13:00
Chris Forbes
4c26710ccb swap args to PlayerColorRemap 2011-10-21 22:15:51 +13:00
Chris Forbes
4a30019536 add equality comparisons to ColorRamp 2011-10-21 22:11:18 +13:00
Chris Forbes
0c2e1f81da tidy in ColorRamp 2011-10-21 22:10:30 +13:00
Chris Forbes
7106f1fe74 another formatting tweak 2011-10-21 19:38:19 +13:00
Chris Forbes
0a977b2940 work around for broken type inference engine in gmcs-2.6.7 2011-10-21 19:38:06 +13:00
Chris Forbes
6010034b4a remove ObjectCreator.Param and all associated nonsense 2011-10-21 18:16:07 +13:00
Chris Forbes
4c8e048c2c relax ObjectCreator.Param requirement on non-renamed args 2011-10-21 17:38:00 +13:00
Chris Forbes
88bfee872f more tidy in DrawLineToTarget 2011-10-21 17:03:18 +13:00
Chris Forbes
3548dacad3 collapse useless layer of crap in DrawLineToTarget 2011-10-21 16:52:50 +13:00
Chris Forbes
b7b2db9ace remove some insanity in DrawLineToTarget 2011-10-21 16:34:54 +13:00
Chris Forbes
b119c14599 fix whitespace in Settings 2011-10-21 10:22:43 +13:00
Curtis S
d47c4f7ca2 Fixed a spawnpoint in map daejeon 2011-10-19 18:15:44 -06:00
Chris Forbes
808464f4d5 get RA replay browser closer to CNC version 2011-10-19 20:04:05 +13:00
Chris Forbes
f5c4a94f93 change currentSummary -> currentReplay in CncReplayBrowserLogic 2011-10-19 19:57:04 +13:00
Chris Forbes
a7c276849d fix formatting 2011-10-19 19:54:05 +13:00
Chris Forbes
10733c3a31 remove useless .ToString() calls in replay browsers 2011-10-19 19:50:02 +13:00
Chris Forbes
03ddbac83b change ReplaySummary to Replay; move to OpenRA.Network 2011-10-19 19:45:13 +13:00
Chris Forbes
a3897dc7a8 tidy DirectConnectLogic 2011-10-19 19:38:47 +13:00
Chris Forbes
2d4b00ec2a remove useless calls to ToArray() in *DirectConnectLogic 2011-10-19 19:34:23 +13:00
Chris Forbes
42aa8a57c5 unify {RA,Cnc}DownloadPackagesLogic 2011-10-19 19:32:28 +13:00
Chris Forbes
1c69f5bef9 add (another) backup file pattern to .gitignore 2011-10-19 16:02:01 +13:00
Chris Forbes
511c956117 fix title of map properties dialog 2011-10-19 10:13:46 +13:00
Chris Forbes
a5547eac97 fix typo in Bridge 2011-10-19 10:11:18 +13:00
Chris Forbes
325ec41182 remove dead functions from Arguments.cs 2011-10-18 21:58:17 +13:00
Chris Forbes
a1dd5cedd4 clean up duplicate trait lookup in RASpecialPowers 2011-10-18 21:52:58 +13:00
Chris Forbes
c790c41465 unify bot spawn choosers in CNC and RA 2011-10-18 21:39:12 +13:00
Chris Forbes
7161b8062e remove useless 'map' arg on ConvertToPreview 2011-10-18 20:55:49 +13:00
Chris Forbes
eddc4cc4b1 remove useless map var in CncLobbyLogic too 2011-10-18 20:47:48 +13:00
Chris Forbes
12968ff9b9 tidy LobbyLogic spawn chooser 2011-10-18 20:43:00 +13:00
Chris Forbes
7ef93f2cf5 remove useless var in LobbyLogic 2011-10-18 20:38:06 +13:00
Chris Forbes
59fdceb4fd convert Map.SpawnPoints to int2[]; tidy 2011-10-18 20:34:00 +13:00
Chris Forbes
0f7a744ef7 replace ridiculous GetSpawnColors function with something tidier 2011-10-18 20:23:10 +13:00
Chris Forbes
50010faf58 move duplicates of GetSpawnColors to LobbyInfo 2011-10-18 20:15:31 +13:00
Chris Forbes
89ea4d1e0a unify C&C and RA colorpicker palette manipulation code 2011-10-18 20:09:24 +13:00
Chris Forbes
bc6af1841b fix indents everywhere 2011-10-18 15:10:17 +13:00
Chris Forbes
227bbc109e fix wonky indent in WorldRenderer.cs 2011-10-18 14:55:51 +13:00
Chris Forbes
737756be51 fix formatting in Game.cs 2011-10-18 13:54:50 +13:00
Chris Forbes
1d5201d797 remove OpenRA.Renderer.SdlCommon.dll in windows uninstall 2011-10-17 17:36:00 +13:00
Curtis S
e29f838425 fixed author on map Paramount 2011-10-16 22:34:27 -06:00
Nukem
3432ce256a added RA map: Engagement 2011-10-16 22:33:11 -06:00
Nukem
cd8f8dbc0f added ore wells to ra map Mass Confliction 2011-10-16 15:15:40 -06:00
Sprog
b912f69212 Added RA map: Bombardment Islands 2011-10-16 15:12:32 -06:00
Curtis S
4812eb95b6 show bot info to all players in lobby 2011-10-16 15:06:13 -06:00
Curtis S
ea0348977e fixed playercount on ra map Battle Lake 2011-10-16 13:56:30 -06:00
Chris Forbes
2566b44627 preserve whole CountryInfo object in ProductionQueue 2011-10-15 13:46:36 +13:00
Chris Forbes
3716f0561c fix formatting 2011-10-15 13:01:45 +13:00
Chris Forbes
1e32014190 add CountryInfo.Selectable 2011-10-15 13:00:19 +13:00
Chris Forbes
d9d0e74d74 remove dead HttpUtil class 2011-10-15 12:38:23 +13:00
Chris Forbes
3991026cf3 add a new menu item to setup default players in editor 2011-10-15 12:29:17 +13:00
Chris Forbes
d202f9627f fix #1205 -- desync when AI builds harvs 2011-10-14 08:24:45 +13:00
Chris Forbes
770cdf38b6 update CHANGELOG for release 2011-10-13 09:48:50 +13:00
Chris Forbes
1e67984806 fix #1099 -- bogus armor on FTNK 2011-10-13 09:39:10 +13:00
Curtis S
5b23fd4873 update CHANGELOG 2011-10-11 22:08:57 -06:00
Nukem
35d167a4fd Added RA map by Nukem: HotZone 2011-10-11 22:08:10 -06:00
Curtis S
32d466ba10 update CHANGELOG 2011-10-11 21:43:12 -06:00
Chris Forbes
6ef8dbf282 updated changelog 2011-10-12 08:16:34 +13:00
Bellator
8de52cf7bc add Battle Lake map 2011-10-12 08:14:09 +13:00
Chris Forbes
261c4c5b62 update AUTHORS 2011-10-12 07:55:28 +13:00
Raymond Martineau
603a29b70d Flame turret range fix (previously outranged by infantry, despite being strong vs. infantry) 2011-10-12 07:53:18 +13:00
Curtis S
0d0d91113c update AUTHORS 2011-10-10 20:14:30 -06:00
Riderr3
536388ab5c Added new RA map by Riderr3: Drop Zone W 2011-10-10 20:13:52 -06:00
Curtis S
03b3649e54 changed MEDI cost to 300; changed SHOK cost to 500 2011-10-10 20:02:45 -06:00
Curtis S
16aec6ba90 Enabled tank squish in RA for 2tnk/3tnk/4tnk/ttnk/harv/mcv 2011-10-10 20:02:04 -06:00
Chris Forbes
47757161d6 fix cancel interaction with UnloadCargo activity; punt to the end of the frame 2011-10-11 14:47:16 +13:00
Chris Forbes
26b9feaf4b support transforming to a different actor type as a result of a passenger entering or leaving 2011-10-11 14:42:36 +13:00
Chris Forbes
c4256faf18 preserve cargo across transform 2011-10-11 14:42:35 +13:00
Chris Forbes
c39050fdda support setting initial cargo of units via ActorInit 2011-10-11 14:42:35 +13:00
Chris Forbes
f085b79491 add hooks for passengers entering/leaving a vehicle 2011-10-11 14:42:35 +13:00
Chris Forbes
206cb88146 update INSTALL file 2011-10-11 09:57:56 +13:00
Chris Forbes
eda7f17ad8 update AUTHORS 2011-10-11 09:52:24 +13:00
Chris Forbes
7f1918d07b add stance cycling on 'z' 2011-10-11 09:33:50 +13:00
Chris Forbes
59e4dd666a updated CHANGELOG 2011-10-11 08:06:37 +13:00
Nukem
1a15398605 add Chokepoint map 2011-10-11 08:06:26 +13:00
Bellator
75e65bf4c5 add Tiberium Oasis map 2011-10-11 08:06:24 +13:00
Bellator
81316a240b add Mad Scramble map 2011-10-11 08:06:24 +13:00
Chris Forbes
ac263697da fix #1197 -- bottom cordon of hectic was right against the map edge 2011-10-11 08:06:24 +13:00
Chris Forbes
20c4db914c implement selectable rules of engagement for AutoTarget 2011-10-11 08:06:23 +13:00
Curtis S
ea3ad0e378 Temp fix for #1200: SystemInformation.DoubleClickTime caused segfault in libx11 on some debian systems 2011-10-11 08:06:23 +13:00
Chris Forbes
2c415a8fd6 add tmp->png conversion to utility 2011-10-11 08:06:23 +13:00
Chris Forbes
a34b2d8c53 combine tileset.{Tiles,Templates}; image data now accessed via Templates[].Data 2011-10-11 08:06:23 +13:00
Chris Forbes
e2cbfb920b tidy in TileSet 2011-10-11 08:06:23 +13:00
Chris Forbes
1f1c2b25b0 move RenderTemplate onto TileSet 2011-10-11 08:06:23 +13:00
Chris Forbes
eaf15fa6b5 tidy in TileSet 2011-10-11 08:06:23 +13:00
Nukem
d2740847cf new AI configuration -- supports 3 difficulty levels 2011-10-11 08:06:06 +13:00
Curtis S
62e9f5c3f7 Removed pointless var in spawn picking logic 2011-10-10 17:15:45 +13:00
Curtis S
9d8ff12d23 Updated RA map Center of Attention 2011-10-10 17:15:43 +13:00
Chris Forbes
7864aeed37 remove obsolete Tao.Platform.Windows packaged dep 2011-10-10 16:25:26 +13:00
Chris Forbes
dc8726a6a0 fix multitap for keyboard events, in a way that doesnt break scrolling etc 2011-10-10 13:07:31 +13:00
Curtis S
3027c9d6f2 update CHANGELOG 2011-10-08 19:12:48 -06:00
Curtis S
bdf9447798 Added 3 RA maps by RAGEQUIT 2011-10-08 18:59:29 -06:00
Curtis S
756a3e551d Removed random sandbag from vegetation oramap 2011-10-08 18:45:04 -06:00
Curtis S
2da46a418f Added more options for bots in RA game lobby 2011-10-08 18:44:21 -06:00
Chris Forbes
88554a5039 temp disable multitap keys (not used yet); breaks keyboard scrolling 2011-10-09 12:48:36 +13:00
Chris Forbes
9f86ef526f move LobbyUtils into its own file 2011-10-09 12:02:57 +13:00
Chris Forbes
57308773a2 grid layout mapchooser in cnc too 2011-10-09 11:12:57 +13:00
Chris Forbes
d6f4b61b1c fixed #1187 - aircraft now reload when ordered back to base via F 2011-10-08 22:22:42 +13:00
Chris Forbes
6922ff3bf9 have ReturnOnIdle use QueueResupplyActivities so it works for airfields that can both rearm and repair 2011-10-08 22:17:15 +13:00
Chris Forbes
1702a9e9f5 tidy helicopter 2011-10-08 22:11:01 +13:00
Chris Forbes
38b6d3527b remove duplicate of ReserveSpawnBuilding from heli 2011-10-08 22:08:38 +13:00
Chris Forbes
9719e10edd drop spurious 'self' from ReserveSpawnBuilding, GetActorBelow 2011-10-08 22:07:15 +13:00
Chris Forbes
c7f780eb1d factor out GetActorBelow from ReserveSpawnBuilding 2011-10-08 22:04:21 +13:00
Chris Forbes
a193eeb202 Convert RA mapchooser to use a grid of minimap images 2011-10-08 21:35:46 +13:00
Chris Forbes
957c1cc74c tidy in ShpImageWidget 2011-10-08 18:16:12 +13:00
Chris Forbes
92bdec7f1d factor out layout policy for ScrollPanelWidget; add GridLayout option. 2011-10-08 18:15:24 +13:00
Chris Forbes
cf46a7ed5f scroll maplist to the top when changing filter 2011-10-08 17:36:48 +13:00
Chris Forbes
f966c08fed remove playercount labels in RA mapchooser 2011-10-08 17:20:52 +13:00
Chris Forbes
be8682fc19 move TextAlign out of LabelWidget 2011-10-08 17:20:52 +13:00
Chris Forbes
12b8774e6d game mode selector in map chooser 2011-10-08 17:20:09 +13:00
Chris Forbes
6c78bb481d fix ctor formatting 2011-10-08 17:19:44 +13:00
Chris Forbes
f79dfd51a2 add gamemode filter to EnumerateMaps 2011-10-08 17:09:01 +13:00
Chris Forbes
8e3bcb892f tidy multitap code up a lot 2011-10-08 17:09:01 +13:00
Curtis S
9b826d91a4 Fixed bogus yaml removals in koth maps 2011-10-07 21:55:41 -06:00
Curtis S
d802cbfd9d Fixed tank squish anims for CNC 2011-10-06 22:06:56 -06:00
Curtis S
22288d10e2 Added RA map by hamb: Vegetation 2011-10-06 20:24:53 -06:00
Curtis S
ce336b46fd fix #1196: can't capture civ buildings 2011-10-06 18:30:47 -06:00
Curtis S
9fdfca6ee5 Added MultiTap support 2011-10-07 09:54:35 +13:00
Chris Forbes
5ced7e270c fixed #536 -- add grid to editor 2011-10-07 09:34:23 +13:00
Chris Forbes
87223f5b64 show map name in ra lobby 2011-10-07 07:58:16 +13:00
Chris Forbes
52daca603b kill CncInstallMusicLogic 2011-10-07 00:02:00 +13:00
Chris Forbes
0fbc6c0a54 move CncInstallMusicLogic into its own file 2011-10-06 23:46:04 +13:00
Chris Forbes
e9a4ec5403 unify disk check between music install and game install for cnc 2011-10-06 23:43:32 +13:00
Chris Forbes
281f706b02 tidy 2011-10-06 23:37:52 +13:00
Chris Forbes
8ab40bc5e8 tidy CncIngameMenuLogic 2011-10-06 23:35:27 +13:00
Chris Forbes
928cfb1f31 fixed #1195 - allow custom delivery vehicle in ProductionAirdrop 2011-10-06 23:31:09 +13:00
Chris Forbes
dea66818cd fix indent in CncReplayBrowserLogic 2011-10-06 23:24:30 +13:00
Chris Forbes
c18dcca1bc fix spelling error in ProductionAirdrop 2011-10-06 23:23:47 +13:00
Chris Forbes
1cf12df1c4 tidy 2011-10-06 23:18:00 +13:00
Chris Forbes
b9e22f50ed tidy derp in CncColorPickerPaletteModifier 2011-10-06 23:17:00 +13:00
Chris Forbes
2bc260c833 move Activity from OpenRA.Traits.Activities namespace to OpenRA.Traits 2011-10-06 23:11:58 +13:00
Chris Forbes
3cf15b870a remove needless cast in CncLobbyLogic.AddChatLine 2011-10-06 22:58:32 +13:00
Chris Forbes
ec8c5849eb remove dead SlotDropDownOption type in CncLobbyLogic 2011-10-06 22:58:31 +13:00
Chris Forbes
c76ebe51a5 remove duplicate ShowRaceDropDown 2011-10-06 22:58:31 +13:00
Chris Forbes
8f560d79fd remove duplicate ShowTeamDropDown 2011-10-06 22:58:30 +13:00
Chris Forbes
6d469a1414 move ShowSlotDropDown to LobbyUtils; kill the cnc clone of it 2011-10-06 22:58:30 +13:00
Chris Forbes
57ac95123e make ShowSlotDropDown static 2011-10-06 22:58:29 +13:00
Chris Forbes
c260635228 remove duplication of lobby name widget setup in CncLobbyLogic 2011-10-06 22:58:28 +13:00
Chris Forbes
2a48e01d91 move SetupNameWidget function into new LobbyUtils static class 2011-10-06 22:58:28 +13:00
Chris Forbes
d3b5939613 remove duplication between CncMapChooserLogic and MapChooserLogic 2011-10-06 22:58:27 +13:00
Chris Forbes
bdcd8097e5 start reducing differences between cnc and ra mapchoosers 2011-10-06 22:58:27 +13:00
Chris Forbes
dfa456a537 tidy mapchooser files 2011-10-06 22:58:26 +13:00
Chris Forbes
f936bbeaf7 tidy 2011-10-06 22:58:26 +13:00
Chris Forbes
e02a6e7ec4 tidy more 2011-10-06 22:58:25 +13:00
Chris Forbes
baa79c2dbc tidy usings in lintpasses 2011-10-06 22:58:24 +13:00
Chris Forbes
23e101deb0 Updated CHANGELOG 2011-10-06 09:02:51 +13:00
Chris Forbes
0a88a6da8e fix #1083 -- allow rank crate to give multiple levels 2011-10-04 23:19:41 +13:00
Chris Forbes
84234e8794 tidy in ActorMap 2011-10-04 22:57:37 +13:00
Chris Forbes
9eecd7ba6b tidy Traits.Util usings 2011-10-04 22:55:19 +13:00
Chris Forbes
9c35debd46 more formatting tidy 2011-10-04 22:54:02 +13:00
Chris Forbes
dc850d3f73 tidy in Armor.cs 2011-10-04 22:49:58 +13:00
Chris Forbes
05ce48b732 tidy in RenderBuildingWarFactory 2011-10-04 22:44:23 +13:00
Chris Forbes
554032ad5f allow null player in RenderSimple.RenderPreview in prep for editor usage 2011-10-04 22:40:46 +13:00
Chris Forbes
e5a1658d87 less code in utility 2011-10-04 22:36:30 +13:00
Chris Forbes
2df7a657d3 remove spurious STAThread attribute from Utility main 2011-10-04 22:35:05 +13:00
Chris Forbes
8174e7fffb move WithDefault onto Exts 2011-10-04 22:33:52 +13:00
Chris Forbes
49a758f031 add --transparent flag to shp->png conversion utility 2011-10-04 22:31:02 +13:00
Chris Forbes
fb8fdb5899 move load from file wrapper for palette into Palette.cs 2011-10-04 22:28:51 +13:00
Chris Forbes
6de9c0b432 remove PrimaryBuilding support from afld/hpad; it doesnt make much sense for 1-unit-per-building 2011-10-04 22:18:36 +13:00
Chris Forbes
c42a39e064 fix #625 -- aircraft smoke should not be visible under fog 2011-10-04 22:11:57 +13:00
Chris Forbes
4fd3e6a390 fix #1151 -- husks should not be selectable 2011-10-04 21:57:20 +13:00
Curtis S
1dc0fbb625 updated CHANGELOG 2011-10-04 21:49:55 +13:00
Curtis S
b0747cafa8 Minor terrain fixes for maps 2011-10-04 21:49:54 +13:00
Curtis S
04a8801f08 Added 3 new RA maps by Nukem 2011-10-04 21:49:46 +13:00
Curtis S
06043512db Added new RA map by bellator: Arctic Triangle Affair 2011-10-04 21:49:43 +13:00
Curtis S
0d4f48822a Removed RA map: middle-mayhem.oramap 2011-10-04 21:49:40 +13:00
Curtis S
06e1a6a38d Changed pressure's (ra map) game type to Conquest 2011-10-04 21:49:36 +13:00
Chris Forbes
1776b17205 fix busted indent in Repair.cs 2011-10-04 13:17:59 +13:00
Chris Forbes
c27af37541 fix busted indents in Plane.cs 2011-09-30 11:06:15 +13:00
Curtis S
174ec12ff0 Fixed ingame crash caused by using "F" on planes when owning no AFLDs 2011-09-30 08:24:17 +13:00
Chris Forbes
4f5bfceb3f remove done todo 2011-09-28 10:04:51 +13:00
Jeff Harris
edecd166a2 Added: Mac launcher readme file with details of how to build the launcher correctly 2011-09-26 08:44:52 +13:00
Jeff Harris
632ae08b87 Updated: Launcher.Mac binary now only contains PPC and x86 code so x64 macs dont try to execv x86 mono (usually crashes) 2011-09-26 08:44:46 +13:00
Chris Forbes
e4afaf4344 remove SequenceEditor, it's no longer useful 2011-09-26 08:40:40 +13:00
Chris Forbes
9663316c6c fix #1138 -- shortcut description on linux 2011-09-26 08:40:40 +13:00
Chris Forbes
ed1b8080df fix formatting in Game.cs 2011-09-26 08:40:40 +13:00
Chris Forbes
567a82fd5d move CanJoin onto GameServer 2011-09-26 08:40:40 +13:00
Chris Forbes
f9eb62beee tidy uid->map lookup in ServerBrowser implementations 2011-09-26 08:40:40 +13:00
Chris Forbes
6b602d5262 tidy up SpawnViceroid 2011-09-26 08:40:40 +13:00
Chris Forbes
7cbd2cb9b6 what kind of name is 'cpts' for a variable? 2011-09-26 08:40:40 +13:00
Chris Forbes
54922a74b1 spliit CncDirectConnectLogic into its own file 2011-09-26 08:40:40 +13:00
Chris Forbes
07175277f1 remove spurious 'refreshing' var 2011-09-26 08:40:40 +13:00
Chris Forbes
c4d10f5637 start similarly tidying CncServerBrowserLogic 2011-09-26 08:40:40 +13:00
Chris Forbes
fdd0897927 untangle default selection in ServerBrowserLogic 2011-09-26 08:40:40 +13:00
Chris Forbes
623fde709f DirectConnectLogic in its own file 2011-09-26 08:40:40 +13:00
Chris Forbes
d3cdb82479 start tidying ServerBrowserLogic 2011-09-26 08:40:39 +13:00
Chris Forbes
55036cd58c fix trailing whitespace everywhere 2011-09-26 08:40:39 +13:00
Chris Forbes
0eb98ef3b5 use OrderBy().ThenBy() rather than relying on unspecified stability of OrderBy(). 2011-09-26 08:40:39 +13:00
Chris Forbes
f3ee2d589b tidy whitespace 2011-09-26 08:40:39 +13:00
Chris Forbes
cef45a890a tidy usings 2011-09-26 08:40:39 +13:00
Chris Forbes
67933fe253 tidy usings in MainMenuButtonsLogic 2011-09-26 08:40:39 +13:00
Chris Forbes
7b3de29f05 simplify teamchat code 2011-09-26 08:40:39 +13:00
Chris Forbes
1216cef981 remove (broken) cloning support from ChatDisplayWidget; doesn't make any sense. 2011-09-26 08:40:39 +13:00
Chris Forbes
d3bfcfea5c remove ChatLine.wrapped; never used 2011-09-26 08:40:39 +13:00
Chris Forbes
1c2f857222 just fetch the font once in ChatDisplayWidget 2011-09-26 08:40:39 +13:00
Chris Forbes
9fcddc0df2 remove duplicated mod prerequisite chain walk; write it clearly 2011-09-26 08:40:39 +13:00
Chris Forbes
23202eff0c untangle Mod.cs inserting of .Id 2011-09-26 08:40:38 +13:00
Chris Forbes
73f4997f6d remove spurious Standalone flag from mod metadata 2011-09-26 08:40:38 +13:00
Chris Forbes
ef71020835 style issue on CncLoadScreen 2011-09-26 08:40:38 +13:00
Chris Forbes
420052b12c remove duplicated path setup in Mod.cs 2011-09-26 08:40:38 +13:00
Chris Forbes
e7900d069d move ActiveModVersion,ActiveModTitle out of cnc-specific code 2011-09-26 08:40:38 +13:00
Chris Forbes
15d846bfb0 rename 'preferences' to 'settings' in various internal cnc bits; UI strings were 'settings' already 2011-09-26 08:39:58 +13:00
Chris Forbes
635315b0af rename SpecialPowerBinWidget to SupportPowerBinWidget 2011-09-24 20:56:41 +12:00
Chris Forbes
4bc963d621 clean up duplication in RA SpecialPowerBinWidget overlay handling 2011-09-24 20:54:16 +12:00
Chris Forbes
b83fa764d4 clean up whitespace in CncWaterPaletteRotation 2011-09-24 20:48:20 +12:00
Chris Forbes
589d201a16 make ShowMouseScrollDropdown static; it needs nothing from the instance. 2011-09-24 20:45:46 +12:00
Chris Forbes
6a78eec512 remove duplicated ShowWindowModeDropdown function from CncSettingsLogic 2011-09-24 20:44:38 +12:00
Chris Forbes
c608b45ef0 move cnc shellmap music toggle into Sound settings group where it belongs 2011-09-24 20:37:03 +12:00
Chris Forbes
68801ba7b5 fix formatting issues in settings 2011-09-24 20:34:21 +12:00
Chris Forbes
657e8ad250 remove misleading dead assignments on saving, before using vars as out params 2011-09-24 20:32:57 +12:00
Chris Forbes
a1fc76acc3 remove hardcoded 20px offset in TimerWidget 2011-09-24 20:28:34 +12:00
Chris Forbes
73676c8f0c remove spurious RenderBounds call 2011-09-24 20:24:18 +12:00
Chris Forbes
1eec17d430 clean up duplication in TimerWidget 2011-09-24 20:22:46 +12:00
Chris Forbes
b76ec11304 remove needless Stopwatch instance from TimerWidget 2011-09-24 20:21:46 +12:00
Chris Forbes
6c39f19a73 remove match timer configuration crap 2011-09-24 20:17:27 +12:00
Chris Forbes
3b2efc7b0b fix #1184 -- useless error message when forgetting to define Render:Image: on a derived actor type 2011-09-24 19:58:34 +12:00
Chris Forbes
e829e4b5aa fix formatting nit in SequenceProvider 2011-09-24 19:57:33 +12:00
Chris Forbes
f6661d5e47 fix sequences being ignored when the only sequences in the mod are provided by a map 2011-09-24 19:57:08 +12:00
Chris Forbes
2063277654 remove dead SaveSequencesForUnit 2011-09-24 19:56:29 +12:00
Curtis S
c1ec8fdd5c Update CHANGELOG 2011-09-18 23:08:02 -06:00
Curtis S
589f590fdc Added 3 RA maps by Nukem 2011-09-18 23:07:25 -06:00
Curtis S
538779e249 Added RA map by ihptru: Free Coasts 2011-09-18 20:53:32 -06:00
Curtis S
025dccaa3f Removed Neutral's colorramp in Styrian Mountains 2011-09-18 20:50:23 -06:00
Chris Forbes
776a1aa817 fix newlines in source files 2011-09-17 11:26:17 +12:00
Chris Forbes
9480846250 remove spurious constructor from MoveAdjacentTo 2011-09-17 11:24:39 +12:00
Chris Forbes
24c74dcdd9 remove needless duplicate Health trait query 2011-09-17 11:09:37 +12:00
Chris Forbes
bc8f02375f fixed #1171 -- don't shade buildable things just because we're building something else 2011-09-16 20:56:24 +12:00
Curtis S
c1f522db63 Fix #1157: Removed HARV minining from cell in front / using MoveAdjacentTo in logic. Was causing harvesters to get stuck - need to revisit this. 2011-09-15 20:49:33 -06:00
Chris Forbes
16fa2f2c1e sort file lists in projectfiles, fix newlines 2011-09-16 08:57:11 +12:00
Chris Forbes
7458deab81 update CHANGELOG 2011-09-14 09:30:11 +12:00
Curtis S
4e52dca3b6 Fixed PlayerIsAllowedToRepair - player requires FACT for repairs 2011-09-13 22:24:26 +12:00
Curtis S
575641155c Proper CNC palette fix for allyrepair.shp 2011-09-13 22:24:19 +12:00
Curtis S
561bec9ada Fix #1165 - PowerdownIndicator now works for replays/spec 2011-09-13 22:24:10 +12:00
Chris Forbes
be1a041a8c fixed #1071 -- adjust cnc resource parameters 2011-09-13 10:36:04 +12:00
Chris Forbes
44f65f15ea increase SYRD cost to 1000 2011-09-12 09:53:35 +12:00
Chris Forbes
25e257f2fa increase SPEN cost to 800 2011-09-12 09:53:26 +12:00
Chris Forbes
446193ecc7 reduce LST speed to 8 2011-09-12 09:40:44 +12:00
Chris Forbes
9942c4cbf8 require DOME for destroyer 2011-09-12 09:38:57 +12:00
Chris Forbes
a8097b1872 updated CHANGELOG 2011-09-11 17:49:54 +12:00
Chris Forbes
2b9d21feb7 fix #1162 (use large_slash for aircraft crashing into water) 2011-09-11 17:49:54 +12:00
Chris Forbes
9de1ed9761 fix #1146 (bogus client lookup) 2011-09-11 17:49:54 +12:00
Chris Forbes
ea190fcf86 combine LobbyCommands and PlayerCommands 2011-09-11 17:49:53 +12:00
Chris Forbes
21ae6ee983 convert FileExtractor into a Utility cmdlet 2011-09-11 17:49:53 +12:00
Curtis S
03adb7f2c3 Added new RA map by Tirili: Seven Stairs 2011-09-10 23:47:24 -06:00
Curtis S
c9c716aae4 Added 4 new RA maps by Nukem 2011-09-10 23:47:09 -06:00
Curtis S
9ee794ee1f Added RA map by Knivesron: Drop Zone Battle of Tikiaki 2011-09-10 23:07:57 -06:00
Curtis S
b2cf3d9513 Added RA map by Holloweye: Drop Zone 2011-09-10 23:06:43 -06:00
Curtis S
7306f92d22 1159: Implemented Nukem's RA AI rules 2011-09-10 22:42:44 -06:00
Curtis S
2cc6a67a95 Harvs built by HackyAI now call FindResources 2011-09-10 22:40:06 -06:00
Curtis S
460696192b PowerdownIndicator will only show to owner and teammates 2011-09-10 22:38:19 -06:00
Curtis S
be9948426c 1078: Added ally repairing for CNC and RA 2011-09-10 16:41:40 -06:00
Curtis S
1d052bbfa2 Powered down buildings now display a "powered off" animation 2011-09-08 20:31:16 +12:00
Chris Forbes
00c6c5c88d update CHANGELOG 2011-09-07 20:51:45 +12:00
Chris Forbes
a3818a6aa2 fix MoveAdjacentTo so it doesnt suck so much 2011-09-07 20:43:18 +12:00
Chris Forbes
cc18a6a515 enable building of LST in yaml 2011-09-07 18:45:16 +12:00
Chris Forbes
aec4e6b5e8 remove .manifest from root 2011-09-07 18:40:44 +12:00
Chris Forbes
75a8139e3b Update CHANGELOG for release 2011-09-06 08:39:01 +12:00
Chris Forbes
9cbf69608a updated CHANGELOG 2011-09-04 14:17:04 +12:00
Chris Forbes
3b22a8588f fix #1129 -- laserzap tolerates null explosion 2011-09-04 11:10:21 +12:00
Chris Forbes
082603dd54 don't offer attackmove OG in cases for other players' stuff 2011-09-04 10:49:26 +12:00
Chris Forbes
014e63383b fix comment in WorldCommandWidget 2011-09-04 10:45:10 +12:00
Chris Forbes
19c7cd650d boost sam rof slightly 2011-09-04 10:28:51 +12:00
Chris Forbes
ee0de12318 boost longbow aa missile speed 2011-09-04 10:28:23 +12:00
Chris Forbes
e64c7680e8 fix #1141 -- lobby kick being broken in ra 2011-09-04 08:53:16 +12:00
Chris Forbes
f62fc7acd3 Updated CHANGELOG 2011-09-03 10:12:54 +12:00
Chris Forbes
8316ffc07e remove spurious trait lookup in AutoHeal 2011-09-01 16:18:36 +12:00
Curtis S
2cce16fe3d Minor ore changes to Doughnut map 2011-08-30 21:51:52 -06:00
Curtis S
43c5137dce Fixed ore distribution on mjolnir-2 2011-08-30 21:51:33 -06:00
Curtis S
6f70b113c8 Fix #1132; Infantry/Husks don't stay above water when bridge beneath is destroyed 2011-08-30 20:58:57 -06:00
Curtis S
3d48c454dc Vehicle husks should not appear on water 2011-08-30 20:55:27 -06:00
Curtis S
29b32dd656 Added new RA map: Doughnut 2011-08-29 17:13:00 +12:00
Curtis S
dc181f495f Added new RA map: Mjolnir 2 2011-08-29 17:12:54 +12:00
Chris Forbes
4b2717118f fix #1130 -- LaserZap beam color is configurable 2011-08-27 13:40:30 +12:00
Curtis S
02d644a09f Reduced Inaccuracy of Cruiser's 8Inch from 120 to 80 2011-08-27 08:21:31 +12:00
Chris Forbes
7b9f389ed1 Updated CHANGELOG 2011-08-22 18:33:31 +12:00
Chris Forbes
064b996ea2 slight tidy in nuke 2011-08-22 07:14:24 +12:00
Chris Forbes
2231436c2f fixed #837 -- hind, yak weapons ignore walls 2011-08-21 22:28:43 +12:00
Chris Forbes
dd306c7b7c fixed #766 -- minelayers not entering FIX properly 2011-08-21 22:17:50 +12:00
Chris Forbes
be7c4193a4 remove duplicated Tick 2011-08-21 22:05:41 +12:00
Chris Forbes
fe40fbf7f7 removed duplicated ResolveOrder 2011-08-21 22:05:41 +12:00
Chris Forbes
c0fd252b9f removed duplicate AttackActivity from AttackPopupTurreted 2011-08-21 22:05:41 +12:00
Chris Forbes
33ec2b3f5e have AttackPopupTurreted inherit AttackTurreted 2011-08-21 22:05:41 +12:00
Chris Forbes
7437e8fabb fix naming of turret member 2011-08-21 21:34:47 +12:00
Chris Forbes
c11b7041f4 push turret facing check down to turret 2011-08-21 21:32:39 +12:00
Chris Forbes
6a092dbfda declare AttackTurreted -> Turreted dep; do trait lookup at spawn time 2011-08-21 21:27:36 +12:00
Chris Forbes
78a0c3e506 move Attack traits into Attack dir 2011-08-21 21:10:49 +12:00
Chris Forbes
05d1c8ee82 move AttackPopupTurreted into RA where it can be fixed. 2011-08-21 21:05:29 +12:00
Chris Forbes
6daeb73471 stop spraying all these damned parentheses where they aren't needed 2011-08-21 21:02:19 +12:00
Chris Forbes
3a5682a1f7 remove Quit option from ingame menu; rename Disconnect to Abort Mission 2011-08-21 20:56:37 +12:00
Chris Forbes
2c5c069480 slow down power bar lerp slightly; extract constant 2011-08-21 20:49:34 +12:00
Chris Forbes
8b33c6c8b0 tidy up spurious typenames in PowerBinWidget 2011-08-21 20:45:47 +12:00
Chris Forbes
6346373e0c remove power manager lookup every render 2011-08-21 20:44:37 +12:00
Chris Forbes
339d5c3405 fix phantom radarbin 2011-08-21 20:40:32 +12:00
Chris Forbes
896cbaae39 clean up ModData package mounting 2011-08-21 20:26:00 +12:00
Chris Forbes
840f6131ac tidy up some spurious trait lookups in HackyAI 2011-08-21 19:39:44 +12:00
Chris Forbes
5a3f5d9f3a move BuildState into BaseBuilder where it belongs 2011-08-21 19:37:22 +12:00
Chris Forbes
b95f49d6f3 remove pointless null checks for owner 2011-08-21 19:34:45 +12:00
Chris Forbes
ee2be405ca fix AppearsFriendlyTo/AppearsHostileTo 2011-08-21 19:31:20 +12:00
Chris Forbes
da4811abe8 rip out ActorStance garbage 2011-08-21 18:59:20 +12:00
Curtis S
8e9045d7f4 Removed ra maps fire alley, isle wars 3, ore isle 2011-08-21 18:51:22 +12:00
Chris Forbes
0e3d07f0b2 adjust size of mcv husk 2011-08-21 18:49:54 +12:00
Chris Forbes
42ab7908d0 adjust size of harvester husk 2011-08-21 18:49:06 +12:00
Chris Forbes
d75784df64 factor out build palette overlays; add timers 2011-08-21 14:26:28 +12:00
Chris Forbes
96860033fb #1121 fixed -- [Sync] and ISync inheritance rules made the same 2011-08-21 10:58:16 +12:00
Chris Forbes
8cc455d23f fix #1105; decloak sound was never used 2011-08-21 10:21:07 +12:00
Chris Forbes
f7fdd885fb produce much better exceptions for missing files in map packages 2011-08-20 14:23:09 +12:00
Chris Forbes
8428eb0499 tidy up new-map-from-tileset support 2011-08-20 14:17:56 +12:00
Chris Forbes
1fe5c1d60f catch map load failures 2011-08-20 14:13:52 +12:00
Chris Forbes
a9d25b603c factor out duplicated hardcoded font in CashTick 2011-08-17 07:52:35 +12:00
Chris Forbes
e922051282 factor formatting code out of CashTick ctor 2011-08-17 07:52:35 +12:00
Chris Forbes
257bd6f431 fixed #849 -- forceMove plumbing removed, noone uses it. 2011-08-17 07:52:35 +12:00
Chris Forbes
67b4ef3084 #1108 changed BuildingInfo.WaterBound to a list of terraintypes. makes it possible to have buildings with custom terrain requirements 2011-08-17 07:52:35 +12:00
Chris Forbes
55ec88316a #1050 Extract generic PlayMusicOnMapLoad trait from cnc shellmap script 2011-08-17 07:52:34 +12:00
Curtis S
c47833e9a0 Fixed a frame in harvempty.shp 2011-08-15 19:15:57 -06:00
Chris Forbes
36f6e503ef clean up some of the noise in Move 2011-08-15 14:48:17 +12:00
Chris Forbes
a74fd17d39 remove a Turreted lookup every render for RenderBuildingTurreted 2011-08-15 14:32:10 +12:00
Chris Forbes
1aa80e0377 fix #960 -- HackyAI shouldn't put itself in low power so much. 2011-08-15 14:23:54 +12:00
Chris Forbes
cc716ab8c7 #1106 fixed -- mac-specific hack should only be applied on a mac. 2011-08-15 14:15:55 +12:00
Chris Forbes
6dd0452c95 drop unused SupportDir= option from 'openra' script produced by 'make install' 2011-08-13 15:01:42 +12:00
Chris Forbes
f3ea06c373 Include OpenRA.Renderer.SdlCommon.dll in 'make install'.
Merged from gentoo ebuild, https://github.com/cerebrum/dr/blob/master/games-strategy/openra/files/Makefile_rsdl.patch
2011-08-13 15:01:42 +12:00
Curtis S
499d9736cc Fix #802; BRIK health reduced to 500. Arty effectiveness remains the same. 2011-08-13 15:01:42 +12:00
Curtis S
cc8a9552b5 Made ATEK a prerequisite for Allied Longbow 2011-08-13 15:01:42 +12:00
Curtis S
d420701e5a Split hellfire missiles into AA/AG definitions 2011-08-13 15:01:42 +12:00
Chris Forbes
99f2f1bab2 fixed #1098; idle animation speed for e2 2011-08-13 15:01:42 +12:00
Chris Forbes
7902c9847e rename Technician -> Civilian 2011-08-13 15:01:42 +12:00
Chris Forbes
5546e977a8 add audio feedback for Stop order 2011-08-13 15:01:42 +12:00
Chris Forbes
c4666df6b9 fix long line in Mobile 2011-08-13 15:01:41 +12:00
Chris Forbes
54df44d43a split recoil into PrimaryRecoil/SecondaryRecoil; make recovery rate configurable per turret; #1069 2011-08-13 15:01:41 +12:00
Chris Forbes
954b0a617f don't consider HideMapCrateAction if the player has GPS 2011-08-13 15:01:41 +12:00
Chris Forbes
ca385e41ea fix bogus file name for HideMapCrateAction 2011-08-13 15:01:41 +12:00
Chris Forbes
9f0f8d381f map scatter->move for audio; #1093 2011-08-13 15:01:41 +12:00
Chris Forbes
d3def71340 Add ReturnToBase (F) support for aircraft; #1084 2011-08-13 15:01:41 +12:00
Chris Forbes
663a323f29 remove trait lookup spam everywhere for IOccupySpace. 2011-08-13 15:01:41 +12:00
Chris Forbes
aff3111eac internals for #919 2011-08-13 15:01:41 +12:00
Curtis S
b6560e6026 Fixed #1090; pilots don't drop for dead players 2011-08-13 15:01:40 +12:00
Chris Forbes
132ca5c667 update text for instant charge time option 2011-08-13 15:01:40 +12:00
Chris Forbes
f2867fbc61 UnregisterEvents functions do not need to be public 2011-08-13 15:01:40 +12:00
Chris Forbes
8d9f7b715d remove Lock Teams checkbox from RA lobby 2011-08-09 08:51:36 +12:00
Chris Forbes
9b9f13ed1b remove some duplication in LobbyLogic's color picker handling 2011-08-09 08:51:36 +12:00
Chris Forbes
e329c9dc55 fix some whitespace issues in LobbyLogic 2011-08-09 08:51:36 +12:00
Chris Forbes
89a209ff52 remove bogus FirstOrDefault + deref in Teleport; just use Trait<> 2011-08-09 08:51:36 +12:00
Paul Chote
5d3ed6aa6a Remove obsolete bits from linux packaging 2011-08-09 08:51:36 +12:00
Paul Chote
21197c702e Update CHANGELOG 2011-08-09 08:51:36 +12:00
Chris Forbes
3051b147f5 fix whitespace in NullGraphicsDevice 2011-08-09 08:51:36 +12:00
Chris Forbes
4e11702a99 fix #1088; gpsdot should not be given to opponents 2011-08-09 08:51:36 +12:00
Chris Forbes
a79cc0a0e0 drop unused parameter on IGraphicsDevice.Clear() 2011-08-09 08:51:36 +12:00
Chris Forbes
2bf7cb1496 fix #1052; tidy up *Init; route initial turret facing for husks through new TurretFacingInit 2011-08-09 08:51:36 +12:00
Chris Forbes
096fe7759c fix ThrowsParticles/ThrowsParticle naming inconsistency 2011-08-09 08:51:35 +12:00
Chris Forbes
18481afda2 fix #1063; don't issue orders while dragging a selection box 2011-08-09 08:51:35 +12:00
Chris Forbes
78e6d69103 fix #1064; always show an arrow while dragging a selection box 2011-08-09 08:51:35 +12:00
Chris Forbes
cfa8298190 remove duplication of initial map choice logic 2011-08-09 08:51:35 +12:00
Chris Forbes
b748e4b11b fix whitespace issues in CncMenuLogic 2011-08-09 08:51:35 +12:00
Chris Forbes
8844ea8e2f fix #1082; setting a bot's color no longer clobbers saved player color 2011-08-09 08:51:35 +12:00
Chris Forbes
5a9cb18881 fix #1070; allow GiveCashCrateAction to generate a cashtick 2011-08-09 08:51:35 +12:00
Chris Forbes
fa78793927 fix #1057 -- bogus trait lookup in RenderUnitSpinner 2011-08-09 08:51:35 +12:00
Chris Forbes
ddc1311d87 Make RenderUnit require IFacing; RenderSimple can be used for crates, mines, etc; fix husk facing init 2011-08-09 08:51:35 +12:00
Chris Forbes
7044d81a40 remove dead makedist.cmd 2011-08-09 08:51:35 +12:00
Chris Forbes
833533b4c3 fix #1056 2011-08-09 08:51:35 +12:00
Chris Forbes
7429c8ef89 don't look up IFacing (twice!) every frame for every actor with RenderUnit; fixes #1054 2011-08-09 08:51:35 +12:00
Chris Forbes
2797ea72cb fix stupid default support dir. if there's something we can't identify reliably, it's going to be a *nix 2011-08-09 08:51:28 +12:00
Matthew Bowra-Dean
21f172228d Fix compilation with Visual Studio
OpenRA.Renderer.SdlCommon was missing the /unsafe compiler flag and RALint was missing a reference to System.Drawing.
2011-08-08 11:17:10 +12:00
Paul Chote
c84f53c10d Extract tile overlays into a shp instead of rolling our own in code; Remove UIOverlay. Fixes #1061. 2011-07-27 21:48:32 +12:00
Paul Chote
08ed7f0316 Hook up empty/full harvester husk variants in RA. 2011-07-27 20:09:37 +12:00
Paul Chote
5fe5addc0c Make Harvester.Fullness an int 2011-07-27 20:00:23 +12:00
Paul Chote
d62ef64fa6 Make ralint give useful stacktraces under mono 2011-07-27 19:58:37 +12:00
Paul Chote
ad12352f41 Add mcv husk by Daniel Hernandez 2011-07-27 19:26:41 +12:00
Paul Chote
a4814b82c8 Display cost/power tooltip labels in red if there are insufficient funds/power. Fixes #1076. 2011-07-27 17:38:37 +12:00
Paul Chote
1c7a9ce08e Fix desert civ building animations (bug #1097). 2011-07-27 16:59:44 +12:00
Paul Chote
4e68ad2b12 Fix default civ building husk walkability 2011-07-27 16:57:23 +12:00
Paul Chote
9df7348683 Add two missing desert buildings 2011-07-27 16:57:12 +12:00
Paul Chote
b216d73ac9 Fix civ structure sequence ordering 2011-07-27 16:34:46 +12:00
Paul Chote
2b3f58e3a4 Fix hospital animation and add husk 2011-07-27 13:36:49 +12:00
Paul Chote
39a3dfffd1 Disallow capturing hospitals until they give something useful 2011-07-27 13:36:49 +12:00
Paul Chote
4c60639a0d Remove build radius from tech structures 2011-07-27 13:36:49 +12:00
Paul Chote
8087f16df0 `The Sentinel' tweaks: replace blue tib fields with hospitals; move starting spawns closer to the center; remove excess tib trees. 2011-07-27 13:36:49 +12:00
Paul Chote
0946bf52c3 Tweak tib and add oil derricks to Chokepoint. 2011-07-27 13:36:49 +12:00
Paul Chote
e62ec6caa1 Remove extra tib trees from `Instant Karma' 2011-07-27 13:36:49 +12:00
Paul Chote
86bc01cf65 Fix tib trees in `dead in motion' (bug #1072) 2011-07-27 13:36:49 +12:00
Paul Chote
8a6a3eac85 Make nod airfield fly the width of the map instead of spawning a fixed distance outside the map. Increase aircraft speed to compensate. Fixes #283. 2011-07-27 13:36:49 +12:00
Paul Chote
d9174b7e3b Kill RenderSimple.OverrideTileset/OverrideImage. 2011-07-27 13:36:48 +12:00
Paul Chote
64ab44c3ea Log a message when trying to render a nonexistent actor in the editor 2011-07-27 13:36:48 +12:00
Paul Chote
d98649e7e1 Switch `minus two' to desert variants. 2011-07-27 13:36:48 +12:00
Paul Chote
2778752a17 Switch `instant karma' to desert variants. 2011-07-27 13:36:48 +12:00
Paul Chote
a0d1686fd1 Fix bogus desert variant in shellmap 2011-07-27 13:36:48 +12:00
Paul Chote
e1691a4a70 Switch `chokepoint' to desert variants. 2011-07-27 13:36:48 +12:00
Paul Chote
6fecb82c98 Switch `break of day' to desert variants. 2011-07-27 13:36:48 +12:00
Paul Chote
7211cd10c6 Define desert variants of civilian buildings as real actors instead of visual hacks. 2011-07-27 13:36:48 +12:00
Paul Chote
17d72f17d9 Add an EditorTilesetFilter trait for filtering the actor palette based on tileset. 2011-07-27 13:36:47 +12:00
Paul Chote
9f7c5791f9 Make vehicle husks unselectable 2011-07-27 13:36:47 +12:00
Paul Chote
7e3cfd7ee9 Don't show a selection cursor over targetable but unselectable actors 2011-07-27 13:36:47 +12:00
Paul Chote
aa2ae95ce1 Kill DeadBuildingState.Zombie 2011-07-27 13:36:47 +12:00
Paul Chote
f9017567c1 Implement dead civilian buildings ask husks. Fixes #149. 2011-07-27 13:36:47 +12:00
Paul Chote
d6ab8b2456 Fix tech structures: cannot sell, can repair, fix husks. 2011-07-27 13:36:47 +12:00
Paul Chote
3972836cd6 Don't allow engineers to repair neutral structures, it conflicts with capturing. 2011-07-27 13:36:47 +12:00
Paul Chote
d8ec459b97 Declare RenderSimple dep in WithFire 2011-07-27 13:36:47 +12:00
Paul Chote
d9bd49bac3 Tweak East vs West 3. Fixes #921. 2011-07-27 13:36:47 +12:00
Paul Chote
4138c5aeb7 Display version in the load screen 2011-07-27 13:36:46 +12:00
Paul Chote
00ba03cbce Fix #1062 2011-07-27 13:36:46 +12:00
Paul Chote
304601b5ca Split some useful bits from CncIngameMenuLogic into CncWidgetUtils for use elsewhere 2011-07-27 13:36:46 +12:00
Paul Chote
648979c8ae Fix a crash in Demolish 2011-07-27 13:36:40 +12:00
Paul Chote
cf9ac8d801 Fix a dumb crash & avoid a trait lookup in DragHusk 2011-07-26 10:01:32 +12:00
Paul Chote
59116fc5b8 Include mod version on the ingame menu (Feature #1075) 2011-07-26 01:19:02 +12:00
Paul Chote
0a5f81c39e Drag husks to their final location. Fixes #730. 2011-07-25 23:50:11 +12:00
Paul Chote
49cbaeb1d2 Fix a crash when an infantry is crushed and killed by conventional means in the same tick. 2011-07-25 22:23:21 +12:00
Paul Chote
8ad3f47608 Further resource tweaks:
- Resource value reduced by 25%
 - Resource spawn rate increased by 15%
 - Unload rate decreased by 50%
 - Harvest rate increased by 25%
2011-07-25 22:23:21 +12:00
Paul Chote
9270c9c6b7 Don't clear RA production queues whenever anything dies. 2011-07-25 22:23:21 +12:00
Paul Chote
eba178a427 Resource changes (Feature #970):
- Harvester capacity ~halved
 - Harvester harvesting rate halved
 - Resource value ~doubled
 - Silo/Refinery capacity increased slightly
2011-07-25 22:23:21 +12:00
Paul Chote
eadf6fe6cf Rename RenderBuildingOre -> RenderBuildingSilo 2011-07-25 22:23:21 +12:00
Paul Chote
2231940056 Harvesters harvest the cell in front of them; fix harvester target lines; split harvester activities into their own (correctly named) files. 2011-07-25 22:23:21 +12:00
Paul Chote
a5b2ff4c75 Remove unused proc sequences 2011-07-25 22:23:21 +12:00
Paul Chote
996a5407a9 Use proc tower lights as a fullness indicator (Feature #1035). 2011-07-25 22:23:20 +12:00
Paul Chote
97c608a9b9 Fix harvempty.shp and harvhalf.shp 2011-07-25 22:23:20 +12:00
Paul Chote
69d23e01aa Remove references to unused mix files 2011-07-25 22:23:20 +12:00
Paul Chote
6c129eed3c Split pip artwork into their own files and kill the hardcoded size/offset junk. Add a blue pip to support C&C blue tib. Fixes #836. 2011-07-25 22:23:20 +12:00
Paul Chote
c793e8571f Update CHANGELOG 2011-07-25 22:23:20 +12:00
Paul Chote
ab132fb743 Increase reload time of mammoth missiles 2011-07-25 22:23:20 +12:00
Paul Chote
f4a03e3d73 Increase missile ROT and remove arming delay to ensure that missiles can hit adjacent targets. 2011-07-25 22:23:19 +12:00
Paul Chote
54b7e8f344 Split apache guns into AA/AG variants too. Fixes #946. 2011-07-25 22:23:19 +12:00
Paul Chote
e30e49006f Split orca missiles into AA and AG variants to avoid splash damage leakage. 2011-07-25 22:23:19 +12:00
Paul Chote
22d3e16225 Installing from CD: Volume names / mount points are unreliable identifiers - check for specific files on the disk instead. 2011-07-25 22:23:19 +12:00
Paul Chote
a165a80101 Fix imported map spawn ownership 2011-07-25 22:23:19 +12:00
Paul Chote
abf63b3054 Remove GameInitInfoWidget and routing startup via widgets in RA. 2011-07-25 22:23:19 +12:00
Paul Chote
2d269155b1 Reimplement installing from CD in RA. 2011-07-25 22:23:19 +12:00
Paul Chote
bf6be0424f Remove file prompting and drop all the remaining utility communication plumbing. 2011-07-25 22:23:18 +12:00
Paul Chote
9ec229bef7 Fix utility to use Platform.SupportDir (#1067); drop the --SupportDir arg and the path passed to --settings-value; Update OSX launcher to match. 2011-07-25 22:23:18 +12:00
Paul Chote
ac9a5efd8e Use GL_ARB_vertex_buffer_object calls instead of gl 1.5 core calls. 2011-07-25 22:23:18 +12:00
Paul Chote
f88ea4c25a Add RA settings UI for PixelDouble 2011-07-25 22:23:18 +12:00
Paul Chote
a94a57db32 Add C&C settings UI for PixelDouble 2011-07-25 22:23:18 +12:00
Paul Chote
d2c033dcd3 Add a PixelDouble preference for rendering at 2x zoom. Allowing arbitrary zoom levels leads to too many rendering artifacts. 2011-07-25 22:23:18 +12:00
Paul Chote
626b83ba12 Fix lines not being centered in the middle of a pixel 2011-07-25 22:23:17 +12:00
Paul Chote
8516fa8748 fix viewport scroll limits 2011-07-25 22:23:17 +12:00
Paul Chote
0bfc9a957f Fix radar viewport rectangle 2011-07-25 22:23:17 +12:00
Paul Chote
0b0e3d5f14 Drop unnecessary `this' uses from Viewport. 2011-07-25 22:23:17 +12:00
Paul Chote
6183621a72 Scale line-width to match zoom. 2011-07-25 22:23:17 +12:00
Paul Chote
fc783ddf80 Support custom zoom levels 2011-07-25 22:23:17 +12:00
Paul Chote
926b396605 Fix bogus naming of Shaders/Renderers. Split LineRenderer into world and chrome variants. 2011-07-25 22:23:16 +12:00
Paul Chote
4fa0962d49 Check for bogus subject clients in ValidateOrder. Fixes crash in #1001. 2011-07-25 22:23:16 +12:00
Paul Chote
2b3ee9e5bc Replace fullscreen checkbox and misleading width/height fields in RA settings menu with a mode/resolution selector like C&C. Fixes bugs #118, #791. 2011-07-25 22:23:16 +12:00
Paul Chote
704c784b51 Remove power and silo icon placeholders 2011-07-25 22:23:16 +12:00
Paul Chote
9b96bfb33b Fix #931 ("Unit Ready" played when a production structure is destroyed). 2011-07-25 22:23:16 +12:00
Paul Chote
d42cf25789 Packaging fixes for renderer deduplication. 2011-07-25 22:23:15 +12:00
Paul Chote
c79f5b5365 Ignore damage modifiers when killing a unit via actor.Kill(). Fixes surrender desync (#460); Fixes invulnerable actors surviving in situations where they should be killed (bridge death, losing/surrender, etc). 2011-07-25 22:23:15 +12:00
Paul Chote
6ede28fdbe Fix mammoth tank not crushing infantry 2011-07-25 22:23:15 +12:00
Paul Chote
ac7c25efa3 Prioritize alerted tabs when switching group / via hotkey. 2011-07-25 22:23:15 +12:00
Paul Chote
1bafd35d61 Rework ProductionTabsWidget getting/setting of the current queue. 2011-07-25 22:23:15 +12:00
Paul Chote
9fb72c9063 Play click sound when using `tab' to cycle queues. 2011-07-25 22:23:15 +12:00
Paul Chote
7be84a5390 Remove demo.mix from the packaged build, not the local copy. 2011-07-25 22:23:14 +12:00
Paul Chote
b8ba48ee67 Switch to observer ui on victory/defeat (Feature #1002). 2011-07-25 22:23:14 +12:00
Paul Chote
8f62ce9b25 Show `-' instead of 0 for unteamed players in the objectives panel. 2011-07-25 22:23:14 +12:00
Paul Chote
ee3be9c89b Laser tweaks:
- Expose the beam duration to the projectileinfo
 - Play an explosion animation at the target
 - Beam tracks moving targets
 - Disable player beam color in C&C
2011-07-25 22:23:14 +12:00
Paul Chote
d9d20338bf Increase orca reload time 2011-07-25 22:23:14 +12:00
Paul Chote
e724a3b200 Decrease stnk speed slightly, increase it's health 2011-07-25 22:23:14 +12:00
Chris Forbes
71cf332ee1 trim some crap out of Contrail 2011-07-25 22:23:13 +12:00
Chris Forbes
e4e443b0ab remove unused SidebarButtonWidget 2011-07-25 22:23:13 +12:00
Chris Forbes
e81cbceb99 aircraft sync debug traits dont really need to do trait lookups every time the synchash is taken.. 2011-07-25 22:23:13 +12:00
Chris Forbes
5055e0be62 clean up PlayerResources trait lookup in MoneyBinWidget 2011-07-25 22:23:13 +12:00
Chris Forbes
ac71e60a4b remove SplitOreAndCash from MoneyBinWidget; noone uses it anymore 2011-07-25 22:23:13 +12:00
Chris Forbes
41baa3b7b0 add escape keybinding to settings dialog 2011-07-25 22:23:13 +12:00
Chris Forbes
2ac1d001a4 add enter/escape bindings to replaybrowser 2011-07-25 22:23:13 +12:00
Chris Forbes
7d506f0ab6 rename gamelobby.yaml -> lobby.yaml 2011-07-25 22:23:12 +12:00
Chris Forbes
2a99cdb935 split map-chooser out of gamelobby.yaml 2011-07-25 22:23:12 +12:00
Chris Forbes
14733841e5 add escape/enter bindings for other join-game dialogs 2011-07-25 22:23:12 +12:00
Chris Forbes
0b97122c41 add escape/enter bindings for server browser dialog 2011-07-25 22:23:12 +12:00
Chris Forbes
00543825e7 setup escape/enter bindings for create-server dialog 2011-07-25 22:23:12 +12:00
Chris Forbes
8d2b6edaf1 split create server dialog into its own yaml file 2011-07-25 22:23:12 +12:00
Chris Forbes
fc9ab25c3f add escape key binding to ingame options button 2011-07-25 22:23:12 +12:00
Chris Forbes
70dfcffaea add another lint pass to ensure that every (non-template) actor type is actually constructible 2011-07-25 22:23:12 +12:00
Chris Forbes
b3bdc2df85 declare RenderUnitTurreted -> Turreted,AttackBase deps; remove spurious TraitOrDefault on AttackBase which just failed later; fixes #1053 2011-07-25 22:23:12 +12:00
Chris Forbes
315c00f67f clean up Contrail trait lookups; fixes #1058 2011-07-25 22:23:11 +12:00
Chris Forbes
0bca88d9d3 remove silly trait lookup in RenderBuildingCharge 2011-07-25 22:23:11 +12:00
Chris Forbes
fc15aa47ad dont really need to setup palettes every frame in ResourceLayer 2011-07-25 22:23:11 +12:00
Chris Forbes
5aaca5bb32 drop ISelectionColorModifier; unused 2011-07-19 21:14:12 +12:00
Chris Forbes
3a1613667b drop unnecessary ISync from ProximityCapturable 2011-07-19 21:14:12 +12:00
Chris Forbes
0d018d3eff tidying some font uses in BuildPaletteWidget 2011-07-19 21:14:12 +12:00
Chris Forbes
4448089cb7 use text rendering to show hold/ready indicators rather than SHP 2011-07-19 21:14:12 +12:00
Chris Forbes
8544930db9 ProximityCapturable simplifications 2011-07-19 21:14:12 +12:00
Chris Forbes
70a582df33 more simplification of Strategic* 2011-07-19 21:14:12 +12:00
Chris Forbes
e7228680e8 make RALint quiet unless -v or --verbose is passed 2011-07-19 21:14:12 +12:00
Chris Forbes
68fd2c9744 clean up usings after prev 2011-07-19 21:14:12 +12:00
Chris Forbes
643e0ee7a2 move CheckActorReferences out of the core lint code 2011-07-19 21:14:11 +12:00
Chris Forbes
3340e124e4 simplify Strategic* 2011-07-19 21:14:11 +12:00
Chris Forbes
33704977b9 remove ScrollingTextWidget 2011-07-19 21:14:11 +12:00
Chris Forbes
3d2635fca5 drop CursorSheetBuilder; use normal SheetBuilder for cursors now. 2011-07-19 21:14:11 +12:00
Chris Forbes
5609c8d041 drop format2 support from CursorSheetBuilder 2011-07-19 21:14:11 +12:00
Chris Forbes
d634f9db90 convert cnc mouse3 to td/ra format 2011-07-19 21:14:11 +12:00
Chris Forbes
4b5d6572ef convert RA cursors to TD/RA format 2011-07-17 18:37:27 +12:00
Chris Forbes
2a16172a20 add d2k -> ra shp conversion support to utility 2011-07-17 18:37:12 +12:00
Chris Forbes
239be241ff fix broken cleanup of import folder in editor after failed import; #1012 2011-07-17 17:55:53 +12:00
Chris Forbes
a635e8a4d8 add Passenger to crate; remove special cases in Cargo to support not having Passenger; #851 2011-07-17 17:55:53 +12:00
Chris Forbes
a95b59081f remove duplicated GL setup code 2011-07-17 17:55:52 +12:00
Chris Forbes
2fcb11d7cc remove duplicated SDL input handling 2011-07-17 17:55:52 +12:00
Chris Forbes
31c2306a57 get rid of Cg versions of Texture and VertexBuffer 2011-07-17 17:55:52 +12:00
Chris Forbes
b0ccc58516 remove unused vsync parameter from renderers 2011-07-17 17:55:52 +12:00
Chris Forbes
df1201b4c2 start moving common parts of the renderer into OpenRA.Renderer.SdlCommon 2011-07-17 17:55:52 +12:00
Chris Forbes
2ac6ccd3a4 add player parameter to ReinforceFromSea in prep for using it elsewhere 2011-07-17 17:55:52 +12:00
Chris Forbes
8221b8acca declare Burns -> RenderSimple dep; remove first tick weirdness 2011-07-17 17:55:52 +12:00
Chris Forbes
4a0b7bb003 put AnimationWithOffset in its own file 2011-07-17 17:55:52 +12:00
Chris Forbes
59616671b6 add harvester husks 2011-07-17 17:55:51 +12:00
Chris Forbes
74b894b69f replace Range with MinimumValue/MaximumValue 2011-07-17 17:55:51 +12:00
Chris Forbes
a52e5a92ae adjust copy ctor for SliderWidget -- copying the isMoving state makes *no sense*; Value should be copied though 2011-07-17 17:55:51 +12:00
Chris Forbes
0efe82018a rewrite SliderWidget to be simpler and have much less fail 2011-07-17 17:55:51 +12:00
Chris Forbes
fe6a99c993 fixed #42 -- show harvester fullness in sprites 2011-07-17 17:55:51 +12:00
Chris Forbes
9dd0ad980b remove backwards compatibility crap from RA edgescroll config 2011-07-17 12:43:12 +12:00
Chris Forbes
5c5eb5d5b5 remove config item for match timer in RA 2011-07-17 12:41:21 +12:00
Chris Forbes
2d79c7c424 clean up graphics settings in SettingsMenuLogic.cs 2011-07-17 12:37:54 +12:00
Chris Forbes
10cb967711 tidy SettingsMenuLogic audio settings 2011-07-17 12:33:05 +12:00
Chris Forbes
f973b1a29f SliderWidget's OnChange event has a parameter for a reason.. 2011-07-17 12:30:45 +12:00
Chris Forbes
a302b7999a trim usings after prev 2011-07-17 12:25:32 +12:00
Chris Forbes
413dd0cce4 move CncColorPickerLogic into its own file 2011-07-17 12:23:42 +12:00
Chris Forbes
af05856a5f fix foreach/closure bugs in CncLobbyLogic when setting up spectators 2011-07-17 12:15:20 +12:00
Chris Forbes
c05215c477 fix foreach/closure bugs in RA LobbyLogic; factor out name widget setup 2011-07-17 12:10:49 +12:00
Chris Forbes
8b78bc0602 move ReserveSpawnBuilding out of Plane.Tick and name it 2011-07-17 11:57:07 +12:00
Chris Forbes
2d8b72a5ff fix usings in Spy.cs 2011-07-17 11:38:45 +12:00
Chris Forbes
37656a02d9 have RALint check actor type in EjectOnDeath 2011-07-17 11:28:40 +12:00
Chris Forbes
5f315bc404 split unit smoke out into WithSmoke trait; remove duplication 2011-07-17 11:27:20 +12:00
Chris Forbes
d6819a19b8 declare WithRotor -> RenderSimple dep 2011-07-17 11:08:02 +12:00
Chris Forbes
cfc499e459 tidy usings for MapChooserLogic 2011-07-17 10:52:05 +12:00
Chris Forbes
c401e9c8fb tidy up ra music player 2011-07-17 10:52:05 +12:00
Chris Forbes
f8a9511a15 have RALint check CrateAction.ExcludedActorTypes 2011-07-17 10:32:03 +12:00
Chris Forbes
835d671752 fix 1036 -- GiveUnitCrateAction can give units which don't have BuildableInfo, to anyone 2011-07-17 10:29:00 +12:00
Chris Forbes
6a99ff7931 reinstate CrateAction.ExcludedActorTypes; custom maps use this. 2011-07-16 19:09:28 +12:00
Paul Chote
21ab82f91d Increase infantry crushability slightly. 2011-07-16 05:03:42 +12:00
Paul Chote
5722db0e34 Make Civilians crushable 2011-07-16 05:03:19 +12:00
Paul Chote
87e02ee7b1 Update CHANGELOG 2011-07-16 00:05:44 +12:00
Curtis S
2748c54002 Added new RA map by Buddha: Snowy Island 2011-07-16 00:05:44 +12:00
Curtis S
70a3b0aaba New version of RA Map: Center Of Attention 2011-07-16 00:05:44 +12:00
Chris Forbes
2a08b28094 remove need for #pragma in Bridge.cs 2011-07-16 00:05:44 +12:00
Chris Forbes
b1eea4a4d3 remove the need for warning suppression in Lazy/Cached 2011-07-16 00:05:44 +12:00
Paul Chote
f9b1c4fcc3 Work around a non-interactable window bug exposed by earlier graphics refactoring. 2011-07-15 23:57:29 +12:00
Paul Chote
eabcc51738 Fix gun firing offset (Bug #940). 2011-07-15 21:31:48 +12:00
Paul Chote
e40581149a Fix mtnk firing offset (Bug #938). 2011-07-15 21:31:48 +12:00
Paul Chote
3ae34fabf1 Fix ltnk firing offsets (Bug #939). 2011-07-15 21:31:48 +12:00
Paul Chote
e39d45d108 Add a delay before playing the win/lose audio notification. 2011-07-15 21:31:48 +12:00
Paul Chote
bc1a50693c Toggle repair/sell button state when active. 2011-07-15 21:31:48 +12:00
Paul Chote
1c29c95614 Use toggle artwork for production tabs. Change tab label color on alerted tabs. Contributes towards #1006. 2011-07-15 21:31:48 +12:00
Paul Chote
8f4c2371c7 Rename TooltipButton -> ToggleButton and add an active state. Use for production group icons. 2011-07-15 21:31:48 +12:00
Paul Chote
fef8008c87 Add click sounds to production tabs. Contributes towards #1006. 2011-07-15 21:31:47 +12:00
Paul Chote
05acdc9b98 Clean up some uses of rect.Contains(int2). 2011-07-15 21:31:47 +12:00
Paul Chote
8390644fbe Fix scrollthumb hover state 2011-07-15 21:31:47 +12:00
Paul Chote
4d2310b077 Add left and right arrows for the tabstrip. Rearrange chrome.png layout slightly. 2011-07-15 21:31:47 +12:00
Paul Chote
affc99e1cd Remove obsolete buttons.psd from artsrc. 2011-07-15 21:31:47 +12:00
Paul Chote
a9b479dfea Show (Dead) in the player list in the objectives screen (Bug #1031). 2011-07-15 21:31:47 +12:00
Paul Chote
d6b5b282bf Fix player name color in objectives screen (Bug #1030). 2011-07-15 21:31:47 +12:00
Paul Chote
e333ea89c9 Remove mods/cnc/packages reference from C&C's mod.yaml to match RA. Packages are now loaded exclusively from the support dir for both mods. Completes fix for #1016. 2011-07-15 21:31:47 +12:00
Curtis S
60adc57ca2 Removed .\mods\ra\packages reference in mod.yaml 2011-07-15 21:31:47 +12:00
Curtis S
e73969cb26 Reduced MSUB damage from 400 to 300 2011-07-15 21:31:47 +12:00
Curtis S
33ad765e3b Changed msub cloak time from 50 ticks to 100 2011-07-15 21:31:47 +12:00
Curtis S
4be76fcfc0 Added CashTrickler trait to RA oil derrick 2011-07-15 21:31:47 +12:00
Curtis S
403b05b4db Fixed palette issues in RA oil derrick SHP 2011-07-15 21:31:46 +12:00
Paul Chote
725b0cda40 Fix Production Palette audio (Bug #1004). 2011-07-15 21:31:46 +12:00
Paul Chote
5fceaaec58 New APC turret; art by Daniel Hernandez. 2011-07-15 20:10:22 +12:00
Paul Chote
089cdf14ad Remove the baked harvester animation from proc. Fixes #1009. 2011-07-15 20:10:22 +12:00
Paul Chote
24d220213e Remove extraneous spaces after weapon names 2011-07-15 20:10:22 +12:00
Paul Chote
c981b4322e Increase bike damage by ~16%, give weapon a sensible name. 2011-07-15 20:10:22 +12:00
Paul Chote
6090fda144 Increase building repair rate, cost. 2011-07-15 20:10:21 +12:00
Paul Chote
6433e6b356 Halve Mammoth Tank regen rate 2011-07-15 20:10:21 +12:00
Paul Chote
39338c1d3a Update CHANGELOG 2011-07-15 20:10:21 +12:00
Paul Chote
e9bd03b686 Add crushable infantry support, enabled in C&C. 2011-07-15 20:10:21 +12:00
Paul Chote
7173d193cf Pass the sequence name to the Corpse effect instead of an InfDeath number. Only play death animations for standard deaths. 2011-07-15 20:10:21 +12:00
Paul Chote
19ead53223 Add a WarnCrush method to ICrushable which is called when a crusher begins to enter the cell. 2011-07-15 20:10:21 +12:00
Paul Chote
74d13286a8 Add a force flag to nudging which skips the ownership and idle checks 2011-07-15 20:10:21 +12:00
Paul Chote
98ae8c7630 Take ownership into account when determining crushability. Fixes the important half of #951 (tanks crushing your own walls). 2011-07-14 21:00:50 +12:00
Paul Chote
64b88819a9 Add plumbing to support ownership checks in MobileInfo.CanEnterCell. 2011-07-14 21:00:50 +12:00
Paul Chote
47ba4cb285 Add click sounds to ingame buttons 2011-07-14 21:00:45 +12:00
Paul Chote
195aecec0e Add chat notification audio 2011-07-14 20:29:14 +12:00
Paul Chote
f724da5628 Tweak lobby chat panel 2011-07-14 20:29:14 +12:00
Paul Chote
3f468353fc Fix player name color in lobby chat. 2011-07-14 20:29:14 +12:00
Paul Chote
562931196f Give observers a minimap 2011-07-14 20:29:14 +12:00
Paul Chote
9eb7a3c27b Tweak button positions 2011-07-14 20:29:14 +12:00
Paul Chote
b82b716506 Add icons for options/sell/repair 2011-07-14 20:29:14 +12:00
Paul Chote
dc0c0e744a Production group icons 2011-07-14 20:29:14 +12:00
Paul Chote
32322b1658 Add tooltip descriptions to support powers 2011-07-14 20:29:14 +12:00
Paul Chote
5b2d2265e3 Add 8 maps by Petrenko, remove evw2. 2011-07-14 20:29:14 +12:00
Paul Chote
2049030ad4 Show remaining build time, remove unnecessary calculations from production palette 2011-07-14 20:29:13 +12:00
Paul Chote
29a90021f6 Fix production tabs crash 2011-07-14 20:29:13 +12:00
Paul Chote
07ae0688ff Fix unexplored terrain tooltip 2011-07-14 20:29:13 +12:00
Paul Chote
ef8ed398ce Tweak special powers widget: move unnecessary calculations out of Draw(); display the charge time over the icon. 2011-07-14 20:29:13 +12:00
Paul Chote
574133429a Fix control groups 2011-07-14 20:29:13 +12:00
Paul Chote
3d9a8cc002 Fix a tooltip crash. 2011-07-14 20:29:13 +12:00
Paul Chote
b2bfc5368a Initial production tooltip 2011-07-14 20:29:13 +12:00
Paul Chote
6199ec1404 Hide the objectives panel when opening submenus 2011-07-14 20:29:13 +12:00
Paul Chote
d70e5d3c42 Simple support power tooltips 2011-07-14 20:29:12 +12:00
Paul Chote
e078c8f8d8 Add owner name/flag to world tooltip. 2011-07-14 20:29:12 +12:00
Paul Chote
c965899b8c Better support for dynamic tooltip sizes 2011-07-14 20:29:12 +12:00
Paul Chote
dd7e270780 Update tooltip every render - fixes tooltips for actors changing under the cursor. 2011-07-14 20:29:12 +12:00
Paul Chote
7c72c1564e Add tooltip hook to SupportPowers; save some batches. 2011-07-14 20:29:12 +12:00
Paul Chote
ca77f20f19 Save batches in ProductionPalette 2011-07-14 20:29:12 +12:00
Paul Chote
5f3483ed17 Improve edge-scroll behavior 2011-07-14 20:29:12 +12:00
Paul Chote
ca8605d3ee Remove dialog4 2011-07-14 20:29:12 +12:00
Paul Chote
b1fe085b4d Remove incorrectly hardcoded "dialog4" from WidgetUtils.GetBorderSizes(). 2011-07-14 20:29:12 +12:00
Paul Chote
06990e356f Simple world tooltip. 2011-07-14 20:29:12 +12:00
Paul Chote
88d68f7790 Containers shouldn't steal mouseover focus 2011-07-14 20:29:11 +12:00
Paul Chote
2f9114fcf8 Power/Silo bar tooltips. 2011-07-14 20:29:11 +12:00
Paul Chote
b4489028de Polish button tooltips. Add tooltips/hotkeys for menu/sell/repair 2011-07-14 20:29:11 +12:00
Paul Chote
460451c402 Start implementing new tooltip bits. Test tooltips added for buttons and production palette. 2011-07-14 20:29:11 +12:00
Chris Forbes
608bdc8fcd pull some validation out of individual lobby/player commands 2011-07-14 20:29:11 +12:00
Chris Forbes
2ec88a6f64 remove duplicated NextPowerOf2 definition 2011-07-14 20:29:11 +12:00
Chris Forbes
2259a0e7a5 remove duplication of DrawSelectionBox 2011-07-14 20:29:11 +12:00
Chris Forbes
2ab2ee17c1 remove duplicated HarvestThisTile function from Harvest.cs 2011-07-14 20:29:11 +12:00
Chris Forbes
332d6d82fe add using rather than fully qualifying StackTrace typename 2011-07-14 20:29:11 +12:00
Chris Forbes
6f477a2c14 fix broken detection of desktop resolution on linux 2011-07-14 20:29:10 +12:00
Chris Forbes
88d0c9238c more debug output from Cg renderer setup 2011-07-14 20:29:10 +12:00
Chris Forbes
b06647a079 reduce noise in Renderer 2011-07-14 20:29:10 +12:00
Chris Forbes
ceaca47747 don't use ScrollDirection.Set when it's not needed 2011-07-14 20:29:10 +12:00
Chris Forbes
1196948a13 remove duplicated box-drawing code from WICW 2011-07-14 20:29:10 +12:00
Chris Forbes
2a7be6debd add missing using for MouseScrollType 2011-07-14 20:29:10 +12:00
Chris Forbes
496135d321 clean up ViewportScrollControllerWidget.GetCursor 2011-07-14 20:29:10 +12:00
Chris Forbes
2da523e824 drop unused WorldRenderer.DrawBox 2011-07-14 20:29:10 +12:00
Chris Forbes
98ebb7c87e add DrawRect helper to LineRenderer, use it in both Radar*Widgets 2011-07-14 20:29:09 +12:00
Chris Forbes
5af4476cd8 split AnnounceOnKill into its own file 2011-07-14 20:29:09 +12:00
Chris Forbes
5633d84d21 add lint pass to check whether types with ISync actually have any [Sync] members 2011-07-14 20:29:09 +12:00
Chris Forbes
513b852a67 fix [Sync] being allowed in places that don't make sense 2011-07-14 20:29:09 +12:00
Chris Forbes
74335f0734 fix bogus indent in ObjectCreator 2011-07-14 20:29:09 +12:00
Chris Forbes
b1ee735f3b put CheckAutotargetWiring in its own file 2011-07-14 20:29:09 +12:00
Chris Forbes
60a3f170ab clean up remaining non-generic GetValue uses 2011-07-14 20:29:09 +12:00
Chris Forbes
913ca89d4f use generic GetValue<> in VoiceInfo 2011-07-14 20:29:09 +12:00
Chris Forbes
914b3e1bee use generic GetValue<> in MobileInfo custom loader 2011-07-14 20:29:09 +12:00
Chris Forbes
33e6c7d39f fix namespace on cnc ProductionQueueFromSelection 2011-07-14 20:29:09 +12:00
Chris Forbes
c6cdee6075 more noise reduction in SVC 2011-07-14 20:29:09 +12:00
Chris Forbes
d0ac8b9766 remove spam from SVC 2011-07-14 20:29:08 +12:00
Chris Forbes
6565f7b32c removing some noise from SVC 2011-07-14 20:29:08 +12:00
Chris Forbes
5b481c2445 add Bits<> support to FieldLoader 2011-07-14 20:29:08 +12:00
Chris Forbes
c7c97ec743 rename ColorHSLR.cs to ColorRamp.cs to match classname 2011-07-14 20:29:08 +12:00
Chris Forbes
95e29e06df add Bits/BitAllocator types 2011-07-14 20:29:08 +12:00
Chris Forbes
47e25bb5a1 use common version of AreMutualAllies in PC 2011-07-14 20:29:08 +12:00
Chris Forbes
85bb56fd8f use common version of AreMutualAllies in SPW 2011-07-14 20:29:08 +12:00
Chris Forbes
f37cf32021 use AreMutualAllies in SVC 2011-07-14 20:29:08 +12:00
Chris Forbes
4e1c845303 add common version of AreMutualAllies to WorldUtils 2011-07-14 20:29:07 +12:00
Chris Forbes
c9c31345aa fix broken indent in WorldUtils.cs 2011-07-14 20:29:07 +12:00
Chris Forbes
1076ebb884 declare SVC -> CVC dep, rather than silently not working 2011-07-14 20:29:07 +12:00
Chris Forbes
002a8edb4c remove RatioRequired, CriticalRatioRequired from SVC, use info members 2011-07-14 20:29:07 +12:00
Chris Forbes
6f920e9011 cleanup StrategicVictoryConditions.cs 2011-07-14 20:29:07 +12:00
Chris Forbes
a9c00bdfba fix vis,naming of StrategicVictoryConditions.self 2011-07-14 20:29:07 +12:00
Chris Forbes
e44b965785 fixed #999 -- replace order/first[ordefault] with .ClosestTo(point) 2011-07-14 20:29:07 +12:00
Chris Forbes
5c3a6c81ae tidy HackyAI 2011-07-14 20:29:07 +12:00
Chris Forbes
c1a6b3470a fix indent in HackyAI.DeployMcv 2011-07-14 20:29:06 +12:00
Chris Forbes
b6bdff6f85 [2/2] fixed #998 -- clean up HackyAI.BuildRandom 2011-07-14 20:29:06 +12:00
Chris Forbes
56a38b9463 [1/2] fixed #998 -- clean up HackyAI.BuildRandom 2011-07-14 20:29:06 +12:00
Chris Forbes
6f2d1c54d6 fixed #983 -- don't crash in HackyAI if we can't find a target. 2011-07-14 20:29:06 +12:00
Chris Forbes
14de16eeba fix indent in HackyAI.Activate 2011-07-14 20:29:06 +12:00
Chris Forbes
b69ed51fb1 remove spurious second BuildRandom(Vehicle) call 2011-07-14 20:29:06 +12:00
Chris Forbes
bccac29297 simplify FieldSaver.FormatValue 2011-07-14 20:29:06 +12:00
Chris Forbes
be1754d424 bug #997 -- remove duplication from HackyAIInfo 2011-07-14 20:29:06 +12:00
Chris Forbes
847a248a26 bug #997 -- introduce generic version of FieldLoader.GetValue 2011-07-14 20:29:06 +12:00
Chris Forbes
7e162ad744 remove done todos from hackyai 2011-07-14 20:29:06 +12:00
Chris Forbes
0cb1f98e7e fixed #994 - use FormatTimeSeconds in MusicPlayerLogic 2011-07-14 20:29:06 +12:00
Chris Forbes
8610222e2c remove spurious typenames from WidgetUtils.WrapText 2011-07-14 20:29:05 +12:00
Chris Forbes
5b5bca9903 split FormatTime, FormatTimeSeconds 2011-07-14 20:29:05 +12:00
Chris Forbes
d40b071ab1 tidy in WidgetUtils 2011-07-14 20:29:05 +12:00
Chris Forbes
99b8c765c7 fixed #996 -- Rules.InstalledMusic 2011-07-14 20:29:05 +12:00
Chris Forbes
1a2dc8ec1c fixed #995 - remove duplication in next/prev song in MusicPlayerLogic.cs 2011-07-14 20:29:05 +12:00
Chris Forbes
b71e8bfe85 work on #993 -- removed OnMouseUp from DeveloperModeLogic.cs 2011-07-14 20:29:05 +12:00
Chris Forbes
897f578fc4 work on #993 -- removed OnMouseUp from DiplomacyLogic.cs 2011-07-14 20:29:05 +12:00
Chris Forbes
b9834c5b88 work on #993 -- removed OnMouseUp from MapChooserLogic.cs 2011-07-14 20:29:05 +12:00
Chris Forbes
accf94d664 work on #993 -- removed OnMouseUp from ReplayBrowserLogic.cs 2011-07-14 20:29:04 +12:00
Chris Forbes
3bdea009e3 work on #993 -- removed OnMouseUp from CreateServerMenuLogic.cs 2011-07-14 20:29:04 +12:00
Chris Forbes
c4985a043b work on #993 -- removed OnMouseUp from IngameObserverChromeLogic.cs 2011-07-14 20:29:04 +12:00
Chris Forbes
50303107d8 work on #993 -- removed OnMouseUp from SettingsMenuLogic.cs 2011-07-14 20:29:04 +12:00
Chris Forbes
f666dc08f5 work on #993 -- removed OnMouseUp from LobbyLogic.cs 2011-07-14 20:29:04 +12:00
Chris Forbes
bd018484e1 work on #993 -- removed OnMouseUp from IngameChromeLogic.cs 2011-07-14 20:29:04 +12:00
Chris Forbes
dfd73ce209 work on #993 -- removed OnMouseUp from MainMenuButtonsLogic.cs 2011-07-14 20:29:04 +12:00
Chris Forbes
980dc265ef work on #993 -- removed OnMouseUp from ServerBrowserLogic.cs 2011-07-14 20:29:04 +12:00
Chris Forbes
c32e0186b9 work on #993 -- removed OnMouseUp from ConnectionDialogsLogic.cs 2011-07-14 20:29:04 +12:00
Chris Forbes
8e780759bf work on #993 -- removed OnMouseUp from GameInitLogic.cs 2011-07-14 20:29:04 +12:00
Chris Forbes
14f29eb30e work on #993 -- removed OnMouseUp from MusicPLayerLogic.cs 2011-07-14 20:29:04 +12:00
Chris Forbes
d5ee3655f3 fixed #992: removed spurious double-semicolons 2011-07-14 20:29:03 +12:00
Chris Forbes
d95b579ead Makefile: fix various issues
* Add missing dependency between shippable binaries and fixheader
* Remove spam when fixheader is used
* Remove error message on from clean
* Fix minimal rebuilds
* Use strict variables to avoid shelling out so often for file lists
* Reenable RALint checking of mods

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2011-07-14 20:29:03 +12:00
Chris Forbes
cd63da85d8 remove FieldLoader.LoadAttribute; replace with FieldLoader.IgnoreAttribute 2011-07-14 20:29:03 +12:00
Chris Forbes
a4648cfbcc move SheetSize to Graphics section of settings 2011-07-14 20:29:03 +12:00
Chris Forbes
54dee43590 test for required extensions in Cg renderer too 2011-07-14 20:29:03 +12:00
Chris Forbes
dcd9627c22 fixed #989: don't do renderer setup in a reflected call. 2011-07-14 20:29:03 +12:00
Chris Forbes
a07e151ab5 drop bogus comment in renderer 2011-07-14 20:29:03 +12:00
Paul Chote
0c95b43c87 Save some dumb perf in Widget.RenderBounds. 2011-07-14 20:29:03 +12:00
Paul Chote
e9d67860de Proper mouseover support. 2011-07-14 20:29:02 +12:00
Paul Chote
1114293035 Apply consistent widget method names. Semantic change: Widgets that want to tick when !Visible must override TickOuter() instead of Tick(). 2011-07-14 20:29:02 +12:00
Paul Chote
193999a040 Move OnMouseUp onto ButtonWidget and drop its unnecessary plumbing. 2011-07-14 20:29:02 +12:00
Paul Chote
8189ef109e Reorganize Widget into static/nonstatic. 2011-07-14 20:29:02 +12:00
Paul Chote
e58e354c4b Move IsDisabled checking for OnMouseDown into ButtonWidget. Remove unnecessary bool plumbing. 2011-07-14 20:29:02 +12:00
Paul Chote
bbeaf2047b Remove OnMouseDown from Widget. Define it on just the widgets that want it. 2011-07-14 20:29:02 +12:00
Paul Chote
7a69daa99c Remove Widget.OnMouseMove. 2011-07-14 20:29:01 +12:00
Paul Chote
f905c87b97 New support powers bin 2011-07-14 20:29:01 +12:00
Paul Chote
e787c46a81 Remove border from buildclock overlay. 2011-07-14 20:29:01 +12:00
Paul Chote
5f8beb632a Switch tabs when a queue is lost, hide tab-strip when there are no queues available, rename queueType -> queueGroup. 2011-07-14 20:29:01 +12:00
Paul Chote
a065ba0338 Keyboard support for production palette:
y/u/i/o/p map to Buildings/Defense/Infantry/Vehicles/Aircraft.
Tab or successive y/u/i/o/p will switch tabs within a category.
Successive clicks on category icons will also switch tabs.
Shift + keyboard/click cycles tabs in reverse.
2011-07-14 20:29:01 +12:00
Paul Chote
c1f7152857 Change Widget key support: Move (unused) Widget.OnKeyPress hook onto ButtonWidget; Buttons will respond to keys with modifiers. 2011-07-14 20:28:35 +12:00
Paul Chote
6877c29fa6 Reimplement production queue switching from selection. 2011-07-03 07:02:17 +12:00
Paul Chote
70faee4e9c Remove obsoleted artwork 2011-07-03 06:32:05 +12:00
Paul Chote
8950ef7bcb Hook up sell/repair buttons 2011-07-03 06:29:41 +12:00
Paul Chote
f96840df36 Rewrite production palette. Tooltips will be reimplemented later. 2011-07-03 06:20:02 +12:00
Paul Chote
c76811c5e1 Rewrite production tabs (again): Avoid doing a pile of work every tick; support multiple queue types grouped under one category; Tab numbering is sticky. 2011-07-03 01:48:14 +12:00
Paul Chote
b85fce3b41 Disable queue buttons when there are no tabs 2011-07-02 21:37:31 +12:00
Paul Chote
fe380b13ac Rewrite ProductionTabsWidget. 2011-07-02 21:18:26 +12:00
Paul Chote
d5e63538ad Port production palette from ui2 branch. Needs reworking. Unfinished. 2011-07-02 07:32:34 +12:00
Paul Chote
dba77daae0 Fix namespace 2011-07-02 07:31:39 +12:00
Paul Chote
e922e8028c Hook up tib storage bar 2011-07-02 06:23:48 +12:00
Paul Chote
7e67fdb446 Wire up power bar 2011-07-02 04:27:40 +12:00
Paul Chote
1f92286b51 Wire up cash display 2011-07-02 03:53:13 +12:00
Paul Chote
7e42175a94 Mock up sidebar using existing widgets 2011-07-02 03:45:42 +12:00
Paul Chote
717471a522 New faction flags 2011-07-02 01:31:18 +12:00
Paul Chote
9b3cedd37f Show map title in the lobby 2011-07-01 23:37:53 +12:00
Daniel Hernandez
0224b3b745 Fix stnk husk (Fixes #985). 2011-07-01 23:22:07 +12:00
Paul Chote
3dec6016e7 Remove diplomacy menu, lock teams option (Feature #950). 2011-07-01 23:19:50 +12:00
Paul Chote
fa6b9983d3 Conquest objectives panel (Feature #949). 2011-07-01 23:07:50 +12:00
Paul Chote
c81735911e Add Funcs for custom label Color/ContrastColor 2011-07-01 23:04:48 +12:00
Paul Chote
97186d8bd9 Support custom checkbox symbols. Add a crossed variant to C&C. Correctly copies checkbox state when copying checkboxes. 2011-07-01 23:04:48 +12:00
Paul Chote
7c63138e3f Mechanism for showing mission objectives in the ingame menu. Fixes #948. 2011-07-01 02:34:30 +12:00
Paul Chote
aaa78649fc Make overflow tabs clickable. Fixes #550. 2011-07-01 00:42:53 +12:00
Paul Chote
c2519375b2 Reduce grenadier death damage. Fixes #957. 2011-07-01 00:35:09 +12:00
Paul Chote
0f3be08491 Halve tiberium damage to infantry, deal it smoothly. 2011-07-01 00:19:46 +12:00
Paul Chote
a835edfab1 Increase tiberium pathing penalty for infantry. Fixes #953. 2011-07-01 00:16:28 +12:00
Paul Chote
9cbf372698 Use new reveal-map and heal crate effects. Fixes #977. 2011-07-01 00:12:27 +12:00
Paul Chote
17fa312108 Use new cloak crate effect 2011-07-01 00:08:43 +12:00
Paul Chote
11a9bc7e43 Remove ExcludedActors from crate actions. Use a tag trait for cloakable actors. Ban MCV from receiving cloak. 2011-07-01 00:07:04 +12:00
Paul Chote
f360559869 Remove some crap from Cloak. 2011-06-30 23:54:42 +12:00
Paul Chote
fc10b79e1d Capturable Biolab allows production of player-controlled viceroids. 2011-06-30 20:20:00 +12:00
Paul Chote
0236dd04ae Work around capturable tech bug. 2011-06-30 20:17:49 +12:00
Paul Chote
9657d697fc Add dino/vice icons, dino voices, crate effects from Sole Survivor 2011-06-30 20:16:16 +12:00
Paul Chote
b58e091892 Write graphics.log on Cg renderer errors. Fixes second half of #967. Untested. 2011-06-29 11:37:52 +12:00
Paul Chote
d62a21da14 Improve GLSL renderer debug logging: Define GL_INVALID_OPERATION error code (was previously error 1282); Include GL_RENDERER, GL_VERSION, GL_SHADING_LANGUAGE_VERSION in graphics.log; write graphics.log when CheckGlError fails. Fixes #966 and half of #967. 2011-06-29 11:33:25 +12:00
Chris Forbes
0e45968573 remove 'private' keyword where possible 2011-06-29 09:15:39 +12:00
Chris Forbes
587b2ef0d1 convert Buildable trait construction to concise style 2011-06-29 07:50:20 +12:00
Paul Chote
3305d5fad9 Update CHANGELOG 2011-06-29 02:26:41 +12:00
Paul Chote
adc9318a05 Add Muzzleflash to RA SAM Site. 2011-06-29 02:03:58 +12:00
Paul Chote
05dead8271 Don't ship demo.mix in packages 2011-06-29 00:05:10 +12:00
Paul Chote
3816cca667 Remove Tundra map and the snow tileset. Fixes #969. 2011-06-29 00:05:10 +12:00
Paul Chote
c58284d06f Increase ATWR range by 1. Fixes #941 (detection circle not visible). 2011-06-29 00:05:10 +12:00
Paul Chote
a7670f10ea Reduce SAM Site range. Fixes #954. 2011-06-29 00:05:10 +12:00
Paul Chote
05826c0c9b Fix Apache tooltip, halve it's damage. Fixes #952. 2011-06-29 00:05:10 +12:00
Chris Forbes
11dc069104 fix RALint prereqs checking 2011-06-28 23:36:39 +12:00
Chris Forbes
0080762bbc fixed #359 -- diplomacy panel shows player colors 2011-06-28 23:21:49 +12:00
Chris Forbes
43d8750aad fixed #728: BuildableInfo.BaseNormal -> GivesBuildableArea 2011-06-28 23:11:20 +12:00
Chris Forbes
fb027a5650 fix broken palette handling in editor on linux/mac 2011-06-28 22:05:10 +12:00
Chris Forbes
9ae566cd68 remove some inconsistency from linux packaging script 2011-06-28 21:02:52 +12:00
Paul Chote
3d442afcab Update AUTHORS 2011-06-28 02:03:18 +12:00
Daniel Hernandez
5e0817fc37 Remappable oil derricks. Fixes #502. 2011-06-27 20:43:30 +12:00
Paul Chote
09bcc16cb1 Fix capturable tech structures. 2011-06-27 20:24:05 +12:00
Paul Chote
9886c1f6fe Fix unremappable pixels in heli.shp (Fixes #965). 2011-06-27 20:10:02 +12:00
Paul Chote
de44833457 Don't mangle shadows/cursors 2011-06-27 18:35:47 +12:00
Paul Chote
ebc0cea217 Fix #961 2011-06-27 18:30:44 +12:00
Paul Chote
3ec5693f69 Fix repair depot crash 2011-06-26 16:12:18 +12:00
Paul Chote
2cdc3c4288 Fix e3 firing offset. Fixes #936. 2011-06-26 02:29:25 +12:00
Paul Chote
31cb1c017f Fix e4, e5 firing offsets. 2011-06-26 02:29:25 +12:00
Paul Chote
98f4db750b Support for changing infantry barrel offsets when prone. Fixes #935. 2011-06-26 02:29:25 +12:00
Paul Chote
9b8e927c33 Fix Ion Cannon cursor 2011-06-25 22:04:00 +12:00
Chris Forbes
8df0d973fa add RA:Aftermath music 2011-06-25 18:48:01 +12:00
Chris Forbes
9f5ee7fc1a add RA:Counterstrike music 2011-06-25 18:44:31 +12:00
Chris Forbes
cf4769979d fixed #899 -- OpenRA.Utility --png was missing unlock 2011-06-25 18:20:32 +12:00
Chris Forbes
a3601b1214 drop redundant virtuals from WithMuzzleFlash 2011-06-25 18:12:05 +12:00
Daniel Hernandez
6da5724af8 added new 2x2 oil derrick 2011-06-25 17:51:51 +12:00
Paul Chote
a4e319b9d2 Define a specific harvest cursor. Use attack for cnc harvest. 2011-06-25 17:40:34 +12:00
Paul Chote
fd2d15c0fe Work around #937. May have negative perf impact. 2011-06-25 16:43:51 +12:00
Paul Chote
fc37733c3c Add a screen-space offset to barrel positions, and fix HTNK firing offsets. Fixes #803, 929. 2011-06-25 15:25:22 +12:00
Paul Chote
b64c5e001e Add support for C&C Covert Ops music (fixes half of #824). 2011-06-25 14:43:45 +12:00
Paul Chote
24a649d491 Fix artillery firing offset. Fixes #928. 2011-06-25 14:06:54 +12:00
Paul Chote
2f07a38de0 Fix JEEP turret offset (Fixes #927) 2011-06-25 13:57:05 +12:00
Paul Chote
81d1444b4a Fix turreted muzzleflashes. 2011-06-25 13:54:30 +12:00
Paul Chote
016a082a76 Add Great Shot!' and Map theme' scores. Use Map theme for the shellmap. Fixes #913. 2011-06-25 13:32:16 +12:00
Chris Forbes
fabb89f4da disable component UI in windows installer 2011-06-25 12:26:45 +12:00
Lawrence Wang
1fa4cf5c0a Bug 856- Removal of extra few lines of code 2011-06-25 11:54:19 +12:00
Lawrence Wang
de5db51f25 Fixed #856 - created trait for ammo reload time, set for some aircraft 2011-06-25 11:54:12 +12:00
Chris Forbes
6be55b61aa fixed #934 -- convert all AttackBase.MuzzleFlash uses to WithMuzzleFlash 2011-06-25 11:51:04 +12:00
Chris Forbes
29b81be5bb removed obsolete data sln 2011-06-25 11:41:13 +12:00
Paul Chote
a59ff827b8 Update CHANGELOG 2011-06-25 00:18:17 +12:00
Paul Chote
b39880a845 SAM site muzzleflash (Fixes #923) 2011-06-25 00:17:49 +12:00
Paul Chote
6817332317 Rework apache weapon and firing offsets. Has duel machine guns with 10 shots, reloads all of its ammo every 8 seconds. Damage increased, and can now attack air. Fixes second half of #930. 2011-06-24 23:58:52 +12:00
Paul Chote
44c86928ec Rework orca weapons and firing offsets. Now fires a volley of 10 rockets, which reload at 2 per 3 seconds. Fixes half of #930. 2011-06-24 23:58:30 +12:00
Paul Chote
3b55b92573 Fix BGGY turret location (Fixes #926) 2011-06-24 20:56:45 +12:00
Paul Chote
24266ebc93 Autodetect CD instead of prompting the user. Fixes #911. Requires testing under Windows and Linux. 2011-06-24 19:08:29 +12:00
Paul Chote
dc9b0adba9 Kill unused map installation code. 2011-06-24 17:26:33 +12:00
Paul Chote
916e63710c Fix #892 2011-06-24 17:08:58 +12:00
Paul Chote
8122d63a74 Remove SSM from Nod 2011-06-24 01:40:00 +12:00
Paul Chote
edbc7a028b Artillery goes back to Nod 2011-06-24 01:21:17 +12:00
Paul Chote
06c32a728a Update CHANGELOG 2011-06-24 00:40:58 +12:00
Paul Chote
35a5fc3356 Work around for #902. 2011-06-24 00:40:58 +12:00
Paul Chote
2d34169d79 Fix harv/proc/selling interaction. Fix formatting issues in OreRefinery. (Fixes #901, #903) 2011-06-24 00:40:58 +12:00
Paul Chote
122c7ec569 Don't show bounty cashticks of $0. 2011-06-24 00:40:58 +12:00
Paul Chote
ef8b6b2e71 Remove FlyOffMap.Interruptable. Fixes #906. 2011-06-24 00:40:58 +12:00
Paul Chote
78502317aa APC becomes an Anti-Air transport. Will need new turret artwork. 2011-06-24 00:40:57 +12:00
Paul Chote
1848405795 Rocket Launcher (MSAM) rework. Now fires 6 unguided rockets, has a fixed turret, cannot target air. 2011-06-24 00:40:57 +12:00
Paul Chote
41def5fef5 Split STNK weapon from MSAM, give it burst 2, and set correct barrel offsets. Doubles effective STNK damage. (Fixes #907) 2011-06-23 18:45:35 +12:00
Paul Chote
60a4a06ee4 Restore APC cargo pips (Fixes #910). 2011-06-23 18:13:08 +12:00
Paul Chote
ec3d467858 HackyAI supports teams (Fixes #917). 2011-06-23 17:41:38 +12:00
Paul Chote
6ed0c574be Update CHANGELOG 2011-06-22 22:33:57 +12:00
Paul Chote
099ede0428 Halve bridge strength 2011-06-21 20:44:19 +12:00
Paul Chote
65f1427bf2 Fix some other bogus bits in Bridge 2011-06-21 20:35:19 +12:00
Paul Chote
5e220a9ac7 Fix #306 2011-06-21 20:35:08 +12:00
Paul Chote
af4093f380 Swap the default value for FlyOffMap.Interruptible. The common case (scripted aircraft) don't want to be interruptible. Fixes badr desync caused by the mono 2.6.7 compiler dropping initializers for bools that default to true. 2011-06-21 14:20:08 +12:00
Paul Chote
74b2b36a40 Clean up and merge #883 2011-06-21 13:34:38 +12:00
Curtis S
bb2e514dfd Fixed title in ra map "Center of Attention" 2011-06-21 13:14:05 +12:00
Paul Chote
6feccab5db Add map-player check to SurrenderOnDisconnect 2011-06-21 03:41:36 +12:00
Paul Chote
1cdfd44d43 Fix #897. 2011-06-21 03:40:39 +12:00
Paul Chote
ce65127e34 Fix observer tooltips (Bug #769) 2011-06-21 02:51:50 +12:00
Paul Chote
e33995d71b Don't display a tooltip for actors without the Tooltip trait 2011-06-21 02:48:52 +12:00
Paul Chote
088573f2b7 Disable controls instead of hiding when ready. Fixes #889 2011-06-20 22:50:32 +12:00
Paul Chote
7838896c81 Display bot spawns to everyone, not just the host. 2011-06-20 22:50:32 +12:00
Paul Chote
43aae99dd0 Fix #888 2011-06-20 22:50:32 +12:00
Paul Chote
49dfbd43b7 Fix #896 2011-06-20 22:50:32 +12:00
Paul Chote
347a80f0a7 Unbitrot GDI01. The broken rules overrides have been left as a testcase for #768 2011-06-20 22:50:32 +12:00
Paul Chote
c014731a2f Fix Map.PlayerCount 2011-06-20 22:50:31 +12:00
Paul Chote
bafa411329 Expose LockTeam/LockSpawn to mappers 2011-06-20 22:50:31 +12:00
Paul Chote
8875d1adee Skirmish starts with the last used map. 2011-06-20 22:50:31 +12:00
Paul Chote
4fa9a2ba2b Group the music button on the left 2011-06-20 22:50:31 +12:00
Paul Chote
e00bfd487d Hook up the spawn selector. 2011-06-20 22:50:31 +12:00
Paul Chote
c80fbaacd5 Add a spawnpoint selector for bots (selector logic unimplemented) 2011-06-20 22:50:30 +12:00
Paul Chote
b4ce97691b Use images instead of checkboxes for non-editable status fields and fix player template naming: local/remote -> editable/non-editable. 2011-06-20 22:50:30 +12:00
Paul Chote
ac68f9dab3 Remove Bot: label from bots in the slot dropdown. 2011-06-20 22:50:30 +12:00
Paul Chote
e7543f28df Fix naming of Player.PlayerReference. 2011-06-20 22:50:29 +12:00
Paul Chote
91b31b1981 Rewrite ChooseInitialStance to support bot teams and remove obsolete crap. 2011-06-20 22:50:29 +12:00
Paul Chote
4f172d7ed8 Make bots first-class players.
- Bots have their own Clients, with unique ClientIDs
 - Hosts can set bot team/color in the lobby
 - Bots are kicked when switching to a smaller map without enough slots
 - Order validator assumes that only client 0 has permission to issue bot orders
2011-06-20 22:50:29 +12:00
Paul Chote
0c9190a1af Enforce color/race/team locking 2011-06-20 22:50:28 +12:00
Paul Chote
19d74fef52 Server support for host changing other client's race/color/team/spawn 2011-06-20 22:50:28 +12:00
Paul Chote
d2df5722b5 Fix the lobby slots.
- lobbyInfo.Slots is now a dictionary, keyed by the name of the PlayerReference that the slot is tied to.
 - LockRace/Color/Team is now specified on the slot, avoiding map lookups in the lobby
 - Observers are no longer tied to slots -> players will join as observers instead of crashing the game if there are no available slots
 - Observers are able to change their name and color
2011-06-20 22:50:27 +12:00
Paul Chote
e934baa6e9 Better bot spawning code; better random color and proper player names. 2011-06-20 22:50:27 +12:00
Paul Chote
0899916406 Disable diplomacy and cheats for observers 2011-06-20 22:50:26 +12:00
Paul Chote
532bd42aed Remove obsolete Player index cruft 2011-06-20 22:50:26 +12:00
Paul Chote
bcbd18bb52 Skirmish mode starts with a bot selected. 2011-06-20 22:50:22 +12:00
Paul Chote
c6182f6039 Fix player connected chat message 2011-06-20 14:39:03 +12:00
Chris Forbes
3409d8f046 remove type-specific functions for ChromeMetrics.Get; use FieldLoader 2011-06-20 14:39:03 +12:00
Paul Chote
7095f293ff Fix #865 2011-06-20 14:39:03 +12:00
Paul Chote
63e77755b7 Fix #864 - don't display the depressed state if the checkbox is disabled 2011-06-20 14:38:59 +12:00
Paul Chote
d043f4807f Make the checkbox depressed state optional, and disabled in ra. 2011-06-20 14:34:29 +12:00
Paul Chote
94bca753d2 Fix #866 2011-06-20 13:03:23 +12:00
Paul Chote
9bf0a97327 Fix RMBO death sequences 2011-06-20 13:03:23 +12:00
Paul Chote
fe5ef82cdf Allow bot players to be created via map.yaml 2011-06-20 13:03:23 +12:00
Paul Chote
64497c9b2f Fix exploding walls 2011-06-20 13:03:23 +12:00
Paul Chote
2f86208a9a Swap mod and replay buttons 2011-06-20 13:03:23 +12:00
Paul Chote
568814b15a Display cnc mod version in the main menu 2011-06-20 13:03:23 +12:00
Paul Chote
7fb46bb2b6 Work around CreateLocalServer miscompile 2011-06-20 13:03:20 +12:00
Paul Chote
00b730ab0f Update changelog 2011-06-01 19:18:26 +12:00
Paul Chote
b487476ea9 Remove Game.AfterGameStart 2011-06-01 19:18:21 +12:00
Paul Chote
2ebb2ae921 Remove static handler crap from widget delegates - Register/unregister events manually (ra & cnc). 2011-06-01 19:15:55 +12:00
Paul Chote
add29e845e Fix orphaned DropDown panels (eg when exiting menus using a hotkey) 2011-06-01 18:53:41 +12:00
Paul Chote
ad3f378545 Add a hook for widgets being removed, and ensure widgets are removed consistently. 2011-06-01 18:50:59 +12:00
Paul Chote
bbce4368d9 Remove some crap from ra ServerBrowserLogic 2011-05-31 21:22:29 +12:00
Mike Bundy
fcceac1730 GPS fix 2011-05-31 20:44:01 +12:00
Curtis S
b64f883658 Moved Medic cost down to 500 from 800 2011-05-31 20:44:01 +12:00
Curtis S
571386f987 Added 13 new RA maps by buddha, hamb, seru 2011-05-31 20:44:01 +12:00
Curtis S
ed26c7c0b4 Fixed open grass areas in koth-crossroads 2011-05-31 20:44:01 +12:00
Curtis S
5f8e5d6da5 Fixed open grass/water/sea areas on community made maps 2011-05-31 20:44:01 +12:00
Paul Chote
9a2f04ce2d Fix cheats button width 2011-05-31 20:44:00 +12:00
Paul Chote
bce8e0ab1d Fix ftnk firing offsets. 2011-05-31 20:44:00 +12:00
Paul Chote
e79d8133d4 Fix ATWR firing offsets. Add a burst delay. 2011-05-31 20:44:00 +12:00
Paul Chote
489487c96c Fix OBLI fire offset 2011-05-31 20:44:00 +12:00
Paul Chote
9b858af2b7 Add muzzleflash to GTWR. WithMuzzleFlash now actually uses the turret position. 2011-05-31 20:44:00 +12:00
Paul Chote
99611f66de Nerf FTNK 2011-05-31 20:44:00 +12:00
Paul Chote
41819354ac Fix selection box dragging behind other ui elements 2011-05-31 20:44:00 +12:00
Paul Chote
6512db14cf Fix #845 (spawnpoint artwork leaks across mod change) 2011-05-30 22:15:15 +12:00
Paul Chote
c07abc48b2 Remove some nonfunctional code in BuildPaletteWidget 2011-05-30 22:15:15 +12:00
Paul Chote
b425d770c5 Correct parameter order in IOrderTargeter.CanTargetLocation interface definition 2011-05-30 22:15:15 +12:00
Paul Chote
922f4754f9 Drop the ControlGroupModifier setting. Use Cmd on osx for group addition. 2011-05-30 22:15:15 +12:00
Paul Chote
2d43d656c2 Remove bs settings state tracking 2011-05-30 22:15:14 +12:00
Paul Chote
81515705ec Add keyboard shortcut support to ButtonWidgets.
Hook up 'escape' and 'return' as appropriate for moving through menus.
2011-05-30 22:15:14 +12:00
Paul Chote
124f19f00b Bind skirmish servers to a random available port 2011-05-30 22:15:14 +12:00
Paul Chote
a288c5df15 Use static ctors for static setup. 2011-05-30 22:15:14 +12:00
Chris Forbes
a5fdfbfd60 fix water artifacts on cnc shellmap 2011-05-30 22:03:47 +12:00
Chris Forbes
f84312acb9 add editor hack for fixing open areas in existing ra maps 2011-05-30 21:59:25 +12:00
Chris Forbes
5531715652 fixed 850 -- rallypoint flags staying original owner's color after capture 2011-05-30 21:35:35 +12:00
Chris Forbes
368468e323 format RenderSimple 2011-05-30 21:32:54 +12:00
Chris Forbes
61cde675ea fixed 741 -- use the correct superweapon building when more than one is available and some are disabled 2011-05-30 21:26:05 +12:00
Chris Forbes
7ac57014fb tidy 2011-05-30 21:17:25 +12:00
Chris Forbes
596e64e527 remove ReverseEnterTransport -- 852 2011-05-30 21:15:56 +12:00
Chris Forbes
d54c632812 remove unused LinkProc function 2011-05-30 20:59:11 +12:00
Chris Forbes
09027d4770 fixup in RenderCargo 2011-05-30 20:58:18 +12:00
Chris Forbes
05bb335ce2 fix missing center panel part on fancy tooltips 2011-05-30 20:52:16 +12:00
Chris Forbes
0ba41acf4a add muzzle flashes to pbox/hbox 2011-05-30 20:50:45 +12:00
Chris Forbes
e24c8971b6 fixed 796 -- AttackTurreted sets IsAttacking correctly now. 2011-05-30 20:14:43 +12:00
Chris Forbes
24586ac056 fixed 771 -- adds Passenger.Weight, Cargo.MaxWeight, Cargo.PipCount 2011-05-30 20:09:22 +12:00
Chris Forbes
faf0ea387f small cleanup 2011-05-30 19:37:16 +12:00
Chris Forbes
6fd4b565c9 reinstate required hack in GainsExperience.InnerModifyRender 2011-05-23 22:16:21 +12:00
Chris Forbes
4cafabc1f3 fixed 773 -- ftur firing offset 2011-05-23 19:59:48 +12:00
Chris Forbes
aca4d2ebbb fixed 823 -- mouse interaction with password fields uses the metrics of the mask character, not the actual content 2011-05-23 19:57:40 +12:00
Chris Forbes
0d63e9f999 fix glitchyness on repairing veteran units 2011-05-23 19:48:59 +12:00
Chris Forbes
0bd4d6d417 remove unused duplicated function from GraphicsDevice 2011-05-23 19:47:20 +12:00
Chris Forbes
5ecc1ebefc split IGraphicsDevice.{Present,PumpInput} 2011-05-22 22:10:48 +12:00
Chris Forbes
77686adc1a remove batch spam from PerfGraphWidget 2011-05-22 22:05:49 +12:00
Chris Forbes
ef03d46f13 eradicate 'delegate' misuse 2011-05-22 22:02:09 +12:00
Chris Forbes
4b12a19af0 remove Renderer.Resolution duplication everywhere -- it's not free. 2011-05-22 21:38:54 +12:00
Chris Forbes
5ad2c43761 remove duplicated crap from CncLoadScreen 2011-05-22 21:34:59 +12:00
Chris Forbes
fdfa3fc1d3 start cleaning GameInitDelegate 2011-05-22 21:33:48 +12:00
Chris Forbes
41124a12f2 remove bogus empty delegates dir from Game 2011-05-22 21:33:47 +12:00
Chris Forbes
66c72d14d8 split scrollthumb/button in chrome data; fixes screwed up RA scrollthumbs 2011-05-22 21:33:47 +12:00
Chris Forbes
d8ff3b8d3a fix 704 -- parachute offsets are configurable, and sensible now for infantry 2011-05-22 21:33:46 +12:00
Chris Forbes
b792d07c8c start reworking player setup 2011-05-22 21:33:34 +12:00
Chris Forbes
cf5d49a328 fix some subtle crap in map upgrader 2011-05-22 20:41:38 +12:00
Chris Forbes
3bbcbf4701 fix #772 -- GivesBounty uses Actor.GetSellValue 2011-05-22 20:41:37 +12:00
Chris Forbes
0807f4ca8d 782 fixed -- friendly units no longer trigger mines 2011-05-22 20:41:37 +12:00
Chris Forbes
4c36403b75 783 fixed -- mines are visible to spec and allies now 2011-05-22 20:41:36 +12:00
Chris Forbes
f319307b43 fix 776 -- support custom SHPs & bright/dim zap count in TeslaZap projectile type 2011-05-22 20:41:35 +12:00
Chris Forbes
81eaf091c2 fix 752 -- utility --png takes a palette filename as well 2011-05-22 20:41:35 +12:00
Chris Forbes
a0e015746f move MakeSystemPalette out of editor.RenderUtils; rename to Palette.AsSystemPalette() 2011-05-22 20:41:34 +12:00
Chris Forbes
e839ae33d8 hax 2011-05-22 20:41:34 +12:00
Chris Forbes
90cea9f73d expose temp VBO tuning parameters in settings 2011-05-22 20:41:31 +12:00
Chris Forbes
cd6f77ca7c move terrain palette constant lookup outside terrain setup inner loop 2011-05-22 20:39:01 +12:00
Chris Forbes
83c80377d0 formatting in Building 2011-05-22 20:39:01 +12:00
Chris Forbes
b3908606c3 remove some silly cost centers in Building 2011-05-22 20:39:00 +12:00
Chris Forbes
af083a39f0 actually emit the list of missing extensions in the error message. 2011-05-22 20:38:59 +12:00
Chris Forbes
f406504147 add render_flip to perf history 2011-05-22 20:38:59 +12:00
Chris Forbes
fe392bd42d add render_widgets to perf history 2011-05-22 20:38:58 +12:00
Chris Forbes
52f79f232e correctly requote arguments to zenity 2011-05-22 20:38:58 +12:00
Chris Forbes
9434dd993a slight cleanup in Renderer 2011-05-22 20:38:57 +12:00
Chris Forbes
a52d7fb496 fix leaky textures & vbos 2011-05-22 20:38:56 +12:00
Chris Forbes
75588b050e improve error message in CreateDevice 2011-05-22 20:38:56 +12:00
Chris Forbes
1d406bde75 #753 fixed 2011-05-22 20:38:55 +12:00
Chris Forbes
bc48044788 fix #742 tsla & ttnk offsets (from djohe) 2011-05-22 20:38:55 +12:00
Chris Forbes
0eff17240c fix #743 (from djohe) 2011-05-22 20:38:54 +12:00
Chris Forbes
b22bb84349 make AttackMoveActivity a bit less aggressive about pwning the tick perf 2011-05-22 20:38:54 +12:00
Chris Forbes
375eb90a88 fix perf of HackyAI AssignRoles, to some extent 2011-05-22 20:38:53 +12:00
Chris Forbes
9b3e6c5c4a remove FP sillyness from FindUnits & friends 2011-05-22 20:38:52 +12:00
Chris Forbes
ccc245ded4 reintroduce Cached<T>; use for Actor.Bounds, Actor.ExtendedBounds, which replace Actor.GetBounds(bool) 2011-05-22 20:38:48 +12:00
Chris Forbes
b12a35af4c more trivial cleanups 2011-05-22 20:36:25 +12:00
Chris Forbes
599ee25cb1 adjust strictness of Production query in ChooseBuildTabOnSelect 2011-05-22 20:36:25 +12:00
Paul Chote
d4baf2d757 Refactor UnitInfluence trait -> world.ActorMap 2011-05-22 19:32:53 +12:00
Paul Chote
d6496cb5be Remove GainsExperience from mcv, harv, e6. 2011-05-22 19:32:53 +12:00
Paul Chote
4f7074fdf9 Don't give a levelup crate if the unit can't gain experience 2011-05-22 19:32:53 +12:00
Chris Forbes
668dfa1f6f don't show cashticks when there is no refund 2011-05-22 19:32:52 +12:00
Paul Chote
b0fd954b80 BRIK after AFLD/WEAP 2011-05-22 19:32:52 +12:00
Paul Chote
b9ceaae4dd All vehicles leave husks 2011-05-22 19:32:52 +12:00
Paul Chote
d8262486f9 Fix bogus attack-move with harv and apc 2011-05-22 19:32:52 +12:00
Paul Chote
13a2dc6866 Ftnk explodes on death. 2011-05-22 19:32:52 +12:00
Paul Chote
6f6e1b342c Tweak proc price, footprint 2011-05-22 19:32:52 +12:00
Paul Chote
7a2b78b1d8 Fix diplomacy/cheats menu stacking 2011-05-22 19:32:25 +12:00
Chris Forbes
cd756885a6 remove MasterServerQuery in favour of ServerList 2011-05-22 18:41:33 +12:00
Paul Chote
53426030ee Fix hover for ra dropdowns (also scrollpanels) 2011-05-22 18:41:33 +12:00
Paul Chote
325fd509b0 Remove obsoleted dropdown & label code 2011-05-22 18:41:33 +12:00
Paul Chote
d029b1ff6f Use new mechanism for stances / color picker 2011-05-22 18:41:32 +12:00
Paul Chote
0c9692c0b1 Use new mechanism for mod list 2011-05-22 18:41:32 +12:00
Paul Chote
078972e3be Use new mechanism for ra dropdowns 2011-05-22 18:41:32 +12:00
Paul Chote
ab298e1eae Remove redundancy from dropdown setup 2011-05-22 18:41:32 +12:00
Paul Chote
d7a0445e59 Remove ContainerWidget.Background 2011-05-22 18:41:32 +12:00
Paul Chote
7a21309d67 Use ScrollItem for ra music list 2011-05-22 18:41:32 +12:00
Paul Chote
46c870b967 Use ScrollItem for ra map browser 2011-05-22 18:41:32 +12:00
Paul Chote
db417545e6 Use ScrollItem for ra replay browser 2011-05-22 18:41:32 +12:00
Paul Chote
1d24c5f49c Use ScrollItem in ra server browser 2011-05-22 18:41:32 +12:00
Paul Chote
dc6bd60fcc Kill CheckboxWidget.Bind and related 2011-05-22 18:41:32 +12:00
Paul Chote
b1cc004194 Remove obsolete calls from ra SettingsMenuDelegate 2011-05-22 18:41:31 +12:00
Paul Chote
dbd16076a5 Remove unused video player from ra 2011-05-22 18:41:31 +12:00
Paul Chote
5cb0be6c4b Remove obsolete calls from ra DeveloperModeDelegate 2011-05-22 18:41:31 +12:00
Paul Chote
35673a058a Remove obsolete Bold field from widgets 2011-05-22 18:41:31 +12:00
Paul Chote
8eb4e663d2 Fix obsolete Game.Disconnect() 2011-05-22 18:41:31 +12:00
Paul Chote
16cd1679dd Fix special power bin position 2011-05-22 18:41:31 +12:00
Paul Chote
74d068423b Give a sensible error instead of spawning inaccessible filepickers when Fullscreen. 2011-05-22 18:41:30 +12:00
Paul Chote
cb53bcd17d Loadscreen tweaks 2011-05-22 18:41:30 +12:00
Paul Chote
13ceafb658 Fix music install crash. 2011-05-22 18:41:30 +12:00
Paul Chote
bafd12b88e Loadscreen progress bar 2011-05-22 18:41:30 +12:00
Paul Chote
126e489a10 More fluff 2011-05-22 18:41:30 +12:00
Paul Chote
f2f59e3f93 Eva logo. Disable scanlines 2011-05-22 18:41:30 +12:00
Paul Chote
e73248f55c Use the scrollbar arrow "pressed" variants 2011-05-22 18:41:29 +12:00
Paul Chote
75cee824be Move checkbox and button bits to chrome.svg 2011-05-22 18:41:29 +12:00
Paul Chote
3faf78ddd0 New spawnpoint artwork 2011-05-22 18:41:29 +12:00
Paul Chote
eb6c55e289 Merge music buttons into chrome.svg 2011-05-22 18:41:29 +12:00
Paul Chote
939a667229 Merge install logo into chrome.png. Display faction logos on install screen 2011-05-22 18:41:29 +12:00
Paul Chote
f577525fad Remove redundant cnc art src 2011-05-22 18:41:29 +12:00
Paul Chote
aef6223c6c Add logos to the loadscreen 2011-05-22 18:41:29 +12:00
Paul Chote
dcaa161bd1 Diplomacy menu 2011-05-22 18:41:28 +12:00
Paul Chote
84a99be18e Split CncIngameMenuLogic into its own file 2011-05-22 18:41:28 +12:00
Paul Chote
aaecd6ce92 "Battle control terminated" 2011-05-22 18:41:28 +12:00
Paul Chote
18c9a719ac Mission Accomplished / Lost notifications (cnc + ra) 2011-05-22 18:41:28 +12:00
Paul Chote
9f17afe289 Fix racing ticks at gamestart 2011-05-22 18:41:28 +12:00
Paul Chote
797a95ad93 Fade in the menu palette effect over a few frames 2011-05-22 18:41:25 +12:00
Paul Chote
9822afcdb8 New loadscreen 2011-05-21 17:26:20 +12:00
Paul Chote
3ea1534082 Show current title and volume slider in music player 2011-05-21 17:26:20 +12:00
Paul Chote
91a3aafa67 Split the download/install logic into multiple files. 2011-05-21 17:26:20 +12:00
Paul Chote
c76d2e37dc Make the sound engine less dumb about music. Fix the music player not knowing about already playing tracks. 2011-05-21 17:26:20 +12:00
Paul Chote
42d8722cbc Merge DropDownButtons 2011-05-21 17:26:20 +12:00
Paul Chote
58e3a1f41e Use the new dropdowns everywhere 2011-05-21 17:26:20 +12:00
Paul Chote
b2c60e0876 Fix graphics mode dropdown 2011-05-21 17:26:20 +12:00
Paul Chote
5bc0ef69ad Pass WidgetArgs to Widget.Initialize. Use this to allow for custom substitutions. 2011-05-21 17:26:20 +12:00
Paul Chote
b417118429 Prototype text dropdown 2011-05-21 17:26:20 +12:00
Paul Chote
e8d652ad63 New method for attaching panels to dropdowns. Implemented for colorpicker. 2011-05-21 17:26:20 +12:00
Paul Chote
85c519c073 Normalize checkboxes 2011-05-21 17:26:19 +12:00
Paul Chote
14af766427 Remove some duplication from widgets that draw fake buttons. 2011-05-21 17:26:19 +12:00
Paul Chote
b3f9725872 Mark another obsolete field 2011-05-21 17:26:19 +12:00
Paul Chote
04e5794678 Normalize slider 2011-05-21 17:26:19 +12:00
Paul Chote
e09cd16042 Normalize scrollpanel 2011-05-21 17:26:19 +12:00
Paul Chote
adb67699e1 Move ScrollItem upstream 2011-05-21 17:26:19 +12:00
Paul Chote
e09ccef48b Normalize TextFields 2011-05-21 17:26:19 +12:00
Chris Forbes
aa772db9a7 fix crashy behavior in TextFieldWidget 2011-05-21 17:26:19 +12:00
Chris Forbes
a96b1ce01c add property support to FieldLoader 2011-05-21 17:26:19 +12:00
Chris Forbes
310ecc34ce clean up usings everywhere 2011-05-21 17:26:18 +12:00
Paul Chote
eb8aafced0 Normalize ButtonWidgets 2011-05-21 17:26:18 +12:00
Paul Chote
3eb3ae76f0 Fix progressbars 2011-05-21 17:26:18 +12:00
Paul Chote
a9bbb5f5c2 Improve manifest parsing 2011-05-21 17:26:18 +12:00
Paul Chote
e2bd20f888 Reorder sequence loading to save batches 2011-05-21 17:26:18 +12:00
Paul Chote
239a96718d Throw a slightly more useful error on duplicate keys 2011-05-21 17:26:18 +12:00
Paul Chote
d7f009b218 Use the font dictionary everywhere 2011-05-21 17:26:18 +12:00
Paul Chote
e1c8658fdc Fonts are now defined in mod.yaml 2011-05-21 17:26:18 +12:00
Paul Chote
ab423fbe8c Mark some bits obsolete 2011-05-21 17:26:18 +12:00
Paul Chote
2075c7033b Refactor scrollpanel items into their own widget 2011-05-21 17:26:18 +12:00
Paul Chote
033880862d Remove last uses of Bold: in cnc 2011-05-21 17:26:18 +12:00
Paul Chote
a65021b550 Merge most of the new ui into a single texture 2011-05-21 17:26:17 +12:00
Paul Chote
810953ea94 Cheats menu 2011-05-21 17:26:17 +12:00
Paul Chote
0b0fac3c4b Shellmap music 2011-05-21 17:26:17 +12:00
Paul Chote
cb565e5d3c Wire up the settings panel 2011-05-21 17:26:17 +12:00
Paul Chote
ce901427bc Nonfunctional settings panel prototype 2011-05-21 17:26:17 +12:00
Paul Chote
76545db7fd Allow custom CncCheckbox fonts. Tweak CncScrollbar rendering. 2011-05-21 17:26:17 +12:00
Paul Chote
665b6c2b8e Fix server browser 2011-05-21 17:26:17 +12:00
Paul Chote
87cfd0a077 Fix sidebar interaction 2011-05-21 17:26:17 +12:00
Paul Chote
32640d0300 Remove range slider, add a random button 2011-05-21 17:26:17 +12:00
Paul Chote
3e2a49934c Don't use a static variable for player palette preview. 2011-05-21 17:26:16 +12:00
Paul Chote
1526b6ff37 Make Game.LoadWidget / Widget.LoadWidget consistent. 2011-05-21 17:26:16 +12:00
Paul Chote
21267688b0 Split the colorpicker logic into its own handler. Game.LoadWidget no longer adds the loaded widget to the RootWidget. 2011-05-21 17:26:16 +12:00
Paul Chote
529ed51034 Nit: use ServerSettings to pass info to the server 2011-05-21 17:26:16 +12:00
Paul Chote
f4ea4c5daa Add a WidgetArgs type to work around gmcs not understanding lambda -> Action -> object. 2011-05-21 17:26:16 +12:00
Paul Chote
603379aa96 Fix nits 2011-05-21 17:26:16 +12:00
Paul Chote
61facc7bb1 Let panels handle closing themselves 2011-05-21 17:26:16 +12:00
Paul Chote
5fffc9d816 Don't tell the master server about local servers 2011-05-21 17:26:16 +12:00
Paul Chote
f0f591c6fb Initial settings menu copied from the old impl. 2011-05-21 17:26:16 +12:00
Paul Chote
be79529d9e Perf debug 2011-05-21 17:26:15 +12:00
Paul Chote
00f0773dc1 Clear state correctly on mod transition 2011-05-21 17:26:15 +12:00
Paul Chote
e8926ccad3 Initial no-frills mod selector 2011-05-21 17:26:15 +12:00
Paul Chote
fb4a5d4083 Fix mapchooser button order 2011-05-21 17:26:15 +12:00
Paul Chote
80d5b67bb9 Music installation 2011-05-21 17:26:15 +12:00
Paul Chote
dfb07153c6 Rollover etc CncDropDownButtonWidgets 2011-05-21 17:26:15 +12:00
Paul Chote
86159f9ddc Fix lobby color picker 2011-05-21 17:26:15 +12:00
Paul Chote
c4f40babb5 Reimplement music player 2011-05-21 17:26:14 +12:00
Paul Chote
7c18614bf3 Fix observers 2011-05-21 17:26:14 +12:00
Paul Chote
ab28f5867f Disallow watching replays with zero duration. 2011-05-21 17:26:14 +12:00
Paul Chote
814845730f Work around a race condition with local servers. 2011-05-21 17:26:14 +12:00
Paul Chote
33a4f5e29e Support loopback servers for solo play 2011-05-21 17:26:14 +12:00
Paul Chote
b1a6eec3d3 Stop using MasterServerQuery in server browser 2011-05-21 17:26:14 +12:00
Paul Chote
2f9ec67510 Fix the server browser player count 2011-05-21 17:26:14 +12:00
Paul Chote
655eb123b9 Give more polished error messages 2011-05-21 17:26:14 +12:00
Paul Chote
3d493d3ace Package download works. Download error messages need polish. 2011-05-21 17:26:14 +12:00
Paul Chote
37577afc36 Polish 2011-05-21 17:26:13 +12:00
Paul Chote
6a1f3cfc18 Installing from CD reimplemented 2011-05-21 17:26:13 +12:00
Paul Chote
93e55d0866 Install logo 2011-05-21 17:26:13 +12:00
Paul Chote
372d2f5426 Saner load code for cnc. Installing not yet implemented. 2011-05-21 17:26:10 +12:00
Paul Chote
3d347848f3 Remove another hardcoded widget reference and prepare for saner init code. 2011-05-21 17:25:45 +12:00
Paul Chote
2e1e8fd7e8 Apply desat effect on ingame menu too 2011-05-21 17:25:45 +12:00
Paul Chote
d95138b600 Use the same mechanism for loading ingame and shellmap ui. 2011-05-21 17:25:45 +12:00
Paul Chote
07d5f91325 Add scanlines 2011-05-21 17:25:45 +12:00
Paul Chote
6fa9eeb5bb Prompt before quit / surrender 2011-05-21 17:25:45 +12:00
Paul Chote
33b35f768e Nits 2011-05-21 17:25:44 +12:00
Paul Chote
8957caeaca Basic ingame menu reimplemented. 2011-05-21 17:25:44 +12:00
Paul Chote
5e32cd38eb Fix initial selected map, naming. 2011-05-21 17:25:44 +12:00
Paul Chote
7db1b5a1a0 Add a hover state for scrollpanel entries 2011-05-21 17:25:44 +12:00
Paul Chote
fdf9927854 Remember the last map. Disable the server desc and password fields. Draw the chat entry box on top of the display box. 2011-05-21 17:25:44 +12:00
Paul Chote
805f61cc4b Bugfix when connecting via server browser 2011-05-21 17:25:44 +12:00
Paul Chote
fd6c0a90c6 Show the host/port in the dialogs. Show the failed dialog in the lobby when the server vanishes. 2011-05-21 17:25:43 +12:00
Paul Chote
5c59f7703d Reimplement connecting / connection failed dialogs. 2011-05-21 17:25:43 +12:00
Paul Chote
a607a60b8f New textfield with support for hover and disabled states. 2011-05-21 17:25:43 +12:00
Paul Chote
1881a6b713 Generalize the map chooser to work anywhere. Hook it up in server creation. 2011-05-21 17:25:42 +12:00
Paul Chote
1c1b89948a Add a server password field and map name 2011-05-21 17:13:20 +12:00
Paul Chote
09526ee2dd New create server layout 2011-05-21 17:13:20 +12:00
Paul Chote
99eb6ab774 Start reimplementing server creation 2011-05-21 17:13:20 +12:00
Paul Chote
9f4eba9003 Tweaks. The primary button feels better on the right. 2011-05-21 17:13:20 +12:00
Paul Chote
c9dd1aa4bd Improved replay browser 2011-05-21 17:13:20 +12:00
Paul Chote
14a904ab7a Start reimplementing replay browser 2011-05-21 17:13:18 +12:00
Paul Chote
57530c819b Direct Connect panel 2011-05-21 16:28:20 +12:00
Paul Chote
dded6040d6 Convert remaining buttons and checkboxes to cnc variants 2011-05-21 16:28:20 +12:00
Paul Chote
1e66d57ef1 Refactor font code out of LabelWidget 2011-05-21 16:28:17 +12:00
Paul Chote
188a16fc08 Cnc scrollpanel with support for rollover etc. 2011-05-21 16:27:38 +12:00
Paul Chote
d349c5341e Map chooser 2011-05-21 16:27:38 +12:00
Paul Chote
44d3412c7b Fix checkbox active area 2011-05-21 16:27:38 +12:00
Paul Chote
16c3f75269 Color tweaks 2011-05-21 16:27:38 +12:00
Paul Chote
8685d34703 New chat display 2011-05-21 16:27:37 +12:00
Paul Chote
5647917fda New checkboxes (independent from old checkboxes) that support hover and disable. 2011-05-21 16:27:37 +12:00
Paul Chote
c15d2f5cfe Simply the common case for buttons. 2011-05-21 16:27:37 +12:00
Paul Chote
b73575f37b Missed a couple of static bits. 2011-05-21 16:27:37 +12:00
Paul Chote
6cb0cb7d0e Can now start a game and disconnect from lobby without triggering a reload.
It is now possible to crash the game by starting a new server before the previous one has had time to timeout and release the port binding (the previous loadscreen pause meant this was always hidden).
2011-05-21 16:27:37 +12:00
Paul Chote
03264fa2ca Start reimplementing lobby. 2011-05-21 16:27:37 +12:00
Paul Chote
28cf48459b New menu buttons that support hover and a disabled state 2011-05-21 16:27:37 +12:00
Paul Chote
845b32281d Reimplement server browser 2011-05-21 16:27:37 +12:00
Paul Chote
6e3a88f670 Remove most of the chrome yaml. It will all be rewritten. 2011-05-21 16:27:37 +12:00
Paul Chote
a3b430c24a Remove engine references to MAINMENU_BG. Don't push the menu background onto the window list. Crashes whenever a delegate tries to open MAINMENU_BG. 2011-05-21 16:27:37 +12:00
Paul Chote
f74b1b6d27 Hook up Skirmish button 2011-05-21 16:27:36 +12:00
Paul Chote
8661415e67 Settings submenu 2011-05-21 16:27:36 +12:00
Paul Chote
7dd6857ae7 Add a Multiplayer menu 2011-05-21 16:27:36 +12:00
Paul Chote
3e6d1fc1e2 New button layout 2011-05-21 16:27:36 +12:00
Paul Chote
79674b7418 buttons 2011-05-21 16:27:36 +12:00
Paul Chote
7a49a3436e Shellmap border 2011-05-21 16:27:36 +12:00
Paul Chote
f3244d5750 Add a targeting reticle 2011-05-21 16:27:36 +12:00
Paul Chote
214697a506 Tweak menu layout 2011-05-21 16:27:36 +12:00
Paul Chote
550b4495a8 Add a black&white palettemod 2011-05-21 16:27:34 +12:00
Paul Chote
b825ddbb05 Convert cnc shellmap oramap -> directory 2011-05-21 16:27:07 +12:00
Chris Forbes
24d9e292dd wire up ButtonWidget.VisualHeight to ChromeMetrics as an example 2011-05-21 16:27:06 +12:00
Chris Forbes
b183366d54 add ChromeMetrics for values we dont want to duplicate everywhere 2011-05-21 16:27:06 +12:00
Paul Chote
c270f9ff4a Refactor text wrapping into WidgetUtils 2011-05-21 16:27:06 +12:00
Paul Chote
f3a54a802a Add color support to LabelWidget 2011-05-21 16:27:06 +12:00
Paul Chote
24712825eb Throw a useful exception on duplicated widget Id. 2011-05-21 16:27:06 +12:00
Paul Chote
388324dd69 Throw a sane exception when trying to load an invalid widget. 2011-05-21 16:27:06 +12:00
Chris Forbes
178e4664c7 790 fixed -- Widget.EventHandler was never used, removed 2011-05-21 16:27:06 +12:00
Chris Forbes
ec82e6fe68 make ScrollPanelWidget mouse interaction cheaper 2011-05-21 16:27:06 +12:00
Chris Forbes
0c9a1a03ce make ProgressBarWidget cheaper 2011-05-21 16:27:05 +12:00
Chris Forbes
4d4a07b791 make ScrollPanelWidget cheaper 2011-05-21 16:27:04 +12:00
Chris Forbes
9ee7fcdff1 mark some nonsense in LabelWidget 2011-05-21 16:27:03 +12:00
Chris Forbes
8d78ad2fec fix comment in CheckboxWidget 2011-05-21 16:27:03 +12:00
Chris Forbes
788e4780c6 s/order/event/ in ButtonWidget 2011-05-21 16:27:03 +12:00
Chris Forbes
8adca1960d fix comment spelling in ButtonWidget 2011-05-21 16:27:02 +12:00
Chris Forbes
1cf63ec803 Make ButtonWidget cheaper 2011-05-21 16:27:01 +12:00
Chris Forbes
072a42536e Make DropDownButtonWidget cheaper 2011-05-21 16:27:01 +12:00
Paul Chote
b08d8a02f4 Support custom margins and background on TextFieldWidget 2011-05-21 16:27:00 +12:00
Paul Chote
890136d447 Allow Labels to use any defined font. Add a new font type. 2011-05-21 16:26:59 +12:00
Paul Chote
4ad4c4dfb0 Support contrast on labels 2011-05-21 16:26:59 +12:00
Matthew Bowra-Dean
20458fc552 Move Platform.cs to OpenRA.FileFormats, fix #765. 2011-05-21 11:35:04 +12:00
Matthew Bowra-Dean
608126483e Fix #789 2011-05-21 11:34:59 +12:00
Chris Forbes
6277def7a0 fix utility filepicker on windows 2011-05-18 20:53:54 +12:00
Chris Forbes
7b3f178595 remove --pipe sillyness from Utility; obsoletes fmode's patch 2011-05-18 20:45:03 +12:00
Chris Forbes
4d6b2c7954 IBOless rendering with quads; considerably reduces renderer complexity 2011-05-18 20:42:10 +12:00
Chris Forbes
8e1bc25006 fix compile failure on windows due to missing #ziplib reference 2011-05-18 20:30:33 +12:00
Paul Chote
e0401f61de Rebuild osx launcher with xcode 3 2011-05-11 22:01:03 +12:00
Paul Chote
a6d258fa53 Disable installing from cd 2011-05-11 22:00:57 +12:00
Paul Chote
766ae84bd9 Update changelog 2011-05-11 22:00:15 +12:00
Paul Chote
16e0a6551a Disable capturable husks in cnc 2011-05-11 21:33:59 +12:00
Paul Chote
820895bf85 Update zenity wrapper - untested. 2011-05-04 20:24:04 +12:00
Paul Chote
22cd7ae1ad Fix osx launcher. TODO: needs testing on 10.5 2011-05-04 20:24:04 +12:00
Paul Chote
221d6ebd4f Make it actually work 2011-05-04 20:24:04 +12:00
Paul Chote
07dac11144 Install cnc from cd 2011-05-04 20:24:03 +12:00
Paul Chote
4efebcd6b2 Save packages to the support dir by default, but continue to support mods/*/packages 2011-05-04 20:24:03 +12:00
Paul Chote
96c3679cc9 Strip installer functionality from Utility 2011-05-04 20:24:03 +12:00
Paul Chote
83c026e12b Don't rely on the utility for ra package extraction. Untested. 2011-05-04 20:24:03 +12:00
Paul Chote
0102a9ad93 Don't rely on the utility for zip extraction. 2011-05-04 20:24:03 +12:00
Chris Forbes
65c6a23900 style nits & lambda reduction in ClassicProductionQueue.cs 2011-05-04 19:39:28 +12:00
Chris Forbes
fcdb16c938 remove warning from GpsWatcher 2011-05-04 19:31:50 +12:00
Chris Forbes
de8180f217 moar 2011-05-04 19:30:11 +12:00
Chris Forbes
7341b1f8f8 batch-process INotifyIdle, and add PerfSample wrappers for tick_idle and tick_activities 2011-05-04 19:23:40 +12:00
Chris Forbes
de6ac7e650 cache IMove in Actor 2011-05-04 19:23:05 +12:00
Chris Forbes
efaf0208f5 rationalize queue cycling 2011-05-04 18:56:53 +12:00
Chris Forbes
71313a264d adjust strictness in BuildPaletteWidget 2011-05-04 18:46:44 +12:00
Chris Forbes
433fc27744 fix capitalization of playerResources in RenderBuildingOre 2011-05-04 18:46:17 +12:00
Chris Forbes
ea32b1bc6d remove a bunch of trait lookups for PlayerResources 2011-05-04 18:40:33 +12:00
Chris Forbes
d86e0ec522 rename ITraitPrerequisite<T> to Requires<T> 2011-05-04 18:02:35 +12:00
Chris Forbes
8aa206ef95 fix bogus copy in Blast.cs 2011-05-04 18:02:35 +12:00
Chris Forbes
068ee3320e saner IPostRender dispatch 2011-05-04 18:02:34 +12:00
Paul Chote
6676d59847 Cache IOccupySpace and IHasLocation for some free perf 2011-05-04 11:20:41 +12:00
Paul Chote
2d7f3086f6 Nits 2011-05-04 10:46:51 +12:00
Paul Chote
6495478433 Kill Util.Centered 2011-05-04 09:21:30 +12:00
Paul Chote
71f79ad068 Add a testcase 2011-05-03 22:40:43 +12:00
Paul Chote
6cb5616c77 Fix the color picker 2011-05-03 22:40:35 +12:00
Paul Chote
8f962853f9 Support arbitrary per-player palettes. Will crash if I missed any cases that don't explicitly set the Renderable palette. 2011-05-03 22:21:31 +12:00
Chris Forbes
b937489f2d remove some inaccuracies in HACKING 2011-05-03 17:40:02 +12:00
Chris Forbes
0bc427c683 make helicopters actually inherit the plane stuff as intended. oops. 2011-05-03 08:21:56 +12:00
Chris Forbes
64782fb254 use ToList rather than List<T>.ctor 2011-05-02 22:23:36 +12:00
Chris Forbes
bd0a953d66 clean up text render of SPW 2011-05-02 22:18:42 +12:00
Chris Forbes
aea8b8da99 remove some more insanity from SPW 2011-05-02 22:14:24 +12:00
Chris Forbes
ba7522bed6 remove a little of the most blatant idiocy from StrategicProgressWidget 2011-05-02 22:09:27 +12:00
Chris Forbes
00e9015671 fix minelayer going to faraway FIX 2011-05-02 21:38:16 +12:00
Chris Forbes
093f159d8e tuned gpsdot to be somewhat nicer 2011-05-02 21:15:09 +12:00
Chris Forbes
2912c921de add custom icon for harvester 2011-05-02 20:00:56 +12:00
Chris Forbes
dd4c5508fa gpsdot has sprites 2011-05-02 19:51:15 +12:00
Mike Bundy
25962d58c6 GpsDot removed when actor .Destroyed. GpsDot removed from BADR 2011-05-02 19:34:36 +12:00
Mike Bundy
bcbac667db Changes how GPS is watched. Changes GPS ability. 2011-05-02 19:31:40 +12:00
Chris Forbes
7923f7d83a add --shp and --png commands to util 2011-05-02 19:18:27 +12:00
Chris Forbes
9d7ac73410 pull BuildingInfluence trait lookup out of the inner loop of building placement 2011-05-02 10:47:25 +12:00
Curtis S
f7bd3951e3 Fixed creeps owning badrs in some map yamls 2011-05-01 15:22:25 +12:00
Chris Forbes
702f787899 fix entering helicopters 2011-05-01 15:20:35 +12:00
Chris Forbes
5675f02c84 fix koth maps; drop nuclear winter 2011-05-01 15:20:34 +12:00
Paul Chote
5c7f1aa237 Fix deb packaging 2011-05-01 12:21:24 +12:00
Chris Forbes
eb3f4ef21d remove random Application.DoEvents() from Game.cs 2011-04-30 14:31:02 +12:00
Chris Forbes
7155747337 remove IShader.Commit 2011-04-30 14:29:32 +12:00
Chris Forbes
279413f05b dont crash on disconnect from lobby 2011-04-30 11:14:25 +12:00
Chris Forbes
f84832a24a remove some duplication in parachute use 2011-04-29 19:52:36 +12:00
Chris Forbes
b26d2e07e9 formatting 2011-04-29 19:50:31 +12:00
Chris Forbes
2b0f553d9d remove a silly lookup in RenderSimpleInfo 2011-04-29 19:47:44 +12:00
Chris Forbes
0b0e857b13 write traitreport to a file on disconnect, not stdout 2011-04-29 19:38:54 +12:00
Chris Forbes
3a0dcf3ae4 trim some crap 2011-04-29 19:37:36 +12:00
Chris Forbes
9ebea704ad clean up CrateDrop 2011-04-29 17:48:29 +12:00
Chris Forbes
71ca0f028e remove some sillyness from LightPaletteRotator 2011-04-29 17:25:13 +12:00
Chris Forbes
2d82f68a89 remove a dumb traitinfo lookup every tick in Crate 2011-04-29 17:20:16 +12:00
Paul Chote
88b7e70d64 Retain old deb package naming to avoid breaking the website 2011-04-24 13:30:40 +12:00
Chris Forbes
60ce83e696 cleanup cargo, remove some traitcalls 2011-04-23 10:58:46 +12:45
Chris Forbes
24798adf72 simplify & patch Passenger 2011-04-23 10:43:03 +12:45
Chris Forbes
c7ee613ca0 add trait query report on disconnect 2011-04-22 11:12:50 +12:45
Chris Forbes
e829c01ee6 else after return is silly 2011-04-22 10:32:47 +12:45
Chris Forbes
c34d987e4a remove a couple of trait lookups 2011-04-22 10:31:47 +12:45
Chris Forbes
8dc3fbead6 fix ra crash on placing refinery 2011-04-22 10:23:22 +12:45
Chris Forbes
00c4d1b469 remove FlyAttackLoop 2011-04-19 18:40:24 +12:00
Chris Forbes
4bf484bbe9 make paratroopers use FlyAttack rather than FlyAttackLoop 2011-04-19 18:39:31 +12:00
Chris Forbes
cd9f2bf716 make CrateDrop use FlyAttack rather than FlyAttackLoop 2011-04-19 18:38:25 +12:00
Chris Forbes
4ea9cdb003 allow FlyAttack to work without AttackPlane 2011-04-19 18:37:12 +12:00
Paul Chote
ca379ce007 Remove some needless allocations 2011-04-18 10:50:36 +12:00
Paul Chote
24908b7269 Split Harvest activity into saner chunks; fix pathfinding. 2011-04-18 10:47:10 +12:00
Paul Chote
eff37461d8 Pull Visible crap out of Harvester 2011-04-18 09:34:58 +12:00
Paul Chote
63e40aec68 Remove some crap from OreRefinery 2011-04-18 09:34:43 +12:00
Chris Forbes
73352937ff fix 705 for cnc 2011-04-18 09:09:20 +12:00
Chris Forbes
9d10bb6c69 fix 705 for ra 2011-04-18 09:08:26 +12:00
Chris Forbes
9481408136 remove some duplication from HackyAI 2011-04-18 08:23:16 +12:00
Chris Forbes
2317325591 add a lint pass to catch Mirey's bogus autotarget wiring cases 2011-04-18 07:37:29 +12:00
Paul Chote
a0941db61b Fix warfactory roof glitch 2011-04-17 20:02:02 +12:00
Paul Chote
5adc90a76e Fix map-placed SAM sites 2011-04-17 19:35:49 +12:00
Chris Forbes
76b3e2325b make RenderBuildingOre slightly more robust; remove some junk 2011-04-17 19:22:21 +12:00
Chris Forbes
ae645bbafe fix missing explosion on war factory; remove some nonsense 2011-04-17 19:22:21 +12:00
Chris Forbes
4f76876f05 remove one of the Move constructors 2011-04-17 19:22:21 +12:00
Chris Forbes
9541023456 664 fixed 2011-04-17 19:22:21 +12:00
Chris Forbes
5e0f57d730 tabify 2011-04-17 19:22:21 +12:00
Chris Forbes
e4dcf256aa quick fix for 702 2011-04-17 19:22:21 +12:00
Paul Chote
5a0aea7eb1 *.exe should remain executable 2011-04-17 13:51:35 +12:00
Paul Chote
3f06d6b867 Fix version string order 2011-04-17 13:02:00 +12:00
Paul Chote
35c925bcbe Update the description 2011-04-17 12:54:35 +12:00
Paul Chote
f0df830b69 Put the openra binary in /usr/games 2011-04-17 12:43:36 +12:00
Paul Chote
5862c795a9 Fix changelog format (still not compliant because it doesn't have * before the entries, but close enough...) 2011-04-17 12:34:35 +12:00
Paul Chote
a93ed12ce0 Put the changelog and copyright files in the correct location 2011-04-17 11:54:13 +12:00
Paul Chote
561eda4ba9 Remove postinst and postrm scripts 2011-04-17 11:34:18 +12:00
Paul Chote
952cd47e7a Update copyright, make myself maintainer, remove nonstandard Uploaders field. 2011-04-17 11:33:11 +12:00
Paul Chote
e7b71e7c66 Fonts are provided by ttf-freefont 2011-04-17 11:16:12 +12:00
Paul Chote
9bc0ad5605 Remove the packages directory from the repo/packages (running a source build should now do the correct thing wrt package downloading) 2011-04-17 11:04:41 +12:00
Paul Chote
aa9eb6058d Make built files nonexecutable 2011-04-17 10:46:58 +12:00
Paul Chote
72a783a647 Remove executable bit from files 2011-04-17 10:40:47 +12:00
Paul Chote
b2167adf1a Kill QueuedActivity 2011-04-16 15:37:31 +12:00
Paul Chote
bfceced8a0 Update changelog 2011-04-16 14:15:43 +12:00
Paul Chote
6b5f455c38 Rename CancelableActivity.cs -> Activity.cs 2011-04-16 13:24:34 +12:00
Paul Chote
4f83e994d0 Tidy up Activity.Cancel(), make Tick abstract 2011-04-16 13:18:22 +12:00
alzeih
0a67c68c45 GetTargetQueue -> GetTargets + Exts 2011-04-16 12:57:55 +12:00
alzeih
820f67e46b more for Activity 2011-04-16 12:56:10 +12:00
alzeih
255bac6aff QueuedActivity's Insert is broken 2011-04-16 12:50:13 +12:00
Paul Chote
4e89326134 Fix #701 - cannot select spawnpoints > 8. 2011-04-16 12:10:45 +12:00
Paul Chote
e5506f2455 Rename RenderWarFactory -> RenderBuildingWarFactory 2011-04-16 12:05:02 +12:00
Chris Forbes
9bd5c153ad interfaces cleanup 2011-04-16 12:01:23 +12:00
Chris Forbes
8a4f49485b remove defunct IOrderCursor interface 2011-04-16 12:01:23 +12:00
Chris Forbes
447fd05723 unify handling of order expose + issue for plane/heli; was identical 2011-04-16 12:01:23 +12:00
Chris Forbes
865f3e1b74 factor out resupply activity queueing for plane/heli into aircraft 2011-04-16 11:59:42 +12:00
Mike Bundy
0cb133e038 Bug Fix: GPS is shared across owned ATEKs 2011-04-16 11:59:42 +12:00
Paul Chote
794dcac4d2 Create INotifyDamageStateChanged for nearly everything else that used INotifyDamage. 2011-04-16 11:51:34 +12:00
Paul Chote
8b00e1cfa5 Remove some bogus duplication in Sell (caused the double-sell bug). 2011-04-16 11:39:32 +12:00
Paul Chote
7b0a9136ab Remove some bogosity from RenderBuilding 2011-04-16 11:19:37 +12:00
Paul Chote
1c2574f4f4 Add an INotifyKilled interface, which is what most things that used INotifyDamaged actually cared about. 2011-04-16 10:58:35 +12:00
Chris Forbes
d9fc84b55e cleanup InflictDamage a bit 2011-04-14 22:44:32 +12:00
Paul Chote
7109428058 Fix double-sell fail 2011-04-14 15:50:16 +12:00
Chris Forbes
f45ec6f918 691,697 fixed 2011-04-14 12:13:08 +12:00
Chris Forbes
d221cb1902 report maxplayers to master server 2011-04-13 20:33:10 +12:00
Chris Forbes
93a2e478f9 fix 'exploit detected' spam when selecting someone else's units and pressing s/f/x 2011-04-13 20:13:54 +12:00
Chris Forbes
005d0a6a32 split out aircraft and ships into their own files for cnc too 2011-04-13 19:59:05 +12:00
Chris Forbes
5f76f1ca7f split ships out into their own yaml too 2011-04-13 14:39:49 +12:00
Chris Forbes
33815eaa4e split aircraft out into their own yaml file 2011-04-13 13:27:09 +12:00
Chris Forbes
7be167b4fd fix crash in SatelliteLaunch ctor 2011-04-13 11:37:15 +12:00
Caleb Anderson
5adda21b28 fix build 2011-04-13 07:22:10 +12:00
Chris Forbes
c19881cae3 694 fixed -- the same building can now do both repair and rearm for aircraft 2011-04-12 08:49:58 +12:00
Chris Forbes
e4d2839254 spacing nit 2011-04-12 08:47:55 +12:00
Paul Chote
61db3b3965 Kill HPFraction 2011-04-12 08:42:13 +12:00
Paul Chote
cd64d62b7e Fix bogus silo/wall rendering 2011-04-12 08:42:13 +12:00
Paul Chote
715425d821 Capturable husks for cnc 2011-04-12 08:42:07 +12:00
Paul Chote
362170ee67 Tweak capturing traits 2011-04-12 08:41:25 +12:00
Paul Chote
a31ef3d8e2 Use MakeAnimation activity for make animations 2011-04-12 08:41:25 +12:00
Chris Forbes
394ee0dfe6 add seru's 'Pressure' map 2011-04-12 08:30:11 +12:00
Caleb Anderson
3fe4d32674 helis don't fail to attack on diagonal approach 2011-04-12 08:17:11 +12:00
Mike Bundy
bca2797bb4 Bug Fix: Helicopters spawning under each other 2011-04-10 23:36:49 +01:00
Mike Bundy
7a63858812 Bug Fix: Cash ticks for TRUK and Bounties only show for allies 2011-04-10 21:22:42 +01:00
Chris Forbes
d2d0e4be96 better support for contrail coloring everywhere 2011-04-10 11:15:43 +12:00
Chris Forbes
79079ebe07 working missile trails 2011-04-10 11:15:42 +12:00
Chris Forbes
5fd3cc7977 internal machinery for contrails on missiles 2011-04-10 11:15:41 +12:00
Chris Forbes
6710ad975e split out ContrailHistory from the trait machinery 2011-04-10 11:15:40 +12:00
Chris Forbes
c4a72f016a remove some more bits 2011-04-10 11:15:39 +12:00
Chris Forbes
c2966978f3 start trimming down prox code 2011-04-10 11:15:37 +12:00
Paul Chote
fe4fd8cab0 Use MakeAnimation for selling; Support selling non-buildings 2011-04-10 11:03:42 +12:00
Paul Chote
e4d8680bd5 Pull the make animation crap out of Transforms 2011-04-10 10:53:04 +12:00
Paul Chote
43f81501a8 Split Capturable into its own trait 2011-04-10 10:07:00 +12:00
Chris Forbes
40f6c4e332 clean up unnecessary junk from MoveAdjacentTo 2011-04-09 15:21:16 +12:00
Chris Forbes
3325739035 fix pathing to repair pad being bogus 2011-04-09 15:20:18 +12:00
Chris Forbes
f851e6a212 fix a silly glitch in unit repairing 2011-04-09 15:14:19 +12:00
Chris Forbes
260b95f96d fix utility crashing on windows (hack) 2011-04-09 14:26:47 +12:00
Chris Forbes
abb895d8be fix logfile opening to be sensible 2011-04-09 14:26:46 +12:00
Chris Forbes
19ad0bf0cc improve util arg parsing 2011-04-09 14:26:45 +12:00
Chris Forbes
ba72276b83 some more sanity in util 2011-04-09 14:26:44 +12:00
Chris Forbes
fddfdd5073 remove some crap code in Util 2011-04-09 14:26:43 +12:00
Chris Forbes
b633802ec2 remove one use of Path.DirectorySeparatorChar 2011-04-09 14:26:42 +12:00
Chris Forbes
48a359e202 cleanup header of FileSystem.cs 2011-04-09 14:26:41 +12:00
Chris Forbes
6105859b25 remove some junk from GameInitDelegate 2011-04-09 14:26:40 +12:00
Paul Chote
110f1aacc2 Normalize yaml lineendings 2011-04-09 12:14:33 +12:00
Paul Chote
4c92293814 Remove UnitInfluenceDebug checkbox 2011-04-09 12:10:16 +12:00
Chris Forbes
c99be90548 remove an unused OT 2011-04-09 12:02:21 +12:00
Mike Bundy
3e04b17b46 Feature: Bounties added to Buildings/Units at 10% of value + 1.25 for each lvl 2011-04-09 11:04:59 +12:00
Chris Forbes
7d29d90338 from mirey: pilot parachutes from shot down plane, sometimes 2011-04-09 11:01:17 +12:00
Chris Forbes
ca81871b7b fix broken merging of yaml overrides in maps; we now have a strict mode and a liberal mode. 2011-04-09 10:55:54 +12:00
Chris Forbes
7cd983a83b fix line endings on various yamls 2011-04-09 10:55:53 +12:00
Paul Chote
c775b5ba68 Remove some dead code from UOG. 2011-04-09 10:32:36 +12:00
Paul Chote
c87188e93f Fix ownership of deb contents 2011-04-09 09:04:25 +12:00
Chris Forbes
f47c2a678c remove some unnecessary semantics-muddying 2011-04-08 09:47:42 +12:00
Paul Chote
aba14eec23 Squash compiler warnings 2011-04-07 21:26:57 +12:00
Paul Chote
b0425aff3b Renormalize line endings and fix copyright headers again. 2011-04-07 21:15:42 +12:00
Caleb Anderson
1a49b46af1 Added myself to authors 2011-04-07 20:05:16 +12:00
Chris Forbes
a97ae5a4d5 fix bogus split2/split3 yaml 2011-04-06 09:24:54 +12:00
Curtis S
88d63d07e6 Adds TRUK to both sides - donates cash to others 2011-04-06 09:16:42 +12:00
Chris Forbes
b4fe4818a9 remove slight sillyness from ralint output 2011-04-06 07:21:06 +12:00
Erasmus Schroder
a2060b26ed HackyAI: Corrected squadsize, removed unnecessary lines. 2011-04-06 07:20:04 +12:00
Erasmus Schroder
8e56bdc197 Made HackyAI attackers scan for enemy units 2011-04-06 07:20:01 +12:00
Chris Forbes
9f3107f642 fix #688 2011-04-06 07:16:54 +12:00
Chris Forbes
24a205d992 actually working custom lint passes 2011-04-05 21:56:31 +12:00
Chris Forbes
55c609ee16 fix bug 609 -- removing traits that arent on an actor is an error. 2011-04-05 21:26:32 +12:00
Chris Forbes
576e9b90f6 remove slight fail 2011-04-05 21:26:02 +12:00
Mike Bundy
4d4cd6940b Fixed Bug: Game crash when ATEK destroyed as GPS launched 2011-04-04 12:40:53 +12:00
Curtis S
f6b8e36f36 v2rl arty bridge behaviour fix 2011-04-04 11:22:00 +12:00
Mike Bundy
e544333d9e Bug Fix: Selling ATEK loses GPS 2011-04-04 11:17:37 +12:00
Chris Forbes
1af23079eb make it crash nicely when you inherit from a bogus actor type 2011-04-04 11:14:07 +12:00
Chris Forbes
cee021ef17 fix AudLoader failing to load sounds that use only half of the final byte 2011-04-04 11:13:58 +12:00
Paul Chote
1f12306924 Fix default utility not passing supportdir to zip/install-ra. Fix game crash when utility crashes during extract. 2011-03-30 21:47:48 +13:00
Paul Chote
e63f9c34f8 Log the gpu vendor into graphics.log 2011-03-30 21:14:49 +13:00
Paul Chote
c746a3e81a Upgrade osx launcher project to xcode 4, remove unnecessary webkit reference, fix bogus arg passing to OpenRA.Utility (now passes everything) 2011-03-30 21:07:49 +13:00
Paul Chote
3dda9ee607 Write a utility.log to the logs dir when the utility crashes 2011-03-30 20:52:54 +13:00
Paul Chote
5d762b1f9c Fix root cause for `world owned by creep' bugs 2011-03-29 21:13:01 +13:00
Paul Chote
23eb077417 #672 - Textfield support for home and end 2011-03-26 10:35:58 +13:00
Paul Chote
ea626d4b39 RMBO voices on build and kill. 2011-03-25 20:04:23 +13:00
Paul Chote
a14968810c Add new voice keys for rmbo in preparation for following patches 2011-03-25 19:17:53 +13:00
Paul Chote
2f29e462a8 Fix #661 - map placed SAMs cannot attack 2011-03-25 18:54:53 +13:00
Paul Chote
8c18949861 Change C4Demolition from minutes to ticks; actually use this value. 2011-03-23 21:07:11 +13:00
Paul Chote
6ecf8aaf20 Set autotarget range to sight for all cnc infantry 2011-03-23 20:35:50 +13:00
Paul Chote
b7262b6490 Allow Autotarget to have a custom scan radius, use it for VICE. 2011-03-23 20:31:27 +13:00
Paul Chote
3071cd8240 Kill RenderUnitRotor in favour of RenderUnit + WithRotor. 2011-03-23 08:05:09 +13:00
Paul Chote
c7e2619a98 Explicitly declare dependency on Attack* from AutoTarget/AutoHeal. 2011-03-22 21:36:06 +13:00
Paul Chote
1ceede4322 Fix #656 - base cycling fired on both key down and key up. 2011-03-22 21:21:34 +13:00
Paul Chote
a745f3dc40 Update changelog 2011-03-20 08:47:54 +13:00
Paul Chote
0d53346138 Fix bogus ClampToWorld behavior (allowed helicopters to fly outside map) 2011-03-19 21:01:14 +13:00
Chris Forbes
41a6e94e87 fix visual glitchyness on creating actors that will be selected in their first tick 2011-03-19 19:48:16 +13:00
Chris Forbes
708cdcd855 add CashTick to building refunds 2011-03-19 18:58:04 +13:00
Chris Forbes
0236da0a28 fix up ralint a bit 2011-03-19 18:53:50 +13:00
Chris Forbes
18e1de1d4b prefer to circle over something friendly than leave the map 2011-03-19 18:44:39 +13:00
Chris Forbes
73a34886ec oops 2011-03-19 18:44:38 +13:00
Chris Forbes
2d480c900f patch plane to circle after move 2011-03-19 18:44:37 +13:00
Chris Forbes
0cf022c87a rename FlyCircle -> FlyAttackLoop, for accuracy; new FlyCircleto fly a hold 2011-03-19 18:44:36 +13:00
Paul Chote
dea199400d Fix #630 - Muzzleflashes on cnc apache 2011-03-19 18:40:12 +13:00
Paul Chote
8e079c310a Give Oil Derricks a small sight range 2011-03-19 17:48:56 +13:00
Paul Chote
a5af4e85ce Tweak CashTick and Oil Derricks 2011-03-19 17:48:56 +13:00
Paul Chote
08158a6929 Allow the control group modifier key to be customized. 2011-03-19 17:48:56 +13:00
Paul Chote
6ba6940aad Support the meta key modifier 2011-03-19 17:48:56 +13:00
Chris Forbes
72e0b58912 fix csproj bogosity 2011-03-19 17:28:45 +13:00
Paul Chote
0d2a692d8d Fix bogus prereqs in ra. 2011-03-18 11:27:16 +13:00
Paul Chote
e043f38c00 Whoops, forgot to commit the changelog 2011-03-18 11:01:57 +13:00
alzeih
53f4337129 Don't change mods if the same one is selected in the dropdown 2011-03-18 10:49:29 +13:00
Paul Chote
eb69b697b1 Fix bogus handling of special keyboard characters everywhere else. Textfields now only accept valid characters, support right-delete. 2011-03-18 10:48:12 +13:00
Paul Chote
7d6d488176 Fix #549 - Shift + tab doesn't cycle build tabs backwards. 2011-03-18 09:44:28 +13:00
Paul Chote
c568759e49 Fix #595 - IDisposable crash. 2011-03-17 22:26:28 +13:00
Paul Chote
d05b979e53 Tweak cnc proc cashtick 2011-03-17 22:26:28 +13:00
Paul Chote
86e8c3974f Fix #611 - prereqs handled by traits. Make both cnc power plants valid for prereqs. 2011-03-17 22:26:28 +13:00
Paul Chote
6d1defc53e Use CashTick on harv unloading. 2011-03-17 22:24:17 +13:00
Paul Chote
ffac0221cf CashTick IEffect for Oil Derricks. 2011-03-17 22:24:17 +13:00
Chris Forbes
a3994df925 queries dies 2011-03-17 22:09:10 +13:00
Chris Forbes
caa52b2780 remove CachedView 2011-03-17 22:09:09 +13:00
Chris Forbes
149324ea92 remove most of the crap from queries 2011-03-17 22:09:08 +13:00
Chris Forbes
eba7641125 remove old Sell handler from Building 2011-03-17 22:08:53 +13:00
Chris Forbes
da36ce19e2 fix sellable compile fail 2011-03-17 20:09:43 +13:00
Chris Forbes
7e25947689 yaml changes for sellable 2011-03-17 19:14:20 +13:00
Chris Forbes
4eaa7d5cf2 split out Sellable into its own trait; yaml requires update 2011-03-17 19:14:17 +13:00
Chris Forbes
ff44e34d89 dont be detected by friendly detectors 2011-03-16 20:48:34 +13:00
Chris Forbes
8bef8d5a72 have spies appear a convincing color on radar too 2011-03-16 20:30:23 +13:00
Chris Forbes
048386e6fa add ExperienceInit (MapActor's 'Experience:' key, int) 2011-03-16 19:30:58 +13:00
Chris Forbes
f3dfc422ab fixed #635 2011-03-16 19:16:38 +13:00
Chris Forbes
3b89110202 fix some bogosity in MasterServerPinger (still not right) 2011-03-16 11:02:17 +13:00
Chris Forbes
73d27c822e add IgnoresDisguise; support it in AppearsHostileTo / AppearsFriendlyTo 2011-03-16 09:51:26 +13:00
Chris Forbes
a21deea60b spam the CellInfo messages into the debug log, not the chat 2011-03-15 12:18:08 +13:00
Chris Forbes
981e57bde8 some more overloads etc 2011-03-15 12:18:03 +13:00
Chris Forbes
c313920c7c include the utility in the core target, since the game needs it for package download now 2011-03-15 10:14:56 +13:00
Chris Forbes
cf9e81ea29 fix #645 2011-03-15 09:41:46 +13:00
Chris Forbes
4f79aca484 fix #643 2011-03-15 09:32:25 +13:00
Chris Forbes
5ad196acc3 fix #646 2011-03-15 09:30:24 +13:00
Chris Forbes
e66ebef73c some more bits for .gitignore 2011-03-15 09:29:19 +13:00
Paul Chote
c00d20e3c0 Update changelog 2011-03-13 21:22:13 +13:00
Paul Chote
795101aac9 Grenadiers explode on death 2011-03-13 21:21:16 +13:00
Paul Chote
0dd9a437b8 support power charge bars in cnc 2011-03-13 21:18:39 +13:00
Chris Forbes
febd92341f patched pchote's map 2011-03-13 15:54:33 +13:00
Chris Forbes
1368bc0731 missing project file change 2011-03-13 15:46:43 +13:00
alzeih
f4e4f987be RA - AppearsFriendlyTo and AppearsHostileTo actor extensions 2011-03-13 15:44:27 +13:00
alzeih
cf8cfdc42d SpyToolTip - Display tooltip of disguised unit to other players, and a modified one for the local player. 2011-03-13 14:14:32 +13:00
alzeih
26f1452930 text / text2 / text3 dies 2011-03-13 14:14:32 +13:00
alzeih
544befb553 Move disguise into Spy from RenderSpy 2011-03-13 14:14:32 +13:00
alzeih
b5efc97996 Fix #604 2011-03-13 12:26:37 +13:00
alzeih
22aa1308ce give GameServer some UsefulMods so we have the remote mod version in the ServerBrowser. 2011-03-13 12:26:27 +13:00
Chris Forbes
900e55900a fix boxes tooltip 'Tree' 2011-03-13 12:12:58 +13:00
Chris Forbes
116ef15fdb GotoNextBase dies in a fire; INotifyKeyPress dies 2011-03-13 12:12:57 +13:00
Paul Chote
3c41efea04 Check for GL extensions before we try to use things that may fail. 2011-03-13 02:46:16 +13:00
Paul Chote
c7d25bb991 Fix a crash with null textfields. 2011-03-13 02:32:48 +13:00
Chris Forbes
a33cca57ec fix a crash in perf graph 2011-03-13 02:27:32 +13:00
Chris Forbes
16eefe6280 increase strength of chrono effect 2011-03-13 00:44:31 +13:00
Chris Forbes
c9be0f44f4 spoilers: cursor dies 2011-03-13 00:39:37 +13:00
Chris Forbes
911ecb2ffa add missing copyright header to Mod.cs 2011-03-13 00:00:27 +13:00
Chris Forbes
56a8653bc6 #582 dont use water explosions for impacts ABOVE water 2011-03-12 23:41:28 +13:00
Chris Forbes
f58e9a2a99 do transport unload on 'f' 2011-03-12 23:34:59 +13:00
Chris Forbes
2eec1b2016 dont show yellow selection boxen 2011-03-12 23:34:58 +13:00
Paul Chote
d1dd3a64f8 Fix evw3 crash. 2011-03-12 23:32:41 +13:00
Chris Forbes
82dea40261 provide a way to grab the laggy clients 2011-03-12 22:55:40 +13:00
Chris Forbes
606873a09e fix warnings in Selectable.cs 2011-03-12 22:33:29 +13:00
Chris Forbes
fe90cbdab8 blah 2011-03-12 22:33:28 +13:00
Chris Forbes
8a14662bc1 remove unitinfluence debug, not needed anymore 2011-03-12 22:33:27 +13:00
Chris Forbes
cf6a1583c6 fix bogosity in SupportPowerManager 2011-03-12 22:33:26 +13:00
Chris Forbes
c3728ce674 blah 2011-03-12 22:33:25 +13:00
Chris Forbes
1e3f365cf2 move all the Game.Exts junk either down into FileFormats or into WorldUtils 2011-03-12 22:33:24 +13:00
Paul Chote
f4494d67b2 Kill chrome.xml. 2011-03-12 22:23:46 +13:00
Paul Chote
0cfbeab864 Export chrome.xml to yaml 2011-03-12 21:54:19 +13:00
Paul Chote
0084566478 Standalone radar widget for new sidebar 2011-03-12 18:58:42 +13:00
Paul Chote
631630fbff Custom button widget for new sidebar 2011-03-12 18:58:42 +13:00
Chris Forbes
19b2e3e521 #601 fixed -- dont require explicit port on Direct Connect 2011-03-12 18:52:35 +13:00
Chris Forbes
ed0ae15d49 fix interior boxes 2011-03-09 22:04:54 +13:00
Chris Forbes
fbc7200472 fix #572 crash when switching mods while playing music 2011-03-08 20:24:52 +13:00
Chris Forbes
0770524c05 add support power charge bar 2011-03-08 20:02:02 +13:00
Chris Forbes
6d36272134 #597 fix crash when spawning mapactors if there is no player in the slot. said actors are not spawned now. 2011-03-08 19:40:16 +13:00
Chris Forbes
e9a1c3f477 fix indent; make this work for Cg renderer too 2011-03-08 19:28:57 +13:00
Chris Forbes
16cb275a5f fix rendering of very large maps 2011-03-08 19:24:15 +13:00
Chris Forbes
682cfcd466 wire up BuildAnywhere so it actually works 2011-03-07 20:25:05 +13:00
Chris Forbes
14a2b68b7d add chrome + plumbing for BuildAnywhere devhack 2011-03-07 20:20:44 +13:00
Chris Forbes
7cf07f5765 make forcing evaluation of lazyness explicit 2011-03-07 19:53:39 +13:00
Chris Forbes
ae58da10bf remove some silly allocation from InvisibleToOthers 2011-03-06 11:35:31 +13:00
Chris Forbes
d7ed0233b0 fix crash with cloaking units and replays 2011-03-06 11:34:19 +13:00
Chris Forbes
020c2a8a4a fix a rare crash in cnc docking 2011-03-06 11:31:54 +13:00
Chris Forbes
d4f58015c7 issue the right order for deploy 2011-03-06 10:36:07 +13:00
Chris Forbes
10a546d3ae remap tsla to 'u' to remove conflict 2011-03-06 10:35:48 +13:00
Chris Forbes
65a54ba13a add audio feedback to stop/scatter/deploy junk 2011-03-06 10:22:40 +13:00
Chris Forbes
1a6ff61836 clean up dumb mess of exit-flags in WorldInteractionControllerWidget 2011-03-06 10:15:31 +13:00
Chris Forbes
d2d425731f change hotkey for ftur to 't' to free up 'f' for deploy/special 2011-03-06 10:14:51 +13:00
Chris Forbes
69ea44310b remove another 40M/min of boxing junk by specializing the key comparer on SpriteFont's dict 2011-03-06 08:59:25 +13:00
Chris Forbes
8d1a69e8ff enhance Cache to allow specializing the key comparer 2011-03-06 08:56:39 +13:00
Chris Forbes
516efa1dc8 remove another 11M/min from GainsExperience.ModifyRender 2011-03-05 22:17:51 +13:00
Chris Forbes
6971d6dbbb remove another 50M/min of delegates being constructed as part of the render 2011-03-05 22:15:03 +13:00
Chris Forbes
0480f1e984 Avoid constructing a delegate on every TraitDict query -- saving 250M/min 2011-03-05 21:53:23 +13:00
Chris Forbes
ea022a0e06 change PlayThen and PlayRepeating definitions to not allocate Action objects like crazy 2011-03-05 21:52:34 +13:00
Chris Forbes
269347ef01 specialize pair's comparison to do something sensible with <char,Color> saving 16M. 2011-03-05 21:51:49 +13:00
Chris Forbes
feecc70a4f remove another bit of insignificant but silly allocation 2011-03-05 18:49:50 +13:00
Chris Forbes
03bda8b511 strip all the allocation out of WaterPaletteRotation too (saves ~25M/min) 2011-03-05 18:34:52 +13:00
Chris Forbes
c1ad99bb99 dont allocate a full new palette texture every frame in HardwarePalette.Update 2011-03-05 18:29:30 +13:00
Chris Forbes
533df844d8 pool CellInfo[,] to save massive amounts of memory (now uses only 512K for CellInfos on default-sized maps) 2011-03-05 18:28:59 +13:00
Chris Forbes
9f92f50597 fix missing unload on jeep 2011-03-05 14:03:33 +13:00
Chris Forbes
94766263c5 add one passenger slot to jeep 2011-03-05 13:23:37 +13:00
Chris Forbes
298baac061 add rollovers for health/production 2011-03-05 13:19:13 +13:00
Chris Forbes
d9881885aa fix bots getting stuck in ra 2011-03-05 13:10:43 +13:00
Chris Forbes
a1f1b5882e fix crates dropping on buildings etc 2011-03-05 12:00:28 +13:00
Chris Forbes
a676bdae71 grenadiers have a 50% chance of exploding on death 2011-03-05 11:27:24 +13:00
Chris Forbes
d6c8bbd52a use Target stuff for Reservables 2011-03-05 11:16:33 +13:00
Chris Forbes
b7b9b68cc0 add Chance (%) value to Explodes: 2011-03-05 11:14:43 +13:00
Chris Forbes
85fe83d608 ignore reservations being collected in worlds other than the one the OM is attached to. 2011-03-05 11:09:56 +13:00
Chris Forbes
7c6d35e318 remove productionbar info leak 2011-03-05 10:10:42 +13:00
Chris Forbes
68de6a8f8b fix cnc tab art 2011-03-02 23:23:09 +13:00
Chris Forbes
43dccb073d support ProductionBar properly in cnc too 2011-03-02 23:22:57 +13:00
Chris Forbes
0bfcb4585c fix glitchy vis on exiting a transport 2011-03-02 23:13:32 +13:00
Chris Forbes
d1b632a4a0 normalize the handling of flares in paradrop and airstrike cases 2011-03-02 23:05:58 +13:00
Chris Forbes
9b2fe9fead make ftur suck less 2011-03-02 22:59:45 +13:00
Chris Forbes
604c8c590b fix vehicle speed on ore being insane 2011-03-02 22:51:05 +13:00
Chris Forbes
df5cb1ddf8 slightly reduce cost of 3tnk 2011-03-02 22:49:36 +13:00
Chris Forbes
1a599cb8c2 dont give ground control with defenses 2011-03-02 22:48:55 +13:00
Chris Forbes
89a96a9fe7 make ProductionBar actually work for all RA stuff 2011-03-02 22:35:44 +13:00
Chris Forbes
c62e025c45 add temp hacked ProductionBar -- not wired to ProductionQueue properly yet. 2011-03-02 22:20:34 +13:00
Chris Forbes
770dbcee52 tweak; save a bit of memory 2011-03-02 22:18:16 +13:00
Chris Forbes
036800531c add support for aux. bars in selection 2011-03-02 22:16:47 +13:00
Chris Forbes
338cff3c45 adjust DisplayHp EWMA 2011-03-02 22:11:00 +13:00
Chris Forbes
e122debc7a remove tent prereq on apc (made it useless) 2011-03-02 22:03:39 +13:00
Chris Forbes
0da7009eea shiny healthbars 2011-03-02 22:03:10 +13:00
Chris Forbes
4a71672a5f fix ftrk not firing over walls 2011-03-02 21:39:57 +13:00
Chris Forbes
9d91dba2d6 fix AA not firing over walls 2011-03-02 21:39:33 +13:00
Chris Forbes
662cf91bdc improve accuracy of arty 2011-03-02 21:37:38 +13:00
Chris Forbes
46987e1688 2/3/4tnk require fix 2011-03-02 21:30:09 +13:00
Chris Forbes
aec1724387 arty requires dome; apc buffed and goes to soviet 2011-03-02 21:29:04 +13:00
Chris Forbes
9ebf880158 increase dome cost to 1.4k 2011-03-02 21:27:40 +13:00
Chris Forbes
8dba72ecfa increase fix cost to 1k 2011-03-02 21:27:09 +13:00
Chris Forbes
a954d21210 tweaks to heli/hind 2011-03-02 21:20:11 +13:00
Chris Forbes
ad72c80bab actors without Health are not dead. 2011-03-02 20:56:46 +13:00
Chris Forbes
11384f692b remove bogus resx 2011-02-28 22:47:39 +13:00
Chris Forbes
772b3a2f9d only add Neutral player if it doesnt exist in the map definition. 2011-02-28 22:46:24 +13:00
Chris Forbes
8aaaf1e44c center error dialog 2011-02-28 22:36:45 +13:00
Chris Forbes
b878bde331 add graceful handling of bogus actor types in import 2011-02-28 22:36:23 +13:00
Chris Forbes
ea40cb015d fix dumb bug in map importer 2011-02-28 22:29:11 +13:00
Chris Forbes
12f8200a0b rename another handler in editor 2011-02-28 22:24:02 +13:00
Chris Forbes
4b853ca9e8 fix another issue with the importer -- it didnt bother to restore the current directory if canceled 2011-02-28 22:23:16 +13:00
Chris Forbes
88436bda45 add ability to throw nonfatal errors in the map importer, and display them. 2011-02-28 22:19:02 +13:00
Chris Forbes
c2b0cec2ea add a sensible error when trying to save a map using a bogus tileset 2011-02-28 22:18:44 +13:00
Chris Forbes
ba949126ab fix the other half of the prox desync 2011-02-28 20:39:24 +13:00
Chris Forbes
8d99652eea add option to show actor names in the editor 2011-02-28 20:36:33 +13:00
Chris Forbes
e1c0c24a47 fix lobby showing Closed with bot in some cases 2011-02-28 20:36:32 +13:00
Chris Forbes
42b88276b1 blah 2011-02-28 20:36:12 +13:00
Chris Forbes
39fef604c2 fix desync in ProximityCapturable 2011-02-28 20:36:02 +13:00
Chris Forbes
c5684fcba5 fix crash on startup 2011-02-28 20:35:09 +13:00
Paul Chote
ced2247af8 Add more info to Reservable dispose exception. 2011-02-26 13:05:58 +13:00
Paul Chote
f74d2318d8 Unreserve helipads on heli death. 2011-02-26 12:57:25 +13:00
Paul Chote
2ffc66416b Update INSTALL. 2011-02-26 00:58:55 +13:00
Paul Chote
05979a7a72 Remove cnc Wargames and Yellowstone II maps. 2011-02-25 11:29:43 +13:00
Chris Forbes
e5ef334941 fix noob error in TakeCover 2011-02-24 20:10:29 +13:00
Paul Chote
8e8b80ba85 Update seaside map by nudalz. 2011-02-24 20:08:32 +13:00
Chris Forbes
252d3e7981 move DefaultShellmapScript.cs into Missions/ 2011-02-24 18:50:17 +13:00
Chris Forbes
ad2ae8b763 report memory usage for textures 2011-02-24 18:48:55 +13:00
Chris Forbes
a8d849a1cb support TrailInterval on bullets too 2011-02-24 18:48:55 +13:00
Chris Forbes
551c94b77c add TrailInterval support for Missile 2011-02-24 18:48:55 +13:00
Chris Forbes
b90a90f8cc refactor texture code a bit 2011-02-24 18:48:54 +13:00
Paul Chote
869448296a Sync RTB path hash. 2011-02-24 17:51:41 +13:00
Paul Chote
7f39909dc8 Throw an exception if a reservation is eaten by the GC. Better to die early with a known error than to desync later. 2011-02-24 17:26:14 +13:00
Paul Chote
fa6a98cca3 Unreserve reservation on death. 2011-02-24 17:17:20 +13:00
Paul Chote
0723723b30 Upgrade maps to v5. 2011-02-23 22:02:48 +13:00
Paul Chote
1df42a7d5e Give upgraded mpspawns an owner. 2011-02-23 21:56:58 +13:00
Chris Forbes
e90177ca58 blah 2011-02-23 21:55:52 +13:00
Paul Chote
0f78fb22e5 add WIP evw3 map. 2011-02-23 21:55:52 +13:00
Paul Chote
ecf866f28a Allow editor to load a map via commandline. 2011-02-23 21:55:52 +13:00
Paul Chote
05e5ee7ca4 Update Rubicon, add new ra map by Arcturus 2011-02-23 21:55:49 +13:00
Paul Chote
5a30750e33 Fix VICE. 2011-02-23 21:54:58 +13:00
Paul Chote
754e45094c Remove ProximityCaptor from cnc. 2011-02-23 21:54:57 +13:00
Paul Chote
0bc8d37bdf Hacky fix for map upgrading 2011-02-17 22:31:07 +13:00
Paul Chote
89b7f3d725 Fix ra rules. 2011-02-17 22:17:00 +13:00
Paul Chote
169baf6df9 Fix ra sequences 2011-02-17 22:05:10 +13:00
Paul Chote
eb9054a4d6 Fix default ColorRamp 2011-02-17 21:50:16 +13:00
Paul Chote
d6e8b554d2 Only save non-default PlayerReference fields 2011-02-17 21:48:36 +13:00
Paul Chote
18d73aef53 Split out RenderInfantryPanic. 2011-02-17 21:38:04 +13:00
Paul Chote
06bf38b526 Split out RenderInfantryProne 2011-02-17 21:10:44 +13:00
Paul Chote
6b80cfc9d4 Refactoring 2011-02-17 20:52:47 +13:00
Paul Chote
9a04a7fa9f Move IdleAnimation into RenderInfantry 2011-02-17 20:15:20 +13:00
Paul Chote
4a3d254c0c Start RenderInfantry rework. TODO: fix ra sequences, split Prone/Panicked into RenderInfantry* overrides, integrate idle anims. 2011-02-17 19:53:58 +13:00
Chris Forbes
437caf9c12 fix map saving 2011-02-16 20:38:26 +13:00
Chris Forbes
30f05fb359 add another thirdparty map 2011-02-16 19:22:19 +13:00
Chris Forbes
618d109a49 embed the correct icon for the editor 2011-02-16 16:56:51 +13:00
Chris Forbes
40647b41e7 remove some crap 2011-02-16 11:51:05 +13:00
Paul Chote
266e2717f5 Remove AvoidUnitsNear pathfinding heuristic (causes problems with crates and crushing). 2011-02-15 22:51:32 +13:00
Paul Chote
3c9de06db0 Remove redundant sequences 2011-02-15 22:41:55 +13:00
Paul Chote
b6328b356c ScaredyCat trait for civilians. 2011-02-15 22:38:13 +13:00
Paul Chote
fa86502795 Emit e6,e1 on sell. 2011-02-15 22:17:43 +13:00
Paul Chote
df4a860dfe Fix crash on surrender 2011-02-15 22:17:25 +13:00
Chris Forbes
3e28fce7ba remove various leftover crap from editor 2011-02-15 16:18:14 +13:00
Chris Forbes
5bd9273a7d fix issues with mpspawn and waypoint sprites 2011-02-15 16:09:53 +13:00
Chris Forbes
2b85c7e0b9 fix stack overflow in Map.Resize() 2011-02-15 15:46:16 +13:00
Chris Forbes
786eafd7fa fix ra production (oops) 2011-02-15 08:28:50 +13:00
982 changed files with 47485 additions and 38393 deletions

8
.gitignore vendored
View File

@@ -7,6 +7,7 @@ obj
*.suo
*.user
*.sln.cache
*.manifest
mods/*/*.dll
# Red Alert binary files
@@ -50,3 +51,10 @@ OpenRA.Launcher.Mac/OpenRA.xcodeproj/*.perspectivev3
OpenRA.Launcher.Mac/OpenRA.xcodeproj/*.mode1v3
*.config
*.resources
# other crap
Logs/
Replays/
settings.yaml
\#*
.*.sw?

47
AUTHORS
View File

@@ -1,11 +1,36 @@
AUTHORS
The OpenRA developers are:
* Chris Forbes
* Robert Pepperell
* Matthew Bowra-Dean
* Paul Chote
* Alli Witheford
* Joakim Lindberg
* Andrew Riedi
* Tim Mylemans
AUTHORS
The OpenRA developers are:
* Alli Witheford (alzeih)
* Caleb Anderson (RobotCaleb)
* Chris Forbes (chrisf)
* Curtis Shmyr (hamb)
* Daniel Hernandez (Mancano)
* Matthew Bowra-Dean (beedee)
* Mike Bundy (kehaar)
Also thanks to:
* Akseli Virtanen (RAGEQUIT)
* Andrew Riedi
* Bellator
* Christer Ulfsparre (Holloweye)
* Erasmus Schroder (rasco)
* Igor Popov (ihptru)
* Jeff Harris (jeff_1amstudios)
* Joakim Lindberg (booom3)
* Kenny Hoxworth (hoxworth)
* Lawrence Wang
* Mark Olson (markolson)
* Matthew Gatland (mgatland)
* Max Ugrumov (katzsmile)
* Max621
* Nukem
* Paolo Chiodi (paolochiodi)
* Paul Dovydaitis (pdovy)
* Raymond Martineau (mart0258)
* Riderr3
* Tim Mylemans (gecko)
Past developers included:
* Paul Chote (pchote)
* Robert Pepperell (ytinasni)

386
CHANGELOG
View File

@@ -1,3 +1,386 @@
NEW:
Engine:
General performance improvements
Fixed minimap export breaking subsequent actions in the editor
Added owner chooser for new actors in the editor
Added actor info panel in the editor (doubleclick)
Added a Setup Default Players menu item to map editor
Both Mods:
Server lobbies upon creation use the previously played map
Added support for a Game.ConnectTo argument which allows clients to direct connect to a server when game is launched
Helicopters now bob slightly in flight
Bots now repair their own buildings
Fixed a bug where bots would be unable to set rallypoints for production buildings
Bots now maintain a level of aggro on enemy units
Made SpawnMPUnits' initial unit configurable
Added a dropdown list in the map editor for setting an actor's owner upon placement
Replaced the server browser with a new and awesome one
Fixed a bug where infantry squish sounds weren't positioned
Fixed a bug where actor priority wasn't correct for doubleclick
Red Alert:
Fixed a crash which occurred when playing an online game with Hard AI
Fixed a bug where planes could stack more than 1-per-airfield
Fixed a bug where planes would not rearm at airfields
Improved logic for sending planes and helicopters back to base
Changed MIG to fire 2 missiles per burst instead of 4
Changed HELI (longbow) to fire missiles in bursts of 2
Added a Show Shellmap setting
Changed team color picker to match C&C's
Fixed a bug where infantry could not pass over anti-tank mines, and vice versa
Fixed a bug where the shellmap would reload unnecessarily when disconnecting from a lobby that hasn't started
Added AutoTarget capability to submarines, but they are set to HoldFire stance by default
New Map: Bombardment Islands (Sprog)
New Map: Engagement (Nukem)
New Map: Man to Man (Nukem)
New Map: Asymetric Battle (Seru)
C&C:
Changed the bot spawn picker to match RA's
Reduced delay of tooltips
20111013:
Engine:
Fixed broken client IDs if players drop before the game starts
Converted FileExtractor into --extract cmdlet for Utility.
Added --transparent option to --png cmdlet in Utility.
Fixed shortcut description on Linux
Fixed launcher crashes on Mac
Removed obsolete SequenceEditor tool
Added --tmp-png cmdlet in Utility, to convert terrain to PNG.
Both Mods:
Allow building repair by allies
Use player color to show who is repairing a building
Only units/structures being built or queued are shaded in the production palette
Aircraft smoke is no longer visible under fog
Added a Show Grid option to the Map Editor
Added multitap support - double clicking a unit selects all units of the same type on screen
Changed map choosers to be a filterable grid of maps
Added internal machinery for IFV-style units
Red Alert:
Added naval transport
Added an indicator over powered down buildings
Aircraft crashing into water now use large_splash
Destroyer now requires Radar Dome
Increased cost of Shipyard and Sub Pen
Fixed a crash when sending aircraft back to base
Husks no longer interfere with selection
Added more options for bots in game lobby
Changed AI behavior -- now has Easy/Normal/Hard difficulty
Increased range of FTUR by 1
Reduced cost of MEDI from 500 to 300
Reduced cost of SHOK from 800 to 500
Heavy vehicles (Tanks, Harvesters, MCV) now crush infantry
New map: Classic DropZone (Holloweye)
New map: DropZone Battle of Tikiaki (Knivesron)
New map: DropZone W (Riderr3)
New map: Seven Stairs (Tirili)
New map: Contact (Nukem)
New map: Encounter (Nukem)
New map: Mass Confliction (Nukem)
New map: Calm before the Storm (Nukem)
New map: Baywatch (Nukem)
New map: Winter Warzone (Nukem)
New map: Paramount (Nukem)
New map: Doubles (Nukem)
New map: Hectic (Nukem)
New map: Pandemonium (Nukem)
New map: Chokepoint (Nukem)
New map: HotZone (Nukem)
New map: No Fly Zone (RAGEQUIT)
New map: Strip Mine (RAGEQUIT)
New map: Doughnut Hole (RAGEQUIT)
New map: Vegetation (hamb/Chris Forbes)
New map: Arctic Triangle Affair (Bellator)
New map: Mad Scramble (Bellator)
New map: Free Coasts (Ihptru)
New map: Battle Lake (Bellator)
C&C:
Slightly increased Tiberium growth rate
Increased harvester unload time
Reduced Tiberium value by 20%
Changed FTNK armor type to Light
Fixed tank squish animations to show properly
New map: Tiberium Oasis (Bellator)
20110906:
Engine:
Fixed compile failures under Windows
Improved platform detection
Modding support for custom fonts
Video memory leaks fixed
Improved error messages for unsupported graphics cards
Improved support for Intel graphics cards
Fixed incorrect resolution under some Linux systems
Write graphics.log on all graphics-related errors
Significant general performance improvements
Fix crashes when joining a game with no free player slots
Bots players are named after their AI type and pick better random colors
Map support for enforcing team and spawn choice
Fix resource-clearing weapons breaking custom terrain types (bridges)
Added a "Pixel double" mode to draw the world at 2x zoom.
Fixed broken mounting of map packages
Fixed crashes when loading broken maps
Fixed units being left alive but stranded on destroyed bridges
Fixed husks being created on water
Fixed AttackMove trying to send orders to units owned by others
Made LaserZap more flexible for modders
Both C&C and Red Alert:
Fixed desync when a player surrenders
Fixed installing from CD
Added Hotkey support:
escape to toggle ingame menu
escape to go up a level in menus / cancel prompts
return to confirm prompts
Changed shortcut for adding units to groups changed from ctrl->cmd on OSX to avoid conflicting with Spaces
Fixed Tooltips for spectators
Fixed cashticks when selling walls
Fixed show explosions when walls are sold
Fixed veteran units not repairing correctly at service depots
Fixed Rally-point color when a building is captured
Fixed selection box dragging behind ui elements
Added Mod support for passengers that take multiple slots
Added Mod support for custom tesla zap effects
Fixed desync when a support aircraft is killed after completing its task
Fixed bugs with selling refineries
Fixed superweapons being fired from disabled structures when multiple are available
Added "Mission Accomplished" / "Mission Failed" notifications when you win or lose a multiplayer game
Fixed husks jumping to the middle of a cell when a unit dies
Fixed decloak sound never being used
Improved HackyAI power management
C&C:
Completely overhauled UI
Added support for installing from original game disks
Added support for installing music from original game disks
Added support for Covert Ops music tracks
Added Skirmish mode (creates a local game against bots)
Added Configurable bot race/team/spawns
Fixed Rocket Launcher turret raising/lowering when attacking
Added muzzle flashes to Guard Tower / SAM site
Fixed firing offsets on all units and structures
Fixed Ion Cannon cursor
Fixed Apache artwork
Fixed uncapturable oil derricks
Added capturable Biolab tech structure: allows you build viceroids
All vehicles leave husks on death
Server/Skirmish creation selects the last played map by default
New animations for cloak and reveal map crates (from C&C Sole Survivor)
Added 8 new maps by Petrenko
Tweaked most existing maps
Removed East vs West 2 map
Fixed Harvester/Refinery docking animation beneath the fog of war
Improved Obelisk laser effect
Added a blue pip for harvested blue tiberium
Changed the Refinery tower lights to indicate the amount of stored tiberium
Fixed an exploit with Nod airfields on the right side of the map
Fixed bot color being saved as player color in lobby
Balance changes:
Refinery footprint changed, price decreased to $1500
Flame tank explodes on death, damage reduced by 40%
Stealth Tank damage increased, speed decreased
Rocket Launcher now fires 6 rockets, loses AA
Orca / Apache weapons reworked. Both now have limited volleys, but reload in the air. Both can attack other air units
APC weapons reworked. Now has a turret, but can attack air units only
Artillery given back to Nod
SSM launcher removed from Nod
Concrete walls require vehicle production to build
MCV, Harvester, Engineer can no longer level up (via crates)
MCV can no longer receive Cloak crates
Advanced Guard Tower range increased
SAM Site range decreased
Bridge HP halved
Infantry tiberium avoidance factor increased by 5x
Decrease tiberium damage to infantry
Rebalanced tiberium value / harvester capacity / harvesting speed
Reduced Grenadier death damage
Mammoth tank regen rate halved, Missile reload rate decreased
Building repair speed, price doubled
Recon Bike damage increased 16%
Infantry can be crushed by tanks
Removed build area radius around tech structures
Red Alert:
Fixed firing offsets on Flame trooper / Tesla trooper / Telsa tank / Tesla coil / Flame turret
Fixed bounties using incorrect unit value
Fixed parachute offsets
Added muzzle flashes to Pillbox / Camo Pillbox / SAM Site
Fixed map reveal when an ally is granted GPS
Added 16 new maps by buddha, hamb, seru
Fixed bounties of $0 displaying
Removed 3 obsolete maps
Fixed Minelayers not entering the Service Depot properly
Fixed Hind, Yak weapons being blocked by walls
Fixed phantom radar bin on subsequent games
Added new Oil Derrick artwork
Added support for Counterstrike & Aftermath music tracks
Added player color to diplomacy panel
Added capturable oil refinery tech structure
Added new harvester artwork for half-empty/empty states
Added new MCV husk artwork
Fixed spy disguise not working
Fixed hellfire missiles splashing back against helicopters
Fixed animation speed for Grenadier idle animations
Removed Lock Teams option
Fixed cursor while dragging selection box
Fixed accidental order issuing while dragging selection box
Fixed lobby "kick" buttons
Balance changes:
Medic cost reduced to $500
Mines are visible to friendlies and spectators
Friendly units don't trigger mines
Increased reload rate for aircraft
Missile sub submerge delay doubled, damage decreased by 25%
Longbow now requires Allied Tech Center
Reduced wall health
Increased cruiser accuracy
Increased Longbow missile speed by 50%
Increased SAM Site rate of fire
Utility:
Fixed --png mode for converting shp -> png
Editor:
Fixed actor rendering on OSX / Linux
Fixed crash relating to incorrect mix file location
20110511:
Engine:
Fix hotkeys firing on both key down and key up
Allow C4 delay to be configurable
Text field support for home and end keys
Fix world actor being owned by Creeps player (causing Neutral to be hostile) on new maps
Include gpu vendor string in graphics.log for unsupported cards
Fix crash with some aud files
Fix a rare crash when a repairing building is killed
Improvements to HackyAI
Generalize capture logic to work for any actor types
Support RA2-style missile trails
Fix helicopters failing to attack targets in some situations
Fix 'exploit detected' when using hotkeys on another players units
Relinquish spawn point in the game lobby when entering a spectator slot
Fix maps with >8 spawnpoints in the game lobby
Yaml loader crashes correctly when trying to inherit from a nonexistant actor
Yaml loader crashes correctly when trying to remove a nonexistant trait
Modding support for multiple player palettes
Fix several crashes when installing packages
Many other general engine improvements
C&C:
Fix Viceroid target-scan radius
Fix map-placed SAM-sites not being able to attack
Commando voice clip when built
Commando voice clip after kills
RA:
New unit: Supply truck for donating funds to another player
Pilots (sometimes) parachute from shot down planes
Bounties on killed units
Use RA2 style missile trails
New GPS logic
New map: Pressure by seru
Packaging:
Utility writes a log to support dir when crashing
Support for Ubuntu 11.04
Fix osx crash when run from a path with spaces
20110320
Engine:
Display range circles when placing defenses
Support a hostile creeps player for viceroids / dinosaurs / ants / etc
General refactoring and performance fixes
Stop/Scatter/Deploy orders give audio feedback
"Allow cheats" option moved into the game lobby, visible to all players
"Build anywhere" developer mode option
Improved pathfinding when collecting crates or crushing walls.
Refactor idle / prone infantry animations
Improve missile trail effects
Actors without health are not considered as dead
Health bars show recent damage as it is inflicted
Production structures and special powers show selection bars showing progress
Mouseover units to display healthbars etc
Fix shroud glitch when units exit transports
Fix bots jamming up their production structures
Direct connect will assume port 1234 if none is given
Chrome image mapping definitions changed from xml to yaml
Water explosion animations are not used for airborne explosions over water
Fix rendering of very large maps
Report GPU memory usage to debug.log
Massive improvements in repeated allocation / deallocation of memory
Fixed a desync with repairing buildings
Fixed a desync with aircraft (it now crashes deterministically instead)
Fixed a desync with KOTH maps
Fixed a bug where a slot is shown as closed when it contains a bot
Fix crash when spawning map actors owned by a nonexisting player
Fix crash when changing mod while playing music
Fix crash with perf graph
Fix crash in replay viewer if replays directory doesn't exist
Fix crash when selling civilian buildings
Fix crashes caused by blank game title / direct connect server textfields
Oil derricks, harvester unloading, selling structures shows cash indicator
Prerequisites system refactoring to allow non-building prerequisites
Fix shift+tab not cycling the build tabs
Fix bogus keyboard input in text fields
Don't change mods if the same one is selected in the dropdown
Support for remapping the control group addition modifier (ctrl) to any modifier key
Fix helicopters flying 1 cell off the right or bottom of the map
C&C:
Viceroids! Infantry killed by tiberium or chem warriors may turn into viceroids
Fixed death animations
Blue tiberium damages infantry
Map-placed SAM sites start closed
Engineers capturing enemy buildings gives enemy tech
Buildings emit minigunners and engineers when sold (no more technicians / civilians)
Civilians panic when attacked
Fix a rare crash with harvester docking
Fix a rare crash with stealth tank
New Map: East vs West 3 by pchote
Removed Maps: Wargames, Yellowstone II
Oil Derricks have a small sight range
Apaches have a muzzleflash
RA:
Service depots repair units faster
Fix crash when telling a minelayer to create an empty minefield
Fixed interior tileset boxes
New Map: Styrian Mountains by ReFlex
New Map: Convergence by Arcturus
Updated Map: Seaside by nudalz
Longbow ammo increased from 6 to 8, description fixed
Hind cost decreased from 1500 to 1000, hp increased from 100 to 150, range decreased from 12 to 10
Service depot cost increased to from 700 to 1000
Radar dome cost increased from 1000 to 1400
Artillery now requires war factor and radar dome, inaccuracy decreased from 80 to 40
APC moved from Allies to Soviets, hp increased from 200 to 300, price increased from 800 to 850
Medium / Heavy / Mammoth tanks now require service depot to build
Heavy tank cost reduced from 1200 to 1150
Flame turret rate of fire increased from 45 to 65, fires 2 bursts
AA guns, flak trucks can now fire over walls
Jeeps can carry a single passenger
Base defenses no longer provide ground control
Vehicle speed on clear ground increased, speed on ore reduced
Grenadiers have a 50% chance of exploding when killed
Spys are ignored by enemy units when disguised, tooltips show as disguised unit
Fix crates being paradropped inside trees, buildings
Production hotkey for flame turret changed to t, tesla coil to u
Disguised spys now appear correctly on radar and tooltips
Fix GPS behavior when alliances change.
Aircraft now fly to a target location and circle instead of returning to base
Aircraft no longer fly off the map if their Airfield is destroyed
Editor:
New map format (version 5). Maps < Version 4 are no longer supported by the editor or game.
Waypoints and MP start locations are now actors
Importing C&C/RA maps fixed
New png loader to support future tools
Editor uses the correct icon under mono
Editor only saves non-default values for PlayerReferences in map files
Default player colours has been returned to neutral grey.
Maps can be loaded from the commandline
Option to show actor names
Support for veteran / elite actors to be defined in the map yaml
Packaging:
Rename .deb package to use debian naming conventions
Improve linux package installation / elevation prompts (uses zenity, require mono >= 2.6.7)
Fix package installation crash on windows xp
Windowed mode now launches in the center of the screen under Windows
20110207
Engine:
Informative drop messages - user is notified of kick vs game has started vs server unavailable
@@ -43,7 +426,6 @@
Fixed paradrop flare, spyplane from capturing KOTH points
New Map: Nuclear Winter (nudalz)
New Map: Seaside (nudalz)
Editor:
Ability to switch mods after launch
Refactor hardcoded tools into a generic interface
@@ -499,4 +881,4 @@
Improved debugging for performance issues
"Give Exploration" developer-mode option
Check for .net framework on windows install
Allow the viewport to scroll past the map edge to prevent ui from blocking buildings
Allow the viewport to scroll past the map edge to prevent ui from blocking buildings

View File

@@ -1,52 +0,0 @@
using System;
using System.IO;
using OpenRA.FileFormats;
namespace FileExtractor
{
public class FileExtractor
{
int Length = 256;
public FileExtractor (string[] args)
{
if (args.Length != 2)
{
Console.WriteLine("usage: FileExtractor mod[,mod]* filename");
return;
}
var mods = args[0].Split(',');
var manifest = new Manifest(mods);
FileSystem.LoadFromManifest( manifest );
try
{
var readStream = FileSystem.Open(args[1]);
var writeStream = new FileStream(args[1], FileMode.OpenOrCreate, FileAccess.Write);
WriteOutFile(readStream, writeStream);
}
catch (FileNotFoundException)
{
Console.WriteLine(String.Format("No Such File {0}", args[1]));
}
}
void WriteOutFile (Stream readStream, Stream writeStream)
{
Byte[] buffer = new Byte[Length];
int bytesRead = readStream.Read(buffer,0,Length);
while( bytesRead > 0 )
{
writeStream.Write(buffer,0,bytesRead);
bytesRead = readStream.Read(buffer,0,Length);
}
readStream.Close();
writeStream.Close();
}
}
}

View File

@@ -1,13 +0,0 @@
using System;
namespace FileExtractor
{
public class MainClass
{
public static void Main (string[] args)
{
new FileExtractor(args);
}
}
}

0
FreeSans.ttf Executable file → Normal file
View File

26
HACKING
View File

@@ -3,7 +3,7 @@ HACKING
There are n main sections to OpenRA: UI, Rendering, unit behaviour, ...
All units/structures/most things in the map are Actors. Actors contain a collection of traits.
Traits consist of an info class and a class that does stuff
Traits consist of an info class and a class that does stuff. There is one instance of the infoclass shared across all actors of the same type. Each actor gets its own instance of the trait class itself. Infoclasses are responsible for instantiating their corresponding trait class -- see ITraitInfo, and TraitInfo<T> for the trivial implementation of this. In some cases the trait class's constructor needs some args, in which case TraitInfo<T> can't be used. This is a limitation of C# generics.
Actor assembly is done via the mod's yaml files. A section exists for each actor type,
and within that section we list the traits the actor should have.
@@ -15,13 +15,10 @@ which are automatically loaded into the corresponding fields on the trait's ITra
as possible - all cross-trait references should be in terms of an interface from
TraitInterfaces.cs.
- Things an actor can be *doing* are represented as IActivity implementations.
Actor has a queue of these. There's a standard set of activities in
OpenRa.Game/Traits/Activities, and mods tend to define more as they need them. (RA
defines various special-infantry actions as activities).
- Things an actor can be *doing* are represented as Activity subclasses.
Actor has a queue of these. The standard set of activities are in OpenRA.Mods.RA/Activities. Ground vehicle movement is more complex, and has bits in OpenRA.Mods.RA/Move. Aircraft use different bits again, in OpenRA.Mods.RA/Air. There are some bits elsewhere for custom infantry behaviors, etc. In some cases, a trait or activity will maintain an internal subqueue of activities. This works exactly the same way as the actor's main activity queue -- its state is evolved by Util.RunActivity().
- Units offer orders they can perform (given context) through traits that implement IIssueOrder.
Every trait with this interface is given a chance to generate orders for the current context.
- Units offer orders they can perform (given context) through traits that implement IIssueOrder. There are two parts to this -- an Orders collection, which exposes IOrderTargeter objects, which describe orders that the actor *could* generate, and the rules for choosing which to perform when the "default action" button is pressed (RMB). The second part is IssueOrder() itself, which resolves an IOrderTargeter into an actual order object to be sent.
- For more complex things that require modal UI (like special abilities,
RA-style sell/repair buttons, etc) we have IOrderGenerator implementations. This can
@@ -52,19 +49,13 @@ containing art assets (typically .mix files), yaml files defining actor defintio
and ini files containing legacy information that have yet to be ported over to
the (relatively new) yaml system.
The unit artwork itself must be defined in a Sequences file (typically Sequences.xml;
check mod.yaml for a list of what the mod uses); the format is self explanatory. There is
also the SequenceEditor tool to make this easy.
The unit artwork itself must be defined in one or more sequences files. These are specified in the manifest. RA puts everything in mods/ra/sequences.yaml.
check mod.yaml for a list of what the mod uses); the format is self explanatory.
Chrome artwork is similarly defined in Chrome.xml. Chrome is already mod dependent. Sortof ;)
mod-dependent *behavior* would be nice too, not just skinning. This is a property of the traits
however; once we port UI into traits this will become a non-issue.
Rendering
OpenRa.Game/Chrome.cs is the user interface.
Three renderers (SpriteRenderer, LineRenderer, Rgba?Renderer) render most stuff. Don't forget
to flush the renderer (if you want to see anything).
UserSettings stores the data loaded from settings.ini (or defaults). Eventually we need to be
able to save values changed in game into settings.ini (not yet implemented)
@@ -74,14 +65,11 @@ We also have a website at http://www.open-ra.org/ .
Our IRC channel is #openra on irc.freenode.net .
As far as using git, get your own repository on github. You probably want to set up the gitbot
to spam irc when you make commits (its nice to know). Push your changes into your git
repository, and it will/might :P be merged into http://github.com/OpenRA/OpenRA .
As far as using git, get your own repository on github. Push your changes into your git repository, and it will/might :P be merged into http://github.com/OpenRA/OpenRA .
See http://help.github.com/ for working with GitHub and see http://progit.org/ for working
with Git.
Other things we probably want to put in here:
- A guide on how to add a generic unit via yaml using existing traits
- and then introduce some element that requires a simple trait change.

89
INSTALL
View File

@@ -5,55 +5,12 @@ as published by the Free Software Foundation. For more information,
see COPYING.
To run OpenRA, several files are needed from the original game disks.
The required files for the Red Alert mod are:
EITHER:
* conquer.mix
* temperat.mix
* interior.mix
* snow.mix
* sounds.mix
* allies.mix
* russian.mix
OR:
* main.mix
AND:
* redalert.mix
These need to be copied into the mods/ra/packages/ directory.
The required files for the Command and Conquer mod are:
* cclocal.mix
* speech.mix
* conquer.mix
* sounds.mix
* tempicnh.mix
* temperat.mix
* winter.mix
* desert.mix
These need to be copied into the mods/cnc/packages/ directory.
If you have a case-sensitive filesystem you must change the filenames to
lower case.
The files can be downloaded from:
http://open-ra.org/get-dependency.php?file=ra-packages for the Red Alert files and
http://open-ra.org/get-dependency.php?file=cnc-packages for the Command & Conquer files.
Alternatively:
Red Alert and C&C have been released by EA Games as freeware. They can be
downloaded from http://www.commandandconquer.com/classic
Unfortunately the installer is 16-bit and so wont run on 64-bit operating
systems. This can be worked around by using the Red Alert Setup Manager
(http://ra.afraid.org/html/downloads/utilities-3.html).
Make sure you apply the no-CD protection fix so all the files needed
are installed to the hard drive.
These files are now downloaded and installed by the game,
so so no explicit action is required.
Dependencies - Make sure you have these installed, or you'll
have very strange errors.
WINDOWS:
* .NET Framework >= 3.5-SP1
@@ -65,7 +22,7 @@ WINDOWS:
* Cg Toolkit >= 2.2
(http://developer.download.nvidia.com/cg/Cg_2.2/Cg-2.2_October2009_Setup.exe)
To compile OpenRA, open the OpenRA.sln solution in the main folder,
To compile OpenRA, open the OpenRA.sln solution in the main folder,
or build it from the command-line with MSBuild.
Run the game with `OpenRA.Game.exe Game.Mods=ra` for Red Alert
@@ -73,31 +30,41 @@ or `OpenRA.Game.exe Game.Mods=cnc` for Command & Conquer
UBUNTU (substitute comparable packages for other linux distros):
* mono-runtime (>= 2.6.7),
* mono-gmcs
* freetype
* libmono-corlib1.0-cil
* libmono-winforms2.0-cil
* libopenal1
* libsdl1.2-dev
* nvidia-cg-toolkit (download the latest version from
http://developer.nvidia.com/object/cg_download.html)
* nvidia-cg-toolkit (for Cg renderer)
OpenRA is incompatible with Compiz, please disable desktop effects when trying
to run OpenRA or the game will crash.
OpenRA does not work with some older versions of Compiz. On affected systems, disable desktop effects before playing. This is fixed in Ubuntu Natty and later.
You will need to copy the third party dependencies (.dll and .config) from the
thirdparty and thirdparty/Tao directories into the game root, or install them permanently into
your GAC with the following script
You will additionally need to copy the third party dependencies (.dll and .config) from the
thirdparty and thirdparty/Tao directories into the game root:
#!/bin/sh
gacutil -i thirdparty/Tao/Tao.Cg.dll
gacutil -i thirdparty/Tao/Tao.OpenGl.dll
gacutil -i thirdparty/Tao/Tao.OpenAl.dll
gacutil -i thirdparty/Tao/Tao.Sdl.dll
gacutil -i thirdparty/Tao/Tao.FreeType.dll
gacutil -i thirdparty/ICSharpCode.SharpZipLib.dll
cp -v thirdparty/*.dll thirdparty/Tao/* .
Alternatively, the dlls can be installed into your system GAC. This is not
recommended because we ship a custom Tao.FreeType that can conflict with
other applications that use Tao:
gacutil -i thirdparty/Tao/Tao.Cg.dll
gacutil -i thirdparty/Tao/Tao.OpenGl.dll
gacutil -i thirdparty/Tao/Tao.OpenAl.dll
gacutil -i thirdparty/Tao/Tao.Sdl.dll
gacutil -i thirdparty/Tao/Tao.FreeType.dll
gacutil -i thirdparty/ICSharpCode.SharpZipLib.dll
To compile OpenRA, run `make' from the command line.
Run the game with `mono OpenRA.Game.exe Game.Mods=ra` for Red Alert
or `mono OpenRA.Game.exe Game.Mods=cnc` for Command & Conquer
SLACKWARE:
The following packages from slackbuilds.org are required, on 13.37 32bit:
* libgdiplus
* mono
* openAL
* nvidia-cg-toolkit (for Cg renderer)

116
Makefile
View File

@@ -5,27 +5,26 @@ COMMON_LIBS = System.dll System.Core.dll System.Drawing.dll System.Xml.dll third
PHONY = core tools package all mods clean distclean
.SUFFIXES:
core: game renderers mod_ra mod_cnc
tools: editor ralint seqed filex tsbuild utility
package: fixheader core editor utility
core: game renderers mod_ra mod_cnc utility
tools: editor ralint tsbuild
package: core editor
mods: mod_ra mod_cnc
all: core tools
clean:
@-rm *.exe *.dll *.mdb mods/**/*.dll mods/**/*.mdb *.resources
@-rm -f *.exe *.dll *.mdb mods/**/*.dll mods/**/*.mdb *.resources
distclean: clean
#
# Core binaries
#
fileformats_SRCS = $(shell find OpenRA.FileFormats/ -iname '*.cs')
fileformats_SRCS := $(shell find OpenRA.FileFormats/ -iname '*.cs')
fileformats_TARGET = OpenRA.FileFormats.dll
#fileformats_DEPS = fixheader
fileformats_KIND = library
fileformats_LIBS = $(COMMON_LIBS) thirdparty/Tao/Tao.Sdl.dll System.Windows.Forms.dll
PROGRAMS = fileformats
fileformats: $(fileformats_TARGET)
game_SRCS = $(shell find OpenRA.Game/ -iname '*.cs')
game_SRCS := $(shell find OpenRA.Game/ -iname '*.cs')
game_TARGET = OpenRA.Game.exe
game_KIND = winexe
game_DEPS = $(fileformats_TARGET)
@@ -38,76 +37,78 @@ game: $(game_TARGET)
#
# Renderer dlls
#
rcg_SRCS = $(shell find OpenRA.Renderer.Cg/ -iname '*.cs')
rsdl_SRCS := $(shell find OpenRA.Renderer.SdlCommon/ -iname '*.cs')
rsdl_TARGET = OpenRA.Renderer.SdlCommon.dll
rsdl_KIND = library
rsdl_DEPS = $(fileformats_TARGET) $(game_TARGET)
rsdl_LIBS = $(COMMON_LIBS) System.Windows.Forms.dll \
thirdparty/Tao/Tao.OpenGl.dll thirdparty/Tao/Tao.Sdl.dll \
$(rsdl_DEPS)
rcg_SRCS := $(shell find OpenRA.Renderer.Cg/ -iname '*.cs')
rcg_TARGET = OpenRA.Renderer.Cg.dll
rcg_KIND = library
rcg_DEPS = $(fileformats_TARGET) $(game_TARGET)
rcg_DEPS = $(fileformats_TARGET) $(game_TARGET) $(rsdl_TARGET)
rcg_LIBS = $(COMMON_LIBS) System.Windows.Forms.dll \
thirdparty/Tao/Tao.Cg.dll thirdparty/Tao/Tao.OpenGl.dll thirdparty/Tao/Tao.Sdl.dll \
$(rcg_DEPS) $(game_TARGET)
$(rcg_DEPS)
rgl_SRCS = $(shell find OpenRA.Renderer.Gl/ -iname '*.cs')
rgl_SRCS := $(shell find OpenRA.Renderer.Gl/ -iname '*.cs')
rgl_TARGET = OpenRA.Renderer.Gl.dll
rgl_KIND = library
rgl_DEPS = $(fileformats_TARGET) $(game_TARGET)
rgl_DEPS = $(fileformats_TARGET) $(game_TARGET) $(rsdl_TARGET)
rgl_LIBS = $(COMMON_LIBS) System.Windows.Forms.dll \
thirdparty/Tao/Tao.Cg.dll thirdparty/Tao/Tao.OpenGl.dll thirdparty/Tao/Tao.Sdl.dll \
$(rgl_DEPS) $(game_TARGET)
$(rgl_DEPS)
rnull_SRCS = $(shell find OpenRA.Renderer.Null/ -iname '*.cs')
rnull_TARGET = OpenRA.Renderer.Null.dll
rnull_SRCS := $(shell find OpenRA.Renderer.Null/ -iname '*.cs')
rnull_TARGET = OpenRA.Renderer.Null.dll
rnull_KIND = library
rnull_DEPS = $(fileformats_TARGET) $(game_TARGET)
rnull_LIBS = $(COMMON_LIBS) System.Windows.Forms.dll \
$(rnull_DEPS) $(game_TARGET)
PROGRAMS += rcg rgl rnull
renderers: $(rcg_TARGET) $(rgl_TARGET) $(rnull_TARGET)
$(rnull_DEPS)
PROGRAMS += rcg rgl rnull rsdl
renderers: $(rcg_TARGET) $(rgl_TARGET) $(rnull_TARGET) $(rsdl_TARGET)
#
# Official Mods
#
# Red Alert
mod_ra_SRCS = $(shell find OpenRA.Mods.RA/ -iname '*.cs')
mod_ra_TARGET = mods/ra/OpenRA.Mods.RA.dll
STD_MOD_LIBS = $(fileformats_TARGET) $(game_TARGET)
STD_MOD_DEPS = $(STD_MOD_LIBS) $(ralint_TARGET)
mod_ra_SRCS := $(shell find OpenRA.Mods.RA/ -iname '*.cs')
mod_ra_TARGET = mods/ra/OpenRA.Mods.RA.dll
mod_ra_KIND = library
mod_ra_DEPS = $(fileformats_TARGET) $(game_TARGET)
mod_ra_LIBS = $(COMMON_LIBS) $(mod_ra_DEPS)
mod_ra_DEPS = $(STD_MOD_DEPS)
mod_ra_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS)
mod_ra_EXTRA_CMDS = mono --debug RALint.exe ra
PROGRAMS += mod_ra
mod_ra: $(mod_ra_TARGET)
# mono RALint.exe ra
# Command and Conquer
mod_cnc_SRCS = $(shell find OpenRA.Mods.Cnc/ -iname '*.cs')
mod_cnc_SRCS := $(shell find OpenRA.Mods.Cnc/ -iname '*.cs')
mod_cnc_TARGET = mods/cnc/OpenRA.Mods.Cnc.dll
mod_cnc_KIND = library
mod_cnc_DEPS = $(fileformats_TARGET) $(game_TARGET) $(mod_ra_TARGET)
mod_cnc_LIBS = $(COMMON_LIBS) $(mod_cnc_DEPS)
PROGRAMS += mod_cnc
mod_cnc_DEPS = $(STD_MOD_DEPS) $(mod_ra_TARGET)
mod_cnc_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_ra_TARGET)
mod_cnc_EXTRA_CMDS = mono --debug RALint.exe cnc
PROGRAMS += mod_cnc
mod_cnc: $(mod_cnc_TARGET)
# mono RALint.exe cnc
#
# Tools
#
# Sequence editor (defunct)
seqed_SRCS = $(shell find SequenceEditor/ -iname '*.cs')
seqed_TARGET = SequenceEditor.exe
seqed_KIND = winexe
seqed_DEPS = $(fileformats_TARGET)
seqed_LIBS = $(COMMON_LIBS) System.Windows.Forms.dll $(seqed_DEPS)
seqed_EXTRA = -resource:SequenceEditor.Form1.resources
PROGRAMS += seqed
SequenceEditor.Form1.resources:
resgen2 SequenceEditor/Form1.resx SequenceEditor.Form1.resources 1> /dev/null
seqed: SequenceEditor.Form1.resources $(seqed_TARGET)
# Map Editor
editor_SRCS = $(shell find OpenRA.Editor/ -iname '*.cs')
editor_TARGET = OpenRA.Editor.exe
editor_SRCS := $(shell find OpenRA.Editor/ -iname '*.cs')
editor_TARGET = OpenRA.Editor.exe
editor_KIND = winexe
editor_DEPS = $(fileformats_TARGET) $(game_TARGET)
editor_LIBS = $(COMMON_LIBS) System.Windows.Forms.dll System.Data.dll $(editor_DEPS)
editor_EXTRA = -resource:OpenRA.Editor.Form1.resources -resource:OpenRA.Editor.MapSelect.resources
editor_FLAGS = -win32icon:OpenRA.Editor/OpenRA.Editor.Icon.ico
PROGRAMS += editor
OpenRA.Editor.MapSelect.resources:
resgen2 OpenRA.Editor/MapSelect.resx OpenRA.Editor.MapSelect.resources 1> /dev/null
@@ -116,25 +117,16 @@ OpenRA.Editor.Form1.resources:
editor: OpenRA.Editor.MapSelect.resources OpenRA.Editor.Form1.resources $(editor_TARGET)
# Analyses mod yaml for easy to detect errors
ralint_SRCS = $(shell find RALint/ -iname '*.cs')
ralint_TARGET = RALint.exe
ralint_SRCS := $(shell find RALint/ -iname '*.cs')
ralint_TARGET = RALint.exe
ralint_KIND = exe
ralint_DEPS = $(fileformats_TARGET) $(game_TARGET)
ralint_LIBS = $(COMMON_LIBS) $(ralint_DEPS)
PROGRAMS += ralint
ralint: $(ralint_TARGET)
# Extracts files from packages (mixfiles, zips, etc)
filex_SRCS = $(shell find FileExtractor/ -iname '*.cs')
filex_TARGET = FileExtractor.exe
filex_KIND = exe
filex_DEPS = $(fileformats_TARGET)
filex_LIBS = $(COMMON_LIBS) $(filex_DEPS)
PROGRAMS += filex
filex: $(filex_TARGET)
# Builds and exports tilesets from a bitmap
tsbuild_SRCS = $(shell find OpenRA.TilesetBuilder/ -iname '*.cs')
tsbuild_SRCS := $(shell find OpenRA.TilesetBuilder/ -iname '*.cs')
tsbuild_TARGET = TilesetBuilder.exe
tsbuild_KIND = winexe
tsbuild_DEPS = $(fileformats_TARGET) $(game_TARGET)
@@ -149,12 +141,12 @@ tsbuild: OpenRA.TilesetBuilder.Form1.resources $(tsbuild_TARGET)
# Launchers / Utilities
#
# Patches binary headers to work around a mono bug
fixheader: packaging/fixheader.cs
fixheader.exe: packaging/fixheader.cs
@echo CSC fixheader.exe
@$(CSC) packaging/fixheader.cs $(CSFLAGS) -out:fixheader.exe -t:exe $(COMMON_LIBS:%=-r:%)
PHONY += fixheader
# Backend for the launcher apps - queries game/mod info and applies actions to an install
utility_SRCS = $(shell find OpenRA.Utility/ -iname '*.cs')
utility_SRCS := $(shell find OpenRA.Utility/ -iname '*.cs')
utility_TARGET = OpenRA.Utility.exe
utility_KIND = exe
utility_DEPS = $(fileformats_TARGET) $(game_TARGET)
@@ -169,7 +161,7 @@ utility: $(utility_TARGET)
#
define BUILD_ASSEMBLY
$$($(1)_TARGET): $$($(1)_SRCS) Makefile $$($(1)_DEPS)
$$($(1)_TARGET): $$($(1)_SRCS) Makefile $$($(1)_DEPS) fixheader.exe
@echo CSC $$(@)
@$(CSC) $$($(1)_LIBS:%=-r:%) \
-out:$$(@) $(CSFLAGS) $$($(1)_FLAGS) \
@@ -177,7 +169,9 @@ $$($(1)_TARGET): $$($(1)_SRCS) Makefile $$($(1)_DEPS)
-t:"$$($(1)_KIND)" \
$$($(1)_EXTRA) \
$$($(1)_SRCS)
@test -e fixheader.exe && mono fixheader.exe $$(@) || ``
@mono fixheader.exe $$(@) > /dev/null
@test `echo $$(@) | sed 's/^.*\.//'` = "dll" && chmod a-x $$(@) || ``
@$$($(1)_EXTRA_CMDS)
endef
$(foreach prog,$(PROGRAMS),$(eval $(call BUILD_ASSEMBLY,$(prog))))
@@ -194,7 +188,7 @@ BIN_INSTALL_DIR = $(DESTDIR)$(bindir)
INSTALL_DIR = $(DESTDIR)$(datadir)/openra
INSTALL = install
INSTALL_PROGRAM = $(INSTALL)
CORE = fileformats rcg rgl rnull game editor utility
CORE = fileformats rcg rgl rsdl rnull game editor utility
install: all
@-echo "Installing OpenRA to $(INSTALL_DIR)"
@@ -230,7 +224,7 @@ install: all
@echo "#!/bin/sh" > openra
@echo "cd "$(datadir)"/openra" >> openra
@echo "mono "$(datadir)"/openra/OpenRA.Game.exe SupportDir=~/.openra \"$$""@\"" >> openra
@echo "mono "$(datadir)"/openra/OpenRA.Game.exe \"$$""@\"" >> openra
@$(INSTALL_PROGRAM) -d $(BIN_INSTALL_DIR)
@$(INSTALL_PROGRAM) -m +rx openra $(BIN_INSTALL_DIR)

View File

@@ -1,94 +1,92 @@
namespace SequenceEditor
{
partial class GetTextForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox1.Location = new System.Drawing.Point(13, 13);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(337, 20);
this.textBox1.TabIndex = 0;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
this.button1.Location = new System.Drawing.Point(194, 50);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 1;
this.button1.Text = "OK";
this.button1.UseVisualStyleBackColor = true;
//
// button2
//
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button2.Location = new System.Drawing.Point(275, 50);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 2;
this.button2.Text = "Cancel";
this.button2.UseVisualStyleBackColor = true;
//
// GetTextForm
//
this.AcceptButton = this.button1;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.button2;
this.ClientSize = new System.Drawing.Size(362, 85);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "GetTextForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Placeholder";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
}
namespace OpenRA.Editor
{
partial class ActorPropertiesDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.SuspendLayout();
//
// button1
//
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button1.Location = new System.Drawing.Point(226, 333);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
this.button1.Text = "Cancel";
this.button1.UseVisualStyleBackColor = true;
//
// button2
//
this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button2.Enabled = false;
this.button2.Location = new System.Drawing.Point(145, 333);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 0;
this.button2.Text = "OK";
this.button2.UseVisualStyleBackColor = true;
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.AutoScroll = true;
this.flowLayoutPanel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.flowLayoutPanel1.Location = new System.Drawing.Point(13, 13);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(288, 314);
this.flowLayoutPanel1.TabIndex = 1;
//
// ActorPropertiesDialog
//
this.AcceptButton = this.button2;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.button1;
this.ClientSize = new System.Drawing.Size(313, 368);
this.Controls.Add(this.flowLayoutPanel1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ActorPropertiesDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Actor Properties";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
}
}

View File

@@ -0,0 +1,49 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
using System.Drawing;
using System.Windows.Forms;
using OpenRA.FileFormats;
namespace OpenRA.Editor
{
public partial class ActorPropertiesDialog : Form
{
public ActorPropertiesDialog()
{
InitializeComponent();
}
public void AddRow(string name, Control c)
{
flowLayoutPanel1.Controls.Add(new Label
{
Text = name,
Width = flowLayoutPanel1.Width * 3 / 10,
Height = 25,
TextAlign = ContentAlignment.MiddleLeft,
});
c.Width = flowLayoutPanel1.Width * 6 / 10 - 25;
c.Height = 25;
flowLayoutPanel1.Controls.Add(c);
}
public Control MakeEditorControl(Type t, Func<object> getter, Action<object> setter)
{
var r = new TextBox();
r.Text = FieldSaver.FormatValue(getter(), t);
r.LostFocus += (e,_) => setter(FieldLoader.GetValue("<editor internals>", t, r.Text));
r.Enabled = false;
return r;
}
}
}

View File

@@ -1,120 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -22,10 +22,8 @@ namespace OpenRA.Editor
public void Preview(Surface surface, SGraphics g)
{
/* todo: include the player
* in the brush so we can color new buildings too */
surface.DrawActor(g, surface.GetBrushLocation(), Actor, null);
surface.DrawActor(g, surface.GetBrushLocation(), Actor,
surface.GetPaletteForPlayer(surface.NewActorOwner));
}
public void Apply(Surface surface)
@@ -33,7 +31,7 @@ namespace OpenRA.Editor
if (surface.Map.Actors.Value.Any(a => a.Value.Location() == surface.GetBrushLocation()))
return;
var owner = "Neutral";
var owner = surface.NewActorOwner;
var id = NextActorName(surface);
surface.Map.Actors.Value[id] = new ActorReference(Actor.Info.Name.ToLowerInvariant())
{

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -26,8 +26,8 @@ namespace OpenRA.Editor
public void Apply(Surface surface)
{
// change the bits in the map
var tile = surface.TileSet.Tiles[Brush.N];
var template = surface.TileSet.Templates[Brush.N];
var tile = template.Data;
var pos = surface.GetBrushLocation();
if (surface.GetModifiers() == Keys.Shift)

100
OpenRA.Editor/ErrorListDialog.Designer.cs generated Normal file
View File

@@ -0,0 +1,100 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
namespace OpenRA.Editor
{
partial class ErrorListDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.listBox1 = new System.Windows.Forms.ListBox();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label1.Location = new System.Drawing.Point(10, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(610, 23);
this.label1.TabIndex = 0;
this.label1.Text = "Your map import completed, but with errors:";
//
// listBox1
//
this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listBox1.FormattingEnabled = true;
this.listBox1.Location = new System.Drawing.Point(13, 30);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(607, 316);
this.listBox1.TabIndex = 1;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button1.Location = new System.Drawing.Point(545, 359);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 2;
this.button1.Text = "Close";
this.button1.UseVisualStyleBackColor = true;
//
// ErrorListDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(632, 394);
this.Controls.Add(this.button1);
this.Controls.Add(this.listBox1);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "ErrorListDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Map Import Errors";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.Button button1;
}
}

View File

@@ -1,34 +1,25 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System.Collections.Generic;
using System.Windows.Forms;
namespace SequenceEditor
namespace OpenRA.Editor
{
public partial class GetTextForm : Form
public partial class ErrorListDialog : Form
{
public GetTextForm()
public ErrorListDialog( IEnumerable<string> errors )
{
InitializeComponent();
}
public static string GetString(string title, string defaultValue)
{
using (var f = new GetTextForm())
{
f.textBox1.Text = defaultValue;
f.Text = title;
if (DialogResult.OK != f.ShowDialog())
return null;
return f.textBox1.Text;
}
foreach (var e in errors)
listBox1.Items.Add(e);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -10,6 +10,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;
@@ -21,16 +22,16 @@ namespace OpenRA.Editor
{
public partial class Form1 : Form
{
public Form1(string[] mods)
public Form1(string[] args)
{
InitializeComponent();
AppDomain.CurrentDomain.AssemblyResolve += FileSystem.ResolveAssembly;
currentMod = mods.FirstOrDefault() ?? "ra";
currentMod = args.FirstOrDefault() ?? "ra";
toolStripComboBox1.Items.AddRange(Mod.AllMods.Keys.ToArray());
toolStripComboBox1.SelectedIndexChanged += (_, e) =>
toolStripComboBox1.SelectedIndexChanged += (_, e) =>
{
tilePalette.SuspendLayout();
actorPalette.SuspendLayout();
@@ -44,18 +45,22 @@ namespace OpenRA.Editor
surface1.Bind(null, null, null);
pmMiniMap.Image = null;
currentMod = toolStripComboBox1.SelectedItem as string;
Text = "OpenRA Editor (mod:{0})".F(currentMod);
Game.modData = new ModData(currentMod);
FileSystem.LoadFromManifest(Game.modData.Manifest);
Rules.LoadRules(Game.modData.Manifest, new Map());
loadedMapName = null;
};
toolStripComboBox1.SelectedItem = currentMod;
surface1.AfterChange += OnMapChanged;
surface1.MousePositionChanged += s => toolStripStatusLabelMousePosition.Text = s;
surface1.ActorDoubleClicked += ActorDoubleClicked;
if (args.Length >= 2)
LoadMap(args[1]);
}
void OnMapChanged()
@@ -64,7 +69,31 @@ namespace OpenRA.Editor
pmMiniMap.Image = Minimap.AddStaticResources(surface1.Map, Minimap.TerrainBitmap(surface1.Map, true));
}
void ActorDoubleClicked(KeyValuePair<string,ActorReference> kv)
{
using( var apd = new ActorPropertiesDialog() )
{
var name = kv.Key;
apd.AddRow("(Name)", apd.MakeEditorControl(typeof(string), () => name, v => name = (string)v));
apd.AddRow("(Type)", apd.MakeEditorControl(typeof(string), () => kv.Value.Type, v => kv.Value.Type = (string)v));
var objSaved = kv.Value.Save();
// TODO: make this work properly
foreach( var init in Rules.Info[kv.Value.Type].GetInitKeys() )
apd.AddRow(init.First,
apd.MakeEditorControl(init.Second,
() => objSaved.NodesDict.ContainsKey( init.First ) ? objSaved.NodesDict[init.First].Value : null,
_ => {}));
apd.ShowDialog();
// TODO: writeback
}
}
void MakeDirty() { dirty = true; }
string loadedMapName;
string currentMod = "ra";
TileSet tileset;
@@ -84,8 +113,7 @@ namespace OpenRA.Editor
// upgrade maps that have no player definitions. editor doesnt care,
// but this breaks the game pretty badly.
if (map.Players.Count == 0)
map.Players.Add("Neutral", new PlayerReference("Neutral",
Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race, true, true));
map.MakeDefaultPlayers();
PrepareMapResources(Game.modData.Manifest, map);
@@ -112,7 +140,6 @@ namespace OpenRA.Editor
tileset.LoadTiles();
var palette = new Palette(FileSystem.Open(tileset.Palette), true);
surface1.Bind(map, tileset, palette);
// construct the palette of tiles
var palettes = new[] { tilePalette, actorPalette, resourcePalette };
@@ -121,7 +148,7 @@ namespace OpenRA.Editor
{
try
{
var bitmap = RenderUtils.RenderTemplate(tileset, (ushort)t.Key, palette);
var bitmap = tileset.RenderTemplate((ushort)t.Key, palette);
var ibox = new PictureBox
{
Image = bitmap,
@@ -153,6 +180,13 @@ namespace OpenRA.Editor
{
var info = Rules.Info[a];
if (!info.Traits.Contains<RenderSimpleInfo>()) continue;
var etf = info.Traits.GetOrDefault<EditorTilesetFilterInfo>();
if (etf != null && etf.ExcludeTilesets != null
&& etf.ExcludeTilesets.Contains(tileset.Id)) continue;
if (etf != null && etf.RequireTilesets != null
&& !etf.RequireTilesets.Contains(tileset.Id)) continue;
var template = RenderUtils.RenderActor(info, tileset, palette);
var ibox = new PictureBox
{
@@ -163,7 +197,6 @@ namespace OpenRA.Editor
BorderStyle = BorderStyle.FixedSingle
};
ibox.Click += (_, e) => surface1.SetTool(new ActorTool(template));
actorPalette.Controls.Add(ibox);
@@ -223,10 +256,19 @@ namespace OpenRA.Editor
propertiesToolStripMenuItem.Enabled = true;
resizeToolStripMenuItem.Enabled = true;
spawnpointsToolStripMenuItem.Enabled = true;
saveToolStripMenuItem.Enabled = true;
saveAsToolStripMenuItem.Enabled = true;
mnuMinimapToPNG.Enabled = true; // todo: what is this VB naming bullshit doing here?
PopulateActorOwnerChooser();
}
void PopulateActorOwnerChooser()
{
actorOwnerChooser.Items.Clear();
actorOwnerChooser.Items.AddRange(surface1.Map.Players.Values.ToArray());
actorOwnerChooser.SelectedIndex = 0;
surface1.NewActorOwner = (actorOwnerChooser.SelectedItem as PlayerReference).Name;
}
void ResizeClicked(object sender, EventArgs e)
@@ -319,8 +361,9 @@ namespace OpenRA.Editor
map.Resize((int)nmd.width.Value, (int)nmd.height.Value);
map.ResizeCordon((int)nmd.cordonLeft.Value, (int)nmd.cordonTop.Value,
(int)nmd.cordonRight.Value, (int)nmd.cordonBottom.Value);
map.Players.Add("Neutral", new PlayerReference("Neutral", Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race, true, true));
map.Players.Add("Creeps", new PlayerReference("Creeps", Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race, true, true));
map.MakeDefaultPlayers();
NewMap(map);
}
}
@@ -357,24 +400,26 @@ namespace OpenRA.Editor
void ImportLegacyMapClicked(object sender, EventArgs e)
{
var currentDirectory = Directory.GetCurrentDirectory();
using (var ofd = new OpenFileDialog { Filter = "Legacy maps (*.ini;*.mpr)|*.ini;*.mpr" })
using (var ofd = new OpenFileDialog { RestoreDirectory = true,
Filter = "Legacy maps (*.ini;*.mpr)|*.ini;*.mpr" })
if (DialogResult.OK == ofd.ShowDialog())
{
Directory.SetCurrentDirectory(currentDirectory);
/* massive hack: we should be able to call NewMap() with the imported Map object,
* but something's not right internally in it, unless loaded via the real maploader */
var savePath = Path.Combine(Path.GetTempPath(), "OpenRA.Import");
Directory.CreateDirectory(savePath);
var map = LegacyMapImporter.Import(ofd.FileName);
map.Players.Add("Neutral", new PlayerReference("Neutral",
Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race, true, true));
map.Players.Add("Creeps", new PlayerReference("Creeps",
Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race, true, true));
var errors = new List<string>();
var map = LegacyMapImporter.Import(ofd.FileName, a => errors.Add(a));
if (errors.Count > 0)
using (var eld = new ErrorListDialog(errors))
eld.ShowDialog();
map.MakeDefaultPlayers();
map.Save(savePath);
LoadMap(savePath);
loadedMapName = null; /* editor needs to think this hasnt been saved */
@@ -397,19 +442,85 @@ namespace OpenRA.Editor
}
}
private void layersFloaterToolStripMenuItem_Click(object sender, EventArgs e)
{
var pb = new PaletteBox();
pb.Show();
}
void ExportMinimap(object sender, EventArgs e)
{
saveFileDialog.InitialDirectory = Path.Combine(Environment.CurrentDirectory, "maps");
saveFileDialog.FileName = Path.ChangeExtension(loadedMapName, ".png");
using( var sfd = new SaveFileDialog() {
InitialDirectory = Path.Combine(Environment.CurrentDirectory, "maps"),
DefaultExt = "*.png",
Filter = "PNG Image (*.png)|*.png",
Title = "Export Minimap to PNG",
FileName = Path.ChangeExtension(loadedMapName, ".png"),
RestoreDirectory = true } )
if (DialogResult.OK == sfd.ShowDialog())
pmMiniMap.Image.Save(sfd.FileName);
}
if (DialogResult.OK == saveFileDialog.ShowDialog())
pmMiniMap.Image.Save(saveFileDialog.FileName);
void ShowActorNamesClicked(object sender, EventArgs e)
{
showActorNamesToolStripMenuItem.Checked ^= true;
surface1.ShowActorNames = showActorNamesToolStripMenuItem.Checked;
}
void ShowGridClicked(object sender, EventArgs e)
{
showGridToolStripMenuItem.Checked ^= true;
surface1.ShowGrid = showGridToolStripMenuItem.Checked;
surface1.Chunks.Clear();
}
void FixOpenAreas(object sender, EventArgs e)
{
dirty = true;
var r = new Random();
for (var j = surface1.Map.Bounds.Top; j < surface1.Map.Bounds.Bottom; j++)
for (var i = surface1.Map.Bounds.Left; i < surface1.Map.Bounds.Right; i++)
{
var tr = surface1.Map.MapTiles.Value[i, j];
if (tr.type == 0xff || tr.type == 0xffff || tr.type == 1 || tr.type == 2)
tr.index = (byte)r.Next(0,
Rules.TileSets[surface1.Map.Tileset].Templates[tr.type].Data.TileBitmapBytes.Count);
surface1.Map.MapTiles.Value[i, j] = tr;
}
surface1.Chunks.Clear();
surface1.Invalidate();
}
void SetupDefaultPlayers(object sender, EventArgs e)
{
dirty = true;
surface1.Map.MakeDefaultPlayers();
surface1.Chunks.Clear();
surface1.Invalidate();
PopulateActorOwnerChooser();
}
void onDrawPlayerItem(object sender, DrawItemEventArgs e)
{
// color block
var player = e.Index >= 0 ? (PlayerReference)(sender as ComboBox).Items[e.Index] : null;
e.DrawBackground();
e.DrawFocusRectangle();
if (player == null)
return;
var color = player.ColorRamp.GetColor(0);
using( var brush = new SolidBrush(color) )
e.Graphics.FillRectangle( brush, e.Bounds.Left + 2, e.Bounds.Top + 2, e.Bounds.Height + 6, e.Bounds.Height - 4 );
using( var foreBrush = new SolidBrush(e.ForeColor) )
e.Graphics.DrawString( player.Name, e.Font, foreBrush, e.Bounds.Left + e.Bounds.Height + 12, e.Bounds.Top );
}
void onSelectOwner(object sender, EventArgs e)
{
var player = actorOwnerChooser.SelectedItem as PlayerReference;
surface1.NewActorOwner = player.Name;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -39,12 +39,12 @@ namespace OpenRA.Editor
{ "gold02", new Pair<byte,byte>(1,1) },
{ "gold03", new Pair<byte,byte>(1,2) },
{ "gold04", new Pair<byte,byte>(1,3) },
{ "gem01", new Pair<byte,byte>(2,0) },
{ "gem02", new Pair<byte,byte>(2,1) },
{ "gem03", new Pair<byte,byte>(2,2) },
{ "gem04", new Pair<byte,byte>(2,3) },
// cnc tiberium
{ "ti1", new Pair<byte,byte>(1,0) },
{ "ti2", new Pair<byte,byte>(1,1) },
@@ -67,7 +67,7 @@ namespace OpenRA.Editor
{"brik","brik"},
{"fenc","fenc"},
{"wood","wood"},
// Fields
{"v12","v12"},
{"v13","v13"},
@@ -76,12 +76,12 @@ namespace OpenRA.Editor
{"v16","v16"},
{"v17","v17"},
{"v18","v18"},
// Crates
// {"wcrate","crate"},
// {"scrate","crate"},
};
// todo: fix this -- will have bitrotted pretty badly.
static Dictionary<string,Pair<Color,Color>> namedColorMapping = new Dictionary<string, Pair<Color, Color>>()
{
@@ -96,28 +96,30 @@ namespace OpenRA.Editor
{"white",Pair.New(Color.FromArgb(255,255,255),Color.FromArgb(75,75,75))},
{"black",Pair.New(Color.FromArgb(80,80,80),Color.FromArgb(5,5,5))},
};
int MapSize;
int ActorCount = 0;
Map Map = new Map();
List<string> Players = new List<string>();
LegacyMapImporter(string filename)
Action<string> errorHandler;
LegacyMapImporter(string filename, Action<string> errorHandler)
{
this.errorHandler = errorHandler;
ConvertIniMap(filename);
}
public static Map Import(string filename)
public static Map Import(string filename, Action<string> errorHandler)
{
var converter = new LegacyMapImporter(filename);
var converter = new LegacyMapImporter(filename, errorHandler);
return converter.Map;
}
enum IniMapFormat { RedAlert = 3, /* otherwise, cnc (2 variants exist, we don't care to differentiate) */ };
public void ConvertIniMap(string iniFile)
{
var file = new IniFile(FileSystem.Open(iniFile));
var basic = file.GetSection("Basic");
var map = file.GetSection("Map");
@@ -135,12 +137,12 @@ namespace OpenRA.Editor
Map.MapSize.Y = MapSize;
Map.Bounds = Rectangle.FromLTRB(XOffset, YOffset, XOffset + Width, YOffset + Height);
Map.Selectable = true;
Map.Smudges = Lazy.New(() => new List<SmudgeReference>());
Map.Actors = Lazy.New(() => new Dictionary<string, ActorReference>());
Map.MapResources = Lazy.New(() => new TileReference<byte, byte>[MapSize, MapSize]);
Map.MapTiles = Lazy.New(() => new TileReference<ushort, byte>[MapSize, MapSize]);
if (legacyMapFormat == IniMapFormat.RedAlert)
{
UnpackRATileData(ReadPackedSection(file.GetSection("MapPack")));
@@ -153,30 +155,31 @@ namespace OpenRA.Editor
ReadCncOverlay(file);
ReadCncTrees(file);
}
LoadActors(file, "STRUCTURES");
LoadActors(file, "UNITS");
LoadActors(file, "INFANTRY");
LoadSmudges(file, "SMUDGE");
foreach (var p in Players)
LoadPlayer(file, p, (legacyMapFormat == IniMapFormat.RedAlert));
var wps = file.GetSection("Waypoints")
.Where(kv => int.Parse(kv.Value) > 0)
.Select(kv => Pair.New(int.Parse(kv.Key),
LocationFromMapOffset(int.Parse(kv.Value), MapSize)))
.ToArray();
// Add waypoint actors
foreach( var kv in wps )
{
var a = new ActorReference("mpspawn");
a.Add(new LocationInit(kv.Second));
a.Add(new OwnerInit("Neutral"));
Map.Actors.Value.Add("spawn" + kv.First, a);
}
}
static int2 LocationFromMapOffset(int offset, int mapSize)
@@ -240,7 +243,7 @@ namespace OpenRA.Editor
return ret;
}
void UnpackRATileData(MemoryStream ms)
{
for (int i = 0; i < MapSize; i++)
@@ -271,10 +274,10 @@ namespace OpenRA.Editor
if (o != 255 && overlayActorMapping.ContainsKey(raOverlayNames[o]))
Map.Actors.Value.Add("Actor" + ActorCount++,
new ActorReference(overlayActorMapping[raOverlayNames[o]])
{
new ActorReference(overlayActorMapping[raOverlayNames[o]])
{
new LocationInit( new int2(i, j) ),
new OwnerInit( "Neutral" )
new OwnerInit( "Neutral" )
});
}
}
@@ -288,7 +291,7 @@ namespace OpenRA.Editor
foreach (KeyValuePair<string, string> kv in terrain)
{
var loc = int.Parse(kv.Key);
Map.Actors.Value.Add("Actor" + ActorCount++,
Map.Actors.Value.Add("Actor" + ActorCount++,
new ActorReference(kv.Value.ToLowerInvariant())
{
new LocationInit(new int2(loc % MapSize, loc / MapSize)),
@@ -310,7 +313,7 @@ namespace OpenRA.Editor
Map.MapTiles.Value[i, j].index = ReadByte(ms);
}
}
void ReadCncOverlay(IniFile file)
{
IniSection overlay = file.GetSection("OVERLAY", true);
@@ -329,7 +332,7 @@ namespace OpenRA.Editor
Map.MapResources.Value[cell.X, cell.Y] = new TileReference<byte, byte>(res.First, res.Second);
if (overlayActorMapping.ContainsKey(kv.Value.ToLower()))
Map.Actors.Value.Add("Actor" + ActorCount++,
Map.Actors.Value.Add("Actor" + ActorCount++,
new ActorReference(overlayActorMapping[kv.Value.ToLower()])
{
new LocationInit(cell),
@@ -337,7 +340,7 @@ namespace OpenRA.Editor
});
}
}
void ReadCncTrees(IniFile file)
{
IniSection terrain = file.GetSection("TERRAIN", true);
@@ -363,57 +366,42 @@ namespace OpenRA.Editor
//Structures: num=owner,type,health,location,turret-facing,trigger
//Units: num=owner,type,health,location,facing,action,trigger
//Infantry: num=owner,type,health,location,subcell,action,facing,trigger
var parts = s.Value.Split(',');
var loc = int.Parse(parts[3]);
if (parts[0] == "")
parts[0] = "Neutral";
if (!Players.Contains(parts[0]))
Players.Add(parts[0]);
var stance = ActorStance.Stance.None;
switch(parts[5])
try
{
case "Area Guard":
case "Guard":
stance = ActorStance.Stance.Guard;
break;
case "Defend Base":
stance = ActorStance.Stance.Defend;
break;
case "Hunt":
case "Rampage":
case "Attack Base":
case "Attack Units":
case "Attack Civil.":
case "Attack Tarcom":
stance = ActorStance.Stance.Hunt;
break;
case "Retreat":
case "Return":
stance = ActorStance.Stance.Retreat;
break;
// do we care about `Harvest' and `Sticky'?
var parts = s.Value.Split(',');
var loc = int.Parse(parts[3]);
if (parts[0] == "")
parts[0] = "Neutral";
if (!Players.Contains(parts[0]))
Players.Add(parts[0]);
var actor = new ActorReference(parts[1].ToLowerInvariant())
{
new LocationInit(new int2(loc % MapSize, loc / MapSize)),
new OwnerInit(parts[0]),
new HealthInit(float.Parse(parts[2], NumberFormatInfo.InvariantInfo)/256),
new FacingInit((section == "INFANTRY") ? int.Parse(parts[6]) : int.Parse(parts[4])),
};
if (section == "INFANTRY")
actor.Add(new SubCellInit(int.Parse(parts[4])));
if (!Rules.Info.ContainsKey(parts[1].ToLowerInvariant()))
errorHandler("Ignoring unknown actor type: `{0}`".F(parts[1].ToLowerInvariant()));
else
Map.Actors.Value.Add("Actor" + ActorCount++, actor);
}
var actor = new ActorReference(parts[1].ToLowerInvariant())
catch (Exception)
{
new LocationInit(new int2(loc % MapSize, loc / MapSize)),
new OwnerInit(parts[0]),
new HealthInit(float.Parse(parts[2], NumberFormatInfo.InvariantInfo)/256),
new FacingInit((section == "INFANTRY") ? int.Parse(parts[6]) : int.Parse(parts[4])),
new ActorStanceInit(stance),
};
if (section == "INFANTRY")
actor.Add(new SubCellInit(int.Parse(parts[4])));
Map.Actors.Value.Add("Actor" + ActorCount++,actor);
errorHandler("Malformed actor definition: `{0}`".F(s));
}
}
}
void LoadSmudges(IniFile file, string section)
{
foreach (var s in file.GetSection(section, true))
@@ -424,28 +412,28 @@ namespace OpenRA.Editor
Map.Smudges.Value.Add(new SmudgeReference(parts[0].ToLowerInvariant(), new int2(loc % MapSize, loc / MapSize), int.Parse(parts[2])));
}
}
void LoadPlayer(IniFile file, string section, bool isRA)
{
var c = (section == "BadGuy") ? "red" :
(isRA) ? "blue" : "gold";
{
var c = section == "BadGuy" ? "red" :
isRA ? "blue" : "gold";
var color = namedColorMapping[c];
var pr = new PlayerReference
{
Name = section,
OwnsWorld = (section == "Neutral"),
NonCombatant = (section == "Neutral"),
Race = (isRA) ? ((section == "BadGuy") ? "soviet" : "allies") : ((section == "BadGuy") ? "nod" : "gdi"),
OwnsWorld = section == "Neutral",
NonCombatant = section == "Neutral",
Race = isRA ? (section == "BadGuy" ? "soviet" : "allies") : (section == "BadGuy" ? "nod" : "gdi"),
ColorRamp = new ColorRamp(
(byte)((color.First.GetHue() / 360.0f) * 255),
(byte)(color.First.GetSaturation() * 255),
(byte)(color.First.GetBrightness() * 255),
(byte)(color.Second.GetBrightness() * 255))
(byte)((color.First.GetHue() / 360.0f) * 255),
(byte)(color.First.GetSaturation() * 255),
(byte)(color.First.GetBrightness() * 255),
(byte)(color.Second.GetBrightness() * 255))
};
var Neutral = new List<string>(){"Neutral"};
var Neutral = new [] {"Neutral"};
foreach (var s in file.GetSection(section, true))
{
Console.WriteLine(s.Key);
@@ -460,7 +448,7 @@ namespace OpenRA.Editor
break;
}
}
Map.Players.Add(section, pr);
}

View File

@@ -1,375 +1,385 @@
namespace OpenRA.Editor
{
partial class MapSelect
{
/// <summary>
/// TODO
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// TODO
/// </summary>
/// <param name="disposing">TODO</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Код, автоматически созданный конструктором форм Windows
/// <summary>
/// TODO
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MapSelect));
this.MapList = new System.Windows.Forms.ListView();
this.colMapName = new System.Windows.Forms.ColumnHeader("(отсутствует)");
this.MapIconsList = new System.Windows.Forms.ImageList(this.components);
this.btnCancel = new System.Windows.Forms.Button();
this.btnOk = new System.Windows.Forms.Button();
this.lblNew = new System.Windows.Forms.Label();
this.txtNew = new System.Windows.Forms.TextBox();
this.pbMinimap = new System.Windows.Forms.PictureBox();
this.pnlBottom = new System.Windows.Forms.Panel();
this.txtPathOut = new System.Windows.Forms.TextBox();
this.lblPathOut = new System.Windows.Forms.Label();
this.lblPath = new System.Windows.Forms.Label();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.lblMapList = new System.Windows.Forms.Label();
this.txtDesc = new System.Windows.Forms.TextBox();
this.lblDesc = new System.Windows.Forms.Label();
this.txtTheater = new System.Windows.Forms.TextBox();
this.lblTheater = new System.Windows.Forms.Label();
this.txtAuthor = new System.Windows.Forms.TextBox();
this.lblAuthor = new System.Windows.Forms.Label();
this.txtTitle = new System.Windows.Forms.TextBox();
this.lblMapName = new System.Windows.Forms.Label();
this.lblMinimap = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pbMinimap)).BeginInit();
this.pnlBottom.SuspendLayout();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// MapList
//
this.MapList.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.MapList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colMapName});
this.MapList.FullRowSelect = true;
this.MapList.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.MapList.LargeImageList = this.MapIconsList;
this.MapList.Location = new System.Drawing.Point(15, 25);
this.MapList.MultiSelect = false;
this.MapList.Name = "MapList";
this.MapList.Size = new System.Drawing.Size(273, 294);
this.MapList.SmallImageList = this.MapIconsList;
this.MapList.StateImageList = this.MapIconsList;
this.MapList.TabIndex = 0;
this.MapList.UseCompatibleStateImageBehavior = false;
this.MapList.View = System.Windows.Forms.View.Details;
this.MapList.SelectedIndexChanged += new System.EventHandler(this.MapList_SelectedIndexChanged);
//
// colMapName
//
this.colMapName.Text = "Map name";
this.colMapName.Width = 240;
//
// MapIconsList
//
this.MapIconsList.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
this.MapIconsList.ImageSize = new System.Drawing.Size(24, 24);
this.MapIconsList.TransparentColor = System.Drawing.Color.Transparent;
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(407, 35);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 3;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
//
// btnOk
//
this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOk.Location = new System.Drawing.Point(326, 35);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(75, 23);
this.btnOk.TabIndex = 2;
this.btnOk.Text = "Open";
this.btnOk.UseVisualStyleBackColor = true;
//
// lblNew
//
this.lblNew.AutoSize = true;
this.lblNew.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.lblNew.Location = new System.Drawing.Point(12, 40);
this.lblNew.Name = "lblNew";
this.lblNew.Size = new System.Drawing.Size(69, 13);
this.lblNew.TabIndex = 3;
this.lblNew.Text = "Map name:";
//
// txtNew
//
this.txtNew.BackColor = System.Drawing.SystemColors.Window;
this.txtNew.Location = new System.Drawing.Point(88, 37);
this.txtNew.Name = "txtNew";
this.txtNew.ReadOnly = true;
this.txtNew.Size = new System.Drawing.Size(232, 20);
this.txtNew.TabIndex = 1;
//
// pbMinimap
//
this.pbMinimap.BackColor = System.Drawing.Color.Black;
this.pbMinimap.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pbMinimap.Location = new System.Drawing.Point(32, 25);
this.pbMinimap.Name = "pbMinimap";
this.pbMinimap.Size = new System.Drawing.Size(124, 124);
this.pbMinimap.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pbMinimap.TabIndex = 5;
this.pbMinimap.TabStop = false;
//
// pnlBottom
//
this.pnlBottom.Controls.Add(this.pictureBox1);
this.pnlBottom.Controls.Add(this.txtPathOut);
this.pnlBottom.Controls.Add(this.lblPathOut);
this.pnlBottom.Controls.Add(this.lblPath);
this.pnlBottom.Controls.Add(this.btnCancel);
this.pnlBottom.Controls.Add(this.btnOk);
this.pnlBottom.Controls.Add(this.txtNew);
this.pnlBottom.Controls.Add(this.lblNew);
this.pnlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
this.pnlBottom.Location = new System.Drawing.Point(0, 332);
this.pnlBottom.MaximumSize = new System.Drawing.Size(0, 70);
this.pnlBottom.Name = "pnlBottom";
this.pnlBottom.Size = new System.Drawing.Size(494, 70);
this.pnlBottom.TabIndex = 6;
//
// txtPathOut
//
this.txtPathOut.BackColor = System.Drawing.SystemColors.Window;
this.txtPathOut.Location = new System.Drawing.Point(55, 10);
this.txtPathOut.Name = "txtPathOut";
this.txtPathOut.ReadOnly = true;
this.txtPathOut.Size = new System.Drawing.Size(265, 20);
this.txtPathOut.TabIndex = 0;
this.txtPathOut.TextChanged += new System.EventHandler(this.txtPathOut_TextChanged);
//
// lblPathOut
//
this.lblPathOut.AutoSize = true;
this.lblPathOut.Location = new System.Drawing.Point(55, 13);
this.lblPathOut.Name = "lblPathOut";
this.lblPathOut.Size = new System.Drawing.Size(0, 13);
this.lblPathOut.TabIndex = 6;
//
// lblPath
//
this.lblPath.AutoSize = true;
this.lblPath.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.lblPath.Location = new System.Drawing.Point(12, 13);
this.lblPath.Name = "lblPath";
this.lblPath.Size = new System.Drawing.Size(37, 13);
this.lblPath.TabIndex = 5;
this.lblPath.Text = "Path:";
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.lblMapList);
this.splitContainer1.Panel1.Controls.Add(this.MapList);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.txtDesc);
this.splitContainer1.Panel2.Controls.Add(this.lblDesc);
this.splitContainer1.Panel2.Controls.Add(this.txtTheater);
this.splitContainer1.Panel2.Controls.Add(this.lblTheater);
this.splitContainer1.Panel2.Controls.Add(this.txtAuthor);
this.splitContainer1.Panel2.Controls.Add(this.lblAuthor);
this.splitContainer1.Panel2.Controls.Add(this.txtTitle);
this.splitContainer1.Panel2.Controls.Add(this.lblMapName);
this.splitContainer1.Panel2.Controls.Add(this.lblMinimap);
this.splitContainer1.Panel2.Controls.Add(this.pbMinimap);
this.splitContainer1.Size = new System.Drawing.Size(494, 332);
this.splitContainer1.SplitterDistance = 300;
this.splitContainer1.TabIndex = 7;
//
// lblMapList
//
this.lblMapList.AutoSize = true;
this.lblMapList.Location = new System.Drawing.Point(12, 9);
this.lblMapList.Name = "lblMapList";
this.lblMapList.Size = new System.Drawing.Size(81, 13);
this.lblMapList.TabIndex = 1;
this.lblMapList.Text = "Available maps:";
//
// txtDesc
//
this.txtDesc.BackColor = System.Drawing.SystemColors.ButtonFace;
this.txtDesc.Location = new System.Drawing.Point(16, 289);
this.txtDesc.Name = "txtDesc";
this.txtDesc.ReadOnly = true;
this.txtDesc.Size = new System.Drawing.Size(162, 20);
this.txtDesc.TabIndex = 14;
//
// lblDesc
//
this.lblDesc.AutoSize = true;
this.lblDesc.Location = new System.Drawing.Point(13, 273);
this.lblDesc.Name = "lblDesc";
this.lblDesc.Size = new System.Drawing.Size(63, 13);
this.lblDesc.TabIndex = 13;
this.lblDesc.Text = "Description:";
//
// txtTheater
//
this.txtTheater.BackColor = System.Drawing.SystemColors.ButtonFace;
this.txtTheater.Location = new System.Drawing.Point(16, 252);
this.txtTheater.Name = "txtTheater";
this.txtTheater.ReadOnly = true;
this.txtTheater.Size = new System.Drawing.Size(162, 20);
this.txtTheater.TabIndex = 12;
//
// lblTheater
//
this.lblTheater.AutoSize = true;
this.lblTheater.Location = new System.Drawing.Point(13, 236);
this.lblTheater.Name = "lblTheater";
this.lblTheater.Size = new System.Drawing.Size(47, 13);
this.lblTheater.TabIndex = 11;
this.lblTheater.Text = "Tileset:";
//
// txtAuthor
//
this.txtAuthor.BackColor = System.Drawing.SystemColors.ButtonFace;
this.txtAuthor.Location = new System.Drawing.Point(16, 214);
this.txtAuthor.Name = "txtAuthor";
this.txtAuthor.ReadOnly = true;
this.txtAuthor.Size = new System.Drawing.Size(162, 20);
this.txtAuthor.TabIndex = 10;
//
// lblAuthor
//
this.lblAuthor.AutoSize = true;
this.lblAuthor.Location = new System.Drawing.Point(13, 198);
this.lblAuthor.Name = "lblAuthor";
this.lblAuthor.Size = new System.Drawing.Size(41, 13);
this.lblAuthor.TabIndex = 9;
this.lblAuthor.Text = "Author:";
//
// txtTitle
//
this.txtTitle.BackColor = System.Drawing.SystemColors.ButtonFace;
this.txtTitle.Location = new System.Drawing.Point(16, 177);
this.txtTitle.Name = "txtTitle";
this.txtTitle.ReadOnly = true;
this.txtTitle.Size = new System.Drawing.Size(162, 20);
this.txtTitle.TabIndex = 8;
//
// lblMapName
//
this.lblMapName.AutoSize = true;
this.lblMapName.Location = new System.Drawing.Point(13, 161);
this.lblMapName.Name = "lblMapName";
this.lblMapName.Size = new System.Drawing.Size(30, 13);
this.lblMapName.TabIndex = 7;
this.lblMapName.Text = "Title:";
//
// lblMinimap
//
this.lblMinimap.AutoSize = true;
this.lblMinimap.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.lblMinimap.Location = new System.Drawing.Point(29, 9);
this.lblMinimap.Name = "lblMinimap";
this.lblMinimap.Size = new System.Drawing.Size(71, 13);
this.lblMinimap.TabIndex = 6;
this.lblMinimap.Text = "Map preview:";
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(336, -9);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(54, 35);
this.pictureBox1.TabIndex = 7;
this.pictureBox1.TabStop = false;
this.pictureBox1.Visible = false;
//
// MapSelect
//
this.AcceptButton = this.btnOk;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(494, 402);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.pnlBottom);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "MapSelect";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Select map";
this.Load += new System.EventHandler(this.MapSelect_Load);
((System.ComponentModel.ISupportInitialize)(this.pbMinimap)).EndInit();
this.pnlBottom.ResumeLayout(false);
this.pnlBottom.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
this.splitContainer1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
}
#endregion
public System.Windows.Forms.ListView MapList;
public System.Windows.Forms.Button btnCancel;
public System.Windows.Forms.Button btnOk;
public System.Windows.Forms.Label lblNew;
public System.Windows.Forms.TextBox txtNew;
public System.Windows.Forms.ColumnHeader colMapName;
public System.Windows.Forms.ImageList MapIconsList;
public System.Windows.Forms.PictureBox pbMinimap;
public System.Windows.Forms.Panel pnlBottom;
public System.Windows.Forms.SplitContainer splitContainer1;
public System.Windows.Forms.Label lblMinimap;
public System.Windows.Forms.TextBox txtTheater;
public System.Windows.Forms.Label lblTheater;
public System.Windows.Forms.TextBox txtAuthor;
public System.Windows.Forms.Label lblAuthor;
public System.Windows.Forms.TextBox txtTitle;
public System.Windows.Forms.Label lblMapName;
public System.Windows.Forms.TextBox txtDesc;
public System.Windows.Forms.Label lblDesc;
public System.Windows.Forms.Label lblMapList;
public System.Windows.Forms.Label lblPathOut;
public System.Windows.Forms.Label lblPath;
public System.Windows.Forms.TextBox txtPathOut;
private System.Windows.Forms.PictureBox pictureBox1;
}
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
namespace OpenRA.Editor
{
partial class MapSelect
{
/// <summary>
/// TODO
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// TODO
/// </summary>
/// <param name="disposing">TODO</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Код, автоматически созданный конструктором форм Windows
/// <summary>
/// TODO
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MapSelect));
this.MapList = new System.Windows.Forms.ListView();
this.colMapName = new System.Windows.Forms.ColumnHeader("(отсутствует)");
this.MapIconsList = new System.Windows.Forms.ImageList(this.components);
this.btnCancel = new System.Windows.Forms.Button();
this.btnOk = new System.Windows.Forms.Button();
this.lblNew = new System.Windows.Forms.Label();
this.txtNew = new System.Windows.Forms.TextBox();
this.pbMinimap = new System.Windows.Forms.PictureBox();
this.pnlBottom = new System.Windows.Forms.Panel();
this.txtPathOut = new System.Windows.Forms.TextBox();
this.lblPathOut = new System.Windows.Forms.Label();
this.lblPath = new System.Windows.Forms.Label();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.lblMapList = new System.Windows.Forms.Label();
this.txtDesc = new System.Windows.Forms.TextBox();
this.lblDesc = new System.Windows.Forms.Label();
this.txtTheater = new System.Windows.Forms.TextBox();
this.lblTheater = new System.Windows.Forms.Label();
this.txtAuthor = new System.Windows.Forms.TextBox();
this.lblAuthor = new System.Windows.Forms.Label();
this.txtTitle = new System.Windows.Forms.TextBox();
this.lblMapName = new System.Windows.Forms.Label();
this.lblMinimap = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pbMinimap)).BeginInit();
this.pnlBottom.SuspendLayout();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// MapList
//
this.MapList.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.MapList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colMapName});
this.MapList.FullRowSelect = true;
this.MapList.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.MapList.LargeImageList = this.MapIconsList;
this.MapList.Location = new System.Drawing.Point(15, 25);
this.MapList.MultiSelect = false;
this.MapList.Name = "MapList";
this.MapList.Size = new System.Drawing.Size(273, 294);
this.MapList.SmallImageList = this.MapIconsList;
this.MapList.StateImageList = this.MapIconsList;
this.MapList.TabIndex = 0;
this.MapList.UseCompatibleStateImageBehavior = false;
this.MapList.View = System.Windows.Forms.View.Details;
this.MapList.SelectedIndexChanged += new System.EventHandler(this.MapList_SelectedIndexChanged);
//
// colMapName
//
this.colMapName.Text = "Map name";
this.colMapName.Width = 240;
//
// MapIconsList
//
this.MapIconsList.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
this.MapIconsList.ImageSize = new System.Drawing.Size(24, 24);
this.MapIconsList.TransparentColor = System.Drawing.Color.Transparent;
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(407, 35);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 3;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
//
// btnOk
//
this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOk.Location = new System.Drawing.Point(326, 35);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(75, 23);
this.btnOk.TabIndex = 2;
this.btnOk.Text = "Open";
this.btnOk.UseVisualStyleBackColor = true;
//
// lblNew
//
this.lblNew.AutoSize = true;
this.lblNew.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.lblNew.Location = new System.Drawing.Point(12, 40);
this.lblNew.Name = "lblNew";
this.lblNew.Size = new System.Drawing.Size(69, 13);
this.lblNew.TabIndex = 3;
this.lblNew.Text = "Map name:";
//
// txtNew
//
this.txtNew.BackColor = System.Drawing.SystemColors.Window;
this.txtNew.Location = new System.Drawing.Point(88, 37);
this.txtNew.Name = "txtNew";
this.txtNew.ReadOnly = true;
this.txtNew.Size = new System.Drawing.Size(232, 20);
this.txtNew.TabIndex = 1;
//
// pbMinimap
//
this.pbMinimap.BackColor = System.Drawing.Color.Black;
this.pbMinimap.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pbMinimap.Location = new System.Drawing.Point(32, 25);
this.pbMinimap.Name = "pbMinimap";
this.pbMinimap.Size = new System.Drawing.Size(124, 124);
this.pbMinimap.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pbMinimap.TabIndex = 5;
this.pbMinimap.TabStop = false;
//
// pnlBottom
//
this.pnlBottom.Controls.Add(this.pictureBox1);
this.pnlBottom.Controls.Add(this.txtPathOut);
this.pnlBottom.Controls.Add(this.lblPathOut);
this.pnlBottom.Controls.Add(this.lblPath);
this.pnlBottom.Controls.Add(this.btnCancel);
this.pnlBottom.Controls.Add(this.btnOk);
this.pnlBottom.Controls.Add(this.txtNew);
this.pnlBottom.Controls.Add(this.lblNew);
this.pnlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
this.pnlBottom.Location = new System.Drawing.Point(0, 332);
this.pnlBottom.MaximumSize = new System.Drawing.Size(0, 70);
this.pnlBottom.Name = "pnlBottom";
this.pnlBottom.Size = new System.Drawing.Size(494, 70);
this.pnlBottom.TabIndex = 6;
//
// txtPathOut
//
this.txtPathOut.BackColor = System.Drawing.SystemColors.Window;
this.txtPathOut.Location = new System.Drawing.Point(55, 10);
this.txtPathOut.Name = "txtPathOut";
this.txtPathOut.ReadOnly = true;
this.txtPathOut.Size = new System.Drawing.Size(265, 20);
this.txtPathOut.TabIndex = 0;
this.txtPathOut.TextChanged += new System.EventHandler(this.txtPathOut_TextChanged);
//
// lblPathOut
//
this.lblPathOut.AutoSize = true;
this.lblPathOut.Location = new System.Drawing.Point(55, 13);
this.lblPathOut.Name = "lblPathOut";
this.lblPathOut.Size = new System.Drawing.Size(0, 13);
this.lblPathOut.TabIndex = 6;
//
// lblPath
//
this.lblPath.AutoSize = true;
this.lblPath.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.lblPath.Location = new System.Drawing.Point(12, 13);
this.lblPath.Name = "lblPath";
this.lblPath.Size = new System.Drawing.Size(37, 13);
this.lblPath.TabIndex = 5;
this.lblPath.Text = "Path:";
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.lblMapList);
this.splitContainer1.Panel1.Controls.Add(this.MapList);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.txtDesc);
this.splitContainer1.Panel2.Controls.Add(this.lblDesc);
this.splitContainer1.Panel2.Controls.Add(this.txtTheater);
this.splitContainer1.Panel2.Controls.Add(this.lblTheater);
this.splitContainer1.Panel2.Controls.Add(this.txtAuthor);
this.splitContainer1.Panel2.Controls.Add(this.lblAuthor);
this.splitContainer1.Panel2.Controls.Add(this.txtTitle);
this.splitContainer1.Panel2.Controls.Add(this.lblMapName);
this.splitContainer1.Panel2.Controls.Add(this.lblMinimap);
this.splitContainer1.Panel2.Controls.Add(this.pbMinimap);
this.splitContainer1.Size = new System.Drawing.Size(494, 332);
this.splitContainer1.SplitterDistance = 300;
this.splitContainer1.TabIndex = 7;
//
// lblMapList
//
this.lblMapList.AutoSize = true;
this.lblMapList.Location = new System.Drawing.Point(12, 9);
this.lblMapList.Name = "lblMapList";
this.lblMapList.Size = new System.Drawing.Size(81, 13);
this.lblMapList.TabIndex = 1;
this.lblMapList.Text = "Available maps:";
//
// txtDesc
//
this.txtDesc.BackColor = System.Drawing.SystemColors.ButtonFace;
this.txtDesc.Location = new System.Drawing.Point(16, 289);
this.txtDesc.Name = "txtDesc";
this.txtDesc.ReadOnly = true;
this.txtDesc.Size = new System.Drawing.Size(162, 20);
this.txtDesc.TabIndex = 14;
//
// lblDesc
//
this.lblDesc.AutoSize = true;
this.lblDesc.Location = new System.Drawing.Point(13, 273);
this.lblDesc.Name = "lblDesc";
this.lblDesc.Size = new System.Drawing.Size(63, 13);
this.lblDesc.TabIndex = 13;
this.lblDesc.Text = "Description:";
//
// txtTheater
//
this.txtTheater.BackColor = System.Drawing.SystemColors.ButtonFace;
this.txtTheater.Location = new System.Drawing.Point(16, 252);
this.txtTheater.Name = "txtTheater";
this.txtTheater.ReadOnly = true;
this.txtTheater.Size = new System.Drawing.Size(162, 20);
this.txtTheater.TabIndex = 12;
//
// lblTheater
//
this.lblTheater.AutoSize = true;
this.lblTheater.Location = new System.Drawing.Point(13, 236);
this.lblTheater.Name = "lblTheater";
this.lblTheater.Size = new System.Drawing.Size(47, 13);
this.lblTheater.TabIndex = 11;
this.lblTheater.Text = "Tileset:";
//
// txtAuthor
//
this.txtAuthor.BackColor = System.Drawing.SystemColors.ButtonFace;
this.txtAuthor.Location = new System.Drawing.Point(16, 214);
this.txtAuthor.Name = "txtAuthor";
this.txtAuthor.ReadOnly = true;
this.txtAuthor.Size = new System.Drawing.Size(162, 20);
this.txtAuthor.TabIndex = 10;
//
// lblAuthor
//
this.lblAuthor.AutoSize = true;
this.lblAuthor.Location = new System.Drawing.Point(13, 198);
this.lblAuthor.Name = "lblAuthor";
this.lblAuthor.Size = new System.Drawing.Size(41, 13);
this.lblAuthor.TabIndex = 9;
this.lblAuthor.Text = "Author:";
//
// txtTitle
//
this.txtTitle.BackColor = System.Drawing.SystemColors.ButtonFace;
this.txtTitle.Location = new System.Drawing.Point(16, 177);
this.txtTitle.Name = "txtTitle";
this.txtTitle.ReadOnly = true;
this.txtTitle.Size = new System.Drawing.Size(162, 20);
this.txtTitle.TabIndex = 8;
//
// lblMapName
//
this.lblMapName.AutoSize = true;
this.lblMapName.Location = new System.Drawing.Point(13, 161);
this.lblMapName.Name = "lblMapName";
this.lblMapName.Size = new System.Drawing.Size(30, 13);
this.lblMapName.TabIndex = 7;
this.lblMapName.Text = "Title:";
//
// lblMinimap
//
this.lblMinimap.AutoSize = true;
this.lblMinimap.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.lblMinimap.Location = new System.Drawing.Point(29, 9);
this.lblMinimap.Name = "lblMinimap";
this.lblMinimap.Size = new System.Drawing.Size(71, 13);
this.lblMinimap.TabIndex = 6;
this.lblMinimap.Text = "Map preview:";
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(336, -9);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(54, 35);
this.pictureBox1.TabIndex = 7;
this.pictureBox1.TabStop = false;
this.pictureBox1.Visible = false;
//
// MapSelect
//
this.AcceptButton = this.btnOk;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(494, 402);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.pnlBottom);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "MapSelect";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Select map";
this.Load += new System.EventHandler(this.MapSelect_Load);
((System.ComponentModel.ISupportInitialize)(this.pbMinimap)).EndInit();
this.pnlBottom.ResumeLayout(false);
this.pnlBottom.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
this.splitContainer1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
}
#endregion
public System.Windows.Forms.ListView MapList;
public System.Windows.Forms.Button btnCancel;
public System.Windows.Forms.Button btnOk;
public System.Windows.Forms.Label lblNew;
public System.Windows.Forms.TextBox txtNew;
public System.Windows.Forms.ColumnHeader colMapName;
public System.Windows.Forms.ImageList MapIconsList;
public System.Windows.Forms.PictureBox pbMinimap;
public System.Windows.Forms.Panel pnlBottom;
public System.Windows.Forms.SplitContainer splitContainer1;
public System.Windows.Forms.Label lblMinimap;
public System.Windows.Forms.TextBox txtTheater;
public System.Windows.Forms.Label lblTheater;
public System.Windows.Forms.TextBox txtAuthor;
public System.Windows.Forms.Label lblAuthor;
public System.Windows.Forms.TextBox txtTitle;
public System.Windows.Forms.Label lblMapName;
public System.Windows.Forms.TextBox txtDesc;
public System.Windows.Forms.Label lblDesc;
public System.Windows.Forms.Label lblMapList;
public System.Windows.Forms.Label lblPathOut;
public System.Windows.Forms.Label lblPath;
public System.Windows.Forms.TextBox txtPathOut;
private System.Windows.Forms.PictureBox pictureBox1;
}
}

View File

@@ -1,74 +1,82 @@
using System;
using System.IO;
using System.Windows.Forms;
using OpenRA.FileFormats;
using OpenRA.Graphics;
using System.Linq;
namespace OpenRA.Editor
{
public partial class MapSelect : Form
{
public string MapFolderPath;
public MapSelect(string currentMod)
{
MapFolderPath = new string[] { Environment.CurrentDirectory, "mods", currentMod, "maps" }
.Aggregate(Path.Combine);
InitializeComponent();
MapIconsList.Images.Add(pictureBox1.Image);
}
void MapSelect_Load(object sender, EventArgs e)
{
MapList.Items.Clear();
txtPathOut.Text = MapFolderPath;
foreach (var map in ModData.FindMapsIn(MapFolderPath))
{
ListViewItem map1 = new ListViewItem();
map1.Tag = map;
map1.Text = Path.GetFileNameWithoutExtension(map);
map1.ImageIndex = 0;
MapList.Items.Add(map1);
}
// hack
if (txtNew.Text != "unnamed")
MapList.Items[0].Selected = true;
}
void MapList_SelectedIndexChanged(object sender, EventArgs e)
{
if (MapList.SelectedItems.Count == 1)
{
txtNew.Text = MapList.SelectedItems[0].Text;
txtNew.Tag = MapList.SelectedItems[0].Tag;
var map = new Map(txtNew.Tag as string);
txtTitle.Text = map.Title;
txtAuthor.Text = map.Author;
txtTheater.Text = map.Tileset;
txtDesc.Text = map.Description;
pbMinimap.Image = null;
try
{
pbMinimap.Image = Minimap.AddStaticResources(map, Minimap.TerrainBitmap(map, true));
}
catch (Exception ed)
{
Console.WriteLine("No map preview image found: {0}", ed.ToString());
}
finally { }
}
}
void txtPathOut_TextChanged(object sender, EventArgs e)
{
MapFolderPath = txtPathOut.Text;
}
}
}
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using OpenRA.Graphics;
namespace OpenRA.Editor
{
public partial class MapSelect : Form
{
public string MapFolderPath;
public MapSelect(string currentMod)
{
MapFolderPath = new string[] { Environment.CurrentDirectory, "mods", currentMod, "maps" }
.Aggregate(Path.Combine);
InitializeComponent();
MapIconsList.Images.Add(pictureBox1.Image);
}
void MapSelect_Load(object sender, EventArgs e)
{
MapList.Items.Clear();
txtPathOut.Text = MapFolderPath;
foreach (var map in ModData.FindMapsIn(MapFolderPath))
{
ListViewItem map1 = new ListViewItem();
map1.Tag = map;
map1.Text = Path.GetFileNameWithoutExtension(map);
map1.ImageIndex = 0;
MapList.Items.Add(map1);
}
// hack
if (txtNew.Text != "unnamed")
MapList.Items[0].Selected = true;
}
void MapList_SelectedIndexChanged(object sender, EventArgs e)
{
if (MapList.SelectedItems.Count == 1)
{
txtNew.Text = MapList.SelectedItems[0].Text;
txtNew.Tag = MapList.SelectedItems[0].Tag;
var map = new Map(txtNew.Tag as string);
txtTitle.Text = map.Title;
txtAuthor.Text = map.Author;
txtTheater.Text = map.Tileset;
txtDesc.Text = map.Description;
pbMinimap.Image = null;
try
{
pbMinimap.Image = Minimap.AddStaticResources(map, Minimap.TerrainBitmap(map, true));
}
catch (Exception ed)
{
Console.WriteLine("No map preview image found: {0}", ed.ToString());
}
finally { }
}
}
void txtPathOut_TextChanged(object sender, EventArgs e)
{
MapFolderPath = txtPathOut.Text;
}
}
}

View File

@@ -1,177 +1,177 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="MapIconsList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAArjSURBVFhHrVcJUFRXFmVpkE0Wg0ZEMoIBl8RodGSMmVES
R0NiChVxCyIIAmFfhe6maeh9AZodZHFpUFQWcQmKisiuLKLEKFFEcIuljtZMYmI5Uc/c14EZYyapmpq8
qlP/9/+/373v3HPu+19P7/cf+jSlEWHCOEuzZfNn2Yvo3Pj3D/PTjCwYAwtgyeFwFk163Tos2tvtWJZw
zeUjmYFP6vL9fhw31vRPI8/9LnmMrtCWZhtPcJ7hbC/W8DwfnS0LR0t5NKoFazHcqsaprE3YGbMQLrYW
W/7fBAxogjGEd5wcXuPK4jxa60qD75VrfIbKMrYMD7VlPX/Ul49rp8RoyPbFIaEnhpuU6NRGoVa2HKuX
zEj/X8vAVmlIsDY2Nna2sjBd+ee5b7Yq4tfgfm8a7pxNw60OFa6e4uFmhxr/uFSIexfz0VsZh7PaIJzb
F42u8hAcV2/ANz3KF8Hub52kucb+Fv+jAccbm5quWOfxYX5y6Mcnq/IDh1oreX/vOcx9drdbjTudUgye
Tsb1piT0H4/DACUw0JiEh33ZePhlFi7UxOCLtI1o2x6IW2cUqM/egLtdediV9MnjSTYm60bE+Ys8rMzN
zd1c3/vLgVRV3lN1XjkqyzNoNaEUjIvrLXwMtQsw1JqEy/UxuHg0DJcp+KXj8bh0IobOucSGDA8vpqE6
+VNINixBU0kQbp5JJ8jxDSXdeyAE5arlAxTZ/BfRra2tS8Tqwh9L9tQhq6gSabm7odLkoP8oF90V/rjR
LsRgExc32oS40ZFCiQgw2Mgj+gW42pBI4OPSsUh6Jgn1mX4ojXJH865IXDzCx50uDe6fV+P8oQQ4Tx6r
pOATmVteKgdjXu/Mhk1h328rO4TMwn3gp2YhmquEX7gAfYfjcb4qGH0HQ3D5WAiunU7ApfpofH0ymhIS
UwkSqQRb6VoYvm6IZvXG7W4VBVbjwQU1/tanIQZkGDqtwOmSjzHXxXaLsZnZpy85QpdAnfunax/mllRD
ma2FQJyHxORMJAqzwBVpUJgtRLF8E7bxlqKjzA991QEYaIijgFwMt6VggJK60hCFr46F4sqprbjbLaf6
S0icIh1rwy1i3OvNQff+GEgj3r87/c1JLIGfjX1LP/F6KJDlIy1vN4SyQohVRdAU7IVIXQxuSiZ8/OOw
JYyP8EiqfV04Lh2JoHIwMSbiwoFgtO1ah97aTSTMKGIjDl/WhONWl5jKlYrbZ9OJGRWVIg/+axf8SK5a
8WoC5fPm//l2qqIIOaVVECm3QZG5C7L0HZCklYJLTCQKNUiWFYAnykJYRDRaywNxrTGRyhKNKyciiIEY
dFd743z1ZioT6eJkHK41kXDbRFSKbHzTpcJwsxoHc71fTLGzyBix+L/zUFlaWX+VTcFZ4NzSamQXV1Lw
EggkeeBRAsnSfKgyy6DKKcNnxEahIgRfHg5B/7EoDDYn4ma7FD0VAThfG4Cemi3EDI90IKWVq3GbHHKz
nUpCbrh6QokEr5mPTEw4773MQij9aPZY5fNYrC6hEhRAnrkTjJEkcS5ieWokS/IhUZdCrtlJbGQiIjQQ
/YeD0VMVhoTVbmgs8iVBctG11xtdlUHkDGpQpIN7velUAhmG2+W43spclI6K9JWY6TyxlGKOGxWjG53s
5HBMBpZ7+iI6UY44vhoiVTH4ohxCLoTyArqu1OlBll6CZHE20mI9EOjuis3L5uFCbTh6D4Wgu8offYeC
qSRccgcPD/qyMEiBb55VYahFgSuNckhjlr2YaGMqH2ntOiKmEAQGBgbnNviGPg2LFSM4UoiAUD78ghLo
yEVojBhRiQqEx0nAI5sKiBH/z+OgVfuic7c/Lh+NwZndfughDfQdCtL1hKFmEW51ymn1EjpSAh1ytFCL
Pl+nhKebY8XLTYn16DWEgzY2ttdzyI6yjB06+uP4acRANokvhzRRjBR5oe4aN4WupeYgNCIWZ2vj0b17
I/UKf3Tt34jOis9otTyyILmkORUDTRKyqxj9DSI07Y0k26Yhes38Roo3YVQH7OVhGiGR0K7O0epEqCRB
shKwRIQkQrZqMelAIM6ncihII9uQSCXZEi2HSMjDXvVqXKSGdTLbg6z6OVkwGcfLQvHB4jkYbJMS/UL0
1aeSM6So1Hg/oljTR93AupEVYSXhGE+soZa8X+cIlgALzFhg5/HJ6YhIzACXVs9EKiHRMmckSfMQGx0G
rXIldU4/dJSvJx3EoSDZC7OszHByTxTOfZGEq00y9B3lo70iElamhp4Ujy1eN8wIrEOd0BRW6DpiWEwq
giKSdYiIl5IOUskRKh39AmKECZNP7Mg0O6Ci59Pzd4O/NQK7FBvQULyGOmMUpBsX4KqjGTL5qzHQIqJy
iNG6Px5dtYlY7jqhmeKxvUE32C7FGKiP58uf5W6v0ekgPkmNrYIMor4YqcoinQBFdGQrl2ZsB4/cwBJR
Zml/+k0sxcQnQZzgDWHIIni9NQHSHU5IS15EPSEN11ok6G9UQs1dh/lvv/GdkZHR3NEETOhkIUE7zvb1
wRRFwYv0vD3UBTORJCEdSHMhydgFCXVHVnuWEGvZrDewjqmzKbHDNjHmFl5KBlasWokiFwtop5nhyL6p
2JO/CN2HBdSgMpHJ88GH82c8s7b4T1vmUPA3CFxCp19QzBPdtpxdRqon2kkDKRSYXeOJcyBUFMI7IJ70
kYsEgRLTXGbgrzNnwmWqC2Y4OsLZZjx43El4ggXI1zohy24MAFd4u9tj8YLpmD71DTiMtwGHY1A7ygB7
52N29CLULV7qeT+HnFCoPairu87/RC9rTjE8JYJoY/p4lR8lVQAp7Rc+/pHY7OKE61NN8a21MbQpfwC+
m4fbQ7MQNdcCfWMMsTPWDi2yyRgyNkDhOGPYGhpeo97jP5oAcwJjYQ4hk3DOyzvwn9v3HtUJjHXAzSFc
RHHlCAznIyAsCZa2k56u3xT2gtHPmGHCdXtnHh47mKBqjS1K5Q7ITrCjlf8RqXPM0bDUCr3bp2C9nj70
DDinKMYSwmujCbAjY4G9ZrN3tyMLP/D4IT1vP/J21CBeoKaa55MTUhAeK8J7i91v0DMdxqZmgw7Oc74N
iFQ8T5YX6ZzisWI9Uiebo8rKCOcsjLAv1Z72BydUxE5ElcTuKf2P9RunEeGzmD8bTIzsI0I7wc7xdgyf
NiayWVoueZ1qz7zPT8l5McnBqZieYZsYO/a4zF7yaKWP4HlASMKLj9xX4WrXWzhdMxUFlkaI1tPDAZE9
Htc4wWuhOas5Y/oXgUezYDdZdmK2N6zzCfuB1V1GFkulNswT5cFllms73f+QMIWwjCDjGJnUW1rbfu2z
wvXJk85pUH5gieNJdugvd8QV7RSc0TjgiMwevkvH3np1xa/+ZplZE9jecNh14UcPmO8VmnLyfzGr/feU
mB/dY7VjybItdSZhrb6+fvEYY6PuMWOMn7ZbGeILfQNYmnN+mO1o/OBdCw74HAMsMjR8NjL/r+Yx+p3H
XhjKZs93uxMZr4Z/uOb54qWf3bGf4pw3EpC1UPYsS3g0EU9K4uBsI86zYHPOY3MOp4zuRRLyDfT1O941
Mrzvb86Bob4h+0r6zcEmdiFICA2vvT55kLFBYOJhnYt9or06TOmCJ7HTbGxgADpndmaJMU29QxAQKvTo
vhnHkN1nX12/OlgCNoT3CZsIvgRWc9ao2IT/bTD3+BID7N1/zisBWCKOBB/CagKf8PboJP8CoUmu3yhA
ga8AAAAASUVORK5CYII=
</value>
</data>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="MapIconsList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAArjSURBVFhHrVcJUFRXFmVpkE0Wg0ZEMoIBl8RodGSMmVES
R0NiChVxCyIIAmFfhe6maeh9AZodZHFpUFQWcQmKisiuLKLEKFFEcIuljtZMYmI5Uc/c14EZYyapmpq8
qlP/9/+/373v3HPu+19P7/cf+jSlEWHCOEuzZfNn2Yvo3Pj3D/PTjCwYAwtgyeFwFk163Tos2tvtWJZw
zeUjmYFP6vL9fhw31vRPI8/9LnmMrtCWZhtPcJ7hbC/W8DwfnS0LR0t5NKoFazHcqsaprE3YGbMQLrYW
W/7fBAxogjGEd5wcXuPK4jxa60qD75VrfIbKMrYMD7VlPX/Ul49rp8RoyPbFIaEnhpuU6NRGoVa2HKuX
zEj/X8vAVmlIsDY2Nna2sjBd+ee5b7Yq4tfgfm8a7pxNw60OFa6e4uFmhxr/uFSIexfz0VsZh7PaIJzb
F42u8hAcV2/ANz3KF8Hub52kucb+Fv+jAccbm5quWOfxYX5y6Mcnq/IDh1oreX/vOcx9drdbjTudUgye
Tsb1piT0H4/DACUw0JiEh33ZePhlFi7UxOCLtI1o2x6IW2cUqM/egLtdediV9MnjSTYm60bE+Ys8rMzN
zd1c3/vLgVRV3lN1XjkqyzNoNaEUjIvrLXwMtQsw1JqEy/UxuHg0DJcp+KXj8bh0IobOucSGDA8vpqE6
+VNINixBU0kQbp5JJ8jxDSXdeyAE5arlAxTZ/BfRra2tS8Tqwh9L9tQhq6gSabm7odLkoP8oF90V/rjR
LsRgExc32oS40ZFCiQgw2Mgj+gW42pBI4OPSsUh6Jgn1mX4ojXJH865IXDzCx50uDe6fV+P8oQQ4Tx6r
pOATmVteKgdjXu/Mhk1h328rO4TMwn3gp2YhmquEX7gAfYfjcb4qGH0HQ3D5WAiunU7ApfpofH0ymhIS
UwkSqQRb6VoYvm6IZvXG7W4VBVbjwQU1/tanIQZkGDqtwOmSjzHXxXaLsZnZpy85QpdAnfunax/mllRD
ma2FQJyHxORMJAqzwBVpUJgtRLF8E7bxlqKjzA991QEYaIijgFwMt6VggJK60hCFr46F4sqprbjbLaf6
S0icIh1rwy1i3OvNQff+GEgj3r87/c1JLIGfjX1LP/F6KJDlIy1vN4SyQohVRdAU7IVIXQxuSiZ8/OOw
JYyP8EiqfV04Lh2JoHIwMSbiwoFgtO1ah97aTSTMKGIjDl/WhONWl5jKlYrbZ9OJGRWVIg/+axf8SK5a
8WoC5fPm//l2qqIIOaVVECm3QZG5C7L0HZCklYJLTCQKNUiWFYAnykJYRDRaywNxrTGRyhKNKyciiIEY
dFd743z1ZioT6eJkHK41kXDbRFSKbHzTpcJwsxoHc71fTLGzyBix+L/zUFlaWX+VTcFZ4NzSamQXV1Lw
EggkeeBRAsnSfKgyy6DKKcNnxEahIgRfHg5B/7EoDDYn4ma7FD0VAThfG4Cemi3EDI90IKWVq3GbHHKz
nUpCbrh6QokEr5mPTEw4773MQij9aPZY5fNYrC6hEhRAnrkTjJEkcS5ieWokS/IhUZdCrtlJbGQiIjQQ
/YeD0VMVhoTVbmgs8iVBctG11xtdlUHkDGpQpIN7velUAhmG2+W43spclI6K9JWY6TyxlGKOGxWjG53s
5HBMBpZ7+iI6UY44vhoiVTH4ohxCLoTyArqu1OlBll6CZHE20mI9EOjuis3L5uFCbTh6D4Wgu8offYeC
qSRccgcPD/qyMEiBb55VYahFgSuNckhjlr2YaGMqH2ntOiKmEAQGBgbnNviGPg2LFSM4UoiAUD78ghLo
yEVojBhRiQqEx0nAI5sKiBH/z+OgVfuic7c/Lh+NwZndfughDfQdCtL1hKFmEW51ymn1EjpSAh1ytFCL
Pl+nhKebY8XLTYn16DWEgzY2ttdzyI6yjB06+uP4acRANokvhzRRjBR5oe4aN4WupeYgNCIWZ2vj0b17
I/UKf3Tt34jOis9otTyyILmkORUDTRKyqxj9DSI07Y0k26Yhes38Roo3YVQH7OVhGiGR0K7O0epEqCRB
shKwRIQkQrZqMelAIM6ncihII9uQSCXZEi2HSMjDXvVqXKSGdTLbg6z6OVkwGcfLQvHB4jkYbJMS/UL0
1aeSM6So1Hg/oljTR93AupEVYSXhGE+soZa8X+cIlgALzFhg5/HJ6YhIzACXVs9EKiHRMmckSfMQGx0G
rXIldU4/dJSvJx3EoSDZC7OszHByTxTOfZGEq00y9B3lo70iElamhp4Ujy1eN8wIrEOd0BRW6DpiWEwq
giKSdYiIl5IOUskRKh39AmKECZNP7Mg0O6Ci59Pzd4O/NQK7FBvQULyGOmMUpBsX4KqjGTL5qzHQIqJy
iNG6Px5dtYlY7jqhmeKxvUE32C7FGKiP58uf5W6v0ekgPkmNrYIMor4YqcoinQBFdGQrl2ZsB4/cwBJR
Zml/+k0sxcQnQZzgDWHIIni9NQHSHU5IS15EPSEN11ok6G9UQs1dh/lvv/GdkZHR3NEETOhkIUE7zvb1
wRRFwYv0vD3UBTORJCEdSHMhydgFCXVHVnuWEGvZrDewjqmzKbHDNjHmFl5KBlasWokiFwtop5nhyL6p
2JO/CN2HBdSgMpHJ88GH82c8s7b4T1vmUPA3CFxCp19QzBPdtpxdRqon2kkDKRSYXeOJcyBUFMI7IJ70
kYsEgRLTXGbgrzNnwmWqC2Y4OsLZZjx43El4ggXI1zohy24MAFd4u9tj8YLpmD71DTiMtwGHY1A7ygB7
52N29CLULV7qeT+HnFCoPairu87/RC9rTjE8JYJoY/p4lR8lVQAp7Rc+/pHY7OKE61NN8a21MbQpfwC+
m4fbQ7MQNdcCfWMMsTPWDi2yyRgyNkDhOGPYGhpeo97jP5oAcwJjYQ4hk3DOyzvwn9v3HtUJjHXAzSFc
RHHlCAznIyAsCZa2k56u3xT2gtHPmGHCdXtnHh47mKBqjS1K5Q7ITrCjlf8RqXPM0bDUCr3bp2C9nj70
DDinKMYSwmujCbAjY4G9ZrN3tyMLP/D4IT1vP/J21CBeoKaa55MTUhAeK8J7i91v0DMdxqZmgw7Oc74N
iFQ8T5YX6ZzisWI9Uiebo8rKCOcsjLAv1Z72BydUxE5ElcTuKf2P9RunEeGzmD8bTIzsI0I7wc7xdgyf
NiayWVoueZ1qz7zPT8l5McnBqZieYZsYO/a4zF7yaKWP4HlASMKLj9xX4WrXWzhdMxUFlkaI1tPDAZE9
Htc4wWuhOas5Y/oXgUezYDdZdmK2N6zzCfuB1V1GFkulNswT5cFllms73f+QMIWwjCDjGJnUW1rbfu2z
wvXJk85pUH5gieNJdugvd8QV7RSc0TjgiMwevkvH3np1xa/+ZplZE9jecNh14UcPmO8VmnLyfzGr/feU
mB/dY7VjybItdSZhrb6+fvEYY6PuMWOMn7ZbGeILfQNYmnN+mO1o/OBdCw74HAMsMjR8NjL/r+Yx+p3H
XhjKZs93uxMZr4Z/uOb54qWf3bGf4pw3EpC1UPYsS3g0EU9K4uBsI86zYHPOY3MOp4zuRRLyDfT1O941
Mrzvb86Bob4h+0r6zcEmdiFICA2vvT55kLFBYOJhnYt9or06TOmCJ7HTbGxgADpndmaJMU29QxAQKvTo
vhnHkN1nX12/OlgCNoT3CZsIvgRWc9ao2IT/bTD3+BID7N1/zisBWCKOBB/CagKf8PboJP8CoUmu3yhA
ga8AAAAASUVORK5CYII=
</value>
</data>
</root>

View File

@@ -1,286 +1,296 @@
namespace OpenRA.Editor
{
partial class NewMapDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.cordonBottom = new System.Windows.Forms.NumericUpDown();
this.cordonTop = new System.Windows.Forms.NumericUpDown();
this.cordonRight = new System.Windows.Forms.NumericUpDown();
this.cordonLeft = new System.Windows.Forms.NumericUpDown();
this.height = new System.Windows.Forms.NumericUpDown();
this.width = new System.Windows.Forms.NumericUpDown();
this.label4 = new System.Windows.Forms.Label();
this.theater = new System.Windows.Forms.ComboBox();
((System.ComponentModel.ISupportInitialize)(this.cordonBottom)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cordonTop)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cordonRight)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cordonLeft)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.height)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.width)).BeginInit();
this.SuspendLayout();
//
// button2
//
this.button2.DialogResult = System.Windows.Forms.DialogResult.OK;
this.button2.Location = new System.Drawing.Point(229, 160);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 7;
this.button2.Text = "OK";
this.button2.UseVisualStyleBackColor = true;
//
// button1
//
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button1.Location = new System.Drawing.Point(310, 160);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 8;
this.button1.Text = "Cancel";
this.button1.UseVisualStyleBackColor = true;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(31, 77);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(107, 13);
this.label3.TabIndex = 9;
this.label3.Text = "Cordon Right/Bottom";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(31, 51);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(86, 13);
this.label2.TabIndex = 11;
this.label2.Text = "Cordon Left/Top";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(31, 25);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(27, 13);
this.label1.TabIndex = 10;
this.label1.Text = "Size";
//
// cordonBottom
//
this.cordonBottom.Location = new System.Drawing.Point(280, 75);
this.cordonBottom.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.cordonBottom.Name = "cordonBottom";
this.cordonBottom.Size = new System.Drawing.Size(105, 20);
this.cordonBottom.TabIndex = 5;
this.cordonBottom.Value = new decimal(new int[] {
112,
0,
0,
0});
this.cordonBottom.Enter += new System.EventHandler(this.SelectText);
//
// cordonTop
//
this.cordonTop.Location = new System.Drawing.Point(280, 49);
this.cordonTop.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.cordonTop.Name = "cordonTop";
this.cordonTop.Size = new System.Drawing.Size(105, 20);
this.cordonTop.TabIndex = 3;
this.cordonTop.Value = new decimal(new int[] {
16,
0,
0,
0});
this.cordonTop.Enter += new System.EventHandler(this.SelectText);
//
// cordonRight
//
this.cordonRight.Location = new System.Drawing.Point(169, 75);
this.cordonRight.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.cordonRight.Name = "cordonRight";
this.cordonRight.Size = new System.Drawing.Size(105, 20);
this.cordonRight.TabIndex = 4;
this.cordonRight.Value = new decimal(new int[] {
112,
0,
0,
0});
this.cordonRight.Enter += new System.EventHandler(this.SelectText);
//
// cordonLeft
//
this.cordonLeft.Location = new System.Drawing.Point(169, 49);
this.cordonLeft.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.cordonLeft.Name = "cordonLeft";
this.cordonLeft.Size = new System.Drawing.Size(105, 20);
this.cordonLeft.TabIndex = 2;
this.cordonLeft.Value = new decimal(new int[] {
16,
0,
0,
0});
this.cordonLeft.Enter += new System.EventHandler(this.SelectText);
//
// height
//
this.height.Increment = new decimal(new int[] {
8,
0,
0,
0});
this.height.Location = new System.Drawing.Point(280, 23);
this.height.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.height.Name = "height";
this.height.Size = new System.Drawing.Size(105, 20);
this.height.TabIndex = 1;
this.height.Value = new decimal(new int[] {
128,
0,
0,
0});
this.height.Enter += new System.EventHandler(this.SelectText);
//
// width
//
this.width.Increment = new decimal(new int[] {
8,
0,
0,
0});
this.width.Location = new System.Drawing.Point(169, 23);
this.width.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.width.Name = "width";
this.width.Size = new System.Drawing.Size(105, 20);
this.width.TabIndex = 0;
this.width.Value = new decimal(new int[] {
128,
0,
0,
0});
this.width.Enter += new System.EventHandler(this.SelectText);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(31, 124);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(44, 13);
this.label4.TabIndex = 14;
this.label4.Text = "Tileset";
//
// theater
//
this.theater.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.theater.FormattingEnabled = true;
this.theater.Location = new System.Drawing.Point(169, 121);
this.theater.Name = "theater";
this.theater.Size = new System.Drawing.Size(216, 21);
this.theater.TabIndex = 6;
//
// NewMapDialog
//
this.AcceptButton = this.button2;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.button1;
this.ClientSize = new System.Drawing.Size(418, 210);
this.Controls.Add(this.theater);
this.Controls.Add(this.label4);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.cordonBottom);
this.Controls.Add(this.cordonTop);
this.Controls.Add(this.cordonRight);
this.Controls.Add(this.cordonLeft);
this.Controls.Add(this.height);
this.Controls.Add(this.width);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "NewMapDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "New Map";
((System.ComponentModel.ISupportInitialize)(this.cordonBottom)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cordonTop)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cordonRight)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cordonLeft)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.height)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.width)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
public System.Windows.Forms.NumericUpDown cordonBottom;
public System.Windows.Forms.NumericUpDown cordonTop;
public System.Windows.Forms.NumericUpDown cordonRight;
public System.Windows.Forms.NumericUpDown cordonLeft;
public System.Windows.Forms.NumericUpDown height;
public System.Windows.Forms.NumericUpDown width;
private System.Windows.Forms.Label label4;
public System.Windows.Forms.ComboBox theater;
}
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
namespace OpenRA.Editor
{
partial class NewMapDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.cordonBottom = new System.Windows.Forms.NumericUpDown();
this.cordonTop = new System.Windows.Forms.NumericUpDown();
this.cordonRight = new System.Windows.Forms.NumericUpDown();
this.cordonLeft = new System.Windows.Forms.NumericUpDown();
this.height = new System.Windows.Forms.NumericUpDown();
this.width = new System.Windows.Forms.NumericUpDown();
this.label4 = new System.Windows.Forms.Label();
this.theater = new System.Windows.Forms.ComboBox();
((System.ComponentModel.ISupportInitialize)(this.cordonBottom)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cordonTop)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cordonRight)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cordonLeft)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.height)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.width)).BeginInit();
this.SuspendLayout();
//
// button2
//
this.button2.DialogResult = System.Windows.Forms.DialogResult.OK;
this.button2.Location = new System.Drawing.Point(229, 160);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 7;
this.button2.Text = "OK";
this.button2.UseVisualStyleBackColor = true;
//
// button1
//
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button1.Location = new System.Drawing.Point(310, 160);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 8;
this.button1.Text = "Cancel";
this.button1.UseVisualStyleBackColor = true;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(31, 77);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(107, 13);
this.label3.TabIndex = 9;
this.label3.Text = "Cordon Right/Bottom";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(31, 51);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(86, 13);
this.label2.TabIndex = 11;
this.label2.Text = "Cordon Left/Top";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(31, 25);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(27, 13);
this.label1.TabIndex = 10;
this.label1.Text = "Size";
//
// cordonBottom
//
this.cordonBottom.Location = new System.Drawing.Point(280, 75);
this.cordonBottom.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.cordonBottom.Name = "cordonBottom";
this.cordonBottom.Size = new System.Drawing.Size(105, 20);
this.cordonBottom.TabIndex = 5;
this.cordonBottom.Value = new decimal(new int[] {
112,
0,
0,
0});
this.cordonBottom.Enter += new System.EventHandler(this.SelectText);
//
// cordonTop
//
this.cordonTop.Location = new System.Drawing.Point(280, 49);
this.cordonTop.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.cordonTop.Name = "cordonTop";
this.cordonTop.Size = new System.Drawing.Size(105, 20);
this.cordonTop.TabIndex = 3;
this.cordonTop.Value = new decimal(new int[] {
16,
0,
0,
0});
this.cordonTop.Enter += new System.EventHandler(this.SelectText);
//
// cordonRight
//
this.cordonRight.Location = new System.Drawing.Point(169, 75);
this.cordonRight.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.cordonRight.Name = "cordonRight";
this.cordonRight.Size = new System.Drawing.Size(105, 20);
this.cordonRight.TabIndex = 4;
this.cordonRight.Value = new decimal(new int[] {
112,
0,
0,
0});
this.cordonRight.Enter += new System.EventHandler(this.SelectText);
//
// cordonLeft
//
this.cordonLeft.Location = new System.Drawing.Point(169, 49);
this.cordonLeft.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.cordonLeft.Name = "cordonLeft";
this.cordonLeft.Size = new System.Drawing.Size(105, 20);
this.cordonLeft.TabIndex = 2;
this.cordonLeft.Value = new decimal(new int[] {
16,
0,
0,
0});
this.cordonLeft.Enter += new System.EventHandler(this.SelectText);
//
// height
//
this.height.Increment = new decimal(new int[] {
8,
0,
0,
0});
this.height.Location = new System.Drawing.Point(280, 23);
this.height.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.height.Name = "height";
this.height.Size = new System.Drawing.Size(105, 20);
this.height.TabIndex = 1;
this.height.Value = new decimal(new int[] {
128,
0,
0,
0});
this.height.Enter += new System.EventHandler(this.SelectText);
//
// width
//
this.width.Increment = new decimal(new int[] {
8,
0,
0,
0});
this.width.Location = new System.Drawing.Point(169, 23);
this.width.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.width.Name = "width";
this.width.Size = new System.Drawing.Size(105, 20);
this.width.TabIndex = 0;
this.width.Value = new decimal(new int[] {
128,
0,
0,
0});
this.width.Enter += new System.EventHandler(this.SelectText);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(31, 124);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(44, 13);
this.label4.TabIndex = 14;
this.label4.Text = "Tileset";
//
// theater
//
this.theater.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.theater.FormattingEnabled = true;
this.theater.Location = new System.Drawing.Point(169, 121);
this.theater.Name = "theater";
this.theater.Size = new System.Drawing.Size(216, 21);
this.theater.TabIndex = 6;
//
// NewMapDialog
//
this.AcceptButton = this.button2;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.button1;
this.ClientSize = new System.Drawing.Size(418, 210);
this.Controls.Add(this.theater);
this.Controls.Add(this.label4);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.cordonBottom);
this.Controls.Add(this.cordonTop);
this.Controls.Add(this.cordonRight);
this.Controls.Add(this.cordonLeft);
this.Controls.Add(this.height);
this.Controls.Add(this.width);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "NewMapDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "New Map";
((System.ComponentModel.ISupportInitialize)(this.cordonBottom)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cordonTop)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cordonRight)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cordonLeft)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.height)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.width)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
public System.Windows.Forms.NumericUpDown cordonBottom;
public System.Windows.Forms.NumericUpDown cordonTop;
public System.Windows.Forms.NumericUpDown cordonRight;
public System.Windows.Forms.NumericUpDown cordonLeft;
public System.Windows.Forms.NumericUpDown height;
public System.Windows.Forms.NumericUpDown width;
private System.Windows.Forms.Label label4;
public System.Windows.Forms.ComboBox theater;
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -19,9 +19,10 @@ namespace OpenRA.Editor
InitializeComponent();
}
private void SelectText(object sender, System.EventArgs e)
void SelectText(object sender, System.EventArgs e)
{
(sender as NumericUpDown).Select(0, (sender as NumericUpDown).ToString().Length);
var ud = sender as NumericUpDown;
ud.Select(0, ud.ToString().Length);
}
}
}

View File

@@ -1,120 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -1,162 +1,168 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{00038B75-405B-44F5-8691-BD2546DBE224}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRA.Editor</RootNamespace>
<AssemblyName>OpenRA.Editor</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ApplicationIcon>OpenRA.Editor.Icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ActorTemplate.cs" />
<Compile Include="ActorTool.cs" />
<Compile Include="BrushTool.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="ITool.cs" />
<Compile Include="LegacyMapImporter.cs" />
<Compile Include="MapSelect.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MapSelect.Designer.cs">
<DependentUpon>MapSelect.cs</DependentUpon>
</Compile>
<Compile Include="NewMapDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="NewMapDialog.Designer.cs">
<DependentUpon>NewMapDialog.cs</DependentUpon>
</Compile>
<Compile Include="PaletteBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PaletteBox.Designer.cs">
<DependentUpon>PaletteBox.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="PropertiesDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PropertiesDialog.Designer.cs">
<DependentUpon>PropertiesDialog.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MapSelect.resx">
<DependentUpon>MapSelect.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="NewMapDialog.resx">
<DependentUpon>NewMapDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PaletteBox.resx">
<DependentUpon>PaletteBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PropertiesDialog.resx">
<DependentUpon>PropertiesDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="ResizeDialog.resx">
<DependentUpon>ResizeDialog.cs</DependentUpon>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="RenderUtils.cs" />
<Compile Include="ResizeDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ResizeDialog.Designer.cs">
<DependentUpon>ResizeDialog.cs</DependentUpon>
</Compile>
<Compile Include="ResourceTool.cs" />
<Compile Include="Surface.cs">
<SubType>Component</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
<Project>{BDAEAB25-991E-46A7-AF1E-4F0E03358DAA}</Project>
<Name>OpenRA.FileFormats</Name>
</ProjectReference>
<ProjectReference Include="..\OpenRA.Game\OpenRA.Game.csproj">
<Project>{0DFB103F-2962-400F-8C6D-E2C28CCBA633}</Project>
<Name>OpenRA.Game</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="OpenRA.Editor.Icon.ico" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{00038B75-405B-44F5-8691-BD2546DBE224}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRA.Editor</RootNamespace>
<AssemblyName>OpenRA.Editor</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ApplicationIcon>OpenRA.Editor.Icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ActorPropertiesDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ActorPropertiesDialog.Designer.cs">
<DependentUpon>ActorPropertiesDialog.cs</DependentUpon>
</Compile>
<Compile Include="ActorTemplate.cs" />
<Compile Include="ActorTool.cs" />
<Compile Include="BrushTool.cs" />
<Compile Include="ErrorListDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ErrorListDialog.Designer.cs">
<DependentUpon>ErrorListDialog.cs</DependentUpon>
</Compile>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="ITool.cs" />
<Compile Include="LegacyMapImporter.cs" />
<Compile Include="MapSelect.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MapSelect.Designer.cs">
<DependentUpon>MapSelect.cs</DependentUpon>
</Compile>
<Compile Include="NewMapDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="NewMapDialog.Designer.cs">
<DependentUpon>NewMapDialog.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="PropertiesDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PropertiesDialog.Designer.cs">
<DependentUpon>PropertiesDialog.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="ActorPropertiesDialog.resx">
<DependentUpon>ActorPropertiesDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MapSelect.resx">
<DependentUpon>MapSelect.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="NewMapDialog.resx">
<DependentUpon>NewMapDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PropertiesDialog.resx">
<DependentUpon>PropertiesDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="ResizeDialog.resx">
<DependentUpon>ResizeDialog.cs</DependentUpon>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="RenderUtils.cs" />
<Compile Include="ResizeDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ResizeDialog.Designer.cs">
<DependentUpon>ResizeDialog.cs</DependentUpon>
</Compile>
<Compile Include="ResourceTool.cs" />
<Compile Include="Surface.cs">
<SubType>Component</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
<Project>{BDAEAB25-991E-46A7-AF1E-4F0E03358DAA}</Project>
<Name>OpenRA.FileFormats</Name>
</ProjectReference>
<ProjectReference Include="..\OpenRA.Game\OpenRA.Game.csproj">
<Project>{0DFB103F-2962-400F-8C6D-E2C28CCBA633}</Project>
<Name>OpenRA.Game</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="OpenRA.Editor.Icon.ico" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -1,165 +0,0 @@
namespace OpenRA.Editor
{
partial class PaletteBox
{
/// <summary>
/// Требуется переменная конструктора.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Код, автоматически созданный конструктором форм Windows
/// <summary>
/// Обязательный метод для поддержки конструктора - не изменяйте
/// содержимое данного метода при помощи редактора кода.
/// </summary>
private void InitializeComponent()
{
this.LayerBox = new System.Windows.Forms.ComboBox();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.pbtilePalette = new System.Windows.Forms.FlowLayoutPanel();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.pbactorPalette = new System.Windows.Forms.FlowLayoutPanel();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.pbresourcePalette = new System.Windows.Forms.FlowLayoutPanel();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.SuspendLayout();
//
// LayerBox
//
this.LayerBox.Dock = System.Windows.Forms.DockStyle.Top;
this.LayerBox.FormattingEnabled = true;
this.LayerBox.Location = new System.Drawing.Point(0, 0);
this.LayerBox.Name = "LayerBox";
this.LayerBox.Size = new System.Drawing.Size(194, 21);
this.LayerBox.TabIndex = 0;
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 21);
this.tabControl1.Margin = new System.Windows.Forms.Padding(3, 3, 3, 0);
this.tabControl1.Multiline = true;
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(194, 357);
this.tabControl1.TabIndex = 1;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.pbtilePalette);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(186, 331);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Templates";
this.tabPage1.UseVisualStyleBackColor = true;
//
// pbtilePalette
//
this.pbtilePalette.AutoScroll = true;
this.pbtilePalette.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.pbtilePalette.Dock = System.Windows.Forms.DockStyle.Fill;
this.pbtilePalette.Location = new System.Drawing.Point(3, 3);
this.pbtilePalette.Name = "pbtilePalette";
this.pbtilePalette.Size = new System.Drawing.Size(180, 325);
this.pbtilePalette.TabIndex = 1;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.pbactorPalette);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(186, 331);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Actors";
this.tabPage2.UseVisualStyleBackColor = true;
//
// pbactorPalette
//
this.pbactorPalette.AutoScroll = true;
this.pbactorPalette.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.pbactorPalette.Dock = System.Windows.Forms.DockStyle.Fill;
this.pbactorPalette.Location = new System.Drawing.Point(3, 3);
this.pbactorPalette.Name = "pbactorPalette";
this.pbactorPalette.Size = new System.Drawing.Size(180, 325);
this.pbactorPalette.TabIndex = 2;
//
// tabPage3
//
this.tabPage3.Controls.Add(this.pbresourcePalette);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(186, 331);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "Resources";
this.tabPage3.UseVisualStyleBackColor = true;
//
// pbresourcePalette
//
this.pbresourcePalette.AutoScroll = true;
this.pbresourcePalette.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.pbresourcePalette.Dock = System.Windows.Forms.DockStyle.Fill;
this.pbresourcePalette.Location = new System.Drawing.Point(0, 0);
this.pbresourcePalette.Name = "pbresourcePalette";
this.pbresourcePalette.Size = new System.Drawing.Size(186, 331);
this.pbresourcePalette.TabIndex = 3;
//
// PaletteBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(194, 378);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.LayerBox);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "PaletteBox";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Palette Box";
this.TopMost = true;
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
public System.Windows.Forms.ComboBox LayerBox;
public System.Windows.Forms.TabControl tabControl1;
public System.Windows.Forms.TabPage tabPage1;
public System.Windows.Forms.FlowLayoutPanel pbtilePalette;
public System.Windows.Forms.TabPage tabPage2;
public System.Windows.Forms.FlowLayoutPanel pbactorPalette;
public System.Windows.Forms.TabPage tabPage3;
public System.Windows.Forms.FlowLayoutPanel pbresourcePalette;
}
}

View File

@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace OpenRA.Editor
{
public partial class PaletteBox : Form
{
public PaletteBox()
{
InitializeComponent();
}
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -10,9 +10,9 @@
using System;
using System.Globalization;
using System.Windows.Forms;
using System.Linq;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using OpenRA.FileFormats;
namespace OpenRA.Editor
@@ -30,25 +30,30 @@ namespace OpenRA.Editor
UpgradeMaps(args[1]);
return;
}
Application.CurrentCulture = CultureInfo.InvariantCulture;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1(args));
}
static void UpgradeMaps(string mod)
{
var MapFolderPath = new string[] { Environment.CurrentDirectory, "mods", mod, "maps" }
.Aggregate(Path.Combine);
foreach (var path in ModData.FindMapsIn(MapFolderPath))
{
var map = new Map(path);
{
var map = new Map(path);
// Touch the lazy bits to initialize them
map.Actors.Force();
map.Smudges.Force();
map.MapTiles.Force();
map.MapResources.Force();
map.Save(path);
}
}
}
}
}

View File

@@ -1,36 +1,46 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenRA.Editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("OpenRA.Editor")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e18ea68f-f344-46c9-b026-8bda76fa91f8")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenRA.Editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("OpenRA.Editor")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e18ea68f-f344-46c9-b026-8bda76fa91f8")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,71 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace OpenRA.Editor.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRA.Editor.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace OpenRA.Editor.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRA.Editor.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@@ -1,30 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace OpenRA.Editor.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace OpenRA.Editor.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View File

@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@@ -1,172 +1,182 @@
namespace OpenRA.Editor
{
partial class PropertiesDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.title = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.desc = new System.Windows.Forms.TextBox();
this.selectable = new System.Windows.Forms.CheckBox();
this.label3 = new System.Windows.Forms.Label();
this.author = new System.Windows.Forms.TextBox();
this.useAsShellmap = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// button2
//
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button2.DialogResult = System.Windows.Forms.DialogResult.OK;
this.button2.Location = new System.Drawing.Point(196, 193);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 14;
this.button2.Text = "OK";
this.button2.UseVisualStyleBackColor = true;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button1.Location = new System.Drawing.Point(277, 193);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 15;
this.button1.Text = "Cancel";
this.button1.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 50);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(27, 13);
this.label1.TabIndex = 16;
this.label1.Text = "Title";
//
// title
//
this.title.Location = new System.Drawing.Point(66, 47);
this.title.Name = "title";
this.title.Size = new System.Drawing.Size(286, 20);
this.title.TabIndex = 17;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 76);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(32, 13);
this.label2.TabIndex = 16;
this.label2.Text = "Desc";
//
// desc
//
this.desc.Location = new System.Drawing.Point(66, 73);
this.desc.Name = "desc";
this.desc.Size = new System.Drawing.Size(286, 20);
this.desc.TabIndex = 17;
//
// selectable
//
this.selectable.AutoSize = true;
this.selectable.Location = new System.Drawing.Point(118, 138);
this.selectable.Name = "selectable";
this.selectable.Size = new System.Drawing.Size(130, 17);
this.selectable.TabIndex = 18;
this.selectable.Text = "Show in Map Chooser";
this.selectable.UseVisualStyleBackColor = true;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 102);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(38, 13);
this.label3.TabIndex = 16;
this.label3.Text = "Author";
//
// author
//
this.author.Location = new System.Drawing.Point(66, 99);
this.author.Name = "author";
this.author.Size = new System.Drawing.Size(286, 20);
this.author.TabIndex = 17;
//
// checkBox1
//
this.useAsShellmap.AutoSize = true;
this.useAsShellmap.Location = new System.Drawing.Point(118, 161);
this.useAsShellmap.Name = "checkBox1";
this.useAsShellmap.Size = new System.Drawing.Size(105, 17);
this.useAsShellmap.TabIndex = 18;
this.useAsShellmap.Text = "Use as Shellmap";
this.useAsShellmap.UseVisualStyleBackColor = true;
//
// PropertiesDialog
//
this.AcceptButton = this.button2;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.button1;
this.ClientSize = new System.Drawing.Size(370, 228);
this.Controls.Add(this.useAsShellmap);
this.Controls.Add(this.selectable);
this.Controls.Add(this.author);
this.Controls.Add(this.label3);
this.Controls.Add(this.desc);
this.Controls.Add(this.label2);
this.Controls.Add(this.title);
this.Controls.Add(this.label1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "PropertiesDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "PropertiesDialog";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
public System.Windows.Forms.TextBox title;
private System.Windows.Forms.Label label2;
public System.Windows.Forms.TextBox desc;
public System.Windows.Forms.CheckBox selectable;
private System.Windows.Forms.Label label3;
public System.Windows.Forms.TextBox author;
public System.Windows.Forms.CheckBox useAsShellmap;
}
}
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
namespace OpenRA.Editor
{
partial class PropertiesDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.title = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.desc = new System.Windows.Forms.TextBox();
this.selectable = new System.Windows.Forms.CheckBox();
this.label3 = new System.Windows.Forms.Label();
this.author = new System.Windows.Forms.TextBox();
this.useAsShellmap = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// button2
//
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button2.DialogResult = System.Windows.Forms.DialogResult.OK;
this.button2.Location = new System.Drawing.Point(196, 193);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 14;
this.button2.Text = "OK";
this.button2.UseVisualStyleBackColor = true;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button1.Location = new System.Drawing.Point(277, 193);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 15;
this.button1.Text = "Cancel";
this.button1.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 50);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(27, 13);
this.label1.TabIndex = 16;
this.label1.Text = "Title";
//
// title
//
this.title.Location = new System.Drawing.Point(66, 47);
this.title.Name = "title";
this.title.Size = new System.Drawing.Size(286, 20);
this.title.TabIndex = 17;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 76);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(32, 13);
this.label2.TabIndex = 16;
this.label2.Text = "Desc";
//
// desc
//
this.desc.Location = new System.Drawing.Point(66, 73);
this.desc.Name = "desc";
this.desc.Size = new System.Drawing.Size(286, 20);
this.desc.TabIndex = 17;
//
// selectable
//
this.selectable.AutoSize = true;
this.selectable.Location = new System.Drawing.Point(118, 138);
this.selectable.Name = "selectable";
this.selectable.Size = new System.Drawing.Size(130, 17);
this.selectable.TabIndex = 18;
this.selectable.Text = "Show in Map Chooser";
this.selectable.UseVisualStyleBackColor = true;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 102);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(38, 13);
this.label3.TabIndex = 16;
this.label3.Text = "Author";
//
// author
//
this.author.Location = new System.Drawing.Point(66, 99);
this.author.Name = "author";
this.author.Size = new System.Drawing.Size(286, 20);
this.author.TabIndex = 17;
//
// checkBox1
//
this.useAsShellmap.AutoSize = true;
this.useAsShellmap.Location = new System.Drawing.Point(118, 161);
this.useAsShellmap.Name = "checkBox1";
this.useAsShellmap.Size = new System.Drawing.Size(105, 17);
this.useAsShellmap.TabIndex = 18;
this.useAsShellmap.Text = "Use as Shellmap";
this.useAsShellmap.UseVisualStyleBackColor = true;
//
// PropertiesDialog
//
this.AcceptButton = this.button2;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.button1;
this.ClientSize = new System.Drawing.Size(370, 228);
this.Controls.Add(this.useAsShellmap);
this.Controls.Add(this.selectable);
this.Controls.Add(this.author);
this.Controls.Add(this.label3);
this.Controls.Add(this.desc);
this.Controls.Add(this.label2);
this.Controls.Add(this.title);
this.Controls.Add(this.label1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "PropertiesDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Map Properties";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
public System.Windows.Forms.TextBox title;
private System.Windows.Forms.Label label2;
public System.Windows.Forms.TextBox desc;
public System.Windows.Forms.CheckBox selectable;
private System.Windows.Forms.Label label3;
public System.Windows.Forms.TextBox author;
public System.Windows.Forms.CheckBox useAsShellmap;
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

View File

@@ -1,120 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -18,63 +18,13 @@ namespace OpenRA.Editor
{
static class RenderUtils
{
public static ColorPalette MakeSystemPalette(Palette p)
{
ColorPalette pal;
using (var b = new Bitmap(1, 1, PixelFormat.Format8bppIndexed))
pal = b.Palette;
for (var i = 0; i < 256; i++)
pal.Entries[i] = p.GetColor(i);
return pal;
}
public static Bitmap RenderTemplate(TileSet ts, ushort n, Palette p)
{
var template = ts.Templates[n];
var tile = ts.Tiles[n];
var bitmap = new Bitmap(ts.TileSize * template.Size.X, ts.TileSize * template.Size.Y,
PixelFormat.Format8bppIndexed);
bitmap.Palette = MakeSystemPalette(p);
var data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
unsafe
{
byte* q = (byte*)data.Scan0.ToPointer();
var stride = data.Stride;
for (var u = 0; u < template.Size.X; u++)
for (var v = 0; v < template.Size.Y; v++)
if (tile.TileBitmapBytes[u + v * template.Size.X] != null)
{
var rawImage = tile.TileBitmapBytes[u + v * template.Size.X];
for (var i = 0; i < ts.TileSize; i++)
for (var j = 0; j < ts.TileSize; j++)
q[(v * ts.TileSize + j) * stride + u * ts.TileSize + i] = rawImage[i + ts.TileSize * j];
}
else
{
for (var i = 0; i < ts.TileSize; i++)
for (var j = 0; j < ts.TileSize; j++)
q[(v * ts.TileSize + j) * stride + u * ts.TileSize + i] = 0;
}
}
bitmap.UnlockBits(data);
return bitmap;
}
static Bitmap RenderShp(ShpReader shp, Palette p)
{
var frame = shp[0];
var bitmap = new Bitmap(shp.Width, shp.Height, PixelFormat.Format8bppIndexed);
bitmap.Palette = MakeSystemPalette(p);
bitmap.Palette = p.AsSystemPalette();
var data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
@@ -95,10 +45,9 @@ namespace OpenRA.Editor
public static ActorTemplate RenderActor(ActorInfo info, TileSet tileset, Palette p)
{
var ri = info.Traits.Get<RenderSimpleInfo>();
var image = RenderSimple.GetImage(info, tileset.Id);
using (var s = FileSystem.OpenWithExts(image, tileset.Extensions))
var image = RenderSimple.GetImage(info);
using (var s = FileSystem.OpenWithExts(image, tileset.Extensions))
{
var shp = new ShpReader(s);
var bitmap = RenderShp(shp, p);
@@ -134,7 +83,7 @@ namespace OpenRA.Editor
var frame = shp[shp.ImageCount - 1];
var bitmap = new Bitmap(shp.Width, shp.Height, PixelFormat.Format8bppIndexed);
bitmap.Palette = MakeSystemPalette(p);
bitmap.Palette = p.AsSystemPalette();
var data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);

View File

@@ -1,226 +1,236 @@
namespace OpenRA.Editor
{
partial class ResizeDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.width = new System.Windows.Forms.NumericUpDown();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.cordonLeft = new System.Windows.Forms.NumericUpDown();
this.cordonTop = new System.Windows.Forms.NumericUpDown();
this.cordonRight = new System.Windows.Forms.NumericUpDown();
this.cordonBottom = new System.Windows.Forms.NumericUpDown();
this.label3 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.height = new System.Windows.Forms.NumericUpDown();
((System.ComponentModel.ISupportInitialize)(this.width)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cordonLeft)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cordonTop)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cordonRight)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cordonBottom)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.height)).BeginInit();
this.SuspendLayout();
//
// width
//
this.width.Increment = new decimal(new int[] {
8,
0,
0,
0});
this.width.Location = new System.Drawing.Point(161, 18);
this.width.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.width.Name = "width";
this.width.Size = new System.Drawing.Size(105, 20);
this.width.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(23, 20);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(27, 13);
this.label1.TabIndex = 1;
this.label1.Text = "Size";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(23, 46);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(86, 13);
this.label2.TabIndex = 1;
this.label2.Text = "Cordon Left/Top";
//
// cordonLeft
//
this.cordonLeft.Location = new System.Drawing.Point(161, 44);
this.cordonLeft.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.cordonLeft.Name = "cordonLeft";
this.cordonLeft.Size = new System.Drawing.Size(105, 20);
this.cordonLeft.TabIndex = 0;
//
// cordonTop
//
this.cordonTop.Location = new System.Drawing.Point(272, 44);
this.cordonTop.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.cordonTop.Name = "cordonTop";
this.cordonTop.Size = new System.Drawing.Size(105, 20);
this.cordonTop.TabIndex = 0;
//
// cordonRight
//
this.cordonRight.Location = new System.Drawing.Point(161, 70);
this.cordonRight.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.cordonRight.Name = "cordonRight";
this.cordonRight.Size = new System.Drawing.Size(105, 20);
this.cordonRight.TabIndex = 0;
//
// cordonBottom
//
this.cordonBottom.Location = new System.Drawing.Point(272, 70);
this.cordonBottom.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.cordonBottom.Name = "cordonBottom";
this.cordonBottom.Size = new System.Drawing.Size(105, 20);
this.cordonBottom.TabIndex = 0;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(23, 72);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(107, 13);
this.label3.TabIndex = 1;
this.label3.Text = "Cordon Right/Bottom";
//
// button1
//
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button1.Location = new System.Drawing.Point(302, 111);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 2;
this.button1.Text = "Cancel";
this.button1.UseVisualStyleBackColor = true;
//
// button2
//
this.button2.DialogResult = System.Windows.Forms.DialogResult.OK;
this.button2.Location = new System.Drawing.Point(221, 111);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 2;
this.button2.Text = "OK";
this.button2.UseVisualStyleBackColor = true;
//
// height
//
this.height.Increment = new decimal(new int[] {
8,
0,
0,
0});
this.height.Location = new System.Drawing.Point(272, 18);
this.height.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.height.Name = "height";
this.height.Size = new System.Drawing.Size(105, 20);
this.height.TabIndex = 0;
//
// ResizeDialog
//
this.AcceptButton = this.button2;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.button1;
this.ClientSize = new System.Drawing.Size(409, 146);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.cordonBottom);
this.Controls.Add(this.cordonTop);
this.Controls.Add(this.cordonRight);
this.Controls.Add(this.cordonLeft);
this.Controls.Add(this.height);
this.Controls.Add(this.width);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "ResizeDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Resize Map";
((System.ComponentModel.ISupportInitialize)(this.width)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cordonLeft)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cordonTop)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cordonRight)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cordonBottom)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.height)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
public System.Windows.Forms.NumericUpDown width;
public System.Windows.Forms.NumericUpDown cordonLeft;
public System.Windows.Forms.NumericUpDown cordonTop;
public System.Windows.Forms.NumericUpDown cordonRight;
public System.Windows.Forms.NumericUpDown cordonBottom;
public System.Windows.Forms.NumericUpDown height;
}
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
namespace OpenRA.Editor
{
partial class ResizeDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.width = new System.Windows.Forms.NumericUpDown();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.cordonLeft = new System.Windows.Forms.NumericUpDown();
this.cordonTop = new System.Windows.Forms.NumericUpDown();
this.cordonRight = new System.Windows.Forms.NumericUpDown();
this.cordonBottom = new System.Windows.Forms.NumericUpDown();
this.label3 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.height = new System.Windows.Forms.NumericUpDown();
((System.ComponentModel.ISupportInitialize)(this.width)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cordonLeft)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cordonTop)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cordonRight)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cordonBottom)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.height)).BeginInit();
this.SuspendLayout();
//
// width
//
this.width.Increment = new decimal(new int[] {
8,
0,
0,
0});
this.width.Location = new System.Drawing.Point(161, 18);
this.width.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.width.Name = "width";
this.width.Size = new System.Drawing.Size(105, 20);
this.width.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(23, 20);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(27, 13);
this.label1.TabIndex = 1;
this.label1.Text = "Size";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(23, 46);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(86, 13);
this.label2.TabIndex = 1;
this.label2.Text = "Cordon Left/Top";
//
// cordonLeft
//
this.cordonLeft.Location = new System.Drawing.Point(161, 44);
this.cordonLeft.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.cordonLeft.Name = "cordonLeft";
this.cordonLeft.Size = new System.Drawing.Size(105, 20);
this.cordonLeft.TabIndex = 0;
//
// cordonTop
//
this.cordonTop.Location = new System.Drawing.Point(272, 44);
this.cordonTop.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.cordonTop.Name = "cordonTop";
this.cordonTop.Size = new System.Drawing.Size(105, 20);
this.cordonTop.TabIndex = 0;
//
// cordonRight
//
this.cordonRight.Location = new System.Drawing.Point(161, 70);
this.cordonRight.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.cordonRight.Name = "cordonRight";
this.cordonRight.Size = new System.Drawing.Size(105, 20);
this.cordonRight.TabIndex = 0;
//
// cordonBottom
//
this.cordonBottom.Location = new System.Drawing.Point(272, 70);
this.cordonBottom.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.cordonBottom.Name = "cordonBottom";
this.cordonBottom.Size = new System.Drawing.Size(105, 20);
this.cordonBottom.TabIndex = 0;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(23, 72);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(107, 13);
this.label3.TabIndex = 1;
this.label3.Text = "Cordon Right/Bottom";
//
// button1
//
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button1.Location = new System.Drawing.Point(302, 111);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 2;
this.button1.Text = "Cancel";
this.button1.UseVisualStyleBackColor = true;
//
// button2
//
this.button2.DialogResult = System.Windows.Forms.DialogResult.OK;
this.button2.Location = new System.Drawing.Point(221, 111);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 2;
this.button2.Text = "OK";
this.button2.UseVisualStyleBackColor = true;
//
// height
//
this.height.Increment = new decimal(new int[] {
8,
0,
0,
0});
this.height.Location = new System.Drawing.Point(272, 18);
this.height.Maximum = new decimal(new int[] {
2048,
0,
0,
0});
this.height.Name = "height";
this.height.Size = new System.Drawing.Size(105, 20);
this.height.TabIndex = 0;
//
// ResizeDialog
//
this.AcceptButton = this.button2;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.button1;
this.ClientSize = new System.Drawing.Size(409, 146);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.cordonBottom);
this.Controls.Add(this.cordonTop);
this.Controls.Add(this.cordonRight);
this.Controls.Add(this.cordonLeft);
this.Controls.Add(this.height);
this.Controls.Add(this.width);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "ResizeDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Resize Map";
((System.ComponentModel.ISupportInitialize)(this.width)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cordonLeft)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cordonTop)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cordonRight)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cordonBottom)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.height)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
public System.Windows.Forms.NumericUpDown width;
public System.Windows.Forms.NumericUpDown cordonLeft;
public System.Windows.Forms.NumericUpDown cordonTop;
public System.Windows.Forms.NumericUpDown cordonRight;
public System.Windows.Forms.NumericUpDown cordonBottom;
public System.Windows.Forms.NumericUpDown height;
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

View File

@@ -1,120 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -30,7 +30,7 @@ namespace OpenRA.Editor
index = (byte)random.Next(Resource.Info.SpriteNames.Length)
};
var ch = new int2((surface.GetBrushLocation().X) / Surface.ChunkSize,
var ch = new int2((surface.GetBrushLocation().X) / Surface.ChunkSize,
(surface.GetBrushLocation().Y) / Surface.ChunkSize);
if (surface.Chunks.ContainsKey(ch))

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -33,10 +33,16 @@ namespace OpenRA.Editor
public float Zoom = 1.0f;
ITool Tool;
public bool IsPanning;
public bool ShowActorNames;
public bool ShowGrid;
public string NewActorOwner;
public event Action AfterChange = () => { };
public event Action<string> MousePositionChanged = _ => { };
public event Action<KeyValuePair<string, ActorReference>> ActorDoubleClicked = _ => { };
Dictionary<string, ActorTemplate> ActorTemplates = new Dictionary<string, ActorTemplate>();
Dictionary<int, ResourceTemplate> ResourceTemplates = new Dictionary<int, ResourceTemplate>();
@@ -86,6 +92,15 @@ namespace OpenRA.Editor
Invalidate();
}
protected override void OnDoubleClick(EventArgs e)
{
base.OnDoubleClick(e);
var x = Map.Actors.Value.FirstOrDefault(a => a.Value.Location() == GetBrushLocation());
if (x.Key != null)
ActorDoubleClicked(x);
}
protected override void OnMouseWheel(MouseEventArgs e)
{
base.OnMouseWheel(e);
@@ -151,7 +166,7 @@ namespace OpenRA.Editor
return;
Tool = null;
var key = Map.Actors.Value.FirstOrDefault(a => a.Value.Location() == BrushLocation);
if (key.Key != null) Map.Actors.Value.Remove(key.Key);
@@ -196,7 +211,6 @@ namespace OpenRA.Editor
{
var bitmap = new Bitmap(ChunkSize * TileSet.TileSize, ChunkSize * TileSet.TileSize);
bitmap.SetPixel(0, 0, Color.Green);
var data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
@@ -210,7 +224,7 @@ namespace OpenRA.Editor
for (var j = 0; j < ChunkSize; j++)
{
var tr = Map.MapTiles.Value[u * ChunkSize + i, v * ChunkSize + j];
var tile = TileSet.Tiles[tr.type];
var tile = TileSet.Templates[tr.type].Data;
var index = (tr.index < tile.TileBitmapBytes.Count) ? tr.index : (byte)0;
var rawImage = tile.TileBitmapBytes[index];
for (var x = 0; x < TileSet.TileSize; x++)
@@ -240,6 +254,16 @@ namespace OpenRA.Editor
}
bitmap.UnlockBits(data);
if (ShowGrid)
using( var g = SGraphics.FromImage(bitmap) )
{
var rect = new Rectangle(0,0,bitmap.Width, bitmap.Height);
ControlPaint.DrawGrid( g, rect, new Size(2, Game.CellSize), Color.DarkRed );
ControlPaint.DrawGrid( g, rect, new Size(Game.CellSize, 2), Color.DarkRed );
ControlPaint.DrawGrid( g, rect, new Size(Game.CellSize, Game.CellSize), Color.Red );
}
return bitmap;
}
@@ -280,36 +304,41 @@ namespace OpenRA.Editor
if (cp != null) bmp.Palette = restorePalette;
}
void DrawActorBorder(System.Drawing.Graphics g, int2 p, ActorTemplate t)
void DrawActorBorder(SGraphics g, int2 p, ActorTemplate t)
{
var centered = t.Appearance == null || !t.Appearance.RelativeToTopLeft;
var drawPos = GetDrawPosition(p, t.Bitmap, centered);
g.DrawRectangle(CordonPen,
drawPos.X, drawPos.Y,
t.Bitmap.Width * Zoom, t.Bitmap.Height * Zoom);
}
ColorPalette GetPaletteForPlayer(string name)
ColorPalette GetPaletteForPlayerInner(string name)
{
var pr = Map.Players[name];
var pcpi = Rules.Info["player"].Traits.Get<PlayerColorPaletteInfo>();
var remap = new PlayerColorRemap(pr.ColorRamp, pcpi.PaletteFormat);
return RenderUtils.MakeSystemPalette(new Palette(Palette, remap));
var remap = new PlayerColorRemap(pcpi.PaletteFormat, pr.ColorRamp);
return new Palette(Palette, remap).AsSystemPalette();
}
Cache<string, ColorPalette> PlayerPalettes;
ColorPalette GetPaletteForActor(ActorReference ar)
public ColorPalette GetPaletteForPlayer(string player)
{
if (PlayerPalettes == null)
PlayerPalettes = new Cache<string, ColorPalette>(GetPaletteForPlayer);
PlayerPalettes = new Cache<string, ColorPalette>(GetPaletteForPlayerInner);
return PlayerPalettes[player];
}
ColorPalette GetPaletteForActor(ActorReference ar)
{
var ownerInit = ar.InitDict.GetOrDefault<OwnerInit>();
if (ownerInit == null)
return null;
return PlayerPalettes[ownerInit.PlayerName];
return GetPaletteForPlayer(ownerInit.PlayerName);
}
protected override void OnPaint(PaintEventArgs e)
@@ -339,12 +368,26 @@ namespace OpenRA.Editor
Map.Bounds.Height * TileSet.TileSize * Zoom);
foreach (var ar in Map.Actors.Value)
DrawActor(e.Graphics, ar.Value.Location(), ActorTemplates[ar.Value.Type],
GetPaletteForActor(ar.Value));
{
if (ActorTemplates.ContainsKey(ar.Value.Type))
DrawActor(e.Graphics, ar.Value.Location(), ActorTemplates[ar.Value.Type],
GetPaletteForActor(ar.Value));
else
Console.WriteLine("Warning: Unknown or excluded actor: {0}", ar.Value.Type);
}
if (ShowActorNames)
foreach (var ar in Map.Actors.Value)
if (!ar.Key.StartsWith("Actor")) // if it has a custom name
e.Graphics.DrawStringContrast(Font, ar.Key,
(int)(ar.Value.Location().X * TileSet.TileSize * Zoom + Offset.X),
(int)(ar.Value.Location().Y * TileSet.TileSize * Zoom + Offset.Y),
Brushes.White,
Brushes.Black);
if (Tool != null)
Tool.Preview(this, e.Graphics);
if (Tool == null)
{
var x = Map.Actors.Value.FirstOrDefault(a => a.Value.Location() == GetBrushLocation());
@@ -360,5 +403,15 @@ namespace OpenRA.Editor
{
return ar.InitDict.Get<LocationInit>().value;
}
public static void DrawStringContrast(this SGraphics g, Font f, string s, int x, int y, Brush fg, Brush bg)
{
g.DrawString(s, f, bg, x - 1, y - 1);
g.DrawString(s, f, bg, x + 1, y - 1);
g.DrawString(s, f, bg, x - 1, y + 1);
g.DrawString(s, f, bg, x + 1, y + 1);
g.DrawString(s, f, fg, x, y);
}
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -12,36 +12,36 @@ using System.Drawing;
namespace OpenRA.FileFormats
{
public struct ColorRamp
{
public byte H,S,L,R;
public struct ColorRamp
{
public byte H,S,L,R;
public ColorRamp(byte h, byte s, byte l, byte r)
{
H = h; S = s; L = l; R = r;
}
public ColorRamp(byte h, byte s, byte l, byte r)
{
H = h; S = s; L = l; R = r;
}
/* returns a color along the Lum ramp */
public Color GetColor( float t )
{
return ColorFromHSL( H / 255f, S / 255f, float2.Lerp( L / 255f, L*R / (255f * 255f), t ) );
}
public static readonly ColorRamp Empty = new ColorRamp(0,0,0,0);
public override string ToString()
{
return "{0},{1},{2},{3}".F(H, S, L, R);
}
/* returns a color along the Lum ramp */
public Color GetColor( float t )
{
return ColorFromHSL( H / 255f, S / 255f, float2.Lerp( L / 255f, L*R / (255f * 255f), t ) );
}
// hk is hue in the range [0,1] instead of [0,360]
public override string ToString()
{
return "{0},{1},{2},{3}".F(H, S, L, R);
}
// hk is hue in the range [0,1] instead of [0,360]
public static Color ColorFromHSL(float hk, float s, float l)
{
// Convert from HSL to RGB
var q = (l < 0.5f) ? l * (1 + s) : l + s - (l * s);
var p = 2 * l - q;
float[] trgb = { hk + 1 / 3.0f,
hk,
hk - 1/3.0f };
float[] trgb = { hk + 1 / 3.0f, hk, hk - 1/3.0f };
float[] rgb = { 0, 0, 0 };
for (int k = 0; k < 3; k++)
@@ -60,5 +60,23 @@ namespace OpenRA.FileFormats
return Color.FromArgb((int)(rgb[0] * 255), (int)(rgb[1] * 255), (int)(rgb[2] * 255));
}
}
public static bool operator ==(ColorRamp me, ColorRamp other)
{
return (me.H == other.H && me.S == other.S && me.L == other.L && me.R == other.R );
}
public static bool operator !=(ColorRamp me, ColorRamp other) { return !(me == other); }
public override int GetHashCode() { return H.GetHashCode() ^ S.GetHashCode() ^ L.GetHashCode() ^ R.GetHashCode(); }
public override bool Equals(object obj)
{
if (obj == null)
return false;
ColorRamp o = (ColorRamp)obj;
return o == this;
}
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -61,12 +61,12 @@ namespace OpenRA.FileFormats
while ((temp = s.Pop()) != "(") yield return temp;
}
else if (char.IsNumber(t[0])) yield return t;
else if (char.IsLetter(t[0]))
else if (char.IsLetter(t[0]))
{
if (!syms.ContainsKey(t))
throw new InvalidOperationException("Substitution `{0}` undefined".F(t));
yield return syms[t].ToString();;
yield return syms[t].ToString();
}
else
{
@@ -74,7 +74,7 @@ namespace OpenRA.FileFormats
s.Push(t);
}
}
while (s.Count > 0) yield return s.Pop();
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -24,6 +24,12 @@ namespace OpenRA
return string.Format(fmt, args);
}
public static T WithDefault<T>(T def, Func<T> f)
{
try { return f(); }
catch { return def; }
}
public static void Do<T>(this IEnumerable<T> e, Action<T> fn)
{
foreach (var ee in e)
@@ -106,5 +112,74 @@ namespace OpenRA
{
return r.Contains(p.ToPointF());
}
public static bool HasModifier(this Modifiers k, Modifiers mod)
{
return (k & mod) == mod;
}
public static bool IsValidInput(this KeyInput key)
{
return char.IsLetter(key.UnicodeChar) || char.IsDigit(key.UnicodeChar) ||
char.IsSymbol(key.UnicodeChar) || char.IsSeparator(key.UnicodeChar) ||
char.IsPunctuation(key.UnicodeChar);
}
public static V GetOrAdd<K, V>(this Dictionary<K, V> d, K k)
where V : new()
{
return d.GetOrAdd(k, _ => new V());
}
public static V GetOrAdd<K, V>(this Dictionary<K, V> d, K k, Func<K, V> createFn)
{
V ret;
if (!d.TryGetValue(k, out ret))
d.Add(k, ret = createFn(k));
return ret;
}
public static T Random<T>(this IEnumerable<T> ts, Thirdparty.Random r)
{
var xs = ts.ToArray();
return xs[r.Next(xs.Length)];
}
public static float Product(this IEnumerable<float> xs)
{
return xs.Aggregate(1f, (a, x) => a * x);
}
public static IEnumerable<T> SymmetricDifference<T>(this IEnumerable<T> xs, IEnumerable<T> ys)
{
// this is probably a shockingly-slow way to do this, but it's concise.
return xs.Except(ys).Concat(ys.Except(xs));
}
public static IEnumerable<T> Iterate<T>( this T t, Func<T,T> f )
{
for(;;) { yield return t; t = f(t); }
}
public static int NextPowerOf2(int v)
{
--v;
v |= v >> 1;
v |= v >> 2;
v |= v >> 4;
v |= v >> 8;
++v;
return v;
}
public static string JoinWith<T>(this IEnumerable<T> ts, string j)
{
return string.Join(j, ts.Select(t => t.ToString()).ToArray());
}
public static IEnumerable<T> Append<T>( this IEnumerable<T> ts, params T[] moreTs)
{
return ts.Concat(moreTs);
}
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -66,16 +66,33 @@ namespace OpenRA.FileFormats
return t;
}
static readonly object[] NoIndexes = {};
public static void LoadField( object self, string key, string value )
{
var field = self.GetType().GetField( key.Trim() );
if( field == null )
UnknownFieldAction( key.Trim(), self.GetType() );
else if( field.HasAttribute<FieldFromYamlKeyAttribute>() )
if( field != null )
{
if (!field.HasAttribute<FieldFromYamlKeyAttribute>())
field.SetValue( self, GetValue( field.Name, field.FieldType, value ) );
return;
else
field.SetValue( self, GetValue( field.Name, field.FieldType, value ) );
}
var prop = self.GetType().GetProperty( key.Trim() );
if (prop != null)
{
if (!prop.HasAttribute<FieldFromYamlKeyAttribute>())
prop.SetValue(self, GetValue(prop.Name, prop.PropertyType, value), NoIndexes);
return;
}
UnknownFieldAction( key.Trim(), self.GetType() );
}
public static T GetValue<T>( string field, string value )
{
return (T) GetValue( field, typeof(T), value );
}
public static object GetValue( string field, Type fieldType, string x )
@@ -100,7 +117,7 @@ namespace OpenRA.FileFormats
else if (fieldType == typeof(float))
{
float res;
if (float.TryParse(x.Replace("%",""), System.Globalization.NumberStyles.Any, NumberFormatInfo.InvariantInfo, out res))
if (float.TryParse(x.Replace("%",""), NumberStyles.Any, NumberFormatInfo.InvariantInfo, out res))
return res * (x.Contains( '%' ) ? 0.01f : 1f);
return InvalidValueAction(x,fieldType, field);
}
@@ -108,7 +125,7 @@ namespace OpenRA.FileFormats
else if (fieldType == typeof(decimal))
{
decimal res;
if (decimal.TryParse(x.Replace("%",""), System.Globalization.NumberStyles.Any, NumberFormatInfo.InvariantInfo, out res))
if (decimal.TryParse(x.Replace("%",""), NumberStyles.Any, NumberFormatInfo.InvariantInfo, out res))
return res * (x.Contains( '%' ) ? 0.01m : 1m);
return InvalidValueAction(x,fieldType, field);
}
@@ -126,64 +143,71 @@ namespace OpenRA.FileFormats
return InvalidValueAction(x,fieldType, field);
}
else if (fieldType == typeof(ColorRamp))
{
var parts = x.Split(',');
if (parts.Length == 4)
return new ColorRamp(
(byte)int.Parse(parts[0]).Clamp(0, 255),
(byte)int.Parse(parts[1]).Clamp(0, 255),
(byte)int.Parse(parts[2]).Clamp(0, 255),
(byte)int.Parse(parts[3]).Clamp(0, 255));
else if (fieldType == typeof(ColorRamp))
{
var parts = x.Split(',');
if (parts.Length == 4)
return new ColorRamp(
(byte)int.Parse(parts[0]).Clamp(0, 255),
(byte)int.Parse(parts[1]).Clamp(0, 255),
(byte)int.Parse(parts[2]).Clamp(0, 255),
(byte)int.Parse(parts[3]).Clamp(0, 255));
return InvalidValueAction(x, fieldType, field);
}
return InvalidValueAction(x, fieldType, field);
}
else if (fieldType.IsEnum)
{
if (!Enum.GetNames(fieldType).Select(a => a.ToLower()).Contains(x.ToLower()))
return InvalidValueAction(x, fieldType, field);
return Enum.Parse(fieldType, x, true);
}
else if (fieldType.IsEnum)
{
if (!Enum.GetNames(fieldType).Select(a => a.ToLower()).Contains(x.ToLower()))
return InvalidValueAction(x, fieldType, field);
return Enum.Parse(fieldType, x, true);
}
else if (fieldType == typeof(bool))
return ParseYesNo(x, fieldType, field);
else if (fieldType == typeof(bool))
return ParseYesNo(x, fieldType, field);
else if (fieldType.IsArray)
{
if (x == null)
return Array.CreateInstance(fieldType.GetElementType(), 0);
else if (fieldType.IsArray)
{
if (x == null)
return Array.CreateInstance(fieldType.GetElementType(), 0);
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
var ret = Array.CreateInstance(fieldType.GetElementType(), parts.Length);
for (int i = 0; i < parts.Length; i++)
ret.SetValue(GetValue(field, fieldType.GetElementType(), parts[i].Trim()), i);
return ret;
}
else if (fieldType == typeof(int2))
{
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
return new int2(int.Parse(parts[0]), int.Parse(parts[1]));
}
else if (fieldType == typeof(float2))
{
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
float xx = 0;
float yy = 0;
float res;
if (float.TryParse(parts[0].Replace("%", ""), out res))
xx = res * (parts[0].Contains('%') ? 0.01f : 1f);
if (float.TryParse(parts[1].Replace("%", ""), out res))
yy = res * (parts[1].Contains('%') ? 0.01f : 1f);
return new float2(xx, yy);
}
var ret = Array.CreateInstance(fieldType.GetElementType(), parts.Length);
for (int i = 0; i < parts.Length; i++)
ret.SetValue(GetValue(field, fieldType.GetElementType(), parts[i].Trim()), i);
return ret;
}
else if (fieldType == typeof(int2))
{
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
return new int2(int.Parse(parts[0]), int.Parse(parts[1]));
}
else if (fieldType == typeof(float2))
{
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
float xx = 0;
float yy = 0;
float res;
if (float.TryParse(parts[0].Replace("%", ""), out res))
xx = res * (parts[0].Contains('%') ? 0.01f : 1f);
if (float.TryParse(parts[1].Replace("%", ""), out res))
yy = res * (parts[1].Contains('%') ? 0.01f : 1f);
return new float2(xx, yy);
}
else if (fieldType == typeof(Rectangle))
{
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
return new Rectangle(int.Parse(parts[0]), int.Parse(parts[1]), int.Parse(parts[2]), int.Parse(parts[3]));
}
{
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
return new Rectangle(int.Parse(parts[0]), int.Parse(parts[1]), int.Parse(parts[2]), int.Parse(parts[3]));
}
else if (fieldType.IsGenericType && fieldType.GetGenericTypeDefinition() == typeof(Bits<>))
{
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
var argTypes = new Type[] { typeof(string[]) };
var argValues = new object[] { parts };
return fieldType.GetConstructor(argTypes).Invoke(argValues);
}
UnknownFieldAction("[Type] {0}".F(x),fieldType);
return null;
}
@@ -207,26 +231,22 @@ namespace OpenRA.FileFormats
foreach( var ff in type.GetFields() )
{
var field = ff;
var load = field.GetCustomAttributes<LoadAttribute>( false );
var ignore = field.GetCustomAttributes<IgnoreAttribute>( false );
var loadUsing = field.GetCustomAttributes<LoadUsingAttribute>( false );
var fromYamlKey = field.GetCustomAttributes<FieldFromYamlKeyAttribute>( false );
if( loadUsing.Length != 0 )
ret[ field ] = ( _1, fieldType, yaml ) => loadUsing[ 0 ].LoaderFunc( field )( yaml );
else if( fromYamlKey.Length != 0 )
ret[ field ] = ( f, ft, yaml ) => GetValue( f, ft, yaml.Value );
else if( load.Length != 0 )
else if( ignore.Length == 0 )
ret[ field ] = null;
}
if( ret.Count == 0 )
foreach( var f in type.GetFields() )
ret.Add( f, null );
return ret;
}
[AttributeUsage( AttributeTargets.Field )]
public class LoadAttribute : Attribute { }
public class IgnoreAttribute : Attribute { }
[AttributeUsage( AttributeTargets.Field )]
public class LoadUsingAttribute : Attribute
@@ -284,15 +304,14 @@ namespace OpenRA.FileFormats
{
return new MiniYamlNode(field, FieldSaver.FormatValue( o, o.GetType().GetField(field) ));
}
public static string FormatValue(object o, FieldInfo f)
public static string FormatValue(object v, Type t)
{
var v = f.GetValue(o);
if (v == null)
return "";
// Color.ToString() does the wrong thing; force it to format as an array
if (f.FieldType == typeof(Color))
if (t == typeof(Color))
{
var c = (Color)v;
return "{0},{1},{2},{3}".F(((int)c.A).Clamp(0, 255),
@@ -300,15 +319,25 @@ namespace OpenRA.FileFormats
((int)c.G).Clamp(0, 255),
((int)c.B).Clamp(0, 255));
}
else if (f.FieldType == typeof(Rectangle))
if (t == typeof(Rectangle))
{
var r = (Rectangle)v;
return "{0},{1},{2},{3}".F(r.X, r.Y, r.Width, r.Height);
}
return f.FieldType.IsArray
? string.Join(",", ((Array)v).OfType<object>().Select(a => a.ToString()).ToArray())
: v.ToString();
if (t.IsArray)
{
var elems = ((Array)v).OfType<object>();
return elems.JoinWith(",");
}
return v.ToString();
}
public static string FormatValue(object o, FieldInfo f)
{
return FormatValue(f.GetValue(o), f.FieldType);
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -109,13 +109,13 @@ namespace OpenRA.FileFormats
/*var dataSize = */ br.ReadInt32();
var outputSize = br.ReadInt32();
var flags = (SoundFlags) br.ReadByte();
var samples = outputSize;
if (0 != (flags & SoundFlags.Stereo)) samples /= 2;
if (0 != (flags & SoundFlags._16Bit)) samples /= 2;
return samples / sampleRate;
}
public static byte[] LoadSound(Stream s)
{
var br = new BinaryReader(s);
@@ -140,10 +140,14 @@ namespace OpenRA.FileFormats
var t = DecodeSample(b, ref index, ref currentSample);
output[offset++] = (byte)t;
output[offset++] = (byte)(t >> 8);
t = DecodeSample((byte)(b >> 4), ref index, ref currentSample);
output[offset++] = (byte)t;
output[offset++] = (byte)(t >> 8);
if (offset < outputSize)
{
/* possible that only half of the final byte is used! */
t = DecodeSample((byte)(b >> 4), ref index, ref currentSample);
output[offset++] = (byte)t;
output[offset++] = (byte)(t >> 8);
}
}
dataSize -= 8 + chunk.CompressedSize;

View File

@@ -1,12 +1,12 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*
* This file is based on the blast routines (version 1.1 by Mark Adler)
* This file is based on the blast routines (version 1.1 by Mark Adler)
* included in zlib/contrib
*/
#endregion
@@ -20,7 +20,7 @@ namespace OpenRA.FileFormats
{
public static readonly int MAXBITS = 13; // maximum code length
public static readonly int MAXWIN = 4096; // maximum window size
static byte[] litlen = new byte[] {
11, 124, 8, 7, 28, 7, 188, 13, 76, 4,
10, 8, 12, 10, 12, 10, 8, 23, 8, 9,
@@ -51,28 +51,28 @@ namespace OpenRA.FileFormats
0, 0, 0, 0, 0, 0, 0, 0, 1, 2,
3, 4, 5, 6, 7, 8
};
static Huffman litcode = new Huffman(litlen, litlen.Length, 256);
static Huffman lencode = new Huffman(lenlen, lenlen.Length, 16);
static Huffman distcode = new Huffman(distlen, distlen.Length, 64);
// Decode PKWare Compression Library stream.
public static byte[] Decompress(byte[] src)
{
BitReader br = new BitReader(src);
// Are literals coded?
int coded = br.ReadBits(8);
if (coded < 0 || coded > 1)
throw new NotImplementedException("Invalid datastream");
bool EncodedLiterals = (coded == 1);
// log2(dictionary size) - 6
int dict = br.ReadBits(8);
if (dict < 4 || dict > 6)
throw new InvalidDataException("Invalid dictionary size");
throw new InvalidDataException("Invalid dictionary size");
// output state
ushort next = 0; // index of next write location in out[]
bool first = true; // true to check distances (for first 4K)
@@ -94,37 +94,42 @@ namespace OpenRA.FileFormats
ms.WriteByte(outBuffer[i]);
break;
}
// Distance
symbol = len == 2 ? 2 : dict;
int dist = Decode(distcode, br) << symbol;
dist += br.ReadBits(symbol);
dist++;
if (first && dist > next)
throw new InvalidDataException("Attempt to jump before data");
// copy length bytes from distance bytes back
do
{
int dest = next;
int source = dest - dist;
int copy = MAXWIN;
if (next < dist)
{
source += copy;
copy = dist;
}
copy -= next;
if (copy > len)
copy = len;
len -= copy;
next += (ushort)copy;
Array.Copy(outBuffer, source, outBuffer, dest, copy);
// copy with old-fashioned memcpy semantics
// in case of overlapping ranges. this is NOT
// the same as Array.Copy()
while( copy-- > 0 )
outBuffer[dest++] = outBuffer[source++];
// Flush window to outstream
if (next == MAXWIN)
{
@@ -148,12 +153,12 @@ namespace OpenRA.FileFormats
}
}
} while (true);
return ms.ToArray();
}
// Decode a code using huffman table h.
private static int Decode(Huffman h, BitReader br)
// Decode a code using huffman table h.
static int Decode(Huffman h, BitReader br)
{
int code = 0; // len bits being decoded
int first = 0; // first code of length len
@@ -173,19 +178,19 @@ namespace OpenRA.FileFormats
}
}
}
class BitReader
{
readonly byte[] src;
int offset = 0;
int offset = 0;
int bitBuffer = 0;
int bitCount = 0;
public BitReader(byte[] src)
{
this.src = src;
this.src = src;
}
public int ReadBits(int count)
{
int ret = 0;
@@ -197,7 +202,7 @@ namespace OpenRA.FileFormats
bitBuffer = src[offset++];
bitCount = 8;
}
ret |= (bitBuffer & 1) << filled;
bitBuffer >>= 1;
bitCount--;
@@ -225,7 +230,7 @@ namespace OpenRA.FileFormats
{
short[] length = new short[256]; // code lengths
int s = 0; // current symbol
// convert compact repeat counts into symbol bit length list
foreach (byte code in rep)
{
@@ -237,16 +242,16 @@ namespace OpenRA.FileFormats
} while (--num > 0);
}
n = s;
// count number of codes of each length
Count = new short[Blast.MAXBITS + 1];
for (int i = 0; i < n; i++)
Count[length[i]]++;
// no codes!
if (Count[0] == n)
return;
// check for an over-subscribed or incomplete set of lengths
int left = 1; // one possible code of zero length
for (int len = 1; len <= Blast.MAXBITS; len++)
@@ -258,12 +263,12 @@ namespace OpenRA.FileFormats
if (left < 0)
throw new InvalidDataException ("over subscribed code set");
}
// generate offsets into symbol table for each length for sorting
short[] offs = new short[Blast.MAXBITS + 1];
for (int len = 1; len < Blast.MAXBITS; len++)
offs[len + 1] = (short)(offs[len] + Count[len]);
// put symbols in table sorted by length, by symbol order within each length
Symbol = new short[SymbolCount];
for (short i = 0; i < n; i++)

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -13,516 +13,516 @@ using System.Linq;
namespace OpenRA.FileFormats
{
/* possibly the fugliest C# i've ever seen. */
/* possibly the fugliest C# i've ever seen. */
class BlowfishKeyProvider
{
const string pubkeyStr = "AihRvNoIbTn85FZRYNZRcT+i6KpU+maCsEqr3Q5q+LDB5tH7Tz2qQ38V";
class BlowfishKeyProvider
{
const string pubkeyStr = "AihRvNoIbTn85FZRYNZRcT+i6KpU+maCsEqr3Q5q+LDB5tH7Tz2qQ38V";
static sbyte[] char2num = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
static sbyte[] char2num = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
class PublicKey
{
public uint[] key1 = new uint[64];
public uint[] key2 = new uint[64];
public uint len;
}
PublicKey pubkey = new PublicKey();
class PublicKey
{
public uint[] key1 = new uint[64];
public uint[] key2 = new uint[64];
public uint len;
}
PublicKey pubkey = new PublicKey();
uint[] glob1 = new uint[64];
uint glob1_bitlen, glob1_len_x2;
uint[] glob2 = new uint[130];
uint[] glob1_hi = new uint[4];
uint[] glob1_hi_inv = new uint[4];
uint glob1_hi_bitlen;
uint glob1_hi_inv_lo, glob1_hi_inv_hi;
uint[] glob1 = new uint[64];
uint glob1_bitlen, glob1_len_x2;
uint[] glob2 = new uint[130];
uint[] glob1_hi = new uint[4];
uint[] glob1_hi_inv = new uint[4];
uint glob1_hi_bitlen;
uint glob1_hi_inv_lo, glob1_hi_inv_hi;
void init_bignum(uint[] n, uint val, uint len)
{
for (int i = 0; i < len; i++) n[i] = 0;
n[0] = val;
}
void init_bignum(uint[] n, uint val, uint len)
{
for (int i = 0; i < len; i++) n[i] = 0;
n[0] = val;
}
void move_key_to_big(uint[] n, byte[] key, uint klen, uint blen)
{
byte sign;
void move_key_to_big(uint[] n, byte[] key, uint klen, uint blen)
{
byte sign;
if ((key[0] & 0x80) != 0) sign = 0xff;
else sign = 0;
if ((key[0] & 0x80) != 0) sign = 0xff;
else sign = 0;
unsafe
{
fixed (uint* _pn = &n[0])
{
byte* pn = (byte*)_pn;
uint i = blen * 4;
for (; i > klen; i--) pn[i - 1] = (byte)sign;
for (; i > 0; i--) pn[i - 1] = key[klen - i];
}
}
}
unsafe
{
fixed (uint* _pn = &n[0])
{
byte* pn = (byte*)_pn;
uint i = blen * 4;
for (; i > klen; i--) pn[i - 1] = (byte)sign;
for (; i > 0; i--) pn[i - 1] = key[klen - i];
}
}
}
void key_to_bignum(uint[] n, byte[] key, uint len)
{
uint keylen;
int i;
void key_to_bignum(uint[] n, byte[] key, uint len)
{
uint keylen;
int i;
int j = 0;
int j = 0;
if (key[j] != 2) return;
j++;
if (key[j] != 2) return;
j++;
if ((key[j] & 0x80) != 0)
{
keylen = 0;
for (i = 0; i < (key[j] & 0x7f); i++) keylen = (keylen << 8) | key[j + i + 1];
j += (key[j] & 0x7f) + 1;
}
else
{
keylen = key[j];
j++;
}
if (keylen <= len * 4)
move_key_to_big(n, key.Skip(j).ToArray(), keylen, len);
}
if ((key[j] & 0x80) != 0)
{
keylen = 0;
for (i = 0; i < (key[j] & 0x7f); i++) keylen = (keylen << 8) | key[j + i + 1];
j += (key[j] & 0x7f) + 1;
}
else
{
keylen = key[j];
j++;
}
if (keylen <= len * 4)
move_key_to_big(n, key.Skip(j).ToArray(), keylen, len);
}
uint len_bignum(uint[] n, uint len)
{
uint i;
i = len - 1;
while ((i >= 0) && (n[i] == 0)) i--;
return i + 1;
}
uint len_bignum(uint[] n, uint len)
{
uint i;
i = len - 1;
while ((i >= 0) && (n[i] == 0)) i--;
return i + 1;
}
uint bitlen_bignum(uint[] n, uint len)
{
uint ddlen, bitlen, mask;
ddlen = len_bignum(n, len);
if (ddlen == 0) return 0;
bitlen = ddlen * 32;
mask = 0x80000000;
while ((mask & n[ddlen - 1]) == 0)
{
mask >>= 1;
bitlen--;
}
return bitlen;
}
uint bitlen_bignum(uint[] n, uint len)
{
uint ddlen, bitlen, mask;
ddlen = len_bignum(n, len);
if (ddlen == 0) return 0;
bitlen = ddlen * 32;
mask = 0x80000000;
while ((mask & n[ddlen - 1]) == 0)
{
mask >>= 1;
bitlen--;
}
return bitlen;
}
void init_pubkey()
{
int i = 0;
uint i2, tmp;
byte[] keytmp = new byte[256];
void init_pubkey()
{
int i = 0;
uint i2, tmp;
byte[] keytmp = new byte[256];
init_bignum(pubkey.key2, 0x10001, 64);
init_bignum(pubkey.key2, 0x10001, 64);
i2 = 0;
while (i < pubkeyStr.Length)
{
tmp = (uint)char2num[pubkeyStr[i++]];
tmp <<= 6; tmp |= (uint)(byte)char2num[pubkeyStr[i++]];
tmp <<= 6; tmp |= (uint)(byte)char2num[pubkeyStr[i++]];
tmp <<= 6; tmp |= (uint)(byte)char2num[pubkeyStr[i++]];
keytmp[i2++] = (byte)((tmp >> 16) & 0xff);
keytmp[i2++] = (byte)((tmp >> 8) & 0xff);
keytmp[i2++] = (byte)(tmp & 0xff);
}
i2 = 0;
while (i < pubkeyStr.Length)
{
tmp = (uint)char2num[pubkeyStr[i++]];
tmp <<= 6; tmp |= (uint)(byte)char2num[pubkeyStr[i++]];
tmp <<= 6; tmp |= (uint)(byte)char2num[pubkeyStr[i++]];
tmp <<= 6; tmp |= (uint)(byte)char2num[pubkeyStr[i++]];
keytmp[i2++] = (byte)((tmp >> 16) & 0xff);
keytmp[i2++] = (byte)((tmp >> 8) & 0xff);
keytmp[i2++] = (byte)(tmp & 0xff);
}
key_to_bignum(pubkey.key1, keytmp, 64);
pubkey.len = bitlen_bignum(pubkey.key1, 64) - 1;
}
key_to_bignum(pubkey.key1, keytmp, 64);
pubkey.len = bitlen_bignum(pubkey.key1, 64) - 1;
}
uint len_predata()
{
uint a = (pubkey.len - 1) / 8;
return (55 / a + 1) * (a + 1);
}
uint len_predata()
{
uint a = (pubkey.len - 1) / 8;
return (55 / a + 1) * (a + 1);
}
int cmp_bignum(uint[] n1, uint[] n2, uint len)
{
int cmp_bignum(uint[] n1, uint[] n2, uint len)
{
while (len > 0)
{
--len;
if (n1[len] < n2[len]) return -1;
if (n1[len] > n2[len]) return 1;
}
return 0;
}
while (len > 0)
{
--len;
if (n1[len] < n2[len]) return -1;
if (n1[len] > n2[len]) return 1;
}
return 0;
}
void mov_bignum(uint[] dest, uint[] src, uint len)
{
Array.Copy(src, dest, len);
}
void mov_bignum(uint[] dest, uint[] src, uint len)
{
Array.Copy(src, dest, len);
}
void shr_bignum(uint[] n, int bits, int len)
{
int i; int i2 = bits / 32;
void shr_bignum(uint[] n, int bits, int len)
{
int i; int i2 = bits / 32;
if (i2 > 0)
{
for (i = 0; i < len - i2; i++) n[i] = n[i + i2];
for (; i < len; i++) n[i] = 0;
bits = bits % 32;
}
if (bits == 0) return;
for (i = 0; i < len - 1; i++) n[i] = (n[i] >> bits) | (n[i + 1] << (32 -
bits));
n[i] = n[i] >> bits;
}
if (i2 > 0)
{
for (i = 0; i < len - i2; i++) n[i] = n[i + i2];
for (; i < len; i++) n[i] = 0;
bits = bits % 32;
}
if (bits == 0) return;
for (i = 0; i < len - 1; i++) n[i] = (n[i] >> bits) | (n[i + 1] << (32 -
bits));
n[i] = n[i] >> bits;
}
void shl_bignum(uint[] n, int bits, int len)
{
int i, i2;
void shl_bignum(uint[] n, int bits, int len)
{
int i, i2;
i2 = bits / 32;
if (i2 > 0)
{
for (i = len - 1; i > i2; i--) n[i] = n[i - i2];
for (; i > 0; i--) n[i] = 0;
bits = bits % 32;
}
if (bits == 0) return;
for (i = len - 1; i > 0; i--) n[i] = (n[i] << bits) | (n[i - 1] >> (32 -
bits));
n[0] <<= bits;
}
i2 = bits / 32;
if (i2 > 0)
{
for (i = len - 1; i > i2; i--) n[i] = n[i - i2];
for (; i > 0; i--) n[i] = 0;
bits = bits % 32;
}
if (bits == 0) return;
for (i = len - 1; i > 0; i--) n[i] = (n[i] << bits) | (n[i - 1] >> (32 -
bits));
n[0] <<= bits;
}
uint sub_bignum(uint[] dest, uint[] src1, uint[] src2, uint carry, int len)
{
uint i1, i2;
uint sub_bignum(uint[] dest, uint[] src1, uint[] src2, uint carry, int len)
{
uint i1, i2;
len += len;
unsafe
{
fixed (uint* _ps1 = &src1[0])
fixed (uint* _ps2 = &src2[0])
fixed (uint* _pd = &dest[0])
{
ushort* ps1 = (ushort*)_ps1;
ushort* ps2 = (ushort*)_ps2;
ushort* pd = (ushort*)_pd;
len += len;
unsafe
{
fixed (uint* _ps1 = &src1[0])
fixed (uint* _ps2 = &src2[0])
fixed (uint* _pd = &dest[0])
{
ushort* ps1 = (ushort*)_ps1;
ushort* ps2 = (ushort*)_ps2;
ushort* pd = (ushort*)_pd;
while (--len != -1)
{
i1 = *ps1++;
i2 = *ps2++;
*pd++ = (ushort)(i1 - i2 - carry);
if (((i1 - i2 - carry) & 0x10000) != 0) carry = 1; else carry = 0;
}
}
}
return carry;
}
while (--len != -1)
{
i1 = *ps1++;
i2 = *ps2++;
*pd++ = (ushort)(i1 - i2 - carry);
if (((i1 - i2 - carry) & 0x10000) != 0) carry = 1; else carry = 0;
}
}
}
return carry;
}
unsafe uint sub_bignum(uint* dest, uint* src1, uint* src2, uint carry, int len)
{
uint i1, i2;
unsafe uint sub_bignum(uint* dest, uint* src1, uint* src2, uint carry, int len)
{
uint i1, i2;
len += len;
len += len;
ushort* ps1 = (ushort*)src1;
ushort* ps2 = (ushort*)src2;
ushort* pd = (ushort*)dest;
ushort* ps1 = (ushort*)src1;
ushort* ps2 = (ushort*)src2;
ushort* pd = (ushort*)dest;
while (--len != -1)
{
i1 = *ps1++;
i2 = *ps2++;
*pd++ = (ushort)(i1 - i2 - carry);
if (((i1 - i2 - carry) & 0x10000) != 0) carry = 1; else carry = 0;
while (--len != -1)
{
i1 = *ps1++;
i2 = *ps2++;
*pd++ = (ushort)(i1 - i2 - carry);
if (((i1 - i2 - carry) & 0x10000) != 0) carry = 1; else carry = 0;
}
return carry;
}
}
return carry;
}
void inv_bignum(uint[] n1, uint[] n2, uint len)
{
uint[] n_tmp = new uint[64];
uint n2_bytelen, bit;
int n2_bitlen;
void inv_bignum(uint[] n1, uint[] n2, uint len)
{
uint[] n_tmp = new uint[64];
uint n2_bytelen, bit;
int n2_bitlen;
int j = 0;
int j = 0;
init_bignum(n_tmp, 0, len);
init_bignum(n1, 0, len);
n2_bitlen = (int)bitlen_bignum(n2, len);
bit = ((uint)1) << (n2_bitlen % 32);
j = ((n2_bitlen + 32) / 32) - 1;
n2_bytelen = (uint)((n2_bitlen - 1) / 32) * 4;
n_tmp[n2_bytelen / 4] |= ((uint)1) << ((n2_bitlen - 1) & 0x1f);
init_bignum(n_tmp, 0, len);
init_bignum(n1, 0, len);
n2_bitlen = (int)bitlen_bignum(n2, len);
bit = ((uint)1) << (n2_bitlen % 32);
j = ((n2_bitlen + 32) / 32) - 1;
n2_bytelen = (uint)((n2_bitlen - 1) / 32) * 4;
n_tmp[n2_bytelen / 4] |= ((uint)1) << ((n2_bitlen - 1) & 0x1f);
while (n2_bitlen > 0)
{
n2_bitlen--;
shl_bignum(n_tmp, 1, (int)len);
if (cmp_bignum(n_tmp, n2, len) != -1)
{
sub_bignum(n_tmp, n_tmp, n2, 0, (int)len);
n1[j] |= bit;
}
bit >>= 1;
if (bit == 0)
{
j--;
bit = 0x80000000;
}
}
init_bignum(n_tmp, 0, len);
}
while (n2_bitlen > 0)
{
n2_bitlen--;
shl_bignum(n_tmp, 1, (int)len);
if (cmp_bignum(n_tmp, n2, len) != -1)
{
sub_bignum(n_tmp, n_tmp, n2, 0, (int)len);
n1[j] |= bit;
}
bit >>= 1;
if (bit == 0)
{
j--;
bit = 0x80000000;
}
}
init_bignum(n_tmp, 0, len);
}
void inc_bignum(uint[] n, uint len)
{
int i = 0;
while ((++n[i] == 0) && (--len > 0)) i++;
}
void inc_bignum(uint[] n, uint len)
{
int i = 0;
while ((++n[i] == 0) && (--len > 0)) i++;
}
void init_two_dw(uint[] n, uint len)
{
mov_bignum(glob1, n, len);
glob1_bitlen = bitlen_bignum(glob1, len);
glob1_len_x2 = (glob1_bitlen + 15) / 16;
mov_bignum(glob1_hi, glob1.Skip((int)len_bignum(glob1, len) - 2).ToArray(), 2);
glob1_hi_bitlen = bitlen_bignum(glob1_hi, 2) - 32;
shr_bignum(glob1_hi, (int)glob1_hi_bitlen, 2);
inv_bignum(glob1_hi_inv, glob1_hi, 2);
shr_bignum(glob1_hi_inv, 1, 2);
glob1_hi_bitlen = (glob1_hi_bitlen + 15) % 16 + 1;
inc_bignum(glob1_hi_inv, 2);
if (bitlen_bignum(glob1_hi_inv, 2) > 32)
{
shr_bignum(glob1_hi_inv, 1, 2);
glob1_hi_bitlen--;
}
glob1_hi_inv_lo = (ushort)glob1_hi_inv[0];
glob1_hi_inv_hi = (ushort)(glob1_hi_inv[0] >> 16);
}
void init_two_dw(uint[] n, uint len)
{
mov_bignum(glob1, n, len);
glob1_bitlen = bitlen_bignum(glob1, len);
glob1_len_x2 = (glob1_bitlen + 15) / 16;
mov_bignum(glob1_hi, glob1.Skip((int)len_bignum(glob1, len) - 2).ToArray(), 2);
glob1_hi_bitlen = bitlen_bignum(glob1_hi, 2) - 32;
shr_bignum(glob1_hi, (int)glob1_hi_bitlen, 2);
inv_bignum(glob1_hi_inv, glob1_hi, 2);
shr_bignum(glob1_hi_inv, 1, 2);
glob1_hi_bitlen = (glob1_hi_bitlen + 15) % 16 + 1;
inc_bignum(glob1_hi_inv, 2);
if (bitlen_bignum(glob1_hi_inv, 2) > 32)
{
shr_bignum(glob1_hi_inv, 1, 2);
glob1_hi_bitlen--;
}
glob1_hi_inv_lo = (ushort)glob1_hi_inv[0];
glob1_hi_inv_hi = (ushort)(glob1_hi_inv[0] >> 16);
}
unsafe void mul_bignum_word(ushort *pn1, uint[] n2, uint mul, uint len)
{
uint i, tmp;
unsafe
{
fixed (uint* _pn2 = &n2[0])
{
ushort* pn2 = (ushort*)_pn2;
unsafe void mul_bignum_word(ushort *pn1, uint[] n2, uint mul, uint len)
{
uint i, tmp;
unsafe
{
fixed (uint* _pn2 = &n2[0])
{
ushort* pn2 = (ushort*)_pn2;
tmp = 0;
for (i = 0; i < len; i++)
{
tmp = mul * (*pn2) + (*pn1) + tmp;
*pn1 = (ushort)tmp;
pn1++;
pn2++;
tmp >>= 16;
}
*pn1 += (ushort)tmp;
}
}
}
tmp = 0;
for (i = 0; i < len; i++)
{
tmp = mul * (*pn2) + (*pn1) + tmp;
*pn1 = (ushort)tmp;
pn1++;
pn2++;
tmp >>= 16;
}
*pn1 += (ushort)tmp;
}
}
}
void mul_bignum(uint[] dest, uint[] src1, uint[] src2, uint len)
{
uint i;
void mul_bignum(uint[] dest, uint[] src1, uint[] src2, uint len)
{
uint i;
unsafe
{
fixed( uint * _psrc2 = &src2[0] )
fixed(uint* _pdest = &dest[0])
{
ushort* psrc2 = (ushort*)_psrc2;
ushort* pdest = (ushort*)_pdest;
unsafe
{
fixed( uint * _psrc2 = &src2[0] )
fixed(uint* _pdest = &dest[0])
{
ushort* psrc2 = (ushort*)_psrc2;
ushort* pdest = (ushort*)_pdest;
init_bignum(dest, 0, len * 2);
for (i = 0; i < len * 2; i++)
mul_bignum_word(pdest++, src1, *psrc2++, len * 2);
}
}
}
init_bignum(dest, 0, len * 2);
for (i = 0; i < len * 2; i++)
mul_bignum_word(pdest++, src1, *psrc2++, len * 2);
}
}
}
void not_bignum(uint[] n, uint len)
{
uint i;
for (i = 0; i < len; i++) n[i] = ~n[i];
}
void not_bignum(uint[] n, uint len)
{
uint i;
for (i = 0; i < len; i++) n[i] = ~n[i];
}
void neg_bignum(uint[] n, uint len)
{
not_bignum(n, len);
inc_bignum(n, len);
}
void neg_bignum(uint[] n, uint len)
{
not_bignum(n, len);
inc_bignum(n, len);
}
unsafe uint get_mulword(uint* n)
{
ushort* wn = (ushort*)n;
uint i = (uint)((((((((((*(wn - 1) ^ 0xffff) & 0xffff) * glob1_hi_inv_lo + 0x10000) >> 1)
+ (((*(wn - 2) ^ 0xffff) * glob1_hi_inv_hi + glob1_hi_inv_hi) >> 1) + 1)
>> 16) + ((((*(wn - 1) ^ 0xffff) & 0xffff) * glob1_hi_inv_hi) >> 1) +
(((*wn ^ 0xffff) * glob1_hi_inv_lo) >> 1) + 1) >> 14) + glob1_hi_inv_hi
* (*wn ^ 0xffff) * 2) >> (int)glob1_hi_bitlen);
if (i > 0xffff) i = 0xffff;
return i & 0xffff;
}
unsafe uint get_mulword(uint* n)
{
ushort* wn = (ushort*)n;
uint i = (uint)((((((((((*(wn - 1) ^ 0xffff) & 0xffff) * glob1_hi_inv_lo + 0x10000) >> 1)
+ (((*(wn - 2) ^ 0xffff) * glob1_hi_inv_hi + glob1_hi_inv_hi) >> 1) + 1)
>> 16) + ((((*(wn - 1) ^ 0xffff) & 0xffff) * glob1_hi_inv_hi) >> 1) +
(((*wn ^ 0xffff) * glob1_hi_inv_lo) >> 1) + 1) >> 14) + glob1_hi_inv_hi
* (*wn ^ 0xffff) * 2) >> (int)glob1_hi_bitlen);
if (i > 0xffff) i = 0xffff;
return i & 0xffff;
}
void dec_bignum(uint[] n, uint len)
{
int i = 0;
while ((--n[i] == 0xffffffff) && (--len > 0))
i++;
}
void dec_bignum(uint[] n, uint len)
{
int i = 0;
while ((--n[i] == 0xffffffff) && (--len > 0))
i++;
}
void calc_a_bignum(uint[] n1, uint[] n2, uint[] n3, uint len)
{
uint g2_len_x2, len_diff;
unsafe
{
fixed( uint* g1 = &glob1[0])
fixed (uint* g2 = &glob2[0])
{
mul_bignum(glob2, n2, n3, len);
glob2[len * 2] = 0;
g2_len_x2 = len_bignum(glob2, len * 2 + 1) * 2;
if (g2_len_x2 >= glob1_len_x2)
{
inc_bignum(glob2, len * 2 + 1);
neg_bignum(glob2, len * 2 + 1);
len_diff = g2_len_x2 + 1 - glob1_len_x2;
ushort* esi = ((ushort*)g2) + (1 + g2_len_x2 - glob1_len_x2);
ushort* edi = ((ushort*)g2) + (g2_len_x2 + 1);
for (; len_diff != 0; len_diff--)
{
edi--;
uint tmp = get_mulword((uint*)edi);
esi--;
if (tmp > 0)
{
mul_bignum_word(esi, glob1, tmp, 2 * len);
if ((*edi & 0x8000) == 0)
{
if (0 != sub_bignum((uint*)esi, (uint*)esi, g1, 0, (int)len)) (*edi)--;
}
}
}
neg_bignum(glob2, len);
dec_bignum(glob2, len);
}
mov_bignum(n1, glob2, len);
}
}
}
void calc_a_bignum(uint[] n1, uint[] n2, uint[] n3, uint len)
{
uint g2_len_x2, len_diff;
unsafe
{
fixed( uint* g1 = &glob1[0])
fixed (uint* g2 = &glob2[0])
{
mul_bignum(glob2, n2, n3, len);
glob2[len * 2] = 0;
g2_len_x2 = len_bignum(glob2, len * 2 + 1) * 2;
if (g2_len_x2 >= glob1_len_x2)
{
inc_bignum(glob2, len * 2 + 1);
neg_bignum(glob2, len * 2 + 1);
len_diff = g2_len_x2 + 1 - glob1_len_x2;
ushort* esi = ((ushort*)g2) + (1 + g2_len_x2 - glob1_len_x2);
ushort* edi = ((ushort*)g2) + (g2_len_x2 + 1);
for (; len_diff != 0; len_diff--)
{
edi--;
uint tmp = get_mulword((uint*)edi);
esi--;
if (tmp > 0)
{
mul_bignum_word(esi, glob1, tmp, 2 * len);
if ((*edi & 0x8000) == 0)
{
if (0 != sub_bignum((uint*)esi, (uint*)esi, g1, 0, (int)len)) (*edi)--;
}
}
}
neg_bignum(glob2, len);
dec_bignum(glob2, len);
}
mov_bignum(n1, glob2, len);
}
}
}
void clear_tmp_vars(uint len)
{
init_bignum(glob1, 0, len);
init_bignum(glob2, 0, len);
init_bignum(glob1_hi_inv, 0, 4);
init_bignum(glob1_hi, 0, 4);
glob1_bitlen = 0;
glob1_hi_bitlen = 0;
glob1_len_x2 = 0;
glob1_hi_inv_lo = 0;
glob1_hi_inv_hi = 0;
}
void clear_tmp_vars(uint len)
{
init_bignum(glob1, 0, len);
init_bignum(glob2, 0, len);
init_bignum(glob1_hi_inv, 0, 4);
init_bignum(glob1_hi, 0, 4);
glob1_bitlen = 0;
glob1_hi_bitlen = 0;
glob1_len_x2 = 0;
glob1_hi_inv_lo = 0;
glob1_hi_inv_hi = 0;
}
void calc_a_key(uint[] n1, uint[] n2, uint[] n3, uint[] n4, uint len)
{
uint[] n_tmp = new uint[64];
uint n3_len, n4_len;
int n3_bitlen;
uint bit_mask;
void calc_a_key(uint[] n1, uint[] n2, uint[] n3, uint[] n4, uint len)
{
uint[] n_tmp = new uint[64];
uint n3_len, n4_len;
int n3_bitlen;
uint bit_mask;
unsafe
{
fixed (uint* _pn3 = &n3[0])
{
uint* pn3 = _pn3;
unsafe
{
fixed (uint* _pn3 = &n3[0])
{
uint* pn3 = _pn3;
init_bignum(n1, 1, len);
n4_len = len_bignum(n4, len);
init_two_dw(n4, n4_len);
n3_bitlen = (int)bitlen_bignum(n3, n4_len);
n3_len = (uint)((n3_bitlen + 31) / 32);
bit_mask = (((uint)1) << ((n3_bitlen - 1) % 32)) >> 1;
pn3 += n3_len - 1;
n3_bitlen--;
mov_bignum(n1, n2, n4_len);
while (--n3_bitlen != -1)
{
if (bit_mask == 0)
{
bit_mask = 0x80000000;
pn3--;
}
calc_a_bignum(n_tmp, n1, n1, n4_len);
if ((*pn3 & bit_mask) != 0)
calc_a_bignum(n1, n_tmp, n2, n4_len);
else
mov_bignum(n1, n_tmp, n4_len);
bit_mask >>= 1;
}
init_bignum(n_tmp, 0, n4_len);
clear_tmp_vars(len);
}
}
}
init_bignum(n1, 1, len);
n4_len = len_bignum(n4, len);
init_two_dw(n4, n4_len);
n3_bitlen = (int)bitlen_bignum(n3, n4_len);
n3_len = (uint)((n3_bitlen + 31) / 32);
bit_mask = (((uint)1) << ((n3_bitlen - 1) % 32)) >> 1;
pn3 += n3_len - 1;
n3_bitlen--;
mov_bignum(n1, n2, n4_len);
while (--n3_bitlen != -1)
{
if (bit_mask == 0)
{
bit_mask = 0x80000000;
pn3--;
}
calc_a_bignum(n_tmp, n1, n1, n4_len);
if ((*pn3 & bit_mask) != 0)
calc_a_bignum(n1, n_tmp, n2, n4_len);
else
mov_bignum(n1, n_tmp, n4_len);
bit_mask >>= 1;
}
init_bignum(n_tmp, 0, n4_len);
clear_tmp_vars(len);
}
}
}
unsafe void memcpy(byte* dest, byte* src, int len)
{
while (len-- != 0) *dest++ = *src++;
}
unsafe void memcpy(byte* dest, byte* src, int len)
{
while (len-- != 0) *dest++ = *src++;
}
unsafe void process_predata(byte* pre, uint pre_len, byte *buf)
{
uint[] n2 = new uint[64];
uint[] n3 = new uint[64];
unsafe void process_predata(byte* pre, uint pre_len, byte *buf)
{
uint[] n2 = new uint[64];
uint[] n3 = new uint[64];
uint a = (pubkey.len - 1) / 8;
while (a + 1 <= pre_len)
{
init_bignum(n2, 0, 64);
fixed( uint * pn2 = &n2[0] )
memcpy((byte *)pn2, pre, (int)a + 1);
calc_a_key(n3, n2, pubkey.key2, pubkey.key1, 64);
uint a = (pubkey.len - 1) / 8;
while (a + 1 <= pre_len)
{
init_bignum(n2, 0, 64);
fixed( uint * pn2 = &n2[0] )
memcpy((byte *)pn2, pre, (int)a + 1);
calc_a_key(n3, n2, pubkey.key2, pubkey.key1, 64);
fixed( uint * pn3 = &n3[0] )
memcpy(buf, (byte *)pn3, (int)a);
fixed( uint * pn3 = &n3[0] )
memcpy(buf, (byte *)pn3, (int)a);
pre_len -= a + 1;
pre += a + 1;
buf += a;
}
}
pre_len -= a + 1;
pre += a + 1;
buf += a;
}
}
public byte[] DecryptKey(byte[] src)
{
init_pubkey();
byte[] dest = new byte[256];
public byte[] DecryptKey(byte[] src)
{
init_pubkey();
byte[] dest = new byte[256];
unsafe
{
fixed (byte* pdest = &dest[0])
fixed (byte* psrc = &src[0])
process_predata(psrc, len_predata(), pdest);
}
return dest.Take(56).ToArray();
}
}
unsafe
{
fixed (byte* pdest = &dest[0])
fixed (byte* psrc = &src[0])
process_predata(psrc, len_predata(), pdest);
}
return dest.Take(56).ToArray();
}
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -14,20 +14,20 @@ namespace OpenRA.FileFormats
{
public static int DecodeInto( byte[] src, byte[] dest )
{
var ctx = new FastByteReader(src);
var ctx = new FastByteReader(src);
int destIndex = 0;
while( true )
{
byte i = ctx.ReadByte();
byte i = ctx.ReadByte();
if( ( i & 0x80 ) == 0 )
{
int count = i & 0x7F;
if( count == 0 )
{
// case 6
count = ctx.ReadByte();
byte value = ctx.ReadByte();
count = ctx.ReadByte();
byte value = ctx.ReadByte();
for( int end = destIndex + count ; destIndex < end ; destIndex++ )
dest[ destIndex ] ^= value;
}
@@ -35,7 +35,7 @@ namespace OpenRA.FileFormats
{
// case 5
for( int end = destIndex + count ; destIndex < end ; destIndex++ )
dest[destIndex] ^= ctx.ReadByte();
dest[destIndex] ^= ctx.ReadByte();
}
}
else
@@ -43,7 +43,7 @@ namespace OpenRA.FileFormats
int count = i & 0x7F;
if( count == 0 )
{
count = ctx.ReadWord();
count = ctx.ReadWord();
if( count == 0 )
return destIndex;
@@ -56,12 +56,12 @@ namespace OpenRA.FileFormats
{
// case 3
for( int end = destIndex + ( count & 0x3FFF ) ; destIndex < end ; destIndex++ )
dest[destIndex] ^= ctx.ReadByte();
dest[destIndex] ^= ctx.ReadByte();
}
else
{
// case 4
byte value = ctx.ReadByte();
byte value = ctx.ReadByte();
for( int end = destIndex + ( count & 0x3FFF ) ; destIndex < end ; destIndex++ )
dest[ destIndex ] ^= value;
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -13,32 +13,32 @@ using System.IO;
namespace OpenRA.FileFormats
{
class FastByteReader
{
readonly byte[] src;
int offset = 0;
class FastByteReader
{
readonly byte[] src;
int offset = 0;
public FastByteReader(byte[] src)
{
this.src = src;
}
public FastByteReader(byte[] src)
{
this.src = src;
}
public bool Done() { return offset >= src.Length; }
public byte ReadByte() { return src[offset++]; }
public int ReadWord()
{
int x = ReadByte();
return x | (ReadByte() << 8);
}
public bool Done() { return offset >= src.Length; }
public byte ReadByte() { return src[offset++]; }
public int ReadWord()
{
int x = ReadByte();
return x | (ReadByte() << 8);
}
public void CopyTo(byte[] dest, int offset, int count)
{
Array.Copy(src, this.offset, dest, offset, count);
this.offset += count;
}
public void CopyTo(byte[] dest, int offset, int count)
{
Array.Copy(src, this.offset, dest, offset, count);
this.offset += count;
}
public int Remaining() { return src.Length - offset; }
}
}
public static class Format80
{
@@ -61,16 +61,16 @@ namespace OpenRA.FileFormats
public static int DecodeInto( byte[] src, byte[] dest )
{
var ctx = new FastByteReader(src);
var ctx = new FastByteReader(src);
int destIndex = 0;
while( true )
{
byte i = ctx.ReadByte();
byte i = ctx.ReadByte();
if( ( i & 0x80 ) == 0 )
{
// case 2
byte secondByte = ctx.ReadByte();
byte secondByte = ctx.ReadByte();
int count = ( ( i & 0x70 ) >> 4 ) + 3;
int rpos = ( ( i & 0xf ) << 8 ) + secondByte;
@@ -93,8 +93,8 @@ namespace OpenRA.FileFormats
if( count3 == 0x3E )
{
// case 4
int count = ctx.ReadWord();
byte color = ctx.ReadByte();
int count = ctx.ReadWord();
byte color = ctx.ReadByte();
for( int end = destIndex + count ; destIndex < end ; destIndex++ )
dest[ destIndex ] = color;
@@ -102,8 +102,8 @@ namespace OpenRA.FileFormats
else if( count3 == 0x3F )
{
// case 5
int count = ctx.ReadWord();
int srcIndex = ctx.ReadWord();
int count = ctx.ReadWord();
int srcIndex = ctx.ReadWord();
if( srcIndex >= destIndex )
throw new NotImplementedException( string.Format( "srcIndex >= destIndex {0} {1}", srcIndex, destIndex ) );
@@ -114,7 +114,7 @@ namespace OpenRA.FileFormats
{
// case 3
int count = count3 + 3;
int srcIndex = ctx.ReadWord();
int srcIndex = ctx.ReadWord();
if( srcIndex >= destIndex )
throw new NotImplementedException( string.Format( "srcIndex >= destIndex {0} {1}", srcIndex, destIndex ) );
@@ -129,7 +129,7 @@ namespace OpenRA.FileFormats
{
/* quick & dirty format80 encoder -- only uses raw copy operator, terminated with a zero-run. */
/* this does not produce good compression, but it's valid format80 */
var ctx = new FastByteReader(src);
var ms = new MemoryStream();

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -11,15 +11,14 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Linq;
using System.Reflection;
namespace OpenRA.FileFormats
{
public static class FileSystem
{
static List<IFolder> mountedFolders = new List<IFolder>();
public static string SpecialPackageRoot = "";
static Cache<uint, List<IFolder>> allFiles = new Cache<uint, List<IFolder>>( _ => new List<IFolder>() );
@@ -39,46 +38,46 @@ namespace OpenRA.FileFormats
static IFolder OpenPackage(string filename)
{
return OpenPackage(filename, order++);
return OpenPackage(filename, order++);
}
public static IFolder CreatePackage(string filename, int order, Dictionary<string, byte[]> content)
{
{
if (filename.EndsWith(".mix", StringComparison.InvariantCultureIgnoreCase))
return new MixFile(filename, order, content);
else if (filename.EndsWith(".zip", StringComparison.InvariantCultureIgnoreCase))
return new ZipFile(filename, order, content);
else if (filename.EndsWith(".oramap", StringComparison.InvariantCultureIgnoreCase))
return new ZipFile(filename, order, content);
else if (filename.EndsWith(".Z", StringComparison.InvariantCultureIgnoreCase))
throw new NotImplementedException("Creating .Z archives is unsupported");
else
return new Folder(filename, order, content);
}
public static IFolder OpenPackage(string filename, int order)
{
if (filename.EndsWith(".mix", StringComparison.InvariantCultureIgnoreCase))
return new MixFile(filename, order);
else if (filename.EndsWith(".zip", StringComparison.InvariantCultureIgnoreCase))
return new ZipFile(filename, order);
else if (filename.EndsWith(".oramap", StringComparison.InvariantCultureIgnoreCase))
return new ZipFile(filename, order);
else if (filename.EndsWith(".Z", StringComparison.InvariantCultureIgnoreCase))
return new InstallShieldPackage(filename, order);
else
return new Folder(filename, order);
}
return new MixFile(filename, order, content);
else if (filename.EndsWith(".zip", StringComparison.InvariantCultureIgnoreCase))
return new ZipFile(filename, order, content);
else if (filename.EndsWith(".oramap", StringComparison.InvariantCultureIgnoreCase))
return new ZipFile(filename, order, content);
else if (filename.EndsWith(".Z", StringComparison.InvariantCultureIgnoreCase))
throw new NotImplementedException("Creating .Z archives is unsupported");
else
return new Folder(filename, order, content);
}
public static IFolder OpenPackage(string filename, int order)
{
if (filename.EndsWith(".mix", StringComparison.InvariantCultureIgnoreCase))
return new MixFile(filename, order);
else if (filename.EndsWith(".zip", StringComparison.InvariantCultureIgnoreCase))
return new ZipFile(filename, order);
else if (filename.EndsWith(".oramap", StringComparison.InvariantCultureIgnoreCase))
return new ZipFile(filename, order);
else if (filename.EndsWith(".Z", StringComparison.InvariantCultureIgnoreCase))
return new InstallShieldPackage(filename, order);
else
return new Folder(filename, order);
}
public static void Mount(string name)
{
var optional = name.StartsWith("~");
if (optional) name = name.Substring(1);
// paths starting with $ are relative to SpecialPackageRoot
if (name.StartsWith("$"))
name = SpecialPackageRoot+name.Substring(1);
// paths starting with ^ are relative to the support dir
if (name.StartsWith("^"))
name = Platform.SupportDir+name.Substring(1);
var a = (Action)(() => FileSystem.MountInner(OpenPackage(name)));
if (optional)
@@ -170,7 +169,7 @@ namespace OpenRA.FileFormats
{
foreach (var folder in mountedFolders)
if (folder.Exists(filename))
return true;
return true;
return false;
}
@@ -199,7 +198,7 @@ namespace OpenRA.FileFormats
assemblyCache.Add(filename, a);
return a;
}
return null;
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -26,11 +26,11 @@ namespace OpenRA.FileFormats
this.path = path;
this.priority = priority;
if (Directory.Exists(path))
Directory.Delete(path);
Directory.Delete(path, true);
Write(contents);
}
public Folder(string path, int priority)
{
this.path = path;
@@ -50,7 +50,7 @@ namespace OpenRA.FileFormats
foreach( var filename in Directory.GetFiles( path, "*", SearchOption.TopDirectoryOnly ) )
yield return PackageEntry.HashFilename( Path.GetFileName(filename) );
}
public bool Exists(string filename)
{
return File.Exists(Path.Combine(path,filename));
@@ -61,13 +61,16 @@ namespace OpenRA.FileFormats
{
get { return priority; }
}
public void Write(Dictionary<string, byte[]> contents)
{
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
foreach (var file in contents)
using (var dataStream = File.Create(Path.Combine(path, file.Key)))
using (var writer = new BinaryWriter(dataStream))
writer.Write(file.Value);
writer.Write(file.Value);
}
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -32,7 +32,7 @@ namespace OpenRA.FileFormats
uint signature = reader.ReadUInt32();
if (signature != 0x8C655D13)
throw new InvalidDataException("Not an Installshield package");
reader.ReadBytes(8);
/*var FileCount = */reader.ReadUInt16();
reader.ReadBytes(4);
@@ -41,7 +41,7 @@ namespace OpenRA.FileFormats
var TOCAddress = reader.ReadInt32();
reader.ReadBytes(4);
var DirCount = reader.ReadUInt16();
// Parse the directory list
s.Seek(TOCAddress, SeekOrigin.Begin);
BinaryReader TOCreader = new BinaryReader(s);
@@ -56,15 +56,15 @@ namespace OpenRA.FileFormats
var ChunkSize = reader.ReadUInt16();
var NameLength = reader.ReadUInt16();
reader.ReadChars(NameLength); //var DirName = new String(reader.ReadChars(NameLength));
// Skip to the end of the chunk
reader.ReadBytes(ChunkSize - NameLength - 6);
// Parse files
for (var i = 0; i < FileCount; i++)
ParseFile(reader);
}
uint AccumulatedData = 0;
void ParseFile(BinaryReader reader)
{
@@ -79,11 +79,11 @@ namespace OpenRA.FileFormats
var hash = PackageEntry.HashFilename(FileName);
index.Add(hash, new PackageEntry(hash,AccumulatedData, CompressedSize));
AccumulatedData += CompressedSize;
// Skip to the end of the chunk
reader.ReadBytes(ChunkSize - NameLength - 30);
}
public Stream GetContent(uint hash)
{
PackageEntry e;
@@ -93,7 +93,7 @@ namespace OpenRA.FileFormats
s.Seek( dataStart + e.Offset, SeekOrigin.Begin );
byte[] data = new byte[ e.Length ];
s.Read( data, 0, (int)e.Length );
return new MemoryStream(Blast.Decompress(data));
}
@@ -106,7 +106,7 @@ namespace OpenRA.FileFormats
{
return index.Keys;
}
public bool Exists(string filename)
{
return index.ContainsKey(PackageEntry.HashFilename(filename));
@@ -117,7 +117,7 @@ namespace OpenRA.FileFormats
{
get { return 2000 + priority; }
}
public void Write(Dictionary<string, byte[]> contents)
{
throw new NotImplementedException("Cannot save InstallShieldPackages.");

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -31,14 +31,14 @@ namespace OpenRA.FileFormats
readonly long dataStart;
readonly Stream s;
int priority;
// Create a new MixFile
public MixFile(string filename, int priority, Dictionary<string, byte[]> contents)
{
this.priority = priority;
if (File.Exists(filename))
File.Delete(filename);
s = File.Create(filename);
Write(contents);
}
@@ -137,7 +137,7 @@ namespace OpenRA.FileFormats
dataStart = s.Position;
return items;
}
public Stream GetContent(uint hash)
{
PackageEntry e;
@@ -159,7 +159,7 @@ namespace OpenRA.FileFormats
{
return index.Keys;
}
public bool Exists(string filename)
{
return index.ContainsKey(PackageEntry.HashFilename(filename));
@@ -170,17 +170,17 @@ namespace OpenRA.FileFormats
{
get { return 1000 + priority; }
}
public void Write(Dictionary<string, byte[]> contents)
{
// Cannot modify existing mixfile - rename existing file and
// create a new one with original content plus modifications
FileSystem.Unmount(this);
// TODO: Add existing data to the contents list
if (index.Count > 0)
throw new NotImplementedException("Updating mix files unfinished");
// Construct a list of entries for the file header
uint dataSize = 0;
var items = new List<PackageEntry>();

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -44,7 +44,7 @@ namespace OpenRA.FileFormats
if (File.Exists(filename))
File.Delete(filename);
pkg = SZipFile.Create(filename);
Write(contents);
}
@@ -70,7 +70,7 @@ namespace OpenRA.FileFormats
foreach(ZipEntry entry in pkg)
yield return PackageEntry.HashFilename(entry.Name);
}
public bool Exists(string filename)
{
return pkg.GetEntry(filename) != null;
@@ -80,7 +80,7 @@ namespace OpenRA.FileFormats
{
get { return 500 + priority; }
}
public void Write(Dictionary<string, byte[]> contents)
{
pkg.Close();
@@ -108,7 +108,7 @@ namespace OpenRA.FileFormats
{
this.data = data;
}
public Stream GetSource()
{
return new MemoryStream(data);

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -83,14 +83,14 @@ namespace OpenRA.FileFormats
BinaryReader reader = new BinaryReader(stream);
ImageCount = reader.ReadUInt16();
//Last offset is pointer to end of file.
uint[] offsets = new uint[ImageCount + 1];
uint temp = reader.ReadUInt32();
//If fourth byte in file is non-zero, the offsets are two bytes each.
bool twoByteOffsets = (temp & 0xFF0000) > 0;
bool twoByteOffsets = (temp & 0xFF0000) > 0;
if (twoByteOffsets)
{
offsets[0] = ((temp & 0xFFFF0000) >> 16) + 2; //Offset does not account for image count bytes
@@ -132,7 +132,7 @@ namespace OpenRA.FileFormats
{
get { return headers[index]; }
}
public IEnumerator<Dune2ImageHeader> GetEnumerator()
{
return headers.GetEnumerator();

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -21,28 +21,34 @@ namespace OpenRA.FileFormats.Graphics
public RendererAttribute( Type graphicsDeviceType )
{
if( !typeof( IGraphicsDevice ).IsAssignableFrom( graphicsDeviceType ) )
if( !typeof( IDeviceFactory ).IsAssignableFrom( graphicsDeviceType ) )
throw new InvalidOperationException( "Incorrect type in RendererAttribute" );
Type = graphicsDeviceType;
}
}
public interface IDeviceFactory
{
IGraphicsDevice Create( Size size, WindowMode windowMode );
}
public interface IGraphicsDevice
{
IVertexBuffer<Vertex> CreateVertexBuffer( int length );
IIndexBuffer CreateIndexBuffer( int length );
ITexture CreateTexture( Bitmap bitmap );
ITexture CreateTexture();
IShader CreateShader( string name );
Size WindowSize { get; }
int GpuMemoryUsed { get; }
void Clear( Color color );
void Present( IInputHandler inputHandler );
void Clear();
void Present();
void PumpInput(IInputHandler inputHandler);
void DrawIndexedPrimitives( PrimitiveType type, Range<int> vertexRange, Range<int> indexRange );
void DrawIndexedPrimitives( PrimitiveType type, int vertexPool, int numPrimitives );
void DrawPrimitives( PrimitiveType type, int firstVertex, int numVertices );
void SetLineWidth( float width );
void EnableScissor( int left, int top, int width, int height );
void DisableScissor();
}
@@ -53,17 +59,10 @@ namespace OpenRA.FileFormats.Graphics
void SetData( T[] vertices, int length );
}
public interface IIndexBuffer
{
void Bind();
void SetData( ushort[] indices, int length );
}
public interface IShader
{
void SetValue( string name, float x, float y );
void SetValue( string param, ITexture texture );
void Commit();
void Render( Action a );
}
@@ -74,19 +73,20 @@ namespace OpenRA.FileFormats.Graphics
void SetData(byte[] colors, int width, int height);
}
public enum PrimitiveType
{
PointList,
LineList,
TriangleList,
}
public enum PrimitiveType
{
PointList,
LineList,
TriangleList,
QuadList,
}
public struct Range<T>
{
public readonly T Start, End;
public Range( T start, T end ) { Start = start; End = end; }
}
public enum WindowMode
{
Windowed,

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -27,13 +27,15 @@ namespace OpenRA
public MouseButton Button;
public int2 Location;
public Modifiers Modifiers;
public int MultiTapCount;
public MouseInput( MouseInputEvent ev, MouseButton button, int2 location, Modifiers mods )
public MouseInput( MouseInputEvent ev, MouseButton button, int2 location, Modifiers mods, int multiTapCount )
{
this.Event = ev;
this.Button = button;
this.Location = location;
this.Modifiers = mods;
this.MultiTapCount = multiTapCount;
}
}
@@ -57,15 +59,17 @@ namespace OpenRA
Shift = 1,
Alt = 2,
Ctrl = 4,
Meta = 8,
}
public enum KeyInputEvent { Down, Up };
public struct KeyInput
{
public KeyInputEvent Event;
public char KeyChar;
public char UnicodeChar;
public string KeyName;
public Modifiers Modifiers;
public int VirtKey;
public int MultiTapCount;
}
}

View File

@@ -1,181 +1,182 @@
#region Copyright & License Information
/*
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.IO.Compression;
using System.Net;
using System.Runtime.InteropServices;
using System.Text;
namespace OpenRA.FileFormats.Graphics
{
public static class PngLoader
{
public static Bitmap Load(string filename)
{
return Load(File.OpenRead(filename));
}
public static Bitmap Load(Stream s)
{
using (var br = new BinaryReader(s))
{
var signature = new byte[] { 137, 80, 78, 71, 13, 10, 26, 10 };
foreach (var b in signature)
if (br.ReadByte() != b)
throw new InvalidDataException("PNG Signature is bogus");
Bitmap bitmap = null;
Color[] palette = null;
List<byte> data = new List<byte>();
for (; ; )
{
var length = IPAddress.NetworkToHostOrder(br.ReadInt32());
var type = Encoding.UTF8.GetString(br.ReadBytes(4));
var content = br.ReadBytes(length);
var crc = br.ReadInt32();
using (var ms = new MemoryStream(content))
using (var cr = new BinaryReader(ms))
switch (type)
{
case "IHDR":
{
var width = IPAddress.NetworkToHostOrder(cr.ReadInt32());
var height = IPAddress.NetworkToHostOrder(cr.ReadInt32());
var bitDepth = cr.ReadByte();
var colorType = (PngColorType)cr.ReadByte();
var compression = cr.ReadByte();
var filter = cr.ReadByte();
var interlace = cr.ReadByte();
if (compression != 0) throw new InvalidDataException("Compression method not supported");
if (interlace != 0) throw new InvalidDataException("Interlacing not supported");
bitmap = new Bitmap(width, height, MakePixelFormat(bitDepth, colorType));
}
break;
case "PLTE":
{
palette = new Color[256];
for (var i = 0; i < 256; i++)
{
var r = cr.ReadByte(); var g = cr.ReadByte(); var b = cr.ReadByte();
palette[i] = Color.FromArgb(r, g, b);
}
}
break;
case "tRNS":
{
for (var i = 0; i < length; i++)
palette[i] = Color.FromArgb(cr.ReadByte(), palette[i]);
}
break;
case "IDAT":
{
data.AddRange(content);
}
break;
case "IEND":
{
var bits = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
using (var ns = new MemoryStream(data.ToArray()))
{
// 'zlib' flags bytes; confuses the DeflateStream.
var flags = (byte)ns.ReadByte();
var moreFlags = (byte)ns.ReadByte();
using (var ds = new DeflateStream(ns, CompressionMode.Decompress))
using (var dr = new BinaryReader(ds))
{
var prevLine = new byte[bitmap.Width]; // all zero
for (var y = 0; y < bitmap.Height; y++)
{
var filter = (PngFilter)dr.ReadByte();
var line = dr.ReadBytes(bitmap.Width);
for (var i = 0; i < bitmap.Width; i++)
line[i] = i > 0
? UnapplyFilter(filter, line[i], line[i - 1], prevLine[i], prevLine[i - 1])
: UnapplyFilter(filter, line[i], 0, prevLine[i], 0);
Marshal.Copy(line, 0, new IntPtr(bits.Scan0.ToInt64() + y * bits.Stride), line.Length);
prevLine = line;
}
}
}
bitmap.UnlockBits(bits);
using (var temp = new Bitmap(1, 1, PixelFormat.Format8bppIndexed))
{
var cp = temp.Palette;
for (var i = 0; i < 256; i++)
cp.Entries[i] = palette[i]; // finalize the palette.
bitmap.Palette = cp;
return bitmap;
}
}
}
}
}
}
static byte UnapplyFilter(PngFilter f, byte x, byte a, byte b, byte c)
{
switch (f)
{
case PngFilter.None: return x;
case PngFilter.Sub: return (byte)(x + a);
case PngFilter.Up: return (byte)(x + b);
case PngFilter.Average: return (byte)(x + (a + b) / 2);
case PngFilter.Paeth: return (byte)(x + Paeth(a, b, c));
default:
throw new InvalidOperationException("Unsupported Filter");
}
}
static byte Paeth(byte a, byte b, byte c)
{
var p = a + b - c;
var pa = Math.Abs(p - a);
var pb = Math.Abs(p - b);
var pc = Math.Abs(p - c);
return (pa <= pb && pa <= pc) ? a :
(pb <= pc) ? b : c;
}
[Flags]
enum PngColorType { Indexed = 1, Color = 2, Alpha = 4 };
enum PngFilter { None, Sub, Up, Average, Paeth };
static PixelFormat MakePixelFormat(byte bitDepth, PngColorType colorType)
{
if (bitDepth == 8 && colorType == (PngColorType.Indexed | PngColorType.Color))
return PixelFormat.Format8bppIndexed;
throw new InvalidDataException("Unknown pixelformat");
}
}
}
#region Copyright & License Information
/*
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.IO.Compression;
using System.Net;
using System.Runtime.InteropServices;
using System.Text;
namespace OpenRA.FileFormats.Graphics
{
public static class PngLoader
{
public static Bitmap Load(string filename)
{
using (var s = File.OpenRead(filename))
return Load(s);
}
public static Bitmap Load(Stream s)
{
using (var br = new BinaryReader(s))
{
var signature = new byte[] { 137, 80, 78, 71, 13, 10, 26, 10 };
foreach (var b in signature)
if (br.ReadByte() != b)
throw new InvalidDataException("PNG Signature is bogus");
Bitmap bitmap = null;
Color[] palette = null;
List<byte> data = new List<byte>();
for (; ; )
{
var length = IPAddress.NetworkToHostOrder(br.ReadInt32());
var type = Encoding.UTF8.GetString(br.ReadBytes(4));
var content = br.ReadBytes(length);
/*var crc = */br.ReadInt32();
using (var ms = new MemoryStream(content))
using (var cr = new BinaryReader(ms))
switch (type)
{
case "IHDR":
{
var width = IPAddress.NetworkToHostOrder(cr.ReadInt32());
var height = IPAddress.NetworkToHostOrder(cr.ReadInt32());
var bitDepth = cr.ReadByte();
var colorType = (PngColorType)cr.ReadByte();
var compression = cr.ReadByte();
/*var filter = */cr.ReadByte();
var interlace = cr.ReadByte();
if (compression != 0) throw new InvalidDataException("Compression method not supported");
if (interlace != 0) throw new InvalidDataException("Interlacing not supported");
bitmap = new Bitmap(width, height, MakePixelFormat(bitDepth, colorType));
}
break;
case "PLTE":
{
palette = new Color[256];
for (var i = 0; i < 256; i++)
{
var r = cr.ReadByte(); var g = cr.ReadByte(); var b = cr.ReadByte();
palette[i] = Color.FromArgb(r, g, b);
}
}
break;
case "tRNS":
{
for (var i = 0; i < length; i++)
palette[i] = Color.FromArgb(cr.ReadByte(), palette[i]);
}
break;
case "IDAT":
{
data.AddRange(content);
}
break;
case "IEND":
{
var bits = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
using (var ns = new MemoryStream(data.ToArray()))
{
// 'zlib' flags bytes; confuses the DeflateStream.
/*var flags = (byte)*/ns.ReadByte();
/*var moreFlags = (byte)*/ns.ReadByte();
using (var ds = new DeflateStream(ns, CompressionMode.Decompress))
using (var dr = new BinaryReader(ds))
{
var prevLine = new byte[bitmap.Width]; // all zero
for (var y = 0; y < bitmap.Height; y++)
{
var filter = (PngFilter)dr.ReadByte();
var line = dr.ReadBytes(bitmap.Width);
for (var i = 0; i < bitmap.Width; i++)
line[i] = i > 0
? UnapplyFilter(filter, line[i], line[i - 1], prevLine[i], prevLine[i - 1])
: UnapplyFilter(filter, line[i], 0, prevLine[i], 0);
Marshal.Copy(line, 0, new IntPtr(bits.Scan0.ToInt64() + y * bits.Stride), line.Length);
prevLine = line;
}
}
}
bitmap.UnlockBits(bits);
using (var temp = new Bitmap(1, 1, PixelFormat.Format8bppIndexed))
{
var cp = temp.Palette;
for (var i = 0; i < 256; i++)
cp.Entries[i] = palette[i]; // finalize the palette.
bitmap.Palette = cp;
return bitmap;
}
}
}
}
}
}
static byte UnapplyFilter(PngFilter f, byte x, byte a, byte b, byte c)
{
switch (f)
{
case PngFilter.None: return x;
case PngFilter.Sub: return (byte)(x + a);
case PngFilter.Up: return (byte)(x + b);
case PngFilter.Average: return (byte)(x + (a + b) / 2);
case PngFilter.Paeth: return (byte)(x + Paeth(a, b, c));
default:
throw new InvalidOperationException("Unsupported Filter");
}
}
static byte Paeth(byte a, byte b, byte c)
{
var p = a + b - c;
var pa = Math.Abs(p - a);
var pb = Math.Abs(p - b);
var pc = Math.Abs(p - c);
return (pa <= pb && pa <= pc) ? a :
(pb <= pc) ? b : c;
}
[Flags]
enum PngColorType { Indexed = 1, Color = 2, Alpha = 4 };
enum PngFilter { None, Sub, Up, Average, Paeth };
static PixelFormat MakePixelFormat(byte bitDepth, PngColorType colorType)
{
if (bitDepth == 8 && colorType == (PngColorType.Indexed | PngColorType.Color))
return PixelFormat.Format8bppIndexed;
throw new InvalidDataException("Unknown pixelformat");
}
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -63,7 +63,7 @@ namespace OpenRA.FileFormats
public Size Size { get { return new Size(Width, Height); } }
private readonly List<ImageHeader> headers = new List<ImageHeader>();
readonly List<ImageHeader> headers = new List<ImageHeader>();
int recurseDepth = 0;
@@ -156,7 +156,7 @@ namespace OpenRA.FileFormats
return compressedBytes;
}
private byte[] CopyImageData( byte[] baseImage )
byte[] CopyImageData( byte[] baseImage )
{
byte[] imageData = new byte[ Width * Height ];
for( int i = 0 ; i < Width * Height ; i++ )
@@ -174,5 +174,11 @@ namespace OpenRA.FileFormats
{
return GetEnumerator();
}
public static ShpReader Load(string filename)
{
using (var s = File.OpenRead(filename))
return new ShpReader(s);
}
}
}

View File

@@ -1,46 +1,56 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace OpenRA.FileFormats.Graphics
{
// format80-only SHP writer
public static class ShpWriter
{
public static void Write(Stream s, int width, int height, IEnumerable<byte[]> frames)
{
var compressedFrames = frames.Select(f => Format80.Encode(f)).ToArray();
// note: end-of-file and all-zeroes headers
var dataOffset = 14 + (compressedFrames.Length + 2) * ImageHeader.SizeOnDisk;
using (var bw = new BinaryWriter(s))
{
bw.Write((ushort)compressedFrames.Length);
bw.Write((ushort)0); // unused
bw.Write((ushort)0); // unused
bw.Write((ushort)width);
bw.Write((ushort)height);
bw.Write((uint)0); // unused
foreach (var f in compressedFrames)
{
var ih = new ImageHeader { Format = Format.Format80, Offset = (uint)dataOffset };
dataOffset += f.Length;
ih.WriteTo(bw);
}
var eof = new ImageHeader { Offset = (uint)dataOffset };
eof.WriteTo(bw);
var allZeroes = new ImageHeader { };
allZeroes.WriteTo(bw);
foreach (var f in compressedFrames)
bw.Write(f);
}
}
}
}
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace OpenRA.FileFormats.Graphics
{
// format80-only SHP writer
public static class ShpWriter
{
public static void Write(Stream s, int width, int height, IEnumerable<byte[]> frames)
{
var compressedFrames = frames.Select(f => Format80.Encode(f)).ToArray();
// note: end-of-file and all-zeroes headers
var dataOffset = 14 + (compressedFrames.Length + 2) * ImageHeader.SizeOnDisk;
using (var bw = new BinaryWriter(s))
{
bw.Write((ushort)compressedFrames.Length);
bw.Write((ushort)0); // unused
bw.Write((ushort)0); // unused
bw.Write((ushort)width);
bw.Write((ushort)height);
bw.Write((uint)0); // unused
foreach (var f in compressedFrames)
{
var ih = new ImageHeader { Format = Format.Format80, Offset = (uint)dataOffset };
dataOffset += f.Length;
ih.WriteTo(bw);
}
var eof = new ImageHeader { Offset = (uint)dataOffset };
eof.WriteTo(bw);
var allZeroes = new ImageHeader { };
allZeroes.WriteTo(bw);
foreach (var f in compressedFrames)
bw.Write(f);
}
}
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -19,7 +19,7 @@ namespace OpenRA.FileFormats
public readonly byte Framerate;
public readonly ushort Width;
public readonly ushort Height;
Stream stream;
int currentFrame;
ushort numColors;
@@ -32,75 +32,75 @@ namespace OpenRA.FileFormats
// Stores a list of subpixels, referenced by the VPTZ chunk
byte[] cbf;
byte[] cbp;
byte[] cbp;
int cbChunk = 0;
int cbOffset = 0;
// Top half contains block info, bottom half contains references to cbf array
byte[] origData;
// Final frame output
uint[,] frameData;
byte[] audioData; // audio for this frame: 22050Hz 16bit mono pcm, uncompressed.
public byte[] AudioData { get { return audioData; } }
public int CurrentFrame { get { return currentFrame; } }
public VqaReader( Stream stream )
{
this.stream = stream;
BinaryReader reader = new BinaryReader( stream );
// Decode FORM chunk
if (new String(reader.ReadChars(4)) != "FORM")
throw new InvalidDataException("Invalid vqa (invalid FORM section)");
/*var length = */ reader.ReadUInt32();
if (new String(reader.ReadChars(8)) != "WVQAVQHD")
throw new InvalidDataException("Invalid vqa (not WVQAVQHD)");
/* var length = */reader.ReadUInt32();
/*var version = */reader.ReadUInt16();
/*var flags = */reader.ReadUInt16();
Frames = reader.ReadUInt16();
Width = reader.ReadUInt16();
Height = reader.ReadUInt16();
blockWidth = reader.ReadByte();
blockHeight = reader.ReadByte();
Framerate = reader.ReadByte();
cbParts = reader.ReadByte();
blocks = new int2(Width / blockWidth, Height / blockHeight);
numColors = reader.ReadUInt16();
/*var maxBlocks = */reader.ReadUInt16();
/*var unknown1 = */reader.ReadUInt16();
/*var unknown2 = */reader.ReadUInt32();
// Audio
/*var freq = */reader.ReadUInt16();
/*var channels = */reader.ReadByte();
/*var bits = */reader.ReadByte();
/*var unknown3 = */reader.ReadChars(14);
var frameSize = NextPowerOf2(Math.Max(Width,Height));
var frameSize = Exts.NextPowerOf2(Math.Max(Width,Height));
cbf = new byte[Width*Height];
cbp = new byte[Width*Height];
palette = new uint[numColors];
origData = new byte[2*blocks.X*blocks.Y];
frameData = new uint[frameSize,frameSize];
var type = new String(reader.ReadChars(4));
if (type != "FINF")
{
reader.ReadBytes(27);
type = new String(reader.ReadChars(4));
}
/*var length = */reader.ReadUInt16();
/*var unknown4 = */reader.ReadUInt16();
// Frame offsets
offsets = new UInt32[Frames];
for (int i = 0; i < Frames; i++)
@@ -111,7 +111,7 @@ namespace OpenRA.FileFormats
}
CollectAudioData();
Reset();
}
@@ -120,7 +120,7 @@ namespace OpenRA.FileFormats
currentFrame = cbOffset = cbChunk = 0;
LoadFrame();
}
void CollectAudioData()
{
var ms = new MemoryStream();
@@ -163,17 +163,17 @@ namespace OpenRA.FileFormats
currentFrame++;
LoadFrame();
}
void LoadFrame()
{
{
if (currentFrame >= Frames)
return;
// Seek to the start of the frame
stream.Seek(offsets[currentFrame], SeekOrigin.Begin);
BinaryReader reader = new BinaryReader(stream);
var end = (currentFrame < Frames - 1) ? offsets[currentFrame+1] : stream.Length;
while(reader.BaseStream.Position < end)
{
var type = new String(reader.ReadChars(4));
@@ -189,17 +189,17 @@ namespace OpenRA.FileFormats
reader.ReadBytes((int)length);
break;
}
// Chunks are aligned on even bytes; advance by a byte if the next one is null
if (reader.PeekChar() == 0) reader.ReadByte();
}
}
// VQA Frame
public void DecodeVQFR(BinaryReader reader)
{
{
while(true)
{
{
// Chunks are aligned on even bytes; may be padded with a single null
if (reader.PeekChar() == 0) reader.ReadByte();
var type = new String(reader.ReadChars(4));
@@ -214,9 +214,9 @@ namespace OpenRA.FileFormats
case "CBF0":
cbf = reader.ReadBytes(subchunkLength);
break;
// frame-modifier chunk
case "CBP0":
case "CBP0":
case "CBPZ":
// Partial buffer is full; dump and recreate
if (cbChunk == cbParts)
@@ -225,16 +225,16 @@ namespace OpenRA.FileFormats
cbf = (byte[])cbp.Clone();
else
Format80.DecodeInto( cbp, cbf );
cbOffset = cbChunk = 0;
}
var bytes = reader.ReadBytes(subchunkLength);
bytes.CopyTo(cbp,cbOffset);
cbOffset += subchunkLength;
cbChunk++;
break;
// Palette
case "CPL0":
for (int i = 0; i < numColors; i++)
@@ -245,7 +245,7 @@ namespace OpenRA.FileFormats
palette[i] = (uint)((255 << 24) | (r << 16) | (g << 8) | b);
}
break;
// Frame data
case "VPTZ":
Format80.DecodeInto( reader.ReadBytes(subchunkLength), origData );
@@ -256,39 +256,36 @@ namespace OpenRA.FileFormats
}
}
}
int cachedFrame = -1;
public uint[,] FrameData { get
void DecodeFrameData( int frame )
{
if (cachedFrame != currentFrame)
cachedFrame = currentFrame;
for (var y = 0; y < blocks.Y; y++)
for (var x = 0; x < blocks.X; x++)
{
var px = origData[x + y*blocks.X];
var mod = origData[x + (y + blocks.Y)*blocks.X];
for (var j = 0; j < blockHeight; j++)
for (var i = 0; i < blockWidth; i++)
{
var cbfi = (mod*256 + px)*8 + j*blockWidth + i;
byte color = (mod == 0x0f) ? px : cbf[cbfi];
frameData[y*blockHeight + j, x*blockWidth + i] = palette[color];
}
}
}
public uint[,] FrameData
{
get
{
cachedFrame = currentFrame;
for (var y = 0; y < blocks.Y; y++)
for (var x = 0; x < blocks.X; x++)
{
var px = origData[x + y*blocks.X];
var mod = origData[x + (y + blocks.Y)*blocks.X];
for (var j = 0; j < blockHeight; j++)
for (var i = 0; i < blockWidth; i++)
{
var cbfi = (mod*256 + px)*8 + j*blockWidth + i;
byte color = (mod == 0x0f) ? px : cbf[cbfi];
frameData[y*blockHeight + j, x*blockWidth + i] = palette[color];
}
}
if (cachedFrame != currentFrame)
DecodeFrameData(currentFrame);
return frameData;
}
return frameData;
}}
int NextPowerOf2(int v)
{
--v;
v |= v >> 1;
v |= v >> 2;
v |= v >> 4;
v |= v >> 8;
++v;
return v;
}
}
}

View File

@@ -1,97 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace OpenRA.FileFormats
{
public static class HttpUtil
{
public static byte[] DownloadData(string url, Action<int, int> f, int chunkSize)
{
var uri = new Uri(url);
var ip = Dns.GetHostEntry(uri.DnsSafeHost).AddressList[0];
using (var s = new TcpClient())
{
s.Connect(new IPEndPoint(ip, uri.Port));
var ns = s.GetStream();
var sw = new StreamWriter(ns);
sw.Write("GET {0} HTTP/1.0\r\nHost:{1}\r\n\r\n", uri.PathAndQuery, uri.Host);
sw.Flush();
var br = new BinaryReader(ns);
var contentLength = 0;
var offset = 0;
for (; ; )
{
var result = br.ReadLine();
var kv = result.Split(new string[] { ": " }, StringSplitOptions.RemoveEmptyEntries);
if (result == "")
{
/* data follows the blank line */
if (contentLength > 0)
{
if (f != null)
f(offset, contentLength);
var data = new byte[contentLength];
while (offset < contentLength)
{
var thisChunk = Math.Min(contentLength - offset, chunkSize);
br.Read(data, offset, thisChunk);
offset += thisChunk;
if (f != null)
f(offset, contentLength);
}
s.Close();
return data;
}
else
{
s.Close();
return new byte[] { };
}
}
else if (kv[0] == "Content-Length")
contentLength = int.Parse(kv[1]);
}
}
}
public static byte[] DownloadData(string url, Action<int, int> f)
{
return DownloadData(url, f, 4096);
}
public static byte[] DownloadData(string url)
{
return DownloadData(url, null);
}
static string ReadLine(this BinaryReader br)
{
var sb = new StringBuilder();
char c;
while ((c = br.ReadChar()) != '\n')
if (c != '\r' && c != '\n')
sb.Append(c);
return sb.ToString();
}
}
}

View File

@@ -0,0 +1,131 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using ICSharpCode.SharpZipLib;
using ICSharpCode.SharpZipLib.Zip;
namespace OpenRA.FileFormats
{
public static class InstallUtils
{
static IEnumerable<ZipEntry> GetEntries(this ZipInputStream z)
{
for (; ; )
{
var e = z.GetNextEntry();
if (e != null) yield return e; else break;
}
}
public static string GetMountedDisk(Func<string, bool> isValidDisk)
{
var volumes = DriveInfo.GetDrives()
.Where(v => v.DriveType == DriveType.CDRom && v.IsReady)
.Select(v => v.RootDirectory.FullName);
return volumes.FirstOrDefault(v => isValidDisk(v));
}
// TODO: The package should be mounted into its own context to avoid name collisions with installed files
public static bool ExtractFromPackage(string srcPath, string package, string[] files, string destPath, Action<string> onProgress, Action<string> onError)
{
if (!Directory.Exists(destPath))
Directory.CreateDirectory(destPath);
if (!Directory.Exists(srcPath)) { onError("Cannot find "+package); return false; }
FileSystem.Mount(srcPath);
if (!FileSystem.Exists(package)) { onError("Cannot find "+package); return false; }
FileSystem.Mount(package);
foreach (string s in files)
{
var destFile = Path.Combine(destPath, s);
using (var sourceStream = FileSystem.Open(s))
using (var destStream = File.Create(destFile))
{
onProgress("Extracting "+s);
destStream.Write(sourceStream.ReadAllBytes());
}
}
return true;
}
public static bool CopyFiles(string srcPath, string[] files, string destPath, Action<string> onProgress, Action<string> onError)
{
foreach (var file in files)
{
var fromPath = Path.Combine(srcPath, file);
if (!File.Exists(fromPath))
{
onError("Cannot find "+file);
return false;
}
var destFile = Path.GetFileName(file).ToLowerInvariant();
onProgress("Extracting "+destFile);
File.Copy(fromPath, Path.Combine(destPath, destFile), true);
}
return true;
}
public static bool ExtractZip(string zipFile, string dest, Action<string> onProgress, Action<string> onError)
{
if (!File.Exists(zipFile))
{
onError("Invalid path: "+zipFile);
return false;
}
List<string> extracted = new List<string>();
try
{
var z = new ZipInputStream(File.OpenRead(zipFile));
z.ExtractZip(dest, extracted, s => onProgress("Extracting "+s));
}
catch (SharpZipBaseException)
{
foreach(var f in extracted)
File.Delete(f);
onError("Invalid archive");
return false;
}
return true;
}
// TODO: this belongs in FileSystem/ZipFile
static void ExtractZip(this ZipInputStream z, string destPath, List<string> extracted, Action<string> onProgress)
{
foreach (var entry in z.GetEntries())
{
if (!entry.IsFile) continue;
onProgress(entry.Name);
Directory.CreateDirectory(Path.Combine(destPath, Path.GetDirectoryName(entry.Name)));
var path = Path.Combine(destPath, entry.Name);
extracted.Add(path);
using (var f = File.Create(path))
{
int bufSize = 2048;
byte[] buf = new byte[bufSize];
while ((bufSize = z.Read(buf, 0, buf.Length)) > 0)
f.Write(buf, 0, bufSize);
}
}
z.Close();
}
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -20,17 +20,18 @@ namespace OpenRA.FileFormats
public readonly string[]
Mods, Folders, Packages, Rules, ServerTraits,
Sequences, Cursors, Chrome, Assemblies, ChromeLayout,
Weapons, Voices, Music, Movies, TileSets;
public readonly string LoadScreen;
Weapons, Voices, Music, Movies, TileSets, ChromeMetrics;
public readonly MiniYaml LoadScreen;
public readonly Dictionary<string, Pair<string,int>> Fonts;
public readonly int TileSize = 24;
public Manifest(string[] mods)
{
Mods = mods;
var yaml = mods
var yaml = new MiniYaml(null, mods
.Select(m => MiniYaml.FromFile("mods/" + m + "/mod.yaml"))
.Aggregate(MiniYaml.Merge);
.Aggregate(MiniYaml.MergeLiberal)).NodesDict;
// Todo: Use fieldloader
Folders = YamlList(yaml, "Folders");
Packages = YamlList(yaml, "Packages");
@@ -46,20 +47,21 @@ namespace OpenRA.FileFormats
Music = YamlList(yaml, "Music");
Movies = YamlList(yaml, "Movies");
TileSets = YamlList(yaml, "TileSets");
ChromeMetrics = YamlList(yaml, "ChromeMetrics");
LoadScreen = yaml.First( x => x.Key == "LoadScreen" ).Value.Value;
if (yaml.FirstOrDefault( x => x.Key == "TileSize" ) != null)
TileSize = int.Parse(yaml.First( x => x.Key == "TileSize" ).Value.Value);
LoadScreen = yaml["LoadScreen"];
Fonts = yaml["Fonts"].NodesDict.ToDictionary(x => x.Key, x => Pair.New(x.Value.NodesDict["Font"].Value,
int.Parse(x.Value.NodesDict["Size"].Value)));
if (yaml.ContainsKey("TileSize"))
TileSize = int.Parse(yaml["TileSize"].Value);
}
static string[] YamlList(List<MiniYamlNode> ys, string key)
static string[] YamlList(Dictionary<string, MiniYaml> yaml, string key)
{
var y = ys.FirstOrDefault( x => x.Key == key );
if( y == null )
if (!yaml.ContainsKey(key))
return new string[ 0 ];
return y.Value.NodesDict.Keys.ToArray();
return yaml[key].NodesDict.Keys.ToArray();
}
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -20,31 +20,29 @@ namespace OpenRA.FileFormats
public bool OwnsWorld = false;
public bool NonCombatant = false;
public bool Playable = false;
public string Bot = null;
public bool DefaultStartingUnits = false;
public bool AllowBots = true;
public bool LockRace = false;
public string Race;
public bool LockColor = false;
public ColorRamp ColorRamp = new ColorRamp(75, 255, 180, 25);
public ColorRamp ColorRamp = new ColorRamp(0,0,238,34);
public bool LockSpawn = false;
public int Spawn = 0;
public bool LockTeam = false;
public int Team = 0;
public int InitialCash = 0;
public string[] Allies = {};
public string[] Enemies = {};
public PlayerReference() {}
public PlayerReference(MiniYaml my)
{
FieldLoader.Load(this, my);
}
public PlayerReference(string name, string race, bool ownsworld, bool noncombatant)
{
Name = name;
Race = race;
OwnsWorld = ownsworld;
NonCombatant = noncombatant;
}
public PlayerReference(MiniYaml my) { FieldLoader.Load(this, my); }
public override string ToString() { return Name; }
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -21,7 +21,7 @@ namespace OpenRA.FileFormats
Location = location;
Depth = depth;
}
public override string ToString ()
{
return string.Format("{0} {1},{2} {3}", Type, Location.X,Location.Y, Depth);

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -18,35 +18,35 @@ namespace OpenRA.FileFormats
public readonly List<byte[]> TileBitmapBytes = new List<byte[]>();
public Terrain( Stream stream, int size )
{
{
// Try loading as a cnc .tem
BinaryReader reader = new BinaryReader( stream );
int Width = reader.ReadUInt16();
int Height = reader.ReadUInt16();
if( Width != size || Height != size )
throw new InvalidDataException( "{0}x{1} != {2}x{2}".F(Width, Height, size ) );
/*NumTiles = */reader.ReadUInt16();
/*Zero1 = */reader.ReadUInt16();
/*Zero1 = */reader.ReadUInt16();
/*uint Size = */reader.ReadUInt32();
uint ImgStart = reader.ReadUInt32();
/*Zero2 = */reader.ReadUInt32();
int IndexEnd, IndexStart;
if (reader.ReadUInt16() == 65535) // ID1 = FFFFh for cnc
{
/*ID2 = */reader.ReadUInt16();
/*ID2 = */reader.ReadUInt16();
IndexEnd = reader.ReadInt32();
IndexStart = reader.ReadInt32();
}
else // Load as a ra .tem
{
stream.Position = 0;
stream.Position = 0;
reader = new BinaryReader( stream );
Width = reader.ReadUInt16();
Height = reader.ReadUInt16();
/*NumTiles = */reader.ReadUInt16();
reader.ReadUInt16();
/*XDim = */reader.ReadUInt16();
@@ -57,7 +57,7 @@ namespace OpenRA.FileFormats
reader.ReadUInt32();
IndexEnd = reader.ReadInt32();
reader.ReadUInt32();
IndexStart = reader.ReadInt32();
IndexStart = reader.ReadInt32();
}
stream.Position = IndexStart;

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -14,7 +14,7 @@ namespace OpenRA.FileFormats
{
public T type;
public U index;
public TileReference(T t, U i)
{
type = t;

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -10,6 +10,7 @@
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Reflection;
@@ -19,31 +20,28 @@ namespace OpenRA.FileFormats
public class TerrainTypeInfo
{
public string Type;
public bool Buildable = true;
public bool AcceptSmudge = true;
public bool IsWater = false;
public Color Color;
public TerrainTypeInfo() {}
public TerrainTypeInfo(MiniYaml my) { FieldLoader.Load(this, my); }
public MiniYaml Save() { return FieldSaver.Save(this); }
}
public class TileTemplate
{
[FieldLoader.Load] public ushort Id;
[FieldLoader.Load] public string Image;
[FieldLoader.Load] public int2 Size;
[FieldLoader.Load] public bool PickAny;
public ushort Id;
public string Image;
public int2 Size;
public bool PickAny;
[FieldLoader.LoadUsing( "LoadTiles" )]
public Dictionary<byte, string> Tiles = new Dictionary<byte, string>();
public TileTemplate() {}
public TileTemplate(MiniYaml my)
{
FieldLoader.Load( this, my );
}
public TileTemplate(MiniYaml my) { FieldLoader.Load( this, my ); }
static object LoadTiles( MiniYaml y )
{
@@ -51,11 +49,13 @@ namespace OpenRA.FileFormats
t => byte.Parse(t.Key),
t => t.Value.Value );
}
static readonly string[] Fields = { "Id", "Image", "Size", "PickAny" };
public MiniYaml Save()
{
var root = new List<MiniYamlNode>();
foreach (var field in new string[] {"Id", "Image", "Size", "PickAny"})
foreach (var field in Fields)
{
FieldInfo f = this.GetType().GetField(field);
if (f.GetValue(this) == null) continue;
@@ -64,11 +64,13 @@ namespace OpenRA.FileFormats
root.Add( new MiniYamlNode( "Tiles", null,
Tiles.Select( x => new MiniYamlNode( x.Key.ToString(), x.Value ) ).ToList() ) );
return new MiniYaml(null, root);
}
public Terrain Data;
}
public class TileSet
{
public string Name;
@@ -77,15 +79,16 @@ namespace OpenRA.FileFormats
public int TileSize = 24;
public string[] Extensions;
public Dictionary<string, TerrainTypeInfo> Terrain = new Dictionary<string, TerrainTypeInfo>();
public Dictionary<ushort, Terrain> Tiles = new Dictionary<ushort, Terrain>();
public Dictionary<ushort, TileTemplate> Templates = new Dictionary<ushort, TileTemplate>();
static List<string> fields = new List<string>() {"Name", "TileSize", "Id", "Palette", "Extensions"};
static readonly string[] fields = {"Name", "TileSize", "Id", "Palette", "Extensions"};
public TileSet() {}
public TileSet( string filepath )
{
var yaml = MiniYaml.DictFromFile( filepath );
// General info
FieldLoader.Load(this, yaml["General"]);
@@ -97,30 +100,30 @@ namespace OpenRA.FileFormats
Templates = yaml["Templates"].NodesDict.Values
.Select(y => new TileTemplate(y)).ToDictionary(t => t.Id);
}
public void LoadTiles()
{
foreach (var t in Templates)
using( Stream s = FileSystem.OpenWithExts(t.Value.Image, Extensions) )
{
if( !Tiles.ContainsKey( t.Key ) )
Tiles.Add( t.Key, new Terrain( s, TileSize ) );
}
if (t.Value.Data == null)
using( var s = FileSystem.OpenWithExts(t.Value.Image, Extensions) )
t.Value.Data = new Terrain(s, TileSize);
}
public void Save(string filepath)
{
{
var root = new List<MiniYamlNode>();
var gen = new List<MiniYamlNode>();
foreach (var field in fields)
{
FieldInfo f = this.GetType().GetField(field);
if (f.GetValue(this) == null) continue;
gen.Add( new MiniYamlNode( field, FieldSaver.FormatValue( this, f ) ) );
}
root.Add( new MiniYamlNode( "General", null, gen ) );
root.Add( new MiniYamlNode( "Terrain", null,
root.Add( new MiniYamlNode( "Terrain", null,
Terrain.Select( t => new MiniYamlNode(
"TerrainType@{0}".F( t.Value.Type ),
t.Value.Save() ) ).ToList() ) );
@@ -130,14 +133,14 @@ namespace OpenRA.FileFormats
"Template@{0}".F( t.Value.Id ),
t.Value.Save() ) ).ToList() ) );
root.WriteToFile(filepath);
}
}
public byte[] GetBytes(TileReference<ushort,byte> r)
{
Terrain tile;
if( Tiles.TryGetValue( r.type, out tile ) )
return tile.TileBitmapBytes[ r.index ];
TileTemplate tile;
if( Templates.TryGetValue( r.type, out tile ) )
return tile.Data.TileBitmapBytes[ r.index ];
byte[] missingTile = new byte[ TileSize * TileSize ];
for( int i = 0 ; i < missingTile.Length ; i++ )
missingTile[ i ] = 0x36;
@@ -153,5 +156,43 @@ namespace OpenRA.FileFormats
return "Clear"; // Default walkable
return ret;
}
public Bitmap RenderTemplate(ushort n, Palette p)
{
var template = Templates[n];
var bitmap = new Bitmap(TileSize * template.Size.X, TileSize * template.Size.Y,
PixelFormat.Format8bppIndexed);
bitmap.Palette = p.AsSystemPalette();
var data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
unsafe
{
byte* q = (byte*)data.Scan0.ToPointer();
var stride = data.Stride;
for (var u = 0; u < template.Size.X; u++)
for (var v = 0; v < template.Size.Y; v++)
if (template.Data.TileBitmapBytes[u + v * template.Size.X] != null)
{
var rawImage = template.Data.TileBitmapBytes[u + v * template.Size.X];
for (var i = 0; i < TileSize; i++)
for (var j = 0; j < TileSize; j++)
q[(v * TileSize + j) * stride + u * TileSize + i] = rawImage[i + TileSize * j];
}
else
{
for (var i = 0; i < TileSize; i++)
for (var j = 0; j < TileSize; j++)
q[(v * TileSize + j) * stride + u * TileSize + i] = 0;
}
}
bitmap.UnlockBits(data);
return bitmap;
}
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -22,6 +22,7 @@ namespace OpenRA.FileFormats
public struct SourceLocation
{
public string Filename; public int Line;
public override string ToString() { return "{0}:{1}".F(Filename, Line); }
}
public SourceLocation Location;
@@ -53,6 +54,11 @@ namespace OpenRA.FileFormats
: this( k, new MiniYaml( v, n ), loc )
{
}
public override string ToString()
{
return "{{YamlNode: {0} @ {1}}}".F(Key, Location);
}
}
public class MiniYaml
@@ -60,7 +66,20 @@ namespace OpenRA.FileFormats
public string Value;
public List<MiniYamlNode> Nodes;
public Dictionary<string, MiniYaml> NodesDict { get { return Nodes.ToDictionary( x => x.Key, x => x.Value ); } }
public Dictionary<string, MiniYaml> NodesDict
{
get
{
var ret = new Dictionary<string, MiniYaml>();
foreach (var y in Nodes)
{
if (ret.ContainsKey(y.Key))
throw new InvalidDataException("Duplicate key `{0}' in MiniYaml".F(y.Key));
ret.Add(y.Key, y.Value);
}
return ret;
}
}
public MiniYaml( string value ) : this( value, null ) { }
@@ -79,7 +98,7 @@ namespace OpenRA.FileFormats
{
return new MiniYaml( null, list.Select( x => new MiniYamlNode( x.ToString(), new MiniYaml( null ) ) ).ToList() );
}
static List<MiniYamlNode> FromLines(string[] lines, string filename)
{
var levels = new List<List<MiniYamlNode>>();
@@ -95,14 +114,14 @@ namespace OpenRA.FileFormats
var level = line.Length - t.Length;
if (levels.Count <= level)
throw new InvalidOperationException("Bad indent in miniyaml");
throw new YamlException("Bad indent in miniyaml");
while (levels.Count > level + 1)
levels.RemoveAt(levels.Count - 1);
var d = new List<MiniYamlNode>();
var rhs = SplitAtColon( ref t );
levels[ level ].Add( new MiniYamlNode( t, rhs, d, new MiniYamlNode.SourceLocation { Filename = filename, Line = lineNo } ) );
levels.Add(d);
}
return levels[ 0 ];
@@ -124,11 +143,11 @@ namespace OpenRA.FileFormats
{
StreamReader reader = new StreamReader( FileSystem.Open(path) );
List<string> lines = new List<string>();
while( !reader.EndOfStream )
lines.Add(reader.ReadLine());
reader.Close();
return FromLines(lines.ToArray(), path);
}
@@ -143,7 +162,7 @@ namespace OpenRA.FileFormats
}
public static List<MiniYamlNode> FromFile( string path )
{
{
return FromLines(File.ReadAllLines( path ), path);
}
@@ -158,7 +177,17 @@ namespace OpenRA.FileFormats
return FromLines(text.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries), "<no filename available>");
}
public static List<MiniYamlNode> Merge( List<MiniYamlNode> a, List<MiniYamlNode> b )
public static List<MiniYamlNode> MergeLiberal(List<MiniYamlNode> a, List<MiniYamlNode> b)
{
return Merge(a, b, false);
}
public static List<MiniYamlNode> MergeStrict(List<MiniYamlNode> a, List<MiniYamlNode> b)
{
return Merge(a, b, true);
}
static List<MiniYamlNode> Merge( List<MiniYamlNode> a, List<MiniYamlNode> b, bool throwErrors )
{
if( a.Count == 0 )
return b;
@@ -171,7 +200,8 @@ namespace OpenRA.FileFormats
var bDict = b.ToDictionary( x => x.Key );
var keys = aDict.Keys.Union( bDict.Keys ).ToList();
var noInherit = keys.Where( x => x.Length > 0 && x[ 0 ] == '-' ).Select( x => x.Substring( 1 ) ).ToList();
var noInherit = keys.Where(x => x.Length > 0 && x[0] == '-')
.ToDictionary(x => x.Substring(1), x => false);
foreach( var key in keys )
{
@@ -179,30 +209,48 @@ namespace OpenRA.FileFormats
aDict.TryGetValue( key, out aa );
bDict.TryGetValue( key, out bb );
if( noInherit.Contains( key ) )
if( noInherit.ContainsKey( key ) )
{
if( aa != null )
ret.Add( aa );
if (!throwErrors)
if (aa != null)
ret.Add(aa);
noInherit[key] = true;
}
else
{
var loc = aa == null ? default( MiniYamlNode.SourceLocation ) : aa.Location;
var merged = ( aa == null || bb == null ) ? aa ?? bb : new MiniYamlNode( key, Merge( aa.Value, bb.Value ), loc );
var merged = ( aa == null || bb == null ) ? aa ?? bb : new MiniYamlNode( key, Merge( aa.Value, bb.Value, throwErrors ), loc );
ret.Add( merged );
}
}
if (throwErrors)
if (noInherit.ContainsValue(false))
throw new YamlException("Bogus yaml removals: {0}".F(
noInherit.Where(x => !x.Value).JoinWith(", ")));
return ret;
}
public static MiniYaml Merge( MiniYaml a, MiniYaml b )
public static MiniYaml MergeLiberal(MiniYaml a, MiniYaml b)
{
return Merge(a, b, false);
}
public static MiniYaml MergeStrict(MiniYaml a, MiniYaml b)
{
return Merge(a, b, true);
}
static MiniYaml Merge( MiniYaml a, MiniYaml b, bool throwErrors )
{
if( a == null )
return b;
if( b == null )
return a;
return new MiniYaml( a.Value ?? b.Value, Merge( a.Nodes, b.Nodes ) );
return new MiniYaml( a.Value ?? b.Value, Merge( a.Nodes, b.Nodes, throwErrors ) );
}
public IEnumerable<string> ToLines(string name)
@@ -223,9 +271,9 @@ namespace OpenRA.FileFormats
public static string WriteToString(this MiniYamlNodes y)
{
return string.Join("\n", y.ToLines(true).Select(x => x.TrimEnd()).ToArray());
return y.ToLines(true).Select(x => x.TrimEnd()).JoinWith("\n");
}
public static IEnumerable<string> ToLines(this MiniYamlNodes y, bool lowest)
{
foreach (var kv in y)
@@ -237,4 +285,9 @@ namespace OpenRA.FileFormats
}
}
}
public class YamlException : Exception
{
public YamlException(string s) : base(s) { }
}
}

View File

@@ -1,37 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace OpenRA.FileFormats
{
public class Mod
{
public string Title;
public string Description;
public string Version;
public string Author;
public string Requires;
public bool Standalone = false;
public static readonly Dictionary<string, Mod> AllMods = ValidateMods(Directory.GetDirectories("mods").Select(x => x.Substring(5)).ToArray());
public static Dictionary<string, Mod> ValidateMods(string[] mods)
{
var ret = new Dictionary<string, Mod>();
foreach (var m in mods)
{
if (!File.Exists("mods" + Path.DirectorySeparatorChar + m + Path.DirectorySeparatorChar + "mod.yaml"))
continue;
var yaml = new MiniYaml(null, MiniYaml.FromFile("mods" + Path.DirectorySeparatorChar + m + Path.DirectorySeparatorChar + "mod.yaml"));
if (!yaml.NodesDict.ContainsKey("Metadata"))
continue;
ret.Add(m, FieldLoader.Load<Mod>(yaml.NodesDict["Metadata"]));
}
return ret;
}
}
}
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace OpenRA.FileFormats
{
public class Mod
{
public string Id;
public string Title;
public string Description;
public string Version;
public string Author;
public string Requires;
public static readonly Dictionary<string, Mod> AllMods = ValidateMods(Directory.GetDirectories("mods").Select(x => x.Substring(5)).ToArray());
public static Dictionary<string, Mod> ValidateMods(string[] mods)
{
var ret = new Dictionary<string, Mod>();
foreach (var m in mods)
{
var yamlPath = new[] { "mods", m, "mod.yaml" }.Aggregate( Path.Combine );
if (!File.Exists(yamlPath))
continue;
var yaml = new MiniYaml(null, MiniYaml.FromFile(yamlPath));
if (!yaml.NodesDict.ContainsKey("Metadata"))
continue;
var mod = FieldLoader.Load<Mod>(yaml.NodesDict["Metadata"]);
mod.Id = m;
ret.Add(m, mod);
}
return ret;
}
public string[] WithPrerequisites()
{
return Id.Iterate(m => AllMods[m].Requires)
.TakeWhile(m => m != null)
.ToArray();
}
}
}

View File

@@ -1,124 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{BDAEAB25-991E-46A7-AF1E-4F0E03358DAA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRA.FileFormats</RootNamespace>
<AssemblyName>OpenRA.FileFormats</AssemblyName>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>2.0</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Tao.Sdl, Version=1.2.13.0, Culture=neutral, PublicKeyToken=9c7a200e36c0094e">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\thirdparty\Tao\Tao.Sdl.dll</HintPath>
</Reference>
<Reference Include="WindowsBase">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\thirdparty\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ColorHSLR.cs" />
<Compile Include="Evaluator.cs" />
<Compile Include="Exts.cs" />
<Compile Include="FieldLoader.cs" />
<Compile Include="Graphics\IGraphicsDevice.cs" />
<Compile Include="Graphics\IInputHandler.cs" />
<Compile Include="Graphics\PngLoader.cs" />
<Compile Include="Graphics\ShpWriter.cs" />
<Compile Include="Graphics\Vertex.cs" />
<Compile Include="HttpUtil.cs" />
<Compile Include="Manifest.cs" />
<Compile Include="MiniYaml.cs" />
<Compile Include="Mod.cs" />
<Compile Include="PackageEntry.cs" />
<Compile Include="Palette.cs" />
<Compile Include="PlayerColorRemap.cs" />
<Compile Include="Primitives\ActionQueue.cs" />
<Compile Include="Primitives\DisposableAction.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Thirdparty\Random.cs" />
<Compile Include="Support\Log.cs" />
<Compile Include="Support\Stopwatch.cs" />
<Compile Include="Support\Timer.cs" />
<Compile Include="TypeDictionary.cs" />
<Compile Include="Map\TileReference.cs" />
<Compile Include="Map\Terrain.cs" />
<Compile Include="Primitives\Cache.cs" />
<Compile Include="Primitives\float2.cs" />
<Compile Include="Primitives\Pair.cs" />
<Compile Include="Map\TileSet.cs" />
<Compile Include="Primitives\PriorityQueue.cs" />
<Compile Include="Primitives\Lazy.cs" />
<Compile Include="FileFormats\AudLoader.cs" />
<Compile Include="FileFormats\Blowfish.cs" />
<Compile Include="FileFormats\BlowfishKeyProvider.cs" />
<Compile Include="Primitives\Set.cs" />
<Compile Include="Graphics\Dune2ShpReader.cs" />
<Compile Include="FileFormats\Format2.cs" />
<Compile Include="FileFormats\Format40.cs" />
<Compile Include="FileFormats\Format80.cs" />
<Compile Include="FileFormats\IniFile.cs" />
<Compile Include="Graphics\ShpReader.cs" />
<Compile Include="Primitives\int2.cs" />
<Compile Include="Map\SmudgeReference.cs" />
<Compile Include="Map\PlayerReference.cs" />
<Compile Include="Graphics\VqaReader.cs" />
<Compile Include="Filesystem\MixFile.cs" />
<Compile Include="Filesystem\FileSystem.cs" />
<Compile Include="Filesystem\Folder.cs" />
<Compile Include="Filesystem\InstallShieldPackage.cs" />
<Compile Include="FileFormats\Blast.cs" />
<Compile Include="Filesystem\ZipFile.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{BDAEAB25-991E-46A7-AF1E-4F0E03358DAA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRA.FileFormats</RootNamespace>
<AssemblyName>OpenRA.FileFormats</AssemblyName>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>2.0</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Tao.Sdl, Version=1.2.13.0, Culture=neutral, PublicKeyToken=9c7a200e36c0094e">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\thirdparty\Tao\Tao.Sdl.dll</HintPath>
</Reference>
<Reference Include="WindowsBase">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\thirdparty\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ColorRamp.cs" />
<Compile Include="Evaluator.cs" />
<Compile Include="Exts.cs" />
<Compile Include="FieldLoader.cs" />
<Compile Include="FileFormats\AudLoader.cs" />
<Compile Include="FileFormats\Blast.cs" />
<Compile Include="FileFormats\Blowfish.cs" />
<Compile Include="FileFormats\BlowfishKeyProvider.cs" />
<Compile Include="FileFormats\Format2.cs" />
<Compile Include="FileFormats\Format40.cs" />
<Compile Include="FileFormats\Format80.cs" />
<Compile Include="FileFormats\IniFile.cs" />
<Compile Include="Filesystem\FileSystem.cs" />
<Compile Include="Filesystem\Folder.cs" />
<Compile Include="Filesystem\InstallShieldPackage.cs" />
<Compile Include="Filesystem\MixFile.cs" />
<Compile Include="Filesystem\ZipFile.cs" />
<Compile Include="Graphics\Dune2ShpReader.cs" />
<Compile Include="Graphics\IGraphicsDevice.cs" />
<Compile Include="Graphics\IInputHandler.cs" />
<Compile Include="Graphics\PngLoader.cs" />
<Compile Include="Graphics\ShpReader.cs" />
<Compile Include="Graphics\ShpWriter.cs" />
<Compile Include="Graphics\Vertex.cs" />
<Compile Include="Graphics\VqaReader.cs" />
<Compile Include="InstallUtils.cs" />
<Compile Include="Manifest.cs" />
<Compile Include="Map\PlayerReference.cs" />
<Compile Include="Map\SmudgeReference.cs" />
<Compile Include="Map\Terrain.cs" />
<Compile Include="Map\TileReference.cs" />
<Compile Include="Map\TileSet.cs" />
<Compile Include="MiniYaml.cs" />
<Compile Include="Mod.cs" />
<Compile Include="PackageEntry.cs" />
<Compile Include="Palette.cs" />
<Compile Include="Platform.cs" />
<Compile Include="PlayerColorRemap.cs" />
<Compile Include="Primitives\ActionQueue.cs" />
<Compile Include="Primitives\Bits.cs" />
<Compile Include="Primitives\Cache.cs" />
<Compile Include="Primitives\Cached.cs" />
<Compile Include="Primitives\DisposableAction.cs" />
<Compile Include="Primitives\Lazy.cs" />
<Compile Include="Primitives\Pair.cs" />
<Compile Include="Primitives\PriorityQueue.cs" />
<Compile Include="Primitives\Set.cs" />
<Compile Include="Primitives\float2.cs" />
<Compile Include="Primitives\int2.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Support\Log.cs" />
<Compile Include="Support\Stopwatch.cs" />
<Compile Include="Support\Timer.cs" />
<Compile Include="Thirdparty\Random.cs" />
<Compile Include="TypeDictionary.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -20,21 +20,21 @@ namespace OpenRA.FileFormats
public readonly uint Offset;
public readonly uint Length;
public PackageEntry(uint hash, uint offset, uint length)
{
Hash = hash;
Offset = offset;
Length = length;
}
public PackageEntry(BinaryReader r)
{
Hash = r.ReadUInt32();
Offset = r.ReadUInt32();
Length = r.ReadUInt32();
}
public void Write(BinaryWriter w)
{
w.Write(Hash);
@@ -63,7 +63,7 @@ namespace OpenRA.FileFormats
MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(name));
BinaryReader reader = new BinaryReader(ms);
int len = name.Length >> 2;
int len = name.Length >> 2;
uint result = 0;
while (len-- != 0)
@@ -73,7 +73,7 @@ namespace OpenRA.FileFormats
}
static Dictionary<uint, string> Names = new Dictionary<uint,string>();
public static void AddStandardName(string s)
{
uint hash = HashFilename(s);

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -9,7 +9,10 @@
#endregion
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System;
using System.Reflection;
namespace OpenRA.FileFormats
{
@@ -20,26 +23,26 @@ namespace OpenRA.FileFormats
{
return Color.FromArgb((int)colors[index]);
}
public void SetColor(int index, Color color)
{
colors[index] = (uint)color.ToArgb();
}
public void SetColor(int index, uint color)
{
colors[index] = (uint)color;
}
public uint[] Values
{
{
get { return colors; }
}
public Palette(Stream s, bool remapTransparent)
{
colors = new uint[256];
using (BinaryReader reader = new BinaryReader(s))
{
for (int i = 0; i < 256; i++)
@@ -66,11 +69,34 @@ namespace OpenRA.FileFormats
for(int i = 0; i < 256; i++)
colors[i] = (uint)r.GetRemappedColor(Color.FromArgb((int)p.colors[i]),i).ToArgb();
}
public Palette(Palette p)
{
colors = (uint[])p.colors.Clone();
}
public ColorPalette AsSystemPalette()
{
ColorPalette pal;
using (var b = new Bitmap(1, 1, PixelFormat.Format8bppIndexed))
pal = b.Palette;
for (var i = 0; i < 256; i++)
pal.Entries[i] = GetColor(i);
// hack around a mono bug -- the palette flags get set wrong.
if (Platform.CurrentPlatform != PlatformType.Windows)
typeof(ColorPalette).GetField("flags",
BindingFlags.Instance | BindingFlags.NonPublic).SetValue(pal, 1);
return pal;
}
public static Palette Load( string filename, bool remap )
{
using(var s = File.OpenRead(filename))
return new Palette(s, remap);
}
}
public interface IPaletteRemap { Color GetRemappedColor(Color original, int index); }

View File

@@ -0,0 +1,75 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
using System.Diagnostics;
using System.IO;
using OpenRA.FileFormats;
namespace OpenRA
{
public enum PlatformType { Unknown, Windows, OSX, Linux }
public static class Platform
{
public static PlatformType CurrentPlatform { get { return currentPlatform.Value; } }
static Lazy<PlatformType> currentPlatform = Lazy.New((Func<PlatformType>)GetCurrentPlatform);
static PlatformType GetCurrentPlatform()
{
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
return PlatformType.Windows;
try
{
var psi = new ProcessStartInfo("uname", "-s");
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
var p = Process.Start(psi);
var kernelName = p.StandardOutput.ReadToEnd();
if (kernelName.Contains("Linux") || kernelName.Contains("BSD"))
return PlatformType.Linux;
if (kernelName.Contains("Darwin"))
return PlatformType.OSX;
}
catch { }
return PlatformType.Unknown;
}
public static string SupportDir
{
get
{
var dir = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
switch (CurrentPlatform)
{
case PlatformType.Windows:
dir += Path.DirectorySeparatorChar + "OpenRA";
break;
case PlatformType.OSX:
dir += "/Library/Application Support/OpenRA";
break;
case PlatformType.Linux:
default:
dir += "/.openra";
break;
}
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
return dir + Path.DirectorySeparatorChar;
}
}
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -21,10 +21,10 @@ namespace OpenRA.FileFormats
{
Dictionary<int, Color> remapColors;
public PlayerColorRemap(ColorRamp c, PaletteFormat fmt)
public PlayerColorRemap(PaletteFormat fmt, ColorRamp c)
{
var c1 = c.GetColor(0);
var c2 = c.GetColor(1); /* temptemp: this can be expressed better */
var c1 = c.GetColor(0);
var c2 = c.GetColor(1); /* temptemp: this can be expressed better */
var baseIndex = (fmt == PaletteFormat.cnc) ? 0xb0 : (fmt == PaletteFormat.d2k) ? 240 : 80;
var ramp = (fmt == PaletteFormat.cnc)
@@ -42,11 +42,11 @@ namespace OpenRA.FileFormats
(int)(t * c2.G + (1 - t) * c1.G),
(int)(t * c2.B + (1 - t) * c1.B));
}
public Color GetRemappedColor(Color original, int index)
{
Color c;
return remapColors.TryGetValue(index, out c)
return remapColors.TryGetValue(index, out c)
? c : original;
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -18,23 +18,45 @@ namespace OpenRA.FileFormats
public class ActionQueue
{
object syncRoot = new object();
Action actions = () => { };
PriorityQueue<DelayedAction> actions = new PriorityQueue<DelayedAction>();
public void Add(Action a)
public void Add(Action a) { Add(a, 0); }
public void Add(Action a, int delay)
{
lock (syncRoot)
actions += a;
actions.Add(new DelayedAction(a, Environment.TickCount + delay));
}
public void PerformActions()
{
Action a;
Action a = () => {};
lock (syncRoot)
{
a = actions;
actions = () => { };
var t = Environment.TickCount;
while (!actions.Empty && actions.Peek().Time <= t)
{
var da = actions.Pop();
a += da.Action;
}
}
a();
}
}
struct DelayedAction : IComparable<DelayedAction>
{
public int Time;
public Action Action;
public DelayedAction(Action action, int time)
{
Action = action;
Time = time;
}
public int CompareTo(DelayedAction other)
{
return Math.Sign(Time - other.Time);
}
}
}

View File

@@ -0,0 +1,65 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
namespace OpenRA.FileFormats
{
static class BitAllocator<T> where T : struct
{
static int nextVal = 1;
static Cache<string,int> bits;
static BitAllocator() { bits = new Cache<string, int>( _ => Allocate() ); }
static int Allocate()
{
if (nextVal == 0)
throw new InvalidOperationException(
"Too many values in BitAllocator<{0}>".F(typeof(T).Name));
var val = nextVal;
nextVal <<= 1;
return val;
}
public static int GetValue(string[] val)
{
return val.Select( a => bits[a] ).Aggregate( 0, (a,b) => a | b );
}
public static IEnumerable<string> GetStrings(int val)
{
for( var i = 0; i < 32; i++ )
{
var x = 1 << i;
if ((val & x) != 0)
yield return bits.Single( a => a.Value == x ).Key;
}
}
}
public struct Bits<T> where T : struct
{
public int Value;
public Bits(string[] val) { Value = BitAllocator<T>.GetValue(val); }
public Bits(Bits<T> other) { Value = other.Value; }
public override string ToString()
{
return BitAllocator<T>.GetStrings(Value).JoinWith(",");
}
public override int GetHashCode() { return Value.GetHashCode(); }
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -16,17 +16,21 @@ namespace OpenRA.FileFormats
{
public class Cache<T, U> : IEnumerable<KeyValuePair<T, U>>
{
Dictionary<T, U> hax = new Dictionary<T, U>();
Dictionary<T, U> hax;
Func<T,U> loader;
public Cache(Func<T,U> loader)
public Cache(Func<T,U> loader, IEqualityComparer<T> c)
{
hax = new Dictionary<T, U>(c);
if (loader == null)
throw new ArgumentNullException();
this.loader = loader;
}
public Cache(Func<T, U> loader)
: this(loader, EqualityComparer<T>.Default) { }
public U this[T key]
{
get

View File

@@ -0,0 +1,55 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
namespace OpenRA.FileFormats
{
public class Cached<T>
{
Func<T> p;
T value;
bool hasValue;
public Cached(Func<T> p)
{
if (p == null)
throw new ArgumentNullException();
this.p = p;
}
public T Value
{
get
{
if (hasValue)
return value;
value = p();
hasValue = true;
return value;
}
}
public T Force() { return Value; }
public void Invalidate()
{
hasValue = false;
}
}
public static class Cached
{
public static Cached<T> New<T>(Func<T> p) { return new Cached<T>(p); }
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -14,22 +14,27 @@ namespace OpenRA
{
public class DisposableAction : IDisposable
{
public DisposableAction(Action a) { this.a = a; }
public DisposableAction(Action onDispose, Action onFinalize)
{
this.onDispose = onDispose;
this.onFinalize = onFinalize;
}
Action a;
Action onDispose;
Action onFinalize;
bool disposed;
public void Dispose()
{
if (disposed) return;
disposed = true;
a();
onDispose();
GC.SuppressFinalize(this);
}
~DisposableAction()
{
Dispose();
onFinalize();
}
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -37,6 +37,8 @@ namespace OpenRA.FileFormats
return value;
}
}
public T Force() { return Value; }
}
public static class Lazy

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -9,6 +9,8 @@
#endregion
using System.Collections.Generic;
using System;
using System.Drawing;
namespace OpenRA.FileFormats
{
@@ -23,8 +25,8 @@ namespace OpenRA.FileFormats
Second = second;
}
static IEqualityComparer<T> tc = EqualityComparer<T>.Default;
static IEqualityComparer<U> uc = EqualityComparer<U>.Default;
internal static IEqualityComparer<T> tc = EqualityComparer<T>.Default;
internal static IEqualityComparer<U> uc = EqualityComparer<U>.Default;
public static bool operator ==(Pair<T, U> a, Pair<T, U> b)
{
@@ -55,16 +57,34 @@ namespace OpenRA.FileFormats
public static T AsFirst(Pair<T, U> p) { return p.First; }
public static U AsSecond(Pair<T, U> p) { return p.Second; }
public Pair<U, T> Swap() { return Pair.New(Second, First); }
public override string ToString()
{
return "({0},{1})".F(First, Second);
}
class PairEqualityComparer : IEqualityComparer<Pair<T, U>>
{
public bool Equals(Pair<T, U> x, Pair<T, U> y) { return x == y; }
public int GetHashCode(Pair<T, U> obj) { return obj.GetHashCode(); }
}
public static IEqualityComparer<Pair<T, U>> EqualityComparer { get { return new PairEqualityComparer(); } }
}
public static class Pair
{
public static Pair<T, U> New<T, U>(T t, U u) { return new Pair<T, U>(t, u); }
}
public static class Pair
{
public static Pair<T, U> New<T, U>(T t, U u) { return new Pair<T, U>(t, u); }
static Pair()
{
Pair<char,Color>.uc = new ColorEqualityComparer();
}
// avoid the default crappy one
class ColorEqualityComparer : IEqualityComparer<Color>
{
public bool Equals(Color x, Color y) { return x.ToArgb() == y.ToArgb(); }
public int GetHashCode(Color obj) { return obj.GetHashCode(); }
}
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -62,6 +62,7 @@ namespace OpenRA.FileFormats
return At(lastLevel, lastIndex);
}
public T Peek() { return At(0,0); }
public T Pop()
{
if (level == 0 && index == 0)

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -45,22 +45,4 @@ namespace OpenRA.Collections
return GetEnumerator();
}
}
public class CachedView<T,U> : Set<U>
{
public CachedView( Set<T> set, Func<T, bool> include, Func<T, U> store )
: this( set, include, x => new[] { store( x ) } )
{
}
public CachedView( Set<T> set, Func<T,bool> include, Func<T,IEnumerable<U>> store )
{
foreach( var t in set )
if( include( t ) )
store( t ).Do( x => Add( x ) );
set.OnAdd += obj => { if( include( obj ) ) store( obj ).Do( x => Add( x ) ); };
set.OnRemove += obj => { if( include( obj ) ) store( obj ).Do( x => Remove( x ) ); };
}
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -62,23 +62,23 @@ namespace OpenRA
Constrain(Y, min.Y, max.Y));
}
public static float2 operator *(float a, float2 b) { return new float2(a * b.X, a * b.Y); }
public static float2 operator *(float2 b, float a) { return new float2(a * b.X, a * b.Y); }
public static float2 operator *(float a, float2 b) { return new float2(a * b.X, a * b.Y); }
public static float2 operator *(float2 b, float a) { return new float2(a * b.X, a * b.Y); }
public static float2 operator *( float2 a, float2 b ) { return new float2( a.X * b.X, a.Y * b.Y ); }
public static float2 operator /( float2 a, float2 b ) { return new float2( a.X / b.X, a.Y / b.Y ); }
public static bool operator ==(float2 me, float2 other) { return (me.X == other.X && me.Y == other.Y); }
public static bool operator !=(float2 me, float2 other) { return !(me == other); }
public override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode(); }
public static bool operator ==(float2 me, float2 other) { return (me.X == other.X && me.Y == other.Y); }
public static bool operator !=(float2 me, float2 other) { return !(me == other); }
public override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode(); }
public override bool Equals(object obj)
{
if (obj == null)
return false;
public override bool Equals(object obj)
{
if (obj == null)
return false;
float2 o = (float2)obj;
return o == this;
}
float2 o = (float2)obj;
return o == this;
}
public static readonly float2 Zero = new float2(0, 0);

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -52,11 +52,11 @@ namespace OpenRA
public static readonly int2 Zero = new int2(0, 0);
public Point ToPoint() { return new Point(X, Y); }
public PointF ToPointF() { return new PointF(X, Y); }
public PointF ToPointF() { return new PointF(X, Y); }
public float2 ToFloat2() { return new float2(X, Y); }
public override string ToString() { return string.Format("{0},{1}", X, Y); }
// Change endianness of a uint32
public static uint Swap(uint orig)
{
@@ -72,13 +72,13 @@ namespace OpenRA
{
return a + ( b - a ) * mul / div;
}
public int2 Clamp(Rectangle r)
{
return new int2(Math.Min(r.Right, Math.Max(X, r.Left)),
Math.Min(r.Bottom, Math.Max(Y, r.Top)));
Math.Min(r.Bottom, Math.Max(Y, r.Top)));
}
public static int Dot(int2 a, int2 b) { return a.X * b.X + a.Y * b.Y; }
}

View File

@@ -1,36 +1,26 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("OpenRA.FileFormats")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OpenRA.FileFormats")]
[assembly: AssemblyCopyright("Copyright © 2007,2009,2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("OpenRA.FileFormats")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OpenRA.FileFormats")]
[assembly: AssemblyCopyright("Copyright © 2007,2009,2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -33,33 +33,38 @@ namespace OpenRA
get { return LogPathPrefix; }
set
{
LogPathPrefix = value;
if (!Directory.Exists(LogPathPrefix))
Directory.CreateDirectory(LogPathPrefix);
LogPathPrefix = value;
Directory.CreateDirectory(LogPathPrefix);
}
}
public static void AddChannel(string channelName, string filename)
static IEnumerable<string> FilenamesForChannel(string channelName, string baseFilename)
{
for(var i = 0;; i++ )
yield return Path.Combine(LogPathPrefix,
i > 0 ? "{0}.{1}".F(baseFilename, i) : baseFilename);
}
public static void AddChannel(string channelName, string baseFilename)
{
if (channels.ContainsKey(channelName)) return;
var i = 0;
var f = filename;
while (File.Exists(LogPathPrefix + filename))
try
foreach (var filename in FilenamesForChannel(channelName, baseFilename))
try
{
StreamWriter writer = File.CreateText(LogPathPrefix + filename);
var writer = File.CreateText(filename);
writer.AutoFlush = true;
channels.Add(channelName, new ChannelInfo() { Filename = filename, Writer = writer });
channels.Add(channelName,
new ChannelInfo()
{
Filename = filename,
Writer = writer
});
return;
}
catch (IOException) { filename = f + ".{0}".F(++i); }
//if no logs exist, just make it
StreamWriter w = File.CreateText(LogPathPrefix + filename);
w.AutoFlush = true;
channels.Add(channelName, new ChannelInfo() { Filename = filename, Writer = w });
catch (IOException) { }
}
public static void Write(string channel, string format, params object[] args)

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

Some files were not shown because too many files have changed in this diff Show More