We have detected that cookies are not enabled on your browser. Please enable cookies to ensure the proper experience.
Results 1 to 4 of 4
  1. #1

    question:how to print field for Turbine.UI.Lotro.LotroUIElemen t?

    Turbine.UI.Lotro.LotroUIElemen t.NewBackpack1 is never,i want to know new field.how to see it?

  2. #2
    Join Date
    Mar 2007
    Posts
    1,212
    Quote Originally Posted by fuchan View Post
    Turbine.UI.Lotro.LotroUIElemen t.NewBackpack1 is never,i want to know new field.how to see it?
    I don't quite understand your question. It appears that you are not a native English speaker and something was lost in translation. I will try to answer your question as best as I can:

    There is no such UI element ID, Turbine.UI.Lotro.LotroUIElemen t.NewBackpack1
    The UI element ID for the first backpack is still Turbine.UI.Lotro.LotroUIElemen t.Backpack1
    The built-in UI element visibility is controlled by Turbine.UI.Lotro.LotroUI.SetEn abled(elementID, true/false)
    So, to hide bag 1 you would still use:
    Turbine.UI.Lotro.LotroUI.SetEn abled( Turbine.UI.Lotro.LotroUIElemen t.Backpack1 , false )
    and to reenable it you use:
    Turbine.UI.Lotro.LotroUI.SetEn abled( Turbine.UI.Lotro.LotroUIElemen t.Backpack1 , true )
    Note, if an inventory element was disabled, you have to re-enable it and then press 'I' to actually redisplay it.

    Is your question about Lua or about skinning the new images for inventory bag 1? The new skinning resources have not been published yet.

  3. #3
    Quote Originally Posted by Garan View Post
    I don't quite understand your question. It appears that you are not a native English speaker and something was lost in translation. I will try to answer your question as best as I can:

    There is no such UI element ID, Turbine.UI.Lotro.LotroUIElemen t.NewBackpack1
    The UI element ID for the first backpack is still Turbine.UI.Lotro.LotroUIElemen t.Backpack1
    The built-in UI element visibility is controlled by Turbine.UI.Lotro.LotroUI.SetEn abled(elementID, true/false)
    So, to hide bag 1 you would still use:
    Turbine.UI.Lotro.LotroUI.SetEn abled( Turbine.UI.Lotro.LotroUIElemen t.Backpack1 , false )
    and to reenable it you use:
    Turbine.UI.Lotro.LotroUI.SetEn abled( Turbine.UI.Lotro.LotroUIElemen t.Backpack1 , true )
    Note, if an inventory element was disabled, you have to re-enable it and then press 'I' to actually redisplay it.

    Is your question about Lua or about skinning the new images for inventory bag 1? The new skinning resources have not been published yet.
    thank you ,first.I'm really not a native English speaker .I think i need wait to publish new API Documentation.

    this is my code ,but not display anything.so don't SetEnaled Backpack1 in U13.

    tbtest = Turbine.UI.Lotro.LotroUIElemen t;
    Turbine.Shell.WriteLine("test log : Test Turbine.UI.Lotro.LotroUIElemen t Enter.");

    for key, value in pairs(tbtest) do
    Turbine.Shell.WriteLine("key :" .. key .. ",value :" .. value);
    end

    for key, value in ipairs(tbtest) do
    Turbine.Shell.WriteLine("key :" .. key .. ",value :" .. value);
    end

  4. #4
    Join Date
    Mar 2007
    Posts
    1,212
    Your code gets an error during the first enumeration using "pairs()" because there is an element of LotroUIElement, "IsA" which is a function, not a numeric value. If you test the value prior to printing it using the "type" function you can skip the non numeric value(s) in Turbine's enumerations.

    Code:
     tbtest = Turbine.UI.Lotro.LotroUIElement;
     Turbine.Shell.WriteLine("test log : Test Turbine.UI.Lotro.LotroUIElement Enter."); 
    
     for key, value in pairs(tbtest) do 
     Turbine.Shell.WriteLine("key :" .. key .. ",value :" .. tostring(value)); 
     end 
    
     for key, value in ipairs(tbtest) do 
     Turbine.Shell.WriteLine("key :" .. key .. ",value :" .. tostring(value)); 
     end
    You will have to strip out the spaces that the forum adds to the code to break up "excessively long strings" but you can see where to wrap "value" to force it into a string value. Forcing values to strings also helps eliminate "nil" values from causing errors when using WriteLine for debugging.

    code with test for "type"
    Code:
     tbtest = Turbine.UI.Lotro.LotroUIElement;
     Turbine.Shell.WriteLine("test log : Test Turbine.UI.Lotro.LotroUIElement Enter."); 
    
     for key, value in pairs(tbtest) do
      if type(value)=="number" then
       Turbine.Shell.WriteLine("key :" .. key .. ",value :" .. value);
      end 
     end 
    
     for key, value in ipairs(tbtest) do 
     Turbine.Shell.WriteLine("key :" .. key .. ",value :" .. tostring(value)); 
     end
    in the second sample, since the value is verified to be a number there is no need to force it to a string

    Note, the Lua ipairs function will only enumerate continuous numeric keys starting at 1. The LotroUIElement enumeration uses text values as keys so the ipairs function returns no pairs.
    Last edited by Garan; Apr 16 2014 at 10:56 AM.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

This form's session has expired. You need to reload the page.

Reload