Soldak Home   Drox Operative   Din's Curse   Depths of Peril   Zombasite  

Go Back   Soldak Entertainment Forums > Din's Curse > Din's Curse modding
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 12-14-2010, 08:08 PM
jeremyosborne jeremyosborne is offline
Champion
 
Join Date: Oct 2010
Posts: 194
Default Ability to make Abstract Widget "classes" or user defined Widget Types?

For relative positioning, the parentWidget and parentLinked are god sends.

I'm modding the Conjurer party pet status bars that normally appear below the character status along the left hand side of the screen.

Since all of the partyMember*.mnu files contain reused data, I was trying to figure out how to build an abstract widget type that would lend repeated values to descendant widgets.

Example pseudo code of what I want to do:

Code:
// In some file named abstractPartyMenu.mnu
name PartyMemberType

// Below I define the Widget, StatBar, and StatusEffectIcons
// curently found in the partyMember*.mnu files
// and give all of the widgets internalName values
and in another file
Code:
name PartyMember1
inheritsFrom PartyMemberType
// I supply the positioning for this widget 
position 5.0 80.0

// For each of the properties that are not generic
// I set the non-generic values. For example,
// the Health bar widget
StartBar
{
    // operates like the parentWidget property
    inheritsFrom PartyMemberType::HealthBarForegroundType
    // size, color, texture aren't needed, but the
    // entityIndex would need to be modified
    entityIndex 0
    // and so would any specific activities
    highlightRedirect PartyMember1::Portrait
}
Is this, or something like it, possible?
Reply With Quote
  #2  
Old 12-15-2010, 09:35 AM
Shadow's Avatar
Shadow Shadow is offline
Super Moderator
 
Join Date: Jun 2007
Location: Dallas, TX
Posts: 9,412
Default

No there's not. I keep wishing I had some way to inherit or include but I've never implemented anything for it.
__________________
Steven Peeler
Designer/programmer
Depths of Peril, Kivi's Underworld, Din's Curse, Drox Operative, Zombasite, Din's Legacy, & Drox Operative 2
Patreon
Reply With Quote
  #3  
Old 12-15-2010, 02:46 PM
jeremyosborne jeremyosborne is offline
Champion
 
Join Date: Oct 2010
Posts: 194
Default

I did a bit more experimentation yesterday with the UI and was able to package up "widget families" a bit better. I made what I called a PartyMembers::Container which positioned all of my lackies in an absolute location on the screen. From there I contained each PartyMemberN widget family in a PartyMemberN::Container, and from there, even though I had to Copy+Paste each widget instance, it was much easier and almost classlike to just copy paste things.

The only changes I needed to make were to the entities that each referred to.

The fact that you allow me at least a ParentWidget type of relationship is good enough in my view... although if you ever get the inheritance thing working, I'll be the first to try it out.

Last edited by jeremyosborne : 12-15-2010 at 02:46 PM. Reason: spelling, spelling, spelling
Reply With Quote
  #4  
Old 12-15-2010, 02:56 PM
jeremyosborne jeremyosborne is offline
Champion
 
Join Date: Oct 2010
Posts: 194
Default

By the way, I did notice something that others making UI changes might wish to know, so I'll just jot it here for archiving purposes.

Version I'm working with: 1.010

When I built said PartyMembers + PartyMemberN position relationships for my UI, I noticed that if I create the following sort of parent relationship in a single file, like so:

Code:
// This is a snippet from my partyMember1_override.mnu file
// A PartyMembers UI object is created in an external file
name PartyMember1

Widget
{
    // SNIP: This internalName would allow me to reference
    // PartyMember1::Container throughout the file, and it does
    //at load time
    internalName Container
    
    // This relationship, I believe because the widgets live in
    // different files and the files are read at different times does
    // not cause a "cannot find" error when using reloadMenus
    parentWidget PartyMembers::Container
}

Widget
{
    //SNIP:
    // Referencing a named widget within the same file will
    // cause a "cannot find" error when using the reloadMenus
    // command.
    parentWidget PartyMember1::Container
}
To repeat the code comments:

Relationships work fine at load time.

I had a problem with the reloadMenus console command giving me errors when using parentWidget and the associated parentLinked (snipped out of the code above) for positioning.

If reloadMenus doesn't seem to work and is returning errors, before giving up on the UI modifications, try quitting/restarting din's curse.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 05:30 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright 2007 - 2019 Soldak Entertainment, Inc.