Difference between revisions of "User:JRoush"

Jump to navigation Jump to search
5,878 bytes removed ,  13:40, 19 December 2009
no edit summary
imported>JRoush
imported>JRoush
Line 20: Line 20:


The GetCursorPos function is a bit dodgy.  Returned positions are not consistent, and seem to depend on integrated movement history.  This, combined with the lack of a function to get screen resolution, makes it impractical for use in menus (specifically, I couldn't use it to script in a custom slider bar).
The GetCursorPos function is a bit dodgy.  Returned positions are not consistent, and seem to depend on integrated movement history.  This, combined with the lack of a function to get screen resolution, makes it impractical for use in menus (specifically, I couldn't use it to script in a custom slider bar).
== Oblivion XML ==
== Editing Menu Files ==
All menus stored in ''Oblivion\Data\Menus''.  Menus are reloaded from disk every time they are reopened in the game (at least, dialog menus like alchemy, spellmaking, etc. are).  You can alt+tab out of the game, edit the menu file, and then switch back and close/reopen the menu to see your changes.  Oblivion generally doesn't like to be alt+tabbed, but I find that if I don't do anything memory intensive while it's minimized it doesn't crash (often).
=== Elements ===
*<menu> - root element of a menu file.  As far as I can tell Menu elements cannot be nested inside other elements, and only one is parsed per xml file.
*<rect> - defines an invisible rectangular region of the menu, used as invisible mouse targets or "containers" for other elements
*<image> - like a rect element, but with an associated visible texture
*<text> - text, in any color, using one of the games internal fonts
*<template> - special element used as a "container" for xml code that the game engine will copy/paste into another part of the menu at run time (e.g. the code for a single inventory item is placed in a template)
Each element in the list should have a name="" trait in the opening tag.
=== General Traits ===
*<id> (int or &generic;) - links an element to a particular aspect of the menu class in the game engine.  The game expects, for each menu class, that certain ids will be present, and treats them specially.  For example, clicking on element id#14 in the alchemy menu will create a new potion, regardless of the name or (I think) the type of the element.
*<user##> (variable) - parameters set/read by game engine, specific to the menu and element in question
*<x>,<y> (int) - coordinates (in pixels) of upper left corner (most elements), or center for center justified text elements
*<height>,<width> (int) - size (in pixels) of element
*<depth> (byte) - visibility ordering; element with highest depth is drawn on top
*<visible> (boolean) - element is rendered
*<locus> (boolean) - x,y coords are taken to be relative to the position of the first parent with locus set to true
*<alpha> (byte) - transparency of element (greater = more opaque)
=== Element Specific Traits ===
*<class> (entity) - menu element - specifies in game class to associate with menu
*<filename> (string) - image elements - location of texture file, relative to ''Oblivion\Data\Textures''
*<zoom> (int) - image elements - scaling factor for textures (percentage), use -1 to  force fit entire texture
*<cropx>,<cropy> (int) - pixels to crop from top and left of texture (applied after zoom settings)
*<red>,<green>,<blue> (byte) - text elements - color of text (greater = more intense)
*<nowiki><font></nowiki> (byte) - text elements - in game font used (1-5)
*<justify> (&left;, &right;, &center;) - text elements - text alignment
*<string> (string) - text elements - actual contents
*<wrapwidth> (int) - text elements - width (in pixels) at which text will break to a new line
=== Input Related Traits ===
*<target> (boolean) - element can be a target of mouse focus
*<clicksound> (byte) - game click sound to use for mouse-targetable elements
*<mousover> (boolean) - set by the game engine for targetable elements - only true when the element has mouse focus
=== Meta Traits ===
Elements in this list may be given literal values, or derive values from traits of another element given by a src="" trait="" in the opening tag.  Sources can be literal names, or include the functions "me()", "parent()", "child()", or "sibling()".  Processing within a given level (these traits may be nested) starts with the first trait and continues with each trait modifying the current value at that level.
<pre>
<x>
    <!-- Place this element to the left of 'some_element' -->
    <!-- with a gap of 4+2=6 pixels between them, or at -->
    <!-- the far left edge of the screen (x=0) -->
    <copy src="some_element" trait="x"/>
    <sub src="me()" trait="width"/>
    <sub>
        <copy> 2 </copy>
        <add> 4 </add>
    </sub>
    <max> 0 </max>
</x>
</pre>
*<add>,<nowiki><sub></nowiki>,<mult>,<nowiki><div></nowiki> - perform algebraic functions
*<onlyif>,<onlyifnot> - replaces with zero if the trait value not is true or false, respectively
*<lt>,<gt>,<eq> - replaces with zero if not less than, greater than, or equal to trait value, respectively
*<min>,<max> - replaces with trait value if greater than or less than, respectively
*<copy> - replaces with trait value.
*<include> - Includes an XML file.  must specify a src="", where the source is the file path relative to ''Oblivion\Data\Menus\Prefabs''
=== Mystery Traits ===
Not sure what these are for yet
*<clips>
*<stackingtype>
*<menufade>
=== Raw Element List (found in Oblivion.exe) ===
*strings
*sibling
*screen
*parent
*me
*child
*zoom
*y
*x
*xscroll
*xright
*xleft
*xdown
*xup
*xlist
*xdefault
*xbuttonstart
*xbuttonrb
*xbuttonlb
*xbuttonrt
*xbuttonlt
*xbuttony
*xbuttonx
*xbuttonb
*xbuttona
*wrapwidth
*wraplines
*wraplimit
*width
*user25
*user24
*user23
*user22
*user21
*user20
*user19
*user18
*user17
*user16
*user15
*user14
*user13
*user12
*user11
*user10
*user9
*user8
*user7
*user6
*user5
*user4
*user3
*user2
*user1
*user0
*tile
*target
*string
*stackingtype
*shiftclicked
*returnvalue
*repeathorizontal
*repeatvertical
*red
*pagenum
*pagecount
*mouseover
*menufade
*locus
*listindex
*listclip
*linecount
*justify
*ishtml
*id
*height
*green
*font
*focusinset
*filewidth
*filename
*fileheight
*explorefade
*depth3d
*clipwindow
*clips
*cropy
*cropx
*cropoffsety
*cropoffsetx
*disablefade
*clicksound
*clickedfunc
*clicked
*clickcountbefore
*clickcountafter
*childcount
*child_count
*blue
*animation
*alpha
*value
*trait
*src
*name
*user
*trunc
*sub
*rand
*or
*onlyifnot
*onlyif
*not
*neq
*mult
*mul
*mod
*min
*max
*lte
*lt
*ln
*log
*gte
*gt
*floor
*eq
*div
*copy
*ceil
*and
*add
*abs
Anonymous user

Navigation menu