Author Topic: easyuo menu combo boxes  (Read 2545 times)

0 Members and 1 Guest are viewing this topic.

Offline HitechsTopic starter

  • Full Member
  • ***
  • Posts: 116
  • Activity:
    0%
  • Reputation Power: 2
  • Hitechs has no influence.
  • Respect: +28
  • Referrals: 1
    • View Profile
easyuo menu combo boxes
« on: March 12, 2017, 10:15:53 PM »
0
I just started working with menu combo boxes.

How do you code your menu combo box?

this code looks way too big for my liking.
what ever selected needs to set a var to #true, if none selected needs to set #false
(im watching the var #menures in the easyuo window when i make selections)

any suggestions on how i can make this less lines of code? or code it more leet

here some test code (its just a menu, you dont need client open to test)

Code: [Select]
;--------------------------------------------------------------------
   ;menu Combo ( {"Create"} {name} {x} {y} {width} ) | ( {"Add"} {name} {text} ) | ( {"SELECT"} {name} {index} )
    menu font BGColor black
    menu Font Color red
    menu Window Size 200 200
    menu font color red

   menu combo create familier 5 10 88
   menu combo add familier none
   menu combo add familier wisp
   menu combo add familier minion
   menu combo add familier death adder
   menu combo add familier vamp bat
   menu combo select familier 0
;------------------------------------------------------------------
   menu combo create form 5 50 88
   menu combo add form none
   menu combo add form Lich
   menu combo add form wraith
   menu combo add form human
   menu combo add form voyage
   menu combo add form reaper
   menu combo add form beast
   menu combo select form 0
   menu show
;------------------------------------------------------------

start:

  menu get form
  if #menures > 0
        gosub formComboBox
  menu get familier
  if #menures > 0
        gosub familierComboBox

goto start
;----------------------------------------

sub familierComboBox
if #menures = 1
    {
    menu combo select familier 0
    set !wisp #false
    set !minion #false
    set !deathAdder #false
    set !vampBat #false
    return
    }
if #menures = 2
   {
    set !wisp #true
    return
    }
if #menures = 3
   {
    set !minion #true
    return
    }
if #menures = 4
   {
    set !deathAdder #true
    return
    }
if #menures = 5
   {
    set !vampBar #true
    return
    }
return
;-----------------------------

sub formComboBox
if #menures = 1
    {
    menu combo select form 0
    set !lich #false
    set !wraith #false
    set !human #false
    set !voyage #false
    set !reaper #false
    set !beast #false
    return
    }
if #menures = 2
   {
    set !lich #true
    return
    }
if #menures = 3
   {
    set !wraith #true
    return
    }
if #menures = 4
   {
    set !human #true
    return
    }
if #menures = 5
    set !voyage #true
    return
    }
if #menures = 6
    {
    set !reaper #true
    return
    }
if #menures = 7
    {
    set !beast #true
    return
    }
return

« Last Edit: March 12, 2017, 10:27:04 PM by Hitechs »

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: easyuo menu combo boxes
« Reply #1 on: March 13, 2017, 04:08:11 AM »
0
To turn on and off my combo box, I use check box     You only use the sub combo box if you need them by using this  if #menures = #true .   This can remove a few reading code in the main loop, but you still need them in the sub to set the box.     Other them that it look go.


Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: easyuo menu combo boxes
« Reply #2 on: March 13, 2017, 08:20:55 AM »
0
With any EasyUO controls, you can't actually color code them individually.  So you need to "bracket" the control when you call it with the proper coloring commands:

Code: easyuo
  1.     menu font BGColor black
  2.     menu Font Color red
  3.     menu combo create first 5 10 88
  4.     menu combo add first entry_1
  5.     menu combo add first entry_2
  6.     menu font BGColor purple
  7.     menu Font Color white
  8.     menu combo create second 5 20 88
  9.     menu combo add second entry_1
  10.     menu combo add second entry_2
  11.  
Please read the ScriptUO site RULES
Come play RIFT with me!

Tags: