Amineri Posted July 7, 2013 Share Posted July 7, 2013 As a further alternative for squeezing in more items, it's possible to make all of the item types use the same smaller display box that the small item does. Currently armor is noticably bigger while the large item / pistol is very slightly larger. I'd tested out making all items use the small item inventory box a while back. They all display the "remove item" button, but only the small items can actually be removed without further hex changes. I did make those hex changes, just to see what would happen. Pistol removal was okay... removing weapon left a soldier with the "holding weapon pose" but with no actual weapon. Removing armor causes the pawn to disappear, and all large and small items are removed, and the number of large and small item slots are set to 0 (this is how the game swaps armor, handling possibly reduced number of slots). Definitely a good easier fix that's achievable without my trying to muck about back in the actionscript trying to add a scrollbar to the inventory itemlist. Link to comment Share on other sites More sharing options...
Bertilsson Posted July 7, 2013 Share Posted July 7, 2013 (edited) I just tested some different paddings. If you set padding for the small items to E5 (-27) then you can have up to 5 items without having so much overlap that it becomes difficult to press remove icon :smile: However changing padding to F0 instead of FB allows 4 items with a relatively small overlapp (~15% of the remove/info-card buttons lost) It is not very pretty, but it is not horribly bad either (talking about 4 items, 5 items did look really bad).I would say it is an very acceptable price if it is part of possibility to have "unlimited" squad sizes with freely selectable members. Edited July 7, 2013 by Bertilsson Link to comment Share on other sites More sharing options...
TheOldOne822 Posted July 7, 2013 Share Posted July 7, 2013 A little off topic but I'd want the small item box and removal change for all anyway for removing all unlimited items and start with 12 of the base items. I've had training in flash but not to the point I could hex edit compiled AS to add scroll bars but if I had (and could recompile without breaking the UPK) the source files or a good decompiler I could try to add scroll-bars to the items. However if we reached the point of freely changing the base files I'd try to fix the squad select screen. Link to comment Share on other sites More sharing options...
Amineri Posted July 7, 2013 Share Posted July 7, 2013 Actually the scrollbar should be that hard to add. Both the Inventory and the Locker inherit from the XComList class, which has a bunch of built-in functionality to implement the XComScrollBar, which is how all of the scrollbars in the Strategy Game UI are built. It's just that the Inventory list didn't initialize the scrollbar, while the locker list did. As far as editing the AS files ... if you've had training in Flash that's more than I have. :) Currently the way I've been able to edit actionscript is via the extracted SWF files (which I think are now available through the wiki). I used the JPEXS free flash decompiler, which allows you to make some edits at the operator level (not in the high level actionscript, but at the level of push/pop). I then can recompile and preserve references and jump offsets automatically. With the new SWF hex code (which has to remain the same size), this generates the find/replace hex in the decompressed Command1.upk. A little bit of a workaround, but not impossibly difficult. Trick usually is coming up with new AS that exactly matches the original size (in hex). Without that the upk replacement will fail :( ------------------- The definition of which item box type to use is done in UISoldierLoadout.UpdateInventoryList via : case 0: Type = 1; break; case 1: case 2: Type = 2; break; case 3: Type = 3; break; Simply changing all cases to set Type = 3 will make Armor / Weapon / Pistol use the smaller box. Although the remove item icon will be displayed, it will not be functional except for small items. If the display of the "remove item" icon is worrisome, could instead just switch the armor (case 0) to set Type = 2, which will make the armor display in the much smaller weapon/pistol-size box. That should then require less overlap of boxes in order to fit 4 or even 5 small items into the space. This hex effectively implements this (but since the 1 for case 0 is a single byte I instead nulled out the break; statements): UISoldierLoadout.UpdateInventoryList original hex: 0A FF 00 25 0F 00 38 15 00 00 26 06 2E 01 0A 03 01 26 0A 17 01 2C 02 0F 00 38 15 00 00 2C 02 06 2E 01 0A 2B 01 2C 03 0F 00 38 15 00 00 2C 03 06 2E 01 new hex: 0A FF 00 25 0F 00 38 15 00 00 26 0B 0B 0B 0A 03 01 26 0A 17 01 2C 02 0F 00 38 15 00 00 2C 02 0B 0B 0B 0A 2B 01 2C 03 0F 00 38 15 00 00 2C 03 06 2E 01 Link to comment Share on other sites More sharing options...
johnnylump Posted July 7, 2013 Share Posted July 7, 2013 @ TheOldOne822 I do want to make sure you've seen the Actionscript we've extracted from the upk files is posted on the Long War miscellaneous page:http://xcom.nexusmods.com/mods/88/?tab=2&navtag=%2Fajax%2Fmodfiles%2F%3Fid%3D88&pUp=1 Link to comment Share on other sites More sharing options...
Bertilsson Posted July 7, 2013 Share Posted July 7, 2013 Simply changing all cases to set Type = 3 will make Armor / Weapon / Pistol use the smaller box. Although the remove item icon will be displayed, it will not be functional except for small items. If the display of the "remove item" icon is worrisome, could instead just switch the armor (case 0) to set Type = 2, which will make the armor display in the much smaller weapon/pistol-size box. That should then require less overlap of boxes in order to fit 4 or even 5 small items into the space.I just tested it and you are right as usual. I looks much better and I wouldn't even had given the remove-item hand a second thought if you hadn't told me about it. Link to comment Share on other sites More sharing options...
TheOldOne822 Posted July 7, 2013 Share Posted July 7, 2013 Trick usually is coming up with new AS that exactly matches the original size (in hex). Without that the upk replacement will fail :( That is the problem I have. I can change the AS but would likely make the compiled Hex bigger and that would break the UPK. @ TheOldOne822 I do want to make sure you've seen the Actionscript we've extracted from the upk files is posted on the Long War miscellaneous page:http://xcom.nexusmods.com/mods/88/?tab=2&navtag=%2Fajax%2Fmodfiles%2F%3Fid%3D88&pUp=1Thank you I didn't see that before Just a thought but if we could completely pull apart/decompile the upks then put them back together with edited scripts (I don't know enough about UPKs to know if that is even possible) is there anything other than the internal code (that should be fixed by the recompile) to stop file size change. Link to comment Share on other sites More sharing options...
Amineri Posted July 8, 2013 Share Posted July 8, 2013 There was a re-compiler that people were using up until around November, when a cease-and-desist order was issued to halt distribution of the re-compiler. I guess it stepped on someone's toes? I haven't seen a upk re-compiler that allows putting the pieces of upk code back together again since. Link to comment Share on other sites More sharing options...
blacklimoband Posted July 8, 2013 Share Posted July 8, 2013 Actually the scrollbar should be that hard to add. Both the Inventory and the Locker inherit from the XComList class, which has a bunch of built-in functionality to implement the XComScrollBar, which is how all of the scrollbars in the Strategy Game UI are built. It's just that the Inventory list didn't initialize the scrollbar, while the locker list did. As far as editing the AS files ... if you've had training in Flash that's more than I have. :smile: Currently the way I've been able to edit actionscript is via the extracted SWF files (which I think are now available through the wiki). I used the JPEXS free flash decompiler, which allows you to make some edits at the operator level (not in the high level actionscript, but at the level of push/pop). I then can recompile and preserve references and jump offsets automatically. With the new SWF hex code (which has to remain the same size), this generates the find/replace hex in the decompressed Command1.upk. A little bit of a workaround, but not impossibly difficult. Trick usually is coming up with new AS that exactly matches the original size (in hex). Without that the upk replacement will fail :( ------------------- The definition of which item box type to use is done in UISoldierLoadout.UpdateInventoryList via : case 0: Type = 1; break; case 1: case 2: Type = 2; break; case 3: Type = 3; break; Simply changing all cases to set Type = 3 will make Armor / Weapon / Pistol use the smaller box. Although the remove item icon will be displayed, it will not be functional except for small items. If the display of the "remove item" icon is worrisome, could instead just switch the armor (case 0) to set Type = 2, which will make the armor display in the much smaller weapon/pistol-size box. That should then require less overlap of boxes in order to fit 4 or even 5 small items into the space. This hex effectively implements this (but since the 1 for case 0 is a single byte I instead nulled out the break; statements): UISoldierLoadout.UpdateInventoryList original hex: 0A FF 00 25 0F 00 38 15 00 00 26 06 2E 01 0A 03 01 26 0A 17 01 2C 02 0F 00 38 15 00 00 2C 02 06 2E 01 0A 2B 01 2C 03 0F 00 38 15 00 00 2C 03 06 2E 01 new hex: 0A FF 00 25 0F 00 38 15 00 00 26 0B 0B 0B 0A 03 01 26 0A 17 01 2C 02 0F 00 38 15 00 00 2C 02 0B 0B 0B 0A 2B 01 2C 03 0F 00 38 15 00 00 2C 03 06 2E 01 Completely off-topic, would it be possible (or even feasible) to add a scroll bar to the PSI Lab list? I've increased the number of slots to 6 in DGC, and it works with the XBOX controller (with the usual bug), but using mouse I can only access the first 4 slots Link to comment Share on other sites More sharing options...
johnnylump Posted July 8, 2013 Share Posted July 8, 2013 FWIW, here is the spawn point for the rooftop abduction map. All six soldiers have an empty space to their right. If this map has the tightest spawn point, then we should be able to spawn soldiers 7 through 12 in the adjacent spot without any overlap. http://xcom.nexusmods.com/images/5736949-1373255644.jpg Link to comment Share on other sites More sharing options...
Recommended Posts