Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Welcome to the new forums!

Discussion in 'Announcements' started by Aurore, Jun 2, 2014.

Thread Status:
Not open for further replies.
  1. andmm

    andmm

    Joined:
    Nov 21, 2013
    Posts:
    37
    We need way more contrast than this, especially on my S***ty tft monitor it's pretty hard to tell one post from the other. More grey or an alternate css style please!
     
    Last edited: Jun 2, 2014
  2. Aurore

    Aurore

    Director of Real-Time Learning Unity Technologies

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    Roger for more contrast and distinctions of things.
     
  3. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,277
  4. randomperson42

    randomperson42

    Joined:
    Jun 29, 2013
    Posts:
    974
    Tried that, mine still says "new member." It's been about a year...
     
  5. Aurore

    Aurore

    Director of Real-Time Learning Unity Technologies

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    We know it's still an issue, it will be sorted soon.
     
  6. randomperson42

    randomperson42

    Joined:
    Jun 29, 2013
    Posts:
    974
    Ok, great, no worries.
    Edit: Nevermind, it seems to be working now.
     
  7. Nanity

    Nanity

    Joined:
    Jul 6, 2012
    Posts:
    148
    Just gotta mention that I love the "Go to First Unread" and "Follow" features!
     
  8. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    I want darker theme for the forum........ current color make me o_O so i need to :cool:
     
    carking1996 likes this.
  9. randomperson42

    randomperson42

    Joined:
    Jun 29, 2013
    Posts:
    974
    Yes.
     
  10. randomperson42

    randomperson42

    Joined:
    Jun 29, 2013
    Posts:
    974
    Two big (and maybe unrealistic) requests:

    And

     
  11. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,663
    I agree, on my subnotebook this is quite hard to see breaks between posts. Maybe just a little darker on the grey and it would be ok. Or even a "legacy" theme that has same look as... yesterday?

    EDIT: oh jeez, apparently I am "new" again :p
     
    Last edited: Jun 2, 2014
  12. Acumen

    Acumen

    Joined:
    Nov 20, 2010
    Posts:
    1,041
    Oh and now one can have images in one's signature, just found out about that in the blog. Will that be disabled/toggable ?
     
  13. NomadKing

    NomadKing

    Joined:
    Feb 11, 2010
    Posts:
    1,461
    See, blindness like i suspected it was :p

    Also don't think the big black square 'Unity Technologies' for staff matches the forum style. Maybe you guys could have a custom post background colour to stand out instead (maybe a paler version of the blue used in the top menu)
     
    Last edited: Jun 2, 2014
  14. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    It would be really great if all images in signatures would be disallowed. So many forums are ruined by image sigs.

    --Eric
     
    ImpossibleRobert and nuverian like this.
  15. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Also, it would be great if sig height would be limited. In half the posts right now the signature is waaaay larger than the actual post.
    P.S. I know that sigs can be switched off. I still want them, but I want them to be smaller.
     
  16. Per

    Per

    Joined:
    Jun 25, 2009
    Posts:
    460
    What's the actual benefit of the new forums?

    From a users perspective it somehow manages to be more cluttered while taking up (much) more space and delivering less information than before.

    Please remove the giant signatures and reduce avatar content, this isn't a fansite.

    Please reduce the vertical spacing on all the text blocks and the number of elements on separate lines, there's
    no
    need
    to
    put
    every
    new
    thought
    or
    word
    on
    a
    new
    line
    ,
    that's
    just
    bad
    design
    when
    dealing
    with
    large
    quantities
    information
    .

    Fix the hovering elements that pop up e.g. within the users notifications/pm's when you select a checkbox, right now they hover directly over and obliterate the item you've just checked as well as those to either side. They're also the only place where options such as select all appear, this is a terrible terrible design concept that just gets in the way rather than helping to expedite navigation or function.

    Actually there's a lot that's hidden then appears on hover... why? Did someone just find out about CSS and javascript for the first time? There's no need to hide how many pages are in a thread for instance. And when you do have a useful popup such as to give an outline on the first post in a thread why is it aligned to obliterate (cover) the surrounding threads, popups really should never block access to content, nor force a direction, they just shouldn't get in the way. What's worse is that these floating elements don't disapear until your mouse exits the element, which makes no sense, they're just popup help bubbles. Fine if they appear, but they should not be a "mousable" element otherwise you have to keep moving the mouse away from the focus area all the time.

    Increase the difference in background between the posts, it's just too subtle, the point isn't to make something that someone somewhere thinks might look a little nifty and "designery", good design follows function.

    Split notifications from general stickies, right now it's just one unrelenting block, which isn't helped by the fact that the unread posts are barely highlighted at all with the tiny blue orbs in the sea of whitespace, remember - proximity, clarity.

    Unread content in forums and subforums needs to be visible at the "Forum" level.

    Otherwise, they appear to be working outside of all notifications and posts being marked as unread which I guess is a side effect of transitioning. Well done as I assume it was a hell of a lot of work, it just needs a fair bit more tweaking and then it'll be much more navigable and useable..
     
    Last edited: Jun 2, 2014
  17. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,081
  18. Per

    Per

    Joined:
    Jun 25, 2009
    Posts:
    460
    Also please disable automatically watch threads when replying to a thread. It's annoying to have to remember to additionally unsubscribe every time you post in order to avoid filling your inbox forum spam.
     
    Moonjump and carking1996 like this.
  19. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    I'm gonna throw my hat into the ring here and say that I'm not a huge fan of the new style. Functionality-wise, I like XenForo more than the older VBulletin forum that had some lacking features.

    As for the style, the problem can be summed up in one word: padding. Actually, make that two words: excessive padding. The padding inside of posts, and the amount of space between lines, tends to inflate posts and take up unnecessary space. I think it was supposed to aid in readability, but it's actually done the opposite.

    Subforums are a mess right now as well. As others have said, there's problems with unread posts, stickies and general readability and usage. Some ways that they could be cleaned up, at least as far as I can see, are:

    1. Author avatars next to the topic don't really look that nice. I was experimenting and the page actually looks better without them. (A simple 'display: none' on div.listBlock.posterAvatar seems to work very well)

    2. Too much padding between the bottom of the topic title, and the thread starter name and date below it.

    3. The blue orb for unread content isn't a very good way to communicate that there's unread posts. It's too small and easily missed.

    4. Stickies and notifications should absolutely be separate, since a lot of them are a 'read once' type of deal, and shouldn't be a part of the general area of updated topics you might be interested in (the old forum had this, and it was glorious).

    Those are off the top of my head. Overall, I like the new forum platform, but don't like the new style as much. The style is much easier to fix than the forum platform, though, so I have faith that it'll work its way towards better readability and usability.
     
    Beennn, JesOb and NTDC-DEV like this.
  20. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    766
    Thank you for making it a responsive theme right off the bat. It looks terrific in the phone.

    White themes work best for me, especially when I use them for long periods of time. If you add a dark theme, please make it optional. That said, a bit more contrast would not hurt, it is hard to see the edges of the text box for posting for example, or where one post ends and the other begins.

    It should be easier to tell the stickies apart, most of the time one goes to the forum to read the first non sticky post, so this should be easy to spot. In fact, I think there are way too many stickies on several forums.

    It would be nice if we could upload pictures instead of linking to them
     
  21. NTDC-DEV

    NTDC-DEV

    Joined:
    Jul 22, 2010
    Posts:
    593
    You know, they did add the "Like" button so you don't have to do this anymore ;)
     
    nuverian and carking1996 like this.
  22. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,605
    Indeed they did.
     
  23. NTDC-DEV

    NTDC-DEV

    Joined:
    Jul 22, 2010
    Posts:
    593
    Bug:

    Checking off "and receive email notifications of replies" in the preferences... does nothing.

    Edit: It works initially, then it just re-checks itself after a while. I have still to find the conditions of how it happens but there is definitely something broken... it's my 4th time checking it off and saving the preferences.
     
  24. Per

    Per

    Joined:
    Jun 25, 2009
    Posts:
    460
    Bug: Inbox sorting doesn't work.
     
  25. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    I have had to turn the brightness down for this forum as the screens are too bright. Messages are not distinct from each other. Everything is spaced out too far (even more than before).

    This might be down to the switchover, but there seems to be no way to pick up the thread where it was last viewed up to.
     
  26. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    I find that on a large screen, or really any screen with a high resolution (1080p+) these forums are too small for comfortable viewing.
     
  27. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,615
    FWIW, you can turn that off yourself in your preferences.

    edit: never mind apparently that's buggy
     
  28. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,523
    It is so difficult to see where the posts start and end, there is so much extra useless information that has been brought up in very dominant ways.

    The only thing that visually separates posts is the avatar picture, the color difference is not working, it's not clear if its a quote or a code block or another post.

    It just feels like the designer was desperate to show off all the new cool features to everyone. :)

    Also browsing the threads somehow feels like looking at an Excel sheet, every piece of information doesn't need to be in it's own little grey box.
     
    Last edited: Jun 2, 2014
    nuverian and NTDC-DEV like this.
  29. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,040
    Yes, that is quite annoying..

    Had to start making custom CSS style using Stylish plugin
    https://gist.github.com/unitycoder/3c51d415332e162257cd
    (currently there are only few modifications to the threads view, more coming later..)
     
    nuverian likes this.
  30. PatHightree

    PatHightree

    Joined:
    Aug 18, 2009
    Posts:
    297
    It would be nice if post previewing also worked in the search results.
     
  31. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    It seems to me that the smilies are bugged. :( They won't appear inline but are always on a separate line by themselves.

    (The above is supposed to be a single line.)

    --Eric
     
  32. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,084
    Yep.noticed that too. It makes a new line for each smily, so the more happy you are the more lines you make :)
     
  33. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,553
    I love it - This looks really fresh, lots of whitespace and very clear. Great work!
     
  34. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,796
    Yay after 3500+ posts I'm now considered a new member :(
     
  35. GMM

    GMM

    Joined:
    Sep 24, 2012
    Posts:
    301
    I like the design on my great well calibrated S-IPS Asus screen that i primarily use for graphic design, but the emphassis on light grey poses some major issues on my two secondary cheap samsung screens i use for information, i simply cannot see the grey sepperation lines without actively looking for them.

    This makes the forums extremely hard to use on that screen, please either make the grey a bit more distinct or offer a secondary higher contrast style.
     
  36. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,890
    It needs to stop auto-cropping/scaling Avatars if they're smaller than 96x96! And it can't handle PNG transparent backrounds.

    Also, it automatically watches any thread you reply to by default. Maybe this should be off.
     
    Last edited: Jun 3, 2014
  37. tswalk

    tswalk

    Joined:
    Jul 27, 2013
    Posts:
    1,109

    would it be possible for us to have some type of "theme" selection ability or editing for our own personal use?
     
  38. landon912

    landon912

    Joined:
    Nov 8, 2011
    Posts:
    1,579
    I'm a new member! Yay. Maybe I'll get some of that fresh excitement back! :p

    Edit: That might be the single ugliest smiley face ever. Remind me to never use it again; with a chair to the face for each one.
     
  39. KheltonHeadley

    KheltonHeadley

    Joined:
    Oct 19, 2010
    Posts:
    1,685
    :);):(:mad::confused::cool::p:D:eek::oops::rolleyes:o_O

    These smilies..still waiting for the sticky threads to be sectioned so it's easier to see normal threads.
     
    Deleted User likes this.
  40. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830
    UI needs some serious work, find this forum hard to read.

    Oh look, we have a like system, let's see how that works.

    Edit post is inconvenient (popup), no option to discard unwanted edits.

    Code (csharp):
    1.  
    2. /* NPSF3001 THIS_IS_GARBAGE GMAIL.COM
    3. *
    4. * Objective:  A simple BF interpreter in Unity to demonstrate skill.
    5. *
    6. * Discussion
    7. *
    8. * This is V2:
    9. *
    10. * * Fixed: Does not function in webplayer!  (Now using COROUTINE preprocessor)
    11. * * Partial Fix:  UI could do with a couple extra functions for usability. (Now Input TextField responds to Enter key).
    12. *
    13. * This is V1:
    14. * *  Functional and Preliminary tests report working.
    15. * *  Need more testing, maybe some minor clean up.
    16. * *  UI could do with a couple extra functions for usability.
    17. * *  BUG:  Output TextArea only shows first ~200 lines
    18. * *  Crash report - Does not function in webplayer!  (Fixed with COROUTINE preprocessor)
    19. *
    20. * For Hire! (31/08/11)
    21. * * http://forum.unity3d.com/threads/102566-**50-OFF**-C-Programmer-**ONE-WEEK-ONLY**
    22. *
    23. * 3rd party programs available at:
    24. * *  http://esoteric.sange.fi/brainfuck/bf-source/
    25. *
    26. * TOS
    27. * *  Attribution required.
    28. * *  Free for commercial and non-commercial use.
    29. * *  *AS IS* - No warrenty or garuntee of this program is provided.
    30. */
    31.  
    32.  
    33. //To work around the webplayer crashes I had to reimplement the threading as a coroutine.
    34. #if UNITY_WEBPLAYER
    35. #define COROUTINE
    36. #endif
    37.  
    38.  
    39. using UnityEngine;
    40. using System.Collections.Generic;
    41. using System;
    42. using System.Threading;
    43. using System.Text;
    44.  
    45.  
    46. /// <summary>
    47. /// Attach this a empty GO in the scene to have a Full Screen BF GUI.
    48. /// </summary>
    49. public class BF_GUI : MonoBehaviour
    50. {
    51.     #region Variables
    52.     /// <summary>
    53.     /// The program displayed in GUI and passed to interpreter.  Can contain non-BF characters (considered comments).
    54.     /// </summary>
    55.     string dirtyProgram;
    56.  
    57.     /// <summary>
    58.     /// The store for output.
    59.     /// </summary>
    60.     List<string> output = new List<string>();
    61.  
    62.     /// <summary>
    63.     /// For the input textfield.
    64.     /// </summary>
    65.     string input = "";
    66.  
    67.     /// <summary>
    68.     /// The TextArea scroll V2's.
    69.     /// </summary>
    70.     Vector2 programScroll, outputScroll = Vector2.zero;
    71.  
    72.     /// <summary>
    73.     /// Value in pixels that determines the Text-Area Sizes.
    74.     /// </summary>
    75.     float vSliderValue = 100f;
    76.  
    77.     /// <summary>
    78.     /// Input waiting to be consumed by the BFI.
    79.     /// </summary>
    80.     Queue<char> queuedInput = new Queue<char>();
    81.  
    82.     /// <summary>
    83.     /// The Brain F*** Interpreter
    84.     /// </summary>
    85.     BF_Interpreter bfi;
    86.  
    87.     /// <summary>
    88.     /// An Important BF constant (Newline)
    89.     /// </summary>
    90.     const byte END_OF_LINE = 10;
    91.     #endregion
    92.  
    93.     // Use this for initialization
    94.     void Start()
    95.     {
    96.         //Version info
    97. #if COROUTINE
    98.         output.Add("VERSION 2 | COROUTINE --  ");
    99. #else
    100.         output.Add("VERSION 2 | THREADED --  ");
    101. #endif
    102.  
    103.         // Some helpful instructions
    104.         output.Add("This is the output area" + Environment.NewLine);
    105.  
    106.         //Lets load a sample BF program
    107.         var file = Resources.Load("99Bottles") as TextAsset;
    108.         if (file != null)
    109.         {
    110.             dirtyProgram = file.text;
    111.         }
    112.         else
    113.         {
    114.             dirtyProgram = "Default Program Not Found!  From wiki: " + Environment.NewLine + Environment.NewLine +
    115.                 " ++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.";
    116.         }
    117.  
    118.     }
    119.  
    120.     void OnGUI()
    121.     {
    122.         //Start layout, use the entire Screen.
    123.         GUILayout.BeginArea(new Rect(0, 0, Screen.width, Screen.height));
    124.         {
    125.  
    126.             //  Everything Above Input
    127.             GUILayout.BeginHorizontal();
    128.             {
    129.                 // The program and output textboxes
    130.                 GUILayout.BeginVertical();
    131.                 {
    132.  
    133.                     //Program Textbox
    134.                     GUILayout.BeginHorizontal(GUILayout.MinHeight(20), GUILayout.Height(vSliderValue));
    135.                     {
    136.                         programScroll = GUILayout.BeginScrollView(programScroll);
    137.                         dirtyProgram = GUILayout.TextArea(dirtyProgram, GUILayout.ExpandHeight(true));
    138.                         GUILayout.EndScrollView();
    139.                     }
    140.                     GUILayout.EndHorizontal();
    141.  
    142.                     GUILayout.Space(3);
    143.                     //Output Textbox
    144.                     GUILayout.BeginHorizontal(GUILayout.ExpandHeight(true));
    145.                     {
    146.                         outputScroll = GUILayout.BeginScrollView(outputScroll);
    147.  
    148.                         string outputText;
    149.                         string[] outputArray;
    150.                         lock (output)
    151.                         {
    152.                             outputArray = output.ToArray();
    153.                         }
    154.                         outputText = string.Join("", outputArray);
    155.  
    156.                         //var lineArray = outputText.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
    157.                         //Array.Reverse(lineArray);
    158.                         //outputText = string.Join(Environment.NewLine, lineArray);
    159.  
    160.                         GUILayout.TextArea(outputText, int.MaxValue, GUILayout.ExpandHeight(true));
    161.                         GUILayout.EndScrollView();
    162.                     }
    163.                     GUILayout.EndHorizontal();
    164.  
    165.                 } GUILayout.EndVertical();
    166.  
    167.                 //The size slider - to change the program : output size ratio
    168.                 GUILayout.BeginVertical(GUILayout.Width(10));
    169.                 {
    170.                     GUILayout.Space(30);
    171.                     vSliderValue = GUILayout.VerticalSlider(vSliderValue, 30f, Screen.height - 60);
    172.                     GUILayout.Space(30);
    173.                 } GUILayout.EndVertical();
    174.  
    175.             } GUILayout.EndHorizontal();
    176.  
    177.             //The Input Fields
    178.             GUILayout.BeginHorizontal();
    179.             GUI.SetNextControlName("InputTF");
    180.             input = GUILayout.TextField(input, GUILayout.MinHeight(20), GUILayout.MaxHeight(20), GUILayout.Width(Screen.width * 0.6f));
    181.  
    182.             //Handle enter key in textfield
    183.             if (((Event.current.keyCode == KeyCode.Return) && GUI.GetNameOfFocusedControl() == "InputTF") && !string.IsNullOrEmpty(input))
    184.             {
    185.                 foreach (char c in input.ToCharArray())
    186.                     queuedInput.Enqueue(c);
    187.  
    188.                 output.Add(Environment.NewLine + input + "1" + Environment.NewLine);
    189.                 input = "";
    190.                 Event.current.Use();
    191.             }
    192.  
    193.             //Enter (input) button
    194.             if (GUILayout.Button("Enter!"))
    195.             {
    196.                 foreach (char c in input.ToCharArray())
    197.                     queuedInput.Enqueue(c);
    198.  
    199.                 output.Add(Environment.NewLine + input + Environment.NewLine);
    200.  
    201.                 input = "";
    202.             }
    203.  
    204.             //Starts a new program
    205.             if (GUILayout.Button("Start Program!"))
    206.             {
    207.                 //clear input
    208.                 queuedInput.Clear();
    209.                 //clear output
    210.                 output.Clear();
    211.  
    212.  
    213.                 //destroy any existing bfi
    214.                 if (bfi != null) bfi.Destroy();
    215.  
    216.                 bfi = new BF_Interpreter(dirtyProgram, Input, Output);
    217.  
    218. #if COROUTINE
    219.                 StartCoroutine(bfi.Run());
    220. #else
    221.                 bfi.Run();
    222. #endif
    223.             }
    224.  
    225.             GUILayout.Space(20); //Just a margin
    226.             GUILayout.EndHorizontal();
    227.         }
    228.  
    229.         //End layout
    230.         GUILayout.EndArea();
    231.     }
    232.  
    233.     /// <summary>
    234.     /// Reads input for the interpreter
    235.     /// </summary>
    236.     byte? Input()
    237.     {
    238.         //No input just yet
    239.         if (queuedInput.Count == 0) return null;
    240.  
    241.         //Correctly encode input
    242.         var input = Encoding.ASCII.GetBytes((queuedInput.Dequeue()).ToString())[0];
    243.         if (input == 13) input = END_OF_LINE;
    244.  
    245.         //Return
    246.         return input;
    247.     }
    248.  
    249.     /// <summary>
    250.     /// Add output to the display
    251.     /// </summary>
    252.     void Output(byte x)
    253.     {
    254.         //This is called from the interpreter which runs in a seperate thread so we lock it.
    255.         lock (output)
    256.         {
    257.             if (x == END_OF_LINE)
    258.                 output.Add(Environment.NewLine);
    259.             else
    260.                 output.Add(Encoding.ASCII.GetString(new[] { x }));
    261.         }
    262.     }
    263.  
    264.     void OnDestroy()
    265.     {
    266.         //destroy any existing bfi
    267.         if (bfi != null) bfi.Destroy();
    268.     }
    269.  
    270. }
    271.  
    272. public class BF_Interpreter
    273. {
    274.     const byte END_OF_LINE = 10;
    275.  
    276.     # region private vars
    277.     /// <summary>
    278.     /// The Commands of BF in a easier to read format.
    279.     /// </summary>
    280.     enum COMMANDS : byte { Left, Right, Add, Subtract, Input, Output, LoopStart, LoopEnd };
    281.  
    282.     /// <summary>
    283.     /// The program
    284.     /// </summary>
    285.     COMMANDS[] program;
    286.  
    287.     /// <summary>
    288.     /// The Stack (Memory for the program)
    289.     /// </summary>
    290.     byte[] stack = new byte[ushort.MaxValue];
    291.  
    292.     /// <summary>
    293.     /// Loop look-up.  returns the position of the corrisponding loop beginning or end.
    294.     /// </summary>
    295.     ushort[] LLU;
    296.  
    297.     /// <summary>
    298.     /// Stack and Program pointers.
    299.     /// </summary>
    300.     ushort sPointer = 0, pPointer = 0;
    301.  
    302.     /// <summary>
    303.     /// Max instructions before interpretor quits.
    304.     /// </summary>
    305.     private uint instructionLimit = 1000000000;
    306.  
    307.     /// <summary>
    308.     /// A delegate that will return a byte as input for the program when called.
    309.     /// </summary>
    310.     Func<byte?> Input;
    311.  
    312.     /// <summary>
    313.     /// A delegate that will be called when the program wants to provide output.
    314.     /// </summary>
    315.     Action<byte> Output;
    316.     #endregion
    317.  
    318.     #region threading vars
    319.  
    320.     private bool _running = false;
    321.  
    322.     /// <summary>
    323.     /// Is the Interpreter currently stepping through a program?
    324.     /// </summary>
    325.     public bool isRunning { get { return _running; } }
    326.  
    327.     /// <summary>
    328.     /// Thread that runs the interpreter (used so as to be non-blocking).
    329.     /// </summary>
    330.     private Thread t;
    331.     #endregion
    332.  
    333.     /// <summary>
    334.     /// Creates a new BF interprator.
    335.     /// </summary>
    336.     /// <param name="dirtyProgram">  The string containing the BF program (can have comments).</param>
    337.     /// <param name="Input">A delegate that will return a byte as input for the program when called.</param>
    338.     /// <param name="Output">A delegate that will be called when the program wants to provide output. </param>
    339.     public BF_Interpreter(string dirtyProgram, Func<byte?> Input, Action<byte> Output)
    340.     {
    341.         Debug.Log("BFI Created");
    342.         //Parse the plain text into (strict) valid BF
    343.         program = CleanProgram(dirtyProgram);
    344.  
    345.         //This interprator can only handle programs smaller than ushort.max length
    346.         if (program.Length >= short.MaxValue) throw new Exception("BF Program was too long");
    347.  
    348.         //Build the 'loop look up' table
    349.         LLU = ParseLoops(program);
    350.  
    351.         //Assign delegates
    352.         this.Input = Input;
    353.         this.Output = Output;
    354.  
    355.  
    356.     }
    357.  
    358. #if !COROUTINE
    359.     /// <summary>
    360.     /// Steps through the program in a seperate thread, counting each instruction and not exceeding limit to prevent infinite loops.
    361.     /// </summary>
    362.     /// <param name="instructionLimit">  The maximum number of instructions to process.</param>
    363.     /// <returns>See IsRunning - True if the program has completed, false otherwise</returns>
    364.     public void Run()
    365.     {
    366.         Debug.Log("BFI ThreadStart");
    367.         if (isRunning) throw new Exception("Can't start if isRunning == true");
    368.  
    369.         t = new Thread(ThreadedRun);
    370.         t.Start();
    371.         Debug.Log("BFI ThreadStarted");
    372.     }
    373. #endif
    374.  
    375.  
    376. #if COROUTINE
    377.     public System.Collections.IEnumerator Run()
    378. #else
    379.     private void ThreadedRun()
    380. #endif
    381.     {
    382.  
    383.         _running = true;
    384.         Debug.Log("BFI Thread running");
    385.         //Sending output :)
    386.         foreach (char c in (char)END_OF_LINE + "Program Started" + (char)END_OF_LINE + (char)END_OF_LINE)
    387.         {
    388.             Output(Encoding.ASCII.GetBytes(c.ToString())[0]);
    389.         }
    390.  
    391.         //While the current instruction is in the program
    392.         while (true)
    393.         {
    394.             //Check to ensure current instruction is in program.
    395.             if (pPointer >= program.Length)
    396.             {
    397.                 foreach (char c in (char)END_OF_LINE + "Program Ended" + (char)END_OF_LINE)
    398.                 {
    399.                     Output(Encoding.ASCII.GetBytes(c.ToString())[0]);
    400.                 }
    401.                 break;
    402.             }
    403.             //Decrement count, exit early if we've exceeded out limit.
    404.             if (instructionLimit < 1)
    405.             {
    406.                 foreach (char c in "Program hit instruction limit")
    407.                 {
    408.                     Output(Encoding.ASCII.GetBytes(c.ToString())[0]);
    409.                 }
    410.                 break;
    411.             }
    412.  
    413.             instructionLimit--;
    414.  
    415.             // http://en.wikipedia.org/wiki/Brainfuck#Commands
    416.             switch (program[pPointer])
    417.             {
    418.                 case COMMANDS.Right: sPointer++; break;
    419.                 case COMMANDS.Left: sPointer--; break;
    420.                 case COMMANDS.Add: stack[sPointer]++; break;
    421.                 case COMMANDS.Subtract: stack[sPointer]--; break;
    422.                 case COMMANDS.Output: Output(stack[sPointer]); break;
    423.                 case COMMANDS.Input:
    424.                     //Wait for input - threaded and nonthreaded.
    425.                     while (true)
    426.                     {
    427.                         byte? input = Input();
    428.                         if (!input.HasValue)
    429. #if COROUTINE
    430.                     yield return null;
    431. #else
    432.                             Thread.Sleep(100);
    433. #endif
    434.                         else
    435.                         {
    436.                             stack[sPointer] = input.Value;
    437.                             break;
    438.                         }
    439.                     } break;
    440.                 case COMMANDS.LoopStart:
    441.                     if (stack[sPointer] == 0) pPointer = LLU[pPointer]; break;
    442.                 case COMMANDS.LoopEnd:
    443.                     if (stack[sPointer] != 0) pPointer = LLU[pPointer]; break;
    444.             }
    445.             pPointer++;  //Move to next instruction
    446.         }
    447.  
    448.         _running = false;
    449.  
    450.         Debug.Log("BFI Thread finished");
    451. #if !COROUTINE
    452.         Thread.CurrentThread.Abort();
    453. #else
    454.  
    455. #endif
    456.     }
    457.  
    458.     public void Destroy()
    459.     {
    460.         //Pretty self explanatory - mainly needed to clean up thread.
    461.         //if (t != null) t.Abort();
    462.         t = null;
    463.         stack = null;
    464.         LLU = null;
    465.         program = null;
    466.     }
    467.  
    468.     # region static  functions
    469.     /// <summary>
    470.     /// Goes through a string and returns a strict BF program
    471.     /// </summary>
    472.     static COMMANDS[] CleanProgram(string dirtyProgram)
    473.     {
    474.         List<COMMANDS> program = new List<COMMANDS>(ushort.MaxValue);
    475.  
    476.         //For each char -
    477.         /// If it is valid command add it to the result
    478.         /// Else ignore it
    479.         foreach (char command in dirtyProgram)
    480.         {
    481.             switch (command)
    482.             {
    483.                 case '>': program.Add(COMMANDS.Right); break;
    484.                 case '<': program.Add(COMMANDS.Left); break;
    485.                 case '+': program.Add(COMMANDS.Add); break;
    486.                 case '-': program.Add(COMMANDS.Subtract); break;
    487.                 case '.': program.Add(COMMANDS.Output); break;
    488.                 case ',': program.Add(COMMANDS.Input); break;
    489.                 case '[': program.Add(COMMANDS.LoopStart); break;
    490.                 case ']': program.Add(COMMANDS.LoopEnd); break;
    491.                 //default: break;  //Ignore invalid chartacters
    492.             }
    493.         }
    494.         return program.ToArray();
    495.     }
    496.  
    497.     static ushort[] ParseLoops(COMMANDS[] program)
    498.     {
    499.         //The result (a simple lookup table)
    500.         var result = new ushort[program.Length];
    501.  
    502.         //For each command
    503.         for (ushort i = 0; i < program.Length; i++)
    504.         {
    505.             COMMANDS command = program[i];
    506.  
    507.             //If it is not a loop start skip it
    508.             if (command != COMMANDS.LoopStart) continue;
    509.  
    510.  
    511.             //Other wise find the loop end
    512.             ushort searchPos = i;
    513.             byte depth = 1;
    514.  
    515.             while (depth != 0)
    516.             {
    517.                 // Skip to matching ']'
    518.                 searchPos++;
    519.  
    520.                 COMMANDS searchCommand = program[searchPos];
    521.  
    522.                 switch (searchCommand)
    523.                 {
    524.                     case COMMANDS.LoopStart: depth++; break;
    525.                     case COMMANDS.LoopEnd: depth--; break;
    526.                 }
    527.             }
    528.             //Save the position of the loop end in the table @ loop start position.
    529.             result[i] = searchPos;
    530.             //And vice versa.
    531.             result[searchPos] = i;
    532.         }
    533.         return result;
    534.     }
    535.     #endregion
    536. }
    Code view appears to be okay, but does not take advantage of whole width of post.
     
    Last edited: Jun 3, 2014
  41. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    However, it does do copy/paste without adding extra blank lines when pasting!!!!!!! At last.

    The cancel button?

    --Eric
     
  42. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830
    Agreed.

    Make a post. Open edit window and make changes. Hit cancel. Reopen edit window - changes are still there. For example, if I accidentally pasted in a couple thousand lines incorrectly (selected whole web page, instead of my desired quote) there's no easily apparent method of discarding those changes short of refreshing my browser window.
     
  43. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Oh, I see. Cmd-Z appears to work fine, however.

    --Eric
     
  44. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830
    If the type of changes you have made can easily be undone.
     
  45. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    I will say one thing: having threads added to watch-list means i can track them easier. (I often forget i posted on a thread then wonder why i have a PM in my inbox!) ;)

    I also just saw the new posts thing pop up. epic stuff! Could i also be taken off "new member"? I have been here for over a year, and was sure i wasn't still "new member!"
     
  46. tswalk

    tswalk

    Joined:
    Jul 27, 2013
    Posts:
    1,109
    also need to sync Answers section account details with this new stuff I think....
     
  47. steego

    steego

    Joined:
    Jul 15, 2010
    Posts:
    968
    Didn't there also use to be a "Select all" button?


    I also miss the "100 posts per page" setting, scrolling is much more comfortable than continuously clicking in long topics.
     
  48. landon912

    landon912

    Joined:
    Nov 8, 2011
    Posts:
    1,579
    Ctrl-A to select all text. Then delete.
     
  49. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    It would be nice if the stickies could be a different shade (darker) to help differentiate them from normal posts.

    I would also like to have a way to condense (vertically) or not to display some of the extra information in favor of seeing more posts and not having to navigate to page 2 or 3.

    Is there a way to quote multiple posts?
     
  50. DanielQuick

    DanielQuick

    Joined:
    Dec 31, 2010
    Posts:
    3,137
    I miss the post count underneath a member's name. It's not horrible if we don't get it back, but I enjoyed the ability to see who is a new user and who has been here for a while without going to their profile.

    Also, it looks like I'll have to finally find a profile image.
     
    shaderop likes this.
Thread Status:
Not open for further replies.