Description:
Many small tweaks.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -155,7 +155,7 | |||
|
155 | 155 | var odds_to_try = new[] {0.5f, 0.75f, 1.0f, 0.5f, 0.75f, 1.0f}; |
|
156 | 156 | var retry_location = new[] {false, false, false, true, false, false}; |
|
157 | 157 | Debug.Assert(odds_to_try.Count() == retry_location.Count()); |
|
158 | // foreach( double odds in odds_to_try ) | |
|
158 | ||
|
159 | 159 | for(int i = 0; i < odds_to_try.Count(); i++) |
|
160 | 160 | { |
|
161 | 161 | |
@@ -204,7 +204,6 | |||
|
204 | 204 | _ => random_generator.Next(CONTRACT_MINIMUM, CONTRACT_MAXIMUM) |
|
205 | 205 | }; |
|
206 | 206 | |
|
207 | // AddComponent | |
|
208 | 207 | AddComponent(contract, new AreaComponent { squares = squares }); |
|
209 | 208 | AddComponent(contract, new NameAndDescriptionComponent { DisplayName = this.grammar.Flatten(message.name) }); |
|
210 | 209 | AddComponent(contract, new SelectedComponent { selected = false }); |
@@ -21,11 +21,9 | |||
|
21 | 21 | Family, |
|
22 | 22 | LargeCorporation, |
|
23 | 23 | Cooperative |
|
24 | ||
|
25 | 24 | } |
|
26 | 25 | |
|
27 | 26 | [Receives(typeof(SpawnOrganizationtMessage))] |
|
28 | //[Reads(typeof(AreaComponent), typeof(ContractStatusComponent))] | |
|
29 | 27 | class OrganizationSpawner : Spawner<SpawnOrganizationtMessage> |
|
30 | 28 | { |
|
31 | 29 | |
@@ -45,7 +43,6 | |||
|
45 | 43 | { |
|
46 | 44 | |
|
47 | 45 | var organization = CreateEntity(); |
|
48 | // var image_index = random_generator.Next(1, 7); | |
|
49 | 46 | var image_index = message.type switch { |
|
50 | 47 | OrganizationType.Cooperative => MathUtils.NextSample(random_generator, new[] {1, 2, 3, 11, 12, 13, 15}), |
|
51 | 48 | OrganizationType.LargeCorporation => MathUtils.NextSample(random_generator, new[] {0, 6, 7, 9, 10}), |
@@ -54,9 +51,7 | |||
|
54 | 51 | |
|
55 | 52 | }; |
|
56 | 53 | Logging.Success("Generated image index."); |
|
57 | ||
|
58 | 54 | |
|
59 | ||
|
60 | 55 | var name = message.name != null ? message.name : "#logging_company.capitalizeAll#"; |
|
61 | 56 | var description = message.description != null ? message.description : ""; |
|
62 | 57 | |
@@ -66,8 +61,6 | |||
|
66 | 61 | AddComponent(organization, new OffersContractsComponent { }); |
|
67 | 62 | AddComponent(organization, new OrganizationTypeComponent { type = message.type }); |
|
68 | 63 | |
|
69 | ||
|
70 | 64 | } |
|
71 | ||
|
72 | 65 | } |
|
73 | 66 | } |
@@ -113,7 +113,6 | |||
|
113 | 113 | |
|
114 | 114 | private FNAGame() |
|
115 | 115 | { |
|
116 | //this.device = new GraphicsDevice(GraphicsAdapter.DefaultAdapter, GraphicsProfile.) | |
|
117 | 116 | |
|
118 | 117 | #if DEBUG |
|
119 | 118 | foreach (System.Reflection.Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) |
@@ -204,10 +203,6 | |||
|
204 | 203 | |
|
205 | 204 | this.grammar = new TraceryNet.Grammar(json2); |
|
206 | 205 | |
|
207 | //let's see if this works: | |
|
208 | // WorldBuilder = new WorldBuilder(); | |
|
209 | var dummy_entity = WorldBuilder.CreateEntity(); | |
|
210 | ||
|
211 | 206 | |
|
212 | 207 | WorldBuilder.AddEngine(new InputEngine(Menu.MENU_BAR_HEIGHT, FNAGame.width, FNAGame.height)); |
|
213 | 208 | WorldBuilder.AddEngine(new UIEngine()); |
@@ -282,12 +277,10 | |||
|
282 | 277 | WorldBuilder.SendMessage(new SpawnContractMessage |
|
283 | 278 | { |
|
284 | 279 | squares = squares, |
|
285 | //new[] {new Vector2(4,4), new Vector2(5,4)}, | |
|
286 | 280 | name = "Northshore Logging" |
|
287 | 281 | }); |
|
288 | 282 | WorldBuilder.SendMessage(new SpawnContractMessage |
|
289 | 283 | { |
|
290 | // squares = squares2, //new[] { new Vector2(6, 6), new Vector2(6, 7), new Vector2(6, 8) }, | |
|
291 | 284 | name = "Aeres Maximalis Ltd." |
|
292 | 285 | }); |
|
293 | 286 | World = WorldBuilder.Build(); |
@@ -308,8 +301,6 | |||
|
308 | 301 | ); |
|
309 | 302 | |
|
310 | 303 | |
|
311 | ||
|
312 | ||
|
313 | 304 | this.output = grammar.Flatten("#greeting#"); |
|
314 | 305 | var result = grammar.Flatten("#[assistantName:#assistantNames#][whatever:whatever]vars#"); |
|
315 | 306 | |
@@ -565,43 +556,6 | |||
|
565 | 556 | null, |
|
566 | 557 | camera.get_transformation(GraphicsDevice)); |
|
567 | 558 | |
|
568 | //New tile stuff | |
|
569 | /* | |
|
570 | Vector2 firstSquare = Vector2.Zero; | |
|
571 | int firstX = (int)firstSquare.X; | |
|
572 | int firstY = (int)firstSquare.Y; | |
|
573 | ||
|
574 | Vector2 squareOffset = Vector2.Zero; | |
|
575 | ||
|
576 | int offsetX = (int)squareOffset.X; | |
|
577 | int offsetY = (int)squareOffset.Y; | |
|
578 | ||
|
579 | ||
|
580 | for (int y = 0; y < this.squaresDown; y++) | |
|
581 | { | |
|
582 | int rowOffset = 0; | |
|
583 | if ((firstY + y) % 2 == 1) | |
|
584 | rowOffset = Tile.OddRowXOffset; | |
|
585 | ||
|
586 | for (int x = 0; x < this.squaresAcross; x++) { | |
|
587 | ||
|
588 | ||
|
589 | batch.Draw( | |
|
590 | Tile.TileSetTexture, | |
|
591 | new Rectangle( | |
|
592 | ((x * Tile.TileStepX) - offsetX + rowOffset + baseOffsetX), | |
|
593 | ((y * Tile.TileStepY) - offsetY + baseOffsetY), | |
|
594 | Tile.TileWidth, Tile.TileHeight), | |
|
595 | Tile.GetSourceRectangle(1), | |
|
596 | Color.White, | |
|
597 | 0.0f, | |
|
598 | Vector2.Zero, | |
|
599 | SpriteEffects.None, | |
|
600 | 0.9f); | |
|
601 | ||
|
602 | ||
|
603 | } | |
|
604 | }*/ | |
|
605 | 559 | |
|
606 | 560 | #region draw_tiles |
|
607 | 561 | //reset |
@@ -757,26 +711,7 | |||
|
757 | 711 | |
|
758 | 712 | |
|
759 | 713 | #endregion draw_cursor |
|
760 | /* | |
|
761 | 714 | |
|
762 | for (int i = 0; i< 80; i++) | |
|
763 | { | |
|
764 | for (int j = 0; j < 50; j += 1) | |
|
765 | { | |
|
766 | //Warning: creates a flashing effect because tree positions update every 1/60th of a second | |
|
767 | ||
|
768 | if (this.random_generator.NextDouble() > 0.75) | |
|
769 | { | |
|
770 | drawTileAt(i, j, 142, 2); | |
|
771 | } | |
|
772 | ||
|
773 | if ((i + j) % 3 == 0) | |
|
774 | { | |
|
775 | drawTileAt(i, j, 142, 2); | |
|
776 | } | |
|
777 | ||
|
778 | } | |
|
779 | }//*/ | |
|
780 | 715 | |
|
781 | 716 | #region draw_trees |
|
782 | 717 | if (this.showTrees) { |
@@ -38,29 +38,16 | |||
|
38 | 38 | |
|
39 | 39 | static public void FillSquare(GraphicsDevice device, int x, int y, Color color, float alpha) |
|
40 | 40 | { |
|
41 | ||
|
42 | // Vector2 adjust2 = new Vector2(Tile.TileSpriteWidth / 2, Tile.TileSpriteHeight); //TODO figure out why this second value shouldn't be halved | |
|
43 | // | |
|
44 | 41 | var startX = ((x - y) * Tile.TileSpriteWidth / 2) + (Tile.TileSpriteWidth / 2); |
|
45 | 42 | var startY = (x + y) * Tile.TileSpriteHeight / 2 + (Tile.TileSpriteHeight); |
|
46 | 43 | startX = 0; |
|
47 | 44 | startY = 10; |
|
48 | // | |
|
49 | // Rectangle rect = new Rectangle(startX, startY, Tile.TileSpriteWidth / 2, (int)(Tile.TileSpriteHeight * 0.75)); | |
|
50 | // batch.Draw(Line.PixelTexture, rect, null, color, 0.785f, new Vector2(0,0), SpriteEffects.None, 0.79f); | |
|
51 | // | |
|
52 | 45 | |
|
53 | // vert[0].Position = new Vector3(startX, startY, 0); | |
|
54 | // vert[1].Position = new Vector3(startX+Tile.TileSpriteWidth, startY, 0); | |
|
55 | // vert[2].Position = new Vector3(startX, startY+Tile.TileSpriteHeight, 0); | |
|
56 | // vert[3].Position = new Vector3(startX+Tile.TileSpriteWidth, startY+Tile.TileSpriteHeight, 0); | |
|
57 | 46 | vert[0].Position = new Vector3(startX, startY, 0); |
|
58 | 47 | vert[1].Position = new Vector3(startX + 100, startY, 0); |
|
59 | 48 | vert[2].Position = new Vector3(startX, startY + 100, 0); |
|
60 | 49 | vert[3].Position = new Vector3(startX + 100, startY + 100, 0); |
|
61 | 50 | |
|
62 | ||
|
63 | ||
|
64 | 51 | vert[0].TextureCoordinate = new Vector2(0, 0); |
|
65 | 52 | vert[1].TextureCoordinate = new Vector2(1, 0); |
|
66 | 53 | vert[2].TextureCoordinate = new Vector2(0, 1); |
@@ -110,10 +97,6 | |||
|
110 | 97 | { |
|
111 | 98 | FillSquare2(batch, (int)square.X, (int)square.Y, color, alpha, depth); |
|
112 | 99 | } |
|
113 | ||
|
114 | 100 | } |
|
115 | ||
|
116 | 101 | } |
|
117 | ||
|
118 | ||
|
119 | } No newline at end of file | |
|
102 | } |
@@ -367,16 +367,7 | |||
|
367 | 367 | this.lastAdvance += advancesToSimulate * millisecondsPerAdvance; |
|
368 | 368 | } |
|
369 | 369 | |
|
370 | /* | |
|
371 | if ((this.Tick % this.millisecondsPerAdvance) == 0) | |
|
372 | { | |
|
373 | this.DateTime = this.DateTime.AddMonths(1); | |
|
374 | }*/ | |
|
375 | ||
|
376 | 370 | } |
|
377 | ||
|
378 | ||
|
379 | ||
|
380 | 371 | } |
|
381 | 372 | } |
|
382 | 373 | } |
@@ -25,22 +25,17 | |||
|
25 | 25 | |
|
26 | 26 | public static void LoadContent(ImGuiRenderer _imGuiRenderer, ImageMap map) |
|
27 | 27 | { |
|
28 | ||
|
29 | 28 | ContractWindow.map = map; |
|
30 | 29 | |
|
31 | 30 | var _xnaTexture = ImageMap.ImageMapTexture; |
|
32 | 31 | ContractWindow._imGuiTexture = _imGuiRenderer.BindTexture(_xnaTexture); |
|
33 | 32 | } |
|
34 | 33 | |
|
35 | ||
|
36 | 34 | public static void Render(ImFontPtr font, ImFontPtr italicFont, ImGuiWindowBridgeEngine engine, Entity entity, string name, string description, ContractStatus status, decimal amount, string delta_trees, int area_size, int imageIndex) |
|
37 | 35 | |
|
38 | 36 | { |
|
39 | 37 | bool newShow = true; |
|
40 | 38 | |
|
41 | // Entity newSelected; | |
|
42 | ; | |
|
43 | ||
|
44 | 39 | if (newShow) |
|
45 | 40 | { |
|
46 | 41 | ImGui.PushFont(font); |
@@ -49,7 +44,8 | |||
|
49 | 44 | StyleSet.pushStyleVarSet(StyleSet.defaultWindowVars); |
|
50 | 45 | StyleSet.pushColorSet(StyleSet.defaultWindowColors); |
|
51 | 46 | ImGui.SetNextWindowSize(new Num.Vector2(320, 360)); |
|
52 |
ImGui.Begin(string.Format("Contract {0} ## {1}", name, entity.ID), ref newShow, |
|
|
47 | ImGui.Begin(string.Format("Contract {0} ## {1}", name, entity.ID), ref newShow, | |
|
48 | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings); | |
|
53 | 49 | |
|
54 | 50 | ImGui.Image(_imGuiTexture, new Num.Vector2(250, 200), map.GetSourceUVStart(imageIndex), map.GetSourceUVEnd(imageIndex), Num.Vector4.One, Num.Vector4.Zero); // Here, the previously loaded texture is used |
|
55 | 51 | |
@@ -84,7 +80,7 | |||
|
84 | 80 | break; |
|
85 | 81 | } |
|
86 | 82 | ImGui.Text(string.Format("Amount: ${0}/mo.", amount)); |
|
87 |
ImGui.Text(string.Format("Size |
|
|
83 | ImGui.Text(string.Format("Size: {0} acres", area_size)); | |
|
88 | 84 | |
|
89 | 85 | if (delta_trees != null) |
|
90 | 86 | { |
@@ -174,7 +170,6 | |||
|
174 | 170 | |
|
175 | 171 | engine.contractStatusMessages.Add(new ChangeContractStatusMessage { Entity = entity, newStatus = ContractStatus.Broken }); |
|
176 | 172 | } |
|
177 | ||
|
178 | 173 | } |
|
179 | 174 | } |
|
180 | 175 | } |
@@ -38,8 +38,12 | |||
|
38 | 38 | ImGui.SetNextWindowSize(new Num.Vector2(320, 340)); |
|
39 | 39 | ImGui.Begin("Contracts", ref newShow, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings); |
|
40 | 40 | ImGui.ListBoxHeader("##Contracts:", new Num.Vector2(320, 150)); |
|
41 | foreach (var contract in contracts.Where((contract) => ((!(new[] {ContractStatus.Expired, ContractStatus.Broken, ContractStatus.Rejected}.Contains(contract.status)) | |
|
42 | || ContractsWindow.show_all )))) | |
|
41 | ||
|
42 | var filter_statuses = new[] {ContractStatus.Expired, ContractStatus.Broken, ContractStatus.Rejected}; | |
|
43 | ||
|
44 | foreach (var contract in contracts.Where((contract) => | |
|
45 | ((!(filter_statuses.Contains(contract.status)) | |
|
46 | || ContractsWindow.show_all )))) | |
|
43 | 47 | { |
|
44 | 48 | if (ImGui.Selectable(String.Format("{0}##{1}",contract.name, contract.entity.ID), |
|
45 | 49 | ContractsWindow.selected.entity == contract.entity)) |
You need to be logged in to leave comments.
Login now