Jump to content

[REL] openFrame 1.0.1 Final


Orange

Recommended Posts

rgh1276280479y.png

OpenFrame is a fully OOP MTA framework. It allows you to make your scripts cleaner and easier. Inspired by GUIClasses, the original form of classes is easy to learn and use.

Classes in openFrame

Go check it yourself, extend it :F

Download

Downloads are available on Google Code - http://code.google.com/p/mta-openframe/downloads/list.

Documentation is temporary unavailable, we're moving to other server

Roadmap

There's currently no roadmap, we're moving to other server

Edited by Guest
Link to comment
Maybe a bit more info about how to use? :)

Also, I noticed you use a lot addEventHandler, for example, in the function Button:Create, you create 3 event handlers for each button, is it really necessary?

Yes. It's supposed to use as many addEventHandlers as many events for GUI there are. Why? Because it makes it easier for scripters to add functions to the GUI events. For instance, if you want to add a function to "OnClick" event, you simply do,

button:AddOnClick( functionName ) this will simply attach functionName to OnClick event.

Isn't it simpler than

addEventHandler( "onClientGUIClick", buttonGUI, functionName, false )

That's the whole purpose of libraries.

EDIT:

Piotr1, I made an XML Lib too. It makes reading/writing XML files easier too. If you need it just PM me and I'll send you the lib. If I remember correctly, it hasn't been finished yet but for simple read/write functionality it works fine.

Link to comment

I'm finishing the documentation now. Version 1.0 Alpha 1.1.2 will be fully commented with few bugfixes.

@50p: If you can, send me it via PM, as I said, every contributions are appreciated

EDIT: 1.0 Alpha 1.1.2 is now available

Link to comment
  • 2 weeks later...
  • 11 months later...

I lost the wiki :F Anyway, here's simple code:

  
SQL = MySQL:Connect("host", "user", "pass", "db", true) -- the true means that if the connection to the database is lost, the script tries to reconnect 
local Query = self.sql:Query("SELECT * FROM users") -- executes a simple query 
outputChatBox(Query:numRows()) -- prints the number of registered users on the chatbox 
  

Check the part "MySQL.return" on http://docs.openframe.co.cc/files/serve ... s-lua.html in order to see which other functions can you use with the Query variable. btw, the docs aren't updated, there's also a function called :itTable, which you can use with ipairs ^^

If you want to use the query generator, check README.txt in ActiveRecord class ( viewtopic.php?f=108&t=33727 )

Link to comment

You've failed. You could see the meta.xml file inside the resource:

  
    <script src="openframe/shared/utils.lua" type="client" /> 
    <script src="openframe/shared/utils.lua" type="server" /> 
    <script src="openframe/client/gui/GUICollection.lua" type="client" /> 
    <script src="openframe/client/gui/button_class.lua" type="client" /> 
    <script src="openframe/client/gui/checkbox_class.lua" type="client" /> 
    <script src="openframe/client/gui/gridlist_class.lua" type="client" /> 
    <script src="openframe/client/gui/label_class.lua" type="client" /> 
    <script src="openframe/client/gui/memo_class.lua" type="client" /> 
    <script src="openframe/client/gui/progressbar_class.lua" type="client" /> 
    <script src="openframe/client/gui/radiobutton_class.lua" type="client" /> 
    <script src="openframe/client/gui/scrollbar_class.lua" type="client" /> 
    <script src="openframe/client/gui/staticimage_class.lua" type="client" /> 
    <script src="openframe/client/gui/textbox_class.lua" type="client" /> 
    <script src="openframe/client/gui/tabpanel_class.lua" type="client" /> 
    <script src="openframe/client/gui/tab_class.lua" type="client" /> 
    <script src="openframe/client/gui/window_class.lua" type="client" /> 
    <script src="openframe/client/gui/sharedfuncs_class.lua" type="client" /> 
    <script src="openframe/client/gui/wndtab_class.lua" type="client" /> 
    <script src="openframe/shared/class_class.lua" type="server" /> 
    <script src="openframe/shared/debug_class.lua" type="server" /> 
    <script src="openframe/shared/store_class.lua" type="server" /> 
    <script src="openframe/shared/event_class.lua" type="server" /> 
    <script src="openframe/shared/class_class.lua" type="client" /> 
    <script src="openframe/shared/debug_class.lua" type="client" /> 
    <script src="openframe/shared/store_class.lua" type="client" /> 
    <script src="openframe/shared/event_class.lua" type="client" /> 
    <script src="openframe/shared/timer_class.lua" type="client" /> 
    <script src="openframe/shared/timer_class.lua" type="server" /> 
    <script src="openframe/shared/command_class.lua" type="client" /> 
    <script src="openframe/shared/command_class.lua" type="server" /> 
    <script src="openframe/shared/xml/xml.lua" type="client" /> 
    <script src="openframe/shared/xml/xml_node.lua" type="server" /> 
    <script src="openframe/server/mysql_class.lua" type="server" /> 
    <script src="openframe/server/textlib_s.lua" type="server" /> 
    <!-- <script src="openframe/server/ar_class.lua" type="server" /> --> 
    <script src="openframe/client/client_anim.lua" type="client" /> 
    <script src="openframe/client/dx/textlib.lua" type="client" /> 
    <script src="openframe/client/dx/textlib_anim.lua" type="client" /> 
  

^add it after tag, before other

  
    <script src="openframe/shared/utils.lua" type="server" /> 
    <script src="openframe/shared/class_class.lua" type="client" /> 
    <script src="openframe/shared/event_class.lua" type="server" /> 
    <script src="openframe/server/mysql_class.lua" type="server" /> 
  

^I'm not sure that's all

I had a script which mixed everything into 2 files, but I accidentaly lost it.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...