Go Back   EQEmulator Home > EQEmulator Forums > Archives > OpenEQ > OpenEQ::General Discussion

OpenEQ::General Discussion General discussion related to the OpenEQ Project

Reply
 
Thread Tools Display Modes
  #1  
Old 12-28-2004, 04:23 AM
daeken_bb
Discordant
 
Join Date: Mar 2003
Location: Chambersburg, PA
Posts: 469
Default

I love you, will you have my children?

Nice work man

Btw... the UI now supports: Windows, text boxes, and buttons fully. I cleaned up the API a good bit, and it's now getting to be really usable. I have a simple python debug console working perfectly

Here's the actual class that handles input from the user and writes output from the interpreter to the UI. It's derived from InteractiveInterpreter.
Code:
class DevConsole(code.InteractiveInterpreter):
    def write(self, data):
        ui.widgets['chat'].AddText(data.strip() + '\n')
    def Enter(self, textbox):
            if textbox.text == '/quit':
                return -1
            elif textbox.text[:7] == '/python':
                print self.runsource(textbox.text[8:], '<<console>>')
                textbox.SetText('/python ')
            else:
                ui.widgets['chat'].AddText(textbox.text + '\n')
                textbox.SetText('')
            return True
And this is the actual initialization code for the UI Test. Following this is all the implementation-specific rendering stuff. OpenEQ will render to OpenGL of course, but the current UI Test just renders to a pygame (SDL) window:

Code:
class UITest:
    size = (800, 600)
    def __init__(self):
        self.ui = ui.UI(self.size)
        win1 = self.ui.Window('win1', pos=(100, 100), size=(600, 600), bgcolor=(255, 255, 255, 255), outline=(255, 0, 0, 255))
        tb1 = win1.Textbox(name='tb1', pos=(10, 310), size=(580, 40), bgcolor=(0, 0, 0, 255), outline=(255, 0, 0, 255), fgcolor=(255, 255, 255, 255), center=(False, True))
        win1.Textbox(name='chat', pos=(10, 10), size=(580, 300), bgcolor=(0, 0, 0, 255), outline=(255, 0, 0, 255), fgcolor=(255, 255, 255, 255), center=(False, False), freeze=True)

        dc = DevConsole()
        tb1.Register('enter', dc.Enter)
If anyone has any ideas on the API, please let me know. Thanks!

(Btw... those keyword args to the Window and Textbox functions populate the `props' property of the widgets. Soon you'll be able to do win1['bgcolor'] = (255, 255, 255, 255) or whatever also... gotta implement that still )
__________________
Keep me unemployed and working on OpenEQ, PM me about donating

Check out my deviantART page at http://daeken.deviantart.com/
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:01 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3