GUI Rework

Discussion in 'Archive' started by Ducky, Aug 22, 2012.

  1. Ducky

    Ducky 2D Artist

    Messages:
    158
    Likes Received:
    0
    Trophy Points:
    0
    Only the existing weapons. All hypothetical weapons in all slot-size variants would probably mean a lot of wasted effort...
    What are the slot sizes for BioGL/LightningMG , 2/3 ? Does Lightning do vehicle damage or just anti-personnel ?
     
  2. Trickster

    Trickster Retired Developer

    Messages:
    16,576
    Likes Received:
    46
    Trophy Points:
    0
    No idea yet, still working shit out. I'll let you know when they're done instead, and just use default icons for now.
     
  3. Ducky

    Ducky 2D Artist

    Messages:
    158
    Likes Received:
    0
    Trophy Points:
    0
    I've looked into the .res files for the class menu again, and even dug into the binaries to see what's going on with the class menu sizing, and I have an idea now why noone seems to be willing to touch this.

    I was able to fix the size of the class menu - partially, but there's not much more I can do here:
    Probably due to a rewrite of the class gui since the current steam version, CEmpClassGUI::|nit() enforces SetProportional(1) on the panel layout now, while other panels still use a fixed and often code-adjusted layout (I can see the full glory of this in CEmpVehicleCustomization::ShowPanel() with tons of SetPos/SetBounds calls).

    While proportional scaling seems like a good idea (adjusts panel size to screen size), it brings up some problems:
    • Sizing through the .res file works for the primary class menu panel (see class_menu.jpg), but not for the submenu (submenu.jpg):
      The reason seems to be in CEmpClassGUISubmenu::SwitchToLayout(), where the panel size and description position is done with hardcoded values, overriding the .res layout...
    • Scaling sometimes produce pixel gaps between touching ImagePanels - I don't know why this happens for base controls like ImagePanel, since it seems the final drawing coordinate transformation is done in Valve's core code...
    So, at least the submenu-switchtolayout-sizing needs dev coding, otherwise it's gonna stay as bulky as it is currently.

    On the bright side the hotkey functionality seems to work fine, so I've added hotkeys for extra fast class customization...

    Other things which probably need to be adjusted in the code are:
    • Squad List (HUD) background - I can't seem to be able to find an associated clientscheme entry for that, if there is one.
    • Tank ammo/cooldown display background/cooldown-bar colors - same
    • Squadpower icon position (under HUD squad list, x-offset)

    The .zip contains the .res files for the screenshots.
     

    Attached Files:

  4. Trickster

    Trickster Retired Developer

    Messages:
    16,576
    Likes Received:
    46
    Trophy Points:
    0
    I passed your post on to Jephir, hopefully he can get back to you with some more information. Beerdude is pretty knowledgeable in this area as well, but he's not around too much at the moment.
     
  5. Jephir

    Jephir ALL GLORY TO THE JEPHIR

    Messages:
    1,409
    Likes Received:
    6
    Trophy Points:
    0
    I don't think I'll be able to re-write the class GUI to be non-scaling.

    I can change those hard-coded colors to be loaded from the scheme instead, if that's what you're asking Ducky.
     
  6. ViroMan

    ViroMan Black Hole (*sniff*) Bully

    Messages:
    8,382
    Likes Received:
    4
    Trophy Points:
    0
    technical problems or just the amount of time required to do so?
     
  7. Ducky

    Ducky 2D Artist

    Messages:
    158
    Likes Received:
    0
    Trophy Points:
    0
    I think I can imagine why: Problems quickly spread out, so far I've found the follow functions participating directly or indirectly in the proportional sizing mess:
    CEmpClassGUI::|nit - SetProportional()
    CEmpClassGUISubmenu::|nit
    CEmpClassGUISubmenu::SwitchToLayout - resizes description panel with proportional values
    CEmpClassGUISubmenu::PerformLayout - proportional size adjustment with const values, calls baseclass function which ignores proportional sizing...
    CEmpClassGUISubmenu::CEmpClassGUISubmenu,
    CEmpBaseFrame::CEmpBaseFrame,
    CEmpBaseFrame::PerformLayout - non-prop size adjustment with a const value
    CEmpBaseFrame::onScreenSizeChanged - does SetProportional(1) - only called by ClassGUISubmenu ?

    I was able to hackishly remove the proportional scaling, but that's leading nowhere, and I'm getting a bit tired of searching through vftables...
    So, if the dev's NDA allows it, would it be possible to post the source just for the above functions ?
    Then maybe I or others (I saw Viroman raising his hand) can provide some ready-to-paste solutions.

    If not, I'll see that I can provide some replacement values for the constants used in the sizing, and hope that it works out somehow... or is it just a minority thinking that the class menu is too big ?


    Yes please that would help, the less stuff is hardocded, the better ;)
     
  8. Jephir

    Jephir ALL GLORY TO THE JEPHIR

    Messages:
    1,409
    Likes Received:
    6
    Trophy Points:
    0
    The clientscheme has been updated with new settings available:
    Code:
    HUD.vehicleAmmo					"255 255 255 50"
    HUD.vehicleAmmoCycle			"255 255 255 50"
    HUD.vehicleAmmoCycleOverheated	"255 0 0 128"
    HUD.vehicleAmmoCycleDepleted	"0 0 0 50"
    		
    HUD.vehicleHeatLow				"0 220 0 220"
    HUD.vehicleHeatMedium			"230 230 0 220"
    HUD.vehicleHeatHigh				"220 0 0 220"
    		
    HUD.vehiclePassengerSeated		"255 255 255 0"
    HUD.vehiclePassengerEmpty		"0 0 0 0"
    		
    HUD.squadListBg						"0 0 0 128"
    HUD.squadListStarIcon				"0 255 0 255"
    HUD.squadListStarIconHealthFlash	"255 0 0 255"
    HUD.squadListStarIconFireFlash		"255 255 0 255"
    		
    HUD.squadPower.offsetX "0"
    HUD.squadPower.offsetY "0"
    		
    HUD.reviveIconTeam					"214 54 0 255"
    HUD.reviveIconSelf					"0 255 0 255"
     
  9. Ducky

    Ducky 2D Artist

    Messages:
    158
    Likes Received:
    0
    Trophy Points:
    0
    Excellent, the power offset really helps, thanks.
     
  10. Ducky

    Ducky 2D Artist

    Messages:
    158
    Likes Received:
    0
    Trophy Points:
    0
    GUI r10

    emp_gui_r10.zip - contains all modified files for the empires folder...
    • adjustments to HUD as per Jephir's new clientscheme options
    • added Tesla MG Icon
    • adjusted vehicle weapons script to use new icons (they don't seem to be in SVN so far?)
    • hotkeys for Classmenu
    • some minor changes to icons
     
  11. Trickster

    Trickster Retired Developer

    Messages:
    16,576
    Likes Received:
    46
    Trophy Points:
    0
    Committed.
     
  12. @@@@Marcin@@@@

    @@@@Marcin@@@@ Developer

    Messages:
    516
    Likes Received:
    0
    Trophy Points:
    0
    [​IMG]

    made a new button , it teleports your camera to the active selected vehicle factory. just need to scale all the buttons and what not.
     
  13. LordDz_2

    LordDz_2 Strange things happens here

    Messages:
    2,956
    Likes Received:
    93
    Trophy Points:
    0
    Thank you.
     
  14. Z100000M

    Z100000M Vithered Weteran

    Messages:
    9,120
    Likes Received:
    70
    Trophy Points:
    0
    You could also add map grid coords next to the name for extra convience.
     
  15. Trickster

    Trickster Retired Developer

    Messages:
    16,576
    Likes Received:
    46
    Trophy Points:
    0
    He looked into that, it was a nightmare to convert the actual position within the world to coordinates, so teleporting was the fastest way to do it.

    Thanks go to Marcin for getting this done though, I appreciate him putting the time in for this month before release.
     
  16. ViroMan

    ViroMan Black Hole (*sniff*) Bully

    Messages:
    8,382
    Likes Received:
    4
    Trophy Points:
    0
    wait... so chat box displays your cords but can't do it for the window?
     
  17. complete_

    complete_ lamer

    Messages:
    6,438
    Likes Received:
    144
    Trophy Points:
    0
    ummm @0
     
  18. ViroMan

    ViroMan Black Hole (*sniff*) Bully

    Messages:
    8,382
    Likes Received:
    4
    Trophy Points:
    0
    that happens when your in weird locations. So it doesn't do it well... but it does work most of the time.
     
  19. @@@@Marcin@@@@

    @@@@Marcin@@@@ Developer

    Messages:
    516
    Likes Received:
    0
    Trophy Points:
    0
    don't act like such a wise guy, it's more a issue of copy pasting code and hacks, for the time being this was the fastest and most clean way to do it.
     
  20. Trickster

    Trickster Retired Developer

    Messages:
    16,576
    Likes Received:
    46
    Trophy Points:
    0
    Actually, that bug has absolutely nothing to do with your position when it's coming up in chat. I think we fixed it but I'm not sure.
     

Share This Page