Switching from cMUD

seamer
Posts: 5
Joined: Tue Jul 28, 2020 1:19 am

Re: Switching from cMUD

Post by seamer »

Jor'Mox wrote:
Wed Feb 08, 2023 3:09 pm
When it comes to getting the text into the containers that you have set up, can you post a screenshot of the trigger you have setup to try to capture that text? Please also show or otherwise include the code you have that is creating those containers (not the code for the containers themselves, just the stuff you have that makes each of them) so I can see what names you are giving them all, to reference when helping you get things up and running.
The variables I want to display are coming through msdp. msdp.HEALTH, msdp.HEALTH_MAX (and the usual suspects in vnum, mana..). I will display the fight counter too. The amount of tabs is simply a relic of the guide, I don't think I even know how to fill 5 of them, let alone 19 + map :D For sure I'd be displaying the map in top right, chat messages in lower right, and whatever variables in the left upper. Once I can see it working, I can tinker it out.
Code: [show] | [select all] lua
GUI.tabwindow =
    GUI.tabwindow or
    Adjustable.TabWindow:new(
      {
        name = "tabwindow",
        x = 0,
        y = 0,
        width = "100%",
        height = "49%",
        tabBarHeight ="10%",
        tabs = {"MyGauge","Tab1", "Tab2", "Tab3", "MapTab"},
      },
      GUI.right
    )
    
 GUI.tabwindow2 =
    GUI.tabwindow2 or
    Adjustable.TabWindow:new(
      {
        name = "tabwindow2",
        x = 0,
        y = '50%',
        width = "100%",
        height = "49%",
        tabBarHeight ="10%",
        tabs = {"MyTest","Tab4", "Tab5", "Tab6", "System"},
      },
      GUI.right
    )

    GUI.tabwindow3 =
     GUI.tabwindow3 or
     Adjustable.TabWindow:new(
      {
        name = "tabwindow3",
        x = 0,
        y = 0,
        width = "100%",
        height = "49%",
        tabBarHeight ="10%",
        tabs = {"MyTest2","Tab7", "Tab8", "Tab9", "Combat"},
      },
      GUI.left
    )
    
 GUI.tabwindow4 =
    GUI.tabwindow4 or
    Adjustable.TabWindow:new(
      {
        name = "tabwindow4",
        x = 0,
        y = '50%',
        width = "100%",
        height = "49%",
        tabBarHeight ="10%",
        tabs = {"MyTest3","Tab10", "Tab11", "Tab12", "Whatever"},
      },
      GUI.left
    )
    
   mapper =
    GUI.mapper or Geyser.Mapper:new({x = 0, y = 0, width = "100%", height = "100%", name="mapper"}, GUI.tabwindow.MapTabcenter)

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Switching from cMUD

Post by Jor'Mox »

Okay, so I see the problem now. You aren't actually creating anything to put text or whatever into in these tabs. They are all empty except for the mapper tab. When all these tabbed containers are created, they also create a container linked to the tab, where if the name of the tab is Tab1, the name of the container it links to is Tab1center. So if you want to put a miniconsole into that tab, you would need to add code like this:
Code: [show] | [select all] lua
myConsole1 = Geyser.MiniConsole:new({
  name="myConsole1",
  x=0, y=0,
  autoWrap = true,
  color = "black",
  scrollBar = false,
  fontSize = 8,
  width="100%", height="100%",
}, Tab1center)
Then to add text to that newly created window, you would do this:
Code: [show] | [select all] lua
-- to echo a message of your own
myConsole1:echo("This is my message")

-- to copy text from the main window
selectCurrentLine()
copy()
myConsole1:appendBuffer()
To add a gauge to one of the containers, you would do something like this:
Code: [show] | [select all] lua
hpbar = Geyser.Gauge:new({
  name="hpbar",
  x="50%", y="85%",
  width="45%", height="5%",
}, MyGaugecenter)
-- and here is an example of setting the gauge to have some value out of a max value
hpbar:setValue(math.random(1,100),100)

Post Reply