HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: [resolved] spec node access?  (Read 909 times)

Thazager

  • General Accounts
  • *
  • Posts: 1129
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
[resolved] spec node access?
« on: Jun 17, 16, 10:45:53 PM »

Working with the specs and trying to manually glom a class on rather than use the list of gloms and GLOM button, to make it easier for those using the specs.

I know how it gets set up, but am not sure how to access the method.

Code: [Select]
    if ClassExists("EO_itemSpecEditorGUI")
      gui = CreateNodeFromPrototype("EO_itemSpecEditorGUI")
      gui.build = true
      gui.SetNodeCollectionInterfaceWindowNode(me)    // <--- this is where it gets set up
   .

Code: [Select]
method GetNodeCollectionInterfaceWindowNode() as NodeRef    // <--- this returns the node
  return me.NPEnode
.


EO_itemSpecEditorGUI is now the main window, so getting root parent sounds right. But it wont allow access to that function above to get the actual node I need.

Code: [Select]
// armor chosen set needed Gloms
method setupArmor()
  spec as NodeRef = me.rootParent()               // <--- problem, cant find spec for use
  gui as NodeRef of Class GUIControl

  guiList as List of String
  add back "EO_ItemGearSpec" to guiList       // a few of things to Glom on
  add back "EO_ItemVendorSpec" to guiList
  add back "EO_ItemCraftSpec" to guiList
  add back "EO_ItemFactionSpec" to guiList

  foreach value in guiList
    GlomClass(value, spec)
  .
  me.PopulateSpecEditorFields(spec)            // show new values in dropdownboxes
.
« Last Edit: Jun 21, 16, 07:41:12 PM by Thazager »
Logged

ToY-Krun

  • General Accounts
  • *
  • Posts: 677
  • Support Volunteer
    • View Profile
Re: spec node access?
« Reply #1 on: Jun 20, 16, 07:41:14 AM »


Spec is not a gui control, and thus cannot be referenced by a parent/rootparent "unless" you have a special field on that control that has stored the spec ID or noderef.




Quote
Working with the specs and trying to manually glom a class on rather than use the list of gloms and GLOM button, to make it easier for those using the specs.

Just a Note:
This isn't something I've tried, but you might want to do some extensive testing of this as I'm not sure your extra classes would be stored on the spec using the method above, and the spec may need to be reloaded again before you could access the new fields(which would be the same process as using the glomm button).  I assume there are reasons why that was setup that way by default.  You could for example name the glomm button to "add item type" and change the spec selector name column to display the item type rather than the class name to make it more understandable for those editing item specs. 

Thazager

  • General Accounts
  • *
  • Posts: 1129
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: spec node access?
« Reply #2 on: Jun 20, 16, 10:52:49 AM »

Had an idea, prolly use that. Going to just store the value when its made on to the mainpanel.value (new field) to store it in.
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1129
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: spec node access?
« Reply #3 on: Jun 21, 16, 07:40:53 PM »

Yep, as simple as adding a field to save the noderef on the gui that I needed it on, solved it.

This is for saving the data for each spec, as the current spec is still in memory, all data is there. Once all data is correct, it can then be saved as normal.
Logged

ToY-Krun

  • General Accounts
  • *
  • Posts: 677
  • Support Volunteer
    • View Profile
Re: [resolved] spec node access?
« Reply #4 on: Jun 23, 16, 02:33:40 PM »

Glad you got it going