Author Topic: Oddity Customizing InvDatabaseInspector.cs  (Read 3754 times)

MetaMythril

  • Guest
Oddity Customizing InvDatabaseInspector.cs
« on: January 22, 2013, 02:55:27 AM »
I was doing some customization and I encountered and odd thing where I try to click on a EditorGUILayout.InField object, but the text field for the int value won't respond.

It seems in some way connected to the drawing of the sprite icon that is situated to the right of the controls, because if I take it out, it responds fine again.

I think I must have done something wonky with managing the layout space, but nothing seems out of place.

Could you explain a little about how you manage to draw the sprite aligned to the right of the inspector, while keeping the other controls properly constrained? I'm guessing this is some sort of odd invisible overlap going on that is keeping me from clicking the control, but I can't figure out a definitive answer.

Thanks for any help you can offer! :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Oddity Customizing InvDatabaseInspector.cs
« Reply #1 on: January 22, 2013, 10:15:49 AM »
Inventory example is a bonus system that comes with NGUI, and comes as-is. You're asking an OnGUI question here, which isn't covered by NGUI. :P

All I can suggest is look closer at the inspector script for the inventory database. I wrote that code over a year ago and haven't touched it since.

MetaMythril

  • Guest
Re: Oddity Customizing InvDatabaseInspector.cs
« Reply #2 on: January 22, 2013, 06:32:23 PM »
I understand that it's just a bonus and that it's related to OnGUI usage. I just thought there may be some simple bit of information that I was overlooking.

I was also able to successfully use the SpriteSelector logic for selecting the item sprite icon, instead of selecting from a list of available sprite names, makes picking items much nicer.

I think the thing that may have to most unknowing effect on things for me is looking at the use of the GUILayout.Space(float) as it's hard to tell what exactly it's doing.

Either way it's still a nice example to run with, so I'm using it. I'll just have to figure it out somehow. Thanks again! :)