Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
modalcontroller.qh
Go to the documentation of this file.
1#pragma once
2
3// modal dialog controller
4// handles a stack of dialog elements
5// each element can have one of the following states:
6// 0: hidden (fading out)
7// 1: visible (zooming in)
8// 2: greyed out (inactive)
9// While an animation is running, no item has focus. When an animation is done,
10// the topmost item gets focus.
11// The items are assumed to be added in overlapping order, that is, the lowest
12// window must get added first.
13//
14// Possible uses:
15// - to control a modal dialog:
16// - show modal dialog: me.showChild(me, childItem, buttonAbsOrigin, buttonAbsSize, 0) // childItem also gets focus
17// - dismiss modal dialog: me.hideChild(me, childItem, 0) // childItem fades out and relinquishes focus
18// - show first screen in m_show: me.hideAll(me, 1); me.showChild(me, me.firstChild, '0 0 0', '0 0 0', 1);
19// - to show a temporary dialog instead of the menu (teamselect): me.hideAll(me, 1); me.showChild(me, teamSelectDialog, '0 0 0', '0 0 0', 1);
20// - as a tabbed dialog control:
21// - to initialize: me.hideAll(me, 1); me.showChild(me, me.firstChild, '0 0 0', '0 0 0', 1);
22// - to show a tab: me.hideChild(me, currentTab, 0); me.showChild(me, newTab, buttonAbsOrigin, buttonAbsSize, 0);
23
24#include "container.qh"
42
47void TabButton_Click(entity button, entity tab); // assumes a button has set the above fields to its own absolute origin, its size, and the tab to activate
48void DialogOpenButton_Click(entity button, entity tab); // assumes a button has set the above fields to its own absolute origin, its size, and the tab to activate
49void DialogOpenButton_Click_withCoords(entity button, entity tab, vector theOrigin, vector theSize);
50void DialogCloseButton_Click(entity button, entity tab); // assumes a button has set the above fields to the tab to close
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
ATTRIB(ModalController, previousButton, entity)
virtual void hideChild()
virtual void resizeNotify()
virtual void showChild()
virtual void addItem()
virtual void hideAll()
virtual void initializeDialog()
virtual void addTab()
virtual void switchState()
virtual void draw()
vector size
vector origin
void DialogCloseButton_Click(entity button, entity tab)
void TabButton_Click(entity button, entity tab)
void DialogOpenButton_Click(entity button, entity tab)
void DialogOpenButton_Click_withCoords(entity button, entity tab, vector theOrigin, vector theSize)
float ModalController_state
entity tabSelectingButton
#define CLASS(...)
Definition oo.qh:145
#define ENDCLASS(cname)
Definition oo.qh:281
#define METHOD(cname, name, prototype)
Definition oo.qh:269
vector
Definition self.qh:92