Changes between Version 5 and Version 6 of UI


Ignore:
Timestamp:
09/02/14 04:06:50 (11 years ago)
Author:
epyon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UI

    v5 v6  
    3333}}}
    3434
    35 {{{
     35{{{#!lua
    3636-- some_script.lua
    3737
    38 ui_element = ui.create( "mywindow" );
    39 local result
    40 ui_element:find("yes").on_click = function(self) result = true;  self:destroy() end
    41 ui_element:find("no").on_click  = function(self) result = false; self:destroy() end
    42 ui:run_modal( ui_element )
     38function run_mywindow()
     39  ui_element = ui.create( "mywindow" );
     40  ui_element:find("yes").on_click = function(self) self:destroy(true) end
     41  ui_element:find("no").on_click  = function(self) self:destroy(false) end
     42  return ui.run_modal( ui_element )
     43end
     44}}}
    4345
     46{{{#!cpp
     47  // C++ invocation
     48  bool result = lua->call<bool>("run_mywindow");
    4449}}}
    4550
     
    5156Each UI element has:
    5257* id value, might not be set
    53 * type value, set by type database
    5458* class value, might be set by user
    5559* special modifier (selected, hover, etc)