aboutsummaryrefslogtreecommitdiff
path: root/src/ban.h
Commit message (Collapse)AuthorAge
* C++ modernize: Pragma once (#6264)Loïc Blot2017-08-17
| | | | * Migrate cpp headers to pragma once
* Cleanup various headers to reduce compilation times (#6255)Loïc Blot2017-08-16
| | | | * Cleanup various headers to reduce compilation times
* C++11 patchset 9: move hardcoded init parameters to class definitions (part ↵Loïc Blot2017-06-16
| | | | | | | | | | | | | | | | | | | | | | | | 1) (#5984) * C++11 patchset 9: move hardcoded init parameters to class definitions C++11 introduced the possibility to define the default values directly in class definitions, do it on current code Also remove some unused attributes * CollisionInfo::bouncy * collisionMoveResult::collides_xy * collisionMoveResult::standing_on_unloaded * Clouds::speed * More constructor cleanups + some variables removal * remove only write guiFormSpecMenu::m_old_tooltip * move header included inside defintions in genericobject.h * remove some unused since years exception classes * remove unused & empty debug_stacks_init * remove unused & empty content_nodemeta_serialize_legacy * remove forgotten useless bool (bouncy) in collision.cpp code
* Use C++11 mutexes only (remove compat code) (#5922)Loïc Blot2017-06-06
| | | | * Fix event LINT & remove default constructor/destructors * remove compat code & modernize autolock header
* Pass clang-format on various cpp/header files (#5559)Loïc Blot2017-04-23
|
* Clean up threadingShadowNinja2015-08-23
| | | | | | | | | | | | | | | | | | | | * Rename everything. * Strip J prefix. * Change UpperCamelCase functions to lowerCamelCase. * Remove global (!) semaphore count mutex on OSX. * Remove semaphore count getter (unused, unsafe, depended on internal API functions on Windows, and used a hack on OSX). * Add `Atomic<type>`. * Make `Thread` handle thread names. * Add support for C++11 multi-threading. * Combine pthread and win32 sources. * Remove `ThreadStarted` (unused, unneeded). * Move some includes from the headers to the sources. * Move all of `Event` into its header (allows inlining with no new includes). * Make `Event` use `Semaphore` (except on Windows). * Move some porting functions into `Thread`. * Integrate logging with `Thread`. * Add threading test.
* Replace instances of std::map<std::string, std::string> with StringMapkwolekr2015-05-19
| | | | | | Also, clean up surrounding code style Replace by-value parameter passing with const refs when possible Fix post-increment of iterators
* Always use builtin JThread librarykwolekr2013-09-15
|
* Update Copyright YearsSfan52013-02-24
|
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
|
* Optimize headersPerttu Ahola2012-06-17
|
* Switch the license to be LGPLv2/later, with small parts still remaining as ↵Perttu Ahola2012-06-05
| | | | GPLv2/later, by agreement of major contributors
* Fixed/extended/modified ban stuff to be good for inclusionPerttu Ahola2011-08-12
|
* added ipban supportConstantin Wenger2011-08-12
commands: /#ipban <nick> /#ipunban <ip>
(ID_soundText2)) e->remove(); if (gui::IGUIElement *e = getElementFromId(ID_soundExitButton)) e->remove(); if (gui::IGUIElement *e = getElementFromId(ID_soundSlider)) e->remove(); } void GUIVolumeChange::regenerateGui(v2u32 screensize) { /* Remove stuff */ removeChildren(); /* Calculate new sizes and positions */ core::rect<s32> rect( screensize.X/2 - 380/2, screensize.Y/2 - 200/2, screensize.X/2 + 380/2, screensize.Y/2 + 200/2 ); DesiredRect = rect; recalculateAbsolutePosition(false); v2s32 size = rect.getSize(); v2s32 topleft_client(40, 0); int volume = (int)(g_settings->getFloat("sound_volume")*100); /* Add stuff */ { core::rect<s32> rect(0, 0, 120, 20); rect = rect + v2s32(size.X/2-60, size.Y/2-35); const wchar_t *text = wgettext("Sound Volume: "); Environment->addStaticText(text, rect, false, true, this, ID_soundText1); delete[] text; } { core::rect<s32> rect(0, 0, 30, 20); rect = rect + v2s32(size.X/2+40, size.Y/2-35); Environment->addStaticText(core::stringw(volume).c_str(), rect, false, true, this, ID_soundText2); } { core::rect<s32> rect(0, 0, 80, 30); rect = rect + v2s32(size.X/2-80/2, size.Y/2+55); const wchar_t *text = wgettext("Exit"); Environment->addButton(rect, this, ID_soundExitButton, text); delete[] text; } { core::rect<s32> rect(0, 0, 300, 20); rect = rect + v2s32(size.X/2-150, size.Y/2); gui::IGUIScrollBar *e = Environment->addScrollBar(true, rect, this, ID_soundSlider); e->setMax(100); e->setPos(volume); } } void GUIVolumeChange::drawMenu() { gui::IGUISkin* skin = Environment->getSkin(); if (!skin) return; video::IVideoDriver* driver = Environment->getVideoDriver(); video::SColor bgcolor(140, 0, 0, 0); driver->draw2DRectangle(bgcolor, AbsoluteRect, &AbsoluteClippingRect); gui::IGUIElement::draw(); } bool GUIVolumeChange::OnEvent(const SEvent& event) { if (event.EventType == EET_KEY_INPUT_EVENT) { if (event.KeyInput.Key == KEY_ESCAPE && event.KeyInput.PressedDown) { quitMenu(); return true; } if (event.KeyInput.Key == KEY_RETURN && event.KeyInput.PressedDown) { quitMenu(); return true; } } if (event.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED) { if (event.GUIEvent.Caller->getID() == ID_soundExitButton) { quitMenu(); return true; } } if (event.GUIEvent.EventType == gui::EGET_SCROLL_BAR_CHANGED) { if (event.GUIEvent.Caller->getID() == ID_soundSlider) { s32 pos = ((gui::IGUIScrollBar*)event.GUIEvent.Caller)->getPos(); g_settings->setFloat("sound_volume", (float)pos/100); gui::IGUIElement *e = getElementFromId(ID_soundText2); e->setText(core::stringw(pos).c_str()); return true; } } return Parent ? Parent->OnEvent(event) : false; }