{"action":"created","issue":{"url":"https://api.github.com/repos/freeorion/freeorion/issues/640","repository_url":"https://api.github.com/repos/freeorion/freeorion","labels_url":"https://api.github.com/repos/freeorion/freeorion/issues/640/labels{/name}","comments_url":"https://api.github.com/repos/freeorion/freeorion/issues/640/comments","events_url":"https://api.github.com/repos/freeorion/freeorion/issues/640/events","html_url":"https://github.com/freeorion/freeorion/pull/640","id":152384293,"number":640,"title":"Add combat log details","user":{"login":"LGM-Doyle","id":17235966,"avatar_url":"https://avatars.githubusercontent.com/u/17235966?v=3","gravatar_id":"","url":"https://api.github.com/users/LGM-Doyle","html_url":"https://github.com/LGM-Doyle","followers_url":"https://api.github.com/users/LGM-Doyle/followers","following_url":"https://api.github.com/users/LGM-Doyle/following{/other_user}","gists_url":"https://api.github.com/users/LGM-Doyle/gists{/gist_id}","starred_url":"https://api.github.com/users/LGM-Doyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LGM-Doyle/subscriptions","organizations_url":"https://api.github.com/users/LGM-Doyle/orgs","repos_url":"https://api.github.com/users/LGM-Doyle/repos","events_url":"https://api.github.com/users/LGM-Doyle/events{/privacy}","received_events_url":"https://api.github.com/users/LGM-Doyle/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/freeorion/freeorion/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/freeorion/freeorion/milestones/15","html_url":"https://github.com/freeorion/freeorion/milestones/Release%20v0.4.6","labels_url":"https://api.github.com/repos/freeorion/freeorion/milestones/15/labels","id":1226316,"number":15,"title":"Release v0.4.6","description":"Bugs, features and pull requests that should be fixed/finalized for the 0.4.6 release.","creator":{"login":"adrianbroher","id":84891,"avatar_url":"https://avatars.githubusercontent.com/u/84891?v=3","gravatar_id":"","url":"https://api.github.com/users/adrianbroher","html_url":"https://github.com/adrianbroher","followers_url":"https://api.github.com/users/adrianbroher/followers","following_url":"https://api.github.com/users/adrianbroher/following{/other_user}","gists_url":"https://api.github.com/users/adrianbroher/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianbroher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianbroher/subscriptions","organizations_url":"https://api.github.com/users/adrianbroher/orgs","repos_url":"https://api.github.com/users/adrianbroher/repos","events_url":"https://api.github.com/users/adrianbroher/events{/privacy}","received_events_url":"https://api.github.com/users/adrianbroher/received_events","type":"User","site_admin":false},"open_issues":20,"closed_issues":302,"state":"open","created_at":"2015-07-26T16:21:09Z","updated_at":"2016-06-05T14:15:38Z","due_on":"2016-06-29T22:00:00Z","closed_at":null},"comments":4,"created_at":"2016-05-01T19:51:11Z","updated_at":"2016-06-05T14:55:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/freeorion/freeorion/pulls/640","html_url":"https://github.com/freeorion/freeorion/pull/640","diff_url":"https://github.com/freeorion/freeorion/pull/640.diff","patch_url":"https://github.com/freeorion/freeorion/pull/640.patch"},"body":"This PR adds expandable details to the combat log.  The point is to make the specific rules governing combat available immediately in the combat log, in particular the interaction of shields and stealth.  It creates a framework for other events and writing the combat log in a more narrative structure.\r\n\r\nPlease comment on this idea and/or the implementation.\r\n\r\nThe motivation is in questions from beginners (like myself) on the forum.  Two often repeated questions are: Why was my massive fleet with mass drivers unable to damage the enemy?; Why did my stealth fleet suddenly get wiped out in round 2? The answer is usually read the manual.  This tries to provide the answer right where the player is already looking.\r\n\r\nI've posted two partially expanded combat logs on the [http://freeorion.org/forum/viewtopic.php?f=6&t=10058](forum), showing shields preventing damage and a ship being destroyed in round 2 after it has been decloaked.  Note that damage is grouped by attacker.\r\n\r\nIn the shield case the details show attack strength, shield strength and final damage implying that 9 strength - 3 shield = 6 damage.\r\n\r\nIn the cloaking case, the details show which (friendly) planets and ships are cloaked at the start of combat and which ones decloaked and why.  It does not list enemy cloaked ships or planets.\r\n\r\n\r\n\r\nTo implement this, I have pushed the XML generation into the CombatEvent, which must generate a CombatLogDescription() and may generate CombatLogDetails() and SubEvents() if appropriate.  This better localizes the code for each type of event.  The combat log itself only checks each log and displays it as plain text or in an accordion window.\r\n\r\nCombatSystem was changed in order to include the new events. ObjectAttackableBy[Monsters/Empire] was refactored to create ObjectUntargettableBy[Monsters/Empire] to create the initial stealth event.\r\n\r\nSome code other than the CombatLog, CombatSystem and the events was changed.\r\n\r\nThe TextControl and Layout were changed so that TextControl can report a minusable size based on a proposed width and the Layout can then use that value.\r\n\r\nAccordionPanel was changed to be more general: report a client area, settable interior color, report state of collapse.\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/freeorion/freeorion/issues/comments/223817596","html_url":"https://github.com/freeorion/freeorion/pull/640#issuecomment-223817596","issue_url":"https://api.github.com/repos/freeorion/freeorion/issues/640","id":223817596,"user":{"login":"geoffthemedio","id":11386908,"avatar_url":"https://avatars.githubusercontent.com/u/11386908?v=3","gravatar_id":"","url":"https://api.github.com/users/geoffthemedio","html_url":"https://github.com/geoffthemedio","followers_url":"https://api.github.com/users/geoffthemedio/followers","following_url":"https://api.github.com/users/geoffthemedio/following{/other_user}","gists_url":"https://api.github.com/users/geoffthemedio/gists{/gist_id}","starred_url":"https://api.github.com/users/geoffthemedio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoffthemedio/subscriptions","organizations_url":"https://api.github.com/users/geoffthemedio/orgs","repos_url":"https://api.github.com/users/geoffthemedio/repos","events_url":"https://api.github.com/users/geoffthemedio/events{/privacy}","received_events_url":"https://api.github.com/users/geoffthemedio/received_events","type":"User","site_admin":false},"created_at":"2016-06-05T14:55:35Z","updated_at":"2016-06-05T14:55:35Z","body":"Initial layout of the log is broken:\r\n![combat log layout](https://cloud.githubusercontent.com/assets/11386908/15806174/f30f4ab2-2b3d-11e6-9a31-dc0dec3abf13.png)\r\n\r\nSub-entries should have the left-edge indented from the enclosing entry.\r\n![need indent](https://cloud.githubusercontent.com/assets/11386908/15806175/f3242d6a-2b3d-11e6-8c73-6fcd1cba8159.png)\r\n\r\nMaybe also put the click point to expand/collapse on the left, instead of the right.\r\n\r\nMaybe also organize the events by round, then by owner of the attacker, not order in which the events were generated. This helps make it not seem to players like there is any order of events within a combat round.\r\n"}}
{"actor":{"display_login":"geoffthemedio"}}